From 05117ca03bb1397b59fd8161479c49dd98cce459 Mon Sep 17 00:00:00 2001 From: Zeftax Date: Tue, 3 Sep 2019 12:49:38 +0200 Subject: [PATCH] fixed a bug where the score didnt reset after swapping sides, expanded example angtest a little bit --- tests/example angtest.tst | 2 ++ vyzkousejme.pyw | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/example angtest.tst b/tests/example angtest.tst index ce6fbca..f59d54d 100644 --- a/tests/example angtest.tst +++ b/tests/example angtest.tst @@ -11,3 +11,5 @@ tooth brush/kartáček na zuby,kartáček,zubní kartáček badge/odznak razor/žiletka,břitva book/kniha,knížka +vitamins/vitamíny +instrument/nástroj diff --git a/vyzkousejme.pyw b/vyzkousejme.pyw index 73a88d0..4130785 100644 --- a/vyzkousejme.pyw +++ b/vyzkousejme.pyw @@ -6,11 +6,14 @@ import random def swapSides(): global test + global score temp = test[0] test[0] = test[1] test[1] = temp + score = 0 + currentScore.set('Score: %s' % score) newQuestion() @@ -57,6 +60,8 @@ def submitAnswer(uselessArgument): highScore.set('High score: %d' % (test[2])) answerEntry.delete(0, 'end') newQuestion() + currentScore.set('Score: %s' % score) + highScore.set('High score: %d' % test[2]) def formatTest(filepath): @@ -97,8 +102,6 @@ def openTest(): messagebox.showinfo("ERROR: unrecognized file", "We are sorry but files with the '%s' appendix are not supported, we support only '.tst' files." % (getExtension(filepath))) test = list(formatTest(filepath)) newQuestion() - currentScore.set('Score: %s' % score) - highScore.set('High score: %d' % test[2]) def makeMenu(root):