Skip to content
Snippets Groups Projects
Commit a96ecbcb authored by Kieran Harrell's avatar Kieran Harrell
Browse files

Added a score and question number reset after answering five questions.

parent a91f9dd9
Branches main
No related tags found
No related merge requests found
......@@ -112,14 +112,18 @@ class QuizzerApp(App):
question = self.questions[-1] if len(self.questions) > 0 else QuizzerApp.DEFAULT_QUESTION
self.paused = True
self.correct = answer == question[2]
if self.correct == True:
self.score+=100
self.num_answered += 1
Clock.schedule_once(lambda delta: self.unpause(), PAUSE_TIME)
if self.num_answered%5 == 0:
self.score = 0
self.num_answered =0
def unpause(self):
self.paused = False
if self.correct == True:
app.score+=100
self.num_answered += 1
#self.num_answered += 1
if len(self.questions) > 0:
self.questions.pop()
if len(self.questions) == 0:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment