fix bug in type answer

This commit is contained in:
Damien Elmes 2009-01-05 15:40:22 +09:00
parent 75fc98cdba
commit 84293c9d7a

View file

@ -151,7 +151,11 @@ class View(object):
given = unicode(self.main.mainWin.typeAnswerField.text()) given = unicode(self.main.mainWin.typeAnswerField.text())
res = [] res = []
for (i, c) in enumerate(given): for (i, c) in enumerate(given):
if c == cor[i]: try:
yes = c == cor[i]
except IndexError:
yes = False
if yes:
res.append("<span style='color: #007700'>%s</span>" % c) res.append("<span style='color: #007700'>%s</span>" % c)
else: else:
res.append("<span style='color: #770000'>%s</span>" % c) res.append("<span style='color: #770000'>%s</span>" % c)