fixed a bug where the score didnt reset after swapping sides, expanded example angtest a little bit
This commit is contained in:
parent
1b7ca5f789
commit
05117ca03b
2 changed files with 7 additions and 2 deletions
|
@ -11,3 +11,5 @@ tooth brush/kartáček na zuby,kartáček,zubní kartáček
|
||||||
badge/odznak
|
badge/odznak
|
||||||
razor/žiletka,břitva
|
razor/žiletka,břitva
|
||||||
book/kniha,knížka
|
book/kniha,knížka
|
||||||
|
vitamins/vitamíny
|
||||||
|
instrument/nástroj
|
||||||
|
|
|
@ -6,11 +6,14 @@ import random
|
||||||
|
|
||||||
def swapSides():
|
def swapSides():
|
||||||
global test
|
global test
|
||||||
|
global score
|
||||||
|
|
||||||
temp = test[0]
|
temp = test[0]
|
||||||
test[0] = test[1]
|
test[0] = test[1]
|
||||||
test[1] = temp
|
test[1] = temp
|
||||||
|
|
||||||
|
score = 0
|
||||||
|
currentScore.set('Score: %s' % score)
|
||||||
newQuestion()
|
newQuestion()
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,6 +60,8 @@ def submitAnswer(uselessArgument):
|
||||||
highScore.set('High score: %d' % (test[2]))
|
highScore.set('High score: %d' % (test[2]))
|
||||||
answerEntry.delete(0, 'end')
|
answerEntry.delete(0, 'end')
|
||||||
newQuestion()
|
newQuestion()
|
||||||
|
currentScore.set('Score: %s' % score)
|
||||||
|
highScore.set('High score: %d' % test[2])
|
||||||
|
|
||||||
|
|
||||||
def formatTest(filepath):
|
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)))
|
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))
|
test = list(formatTest(filepath))
|
||||||
newQuestion()
|
newQuestion()
|
||||||
currentScore.set('Score: %s' % score)
|
|
||||||
highScore.set('High score: %d' % test[2])
|
|
||||||
|
|
||||||
|
|
||||||
def makeMenu(root):
|
def makeMenu(root):
|
||||||
|
|
Loading…
Reference in a new issue