diff --git a/main.py b/main.py index 6bd4bba844042cddf88c625a8ba7cddd3573302d..3836c4fe45128fdfe7cfd2490fd4207bc31b661b 100644 --- a/main.py +++ b/main.py @@ -77,6 +77,7 @@ class QuizzerApp(App): correct = BooleanProperty(False) score = NumericProperty(0) + num_answered = NumericProperty(0) def build(self): inspector.create_inspector(Window, self) @@ -118,6 +119,7 @@ class QuizzerApp(App): self.paused = False if self.correct == True: app.score+=100 + self.num_answered += 1 if len(self.questions) > 0: self.questions.pop() if len(self.questions) == 0: diff --git a/quizzer.kv b/quizzer.kv index 7187e9de07fb8f518a5029438ea77b4183955376..df8476c7660d9fa475a8b6961f7eeae9bc1289f4 100644 --- a/quizzer.kv +++ b/quizzer.kv @@ -78,13 +78,20 @@ ScreenManager: root.transition.direction = 'right' root.current = 'settings' Label: - text: 'Do you know…' + text: f'Question {app.num_answered+1}' font_size: sp(24) - size_hint: (1, None) + size_hint: (1, 1) size: (self.texture_size[0] + 64, self.texture_size[1] + 64) + ProgressBar: + id: progress_bar + min :0 + max: 5 + value: app.num_answered + pos_hint:{'x':.1} + size_hint_x: .8 Label: text: f'Score: {app.score}' - font_size: sp(24) + font_size: sp(16) size_hint: (1, None) size: (self.texture_size[0] + 64, self.texture_size[1] + 64) Label: