make type in answer colours more easily customizable

This commit is contained in:
Damien Elmes 2009-01-07 03:57:51 +09:00
parent e3b564b72e
commit 84ca6ca31f

View file

@ -13,6 +13,9 @@ from ankiqt import ui
from ankiqt.ui.utils import mungeQA from ankiqt.ui.utils import mungeQA
from PyQt4.QtWebKit import QWebPage, QWebView from PyQt4.QtWebKit import QWebPage, QWebView
failedCharColour = "#FF0000"
passedCharColour = "#00FF00"
# Views - define the way a user is prompted for questions, etc # Views - define the way a user is prompted for questions, etc
########################################################################## ##########################################################################
@ -153,8 +156,10 @@ class View(object):
if len(given) < len(cor): if len(given) < len(cor):
given += " " * (len(cor) - len(given)) given += " " * (len(cor) - len(given))
sz = self.main.currentCard.cardModel.answerFontSize sz = self.main.currentCard.cardModel.answerFontSize
ok = "background: #00FF00; color: #000; font-size: %dpx" % sz ok = "background: %s; color: #000; font-size: %dpx" % (
bad = "background: #FF0000; color: #000; font-size: %dpx;" % sz passedCharColour, sz)
bad = "background: %s; color: #000; font-size: %dpx;" % (
failedCharColour, sz)
for (i, c) in enumerate(given): for (i, c) in enumerate(given):
try: try:
yes = c == cor[i] yes = c == cor[i]