From a6013c6c70de1015d95d0c44b89bf8ea2c989ec6 Mon Sep 17 00:00:00 2001
From: dbanks4 <dbanks4@huskers.unl.edu>
Date: Fri, 21 Jul 2023 21:30:38 -0500
Subject: [PATCH] check button widget that resets quiz

---
 main.py    | 2 ++
 quizzer.kv | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/main.py b/main.py
index c1299b9..1c35abf 100644
--- a/main.py
+++ b/main.py
@@ -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.
diff --git a/quizzer.kv b/quizzer.kv
index 72e6d70..e429bc6 100644
--- a/quizzer.kv
+++ b/quizzer.kv
@@ -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
-- 
GitLab