Skip to content
Snippets Groups Projects
Commit 1e4d8ae4 authored by [cscheet2]'s avatar [cscheet2]
Browse files

added a progress bar

parent 40f3f525
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,7 @@ class QuizzerApp(App): ...@@ -75,6 +75,7 @@ class QuizzerApp(App):
paused = BooleanProperty(False) paused = BooleanProperty(False)
correct = BooleanProperty(False) correct = BooleanProperty(False)
questions_answered = NumericProperty(0)
score = NumericProperty(0) score = NumericProperty(0)
def build(self): def build(self):
...@@ -113,6 +114,7 @@ class QuizzerApp(App): ...@@ -113,6 +114,7 @@ class QuizzerApp(App):
if self.correct: if self.correct:
self.score += 10 self.score += 10
Clock.schedule_once(lambda delta: self.unpause(), PAUSE_TIME) Clock.schedule_once(lambda delta: self.unpause(), PAUSE_TIME)
self.questions_answered += 1
def unpause(self): def unpause(self):
self.paused = False self.paused = False
......
...@@ -89,6 +89,9 @@ ScreenManager: ...@@ -89,6 +89,9 @@ ScreenManager:
text_size: (self.width, None) text_size: (self.width, None)
halign: 'center' halign: 'center'
color: (0.0, 0.0, 0.75, 1.0) if not app.paused else ((0.0, 1.0, 0.0, 1.0) if app.correct else (0.5, 0.0, 0.0, 1.0)) color: (0.0, 0.0, 0.75, 1.0) if not app.paused else ((0.0, 1.0, 0.0, 1.0) if app.correct else (0.5, 0.0, 0.0, 1.0))
ProgressBar:
value: app.questions_answered
max: 5
GridLayout: GridLayout:
rows: 2 rows: 2
Button: Button:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment