mirror of
https://github.com/ankitects/anki.git
synced 2025-11-10 22:57:11 -05:00
htmlQuestion/answer() shouldn't be needed anymore
This commit is contained in:
parent
138d9881d3
commit
442bb7a7db
1 changed files with 0 additions and 23 deletions
|
|
@ -123,26 +123,3 @@ streak=?, lapses=?, grade=?, cycles=?, edue=? where id = ?""",
|
||||||
def timeTaken(self):
|
def timeTaken(self):
|
||||||
"Time taken to answer card, in integer MS."
|
"Time taken to answer card, in integer MS."
|
||||||
return int(min(time.time() - self.timerStarted, MAX_TIMER)*1000)
|
return int(min(time.time() - self.timerStarted, MAX_TIMER)*1000)
|
||||||
|
|
||||||
# Questions and answers
|
|
||||||
##########################################################################
|
|
||||||
|
|
||||||
def htmlQuestion(self, type="question", align=True):
|
|
||||||
div = '''<div class="card%s" id="cm%s%s">%s</div>''' % (
|
|
||||||
type[0], type[0], hexifyID(self.tid),
|
|
||||||
getattr(self, type))
|
|
||||||
# add outer div & alignment (with tables due to qt's html handling)
|
|
||||||
if not align:
|
|
||||||
return div
|
|
||||||
attr = type + 'Align'
|
|
||||||
if getattr(self.cardModel, attr) == 0:
|
|
||||||
align = "center"
|
|
||||||
elif getattr(self.cardModel, attr) == 1:
|
|
||||||
align = "left"
|
|
||||||
else:
|
|
||||||
align = "right"
|
|
||||||
return (("<center><table width=95%%><tr><td align=%s>" % align) +
|
|
||||||
div + "</td></tr></table></center>")
|
|
||||||
|
|
||||||
def htmlAnswer(self, align=True):
|
|
||||||
return self.htmlQuestion(type="answer", align=align)
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue