Skip to content
Snippets Groups Projects
Commit a6013c6c authored by Darius Banks's avatar Darius Banks
Browse files

check button widget that resets quiz

parent f01bc0b0
Branches
No related tags found
No related merge requests found
......@@ -89,7 +89,9 @@ class QuizzerApp(App):
if self.answered_questions >= 5:
self.answered_questions = 0
self.paused = True
self.reshuffle()
Clock.schedule_once(self.reset_quiz, PAUSE_TIME)
def reshuffle(self):
questions = [] # Use a plain list, not a list property, for the computations.
......
......@@ -87,6 +87,9 @@ ScreenManager:
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))
GridLayout:
rows: 2
# Button:
# text: 'Reset Quiz' # Add a button to reset the quiz
# on_press: app.reset_quiz()
Button:
text: (app.questions[-1] if len(app.questions) > 0 else app.DEFAULT_QUESTION)[1][0]
disabled: app.paused
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment