mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
add real example to card layout, and move hr like during review
This commit is contained in:
parent
d90652d0d6
commit
1b12ff6fe5
1 changed files with 11 additions and 3 deletions
|
@ -236,11 +236,19 @@ Please create a new card type first."""))
|
||||||
self.playedAudio[c.id] = True
|
self.playedAudio[c.id] = True
|
||||||
|
|
||||||
def maybeTextInput(self, txt, type='q'):
|
def maybeTextInput(self, txt, type='q'):
|
||||||
|
origLen = len(txt)
|
||||||
|
txt = txt.replace("<hr id=answer>", "")
|
||||||
|
hadHR = origLen != len(txt)
|
||||||
|
def answerRepl(match):
|
||||||
|
res = self.mw.reviewer.correct("exomple", "an example")
|
||||||
|
if hadHR:
|
||||||
|
res = "<hr id=answer>" + res
|
||||||
|
return res
|
||||||
if type == 'q':
|
if type == 'q':
|
||||||
repl = "<input id='typeans' type=text value=''>"
|
repl = "<input id='typeans' type=text value='exomple'>"
|
||||||
|
repl = "<center>%s</center>" % repl
|
||||||
else:
|
else:
|
||||||
repl = _("(typing comparison appears here)")
|
repl = answerRepl
|
||||||
repl = "<center>%s</center>" % repl
|
|
||||||
return re.sub("\[\[type:.+?\]\]", repl, txt)
|
return re.sub("\[\[type:.+?\]\]", repl, txt)
|
||||||
|
|
||||||
# Card operations
|
# Card operations
|
||||||
|
|
Loading…
Reference in a new issue