-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz.py
More file actions
36 lines (28 loc) · 844 Bytes
/
quiz.py
File metadata and controls
36 lines (28 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.screenmanager import ScreenManager, Screen
Builder.load_file("QuizPage.kv")
class QuizPageApp(App):
def build(self):
return QuizManager()
class QuizManager(ScreenManager):
pass
class Question1Screen(Screen):
def answer(self, bool):
if bool:
self.manager.current = "correct"
else:
self.manager.current = "wrong"
class Question2Screen(Screen):
def answer_question(self, num):
if num == "2012":
self.manager.current = "correct"
else:
self.manager.current = "wrong"
class CorrectScreen(Screen):
def next(self):
self.manager.current = "question2"
class WrongScreen(Screen):
def next(self):
self.manager.current = "question2"
QuizPageApp().run()