From f30246f381bd36ac9c5805eaa3d27b368e444aae Mon Sep 17 00:00:00 2001
From: "khatri.cs16" <khatri.cs16@gmail.com>
Date: Fri, 16 Jul 2021 03:27:26 -0500
Subject: [PATCH] reset

---
 main.py    | 6 +++++-
 quizzer.kv | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/main.py b/main.py
index 8135697..ffae918 100644
--- a/main.py
+++ b/main.py
@@ -66,7 +66,7 @@ PAUSE_TIME = 0.75  # seconds
 
 class QuizzerApp(App):
     DEFAULT_QUESTION = ('What is your favorite color?', ('Blue', 'Blue', 'Blue', 'Blue'), 'Blue')
-
+    QUIZ_LENGTH=5
     include_gui_topic = BooleanProperty(True)
     include_color_topic = BooleanProperty(False)
     include_tree_topic = BooleanProperty(False)
@@ -121,6 +121,10 @@ class QuizzerApp(App):
             self.questions.pop()
         if len(self.questions) == 0:
             self.reshuffle()
+        if self.attempts >= QuizzerApp.QUIZ_LENGTH:
+            self.attempts = 0
+            self.score = 0
+
 
 
 if __name__ == '__main__':
diff --git a/quizzer.kv b/quizzer.kv
index e7f913f..a88b78f 100644
--- a/quizzer.kv
+++ b/quizzer.kv
@@ -85,7 +85,7 @@ ScreenManager:
                 size_hint: (1, None)
                 size: (self.texture_size[0] + 64, self.texture_size[1] + 64)
             ProgressBar:
-                max: 5
+                max: app.QUIZ_LENGTH
                 value: app.attempts
                 size_hint: (1, None)
                 height: sp(8)
-- 
GitLab