mirror of
https://github.com/ankitects/anki.git
synced 2025-12-10 13:26:56 -05:00
pass current card to drawquestion/answer filter
This commit is contained in:
parent
c21ea725b6
commit
e508239998
2 changed files with 6 additions and 4 deletions
|
|
@ -1055,9 +1055,11 @@ class PreviewDialog(QDialog):
|
||||||
self.dialog.webView.setHtml(
|
self.dialog.webView.setHtml(
|
||||||
('<html><head>%s</head><body>' % getBase(self.deck)) +
|
('<html><head>%s</head><body>' % getBase(self.deck)) +
|
||||||
"<style>" + styles + "</style>" +
|
"<style>" + styles + "</style>" +
|
||||||
runFilter("drawQuestion", mungeQA(self.deck, c.htmlQuestion())) +
|
runFilter("drawQuestion", mungeQA(self.deck, c.htmlQuestion()),
|
||||||
|
c) +
|
||||||
"<br><br><hr><br><br>" +
|
"<br><br><hr><br><br>" +
|
||||||
runFilter("drawAnswer", mungeQA(self.deck, c.htmlAnswer()))
|
runFilter("drawAnswer", mungeQA(self.deck, c.htmlAnswer()),
|
||||||
|
c)
|
||||||
+ "</body></html>")
|
+ "</body></html>")
|
||||||
playFromText(c.question)
|
playFromText(c.question)
|
||||||
playFromText(c.answer)
|
playFromText(c.answer)
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ class View(object):
|
||||||
height = 35
|
height = 35
|
||||||
else:
|
else:
|
||||||
height = 45
|
height = 45
|
||||||
q = runFilter("drawQuestion", q)
|
q = runFilter("drawQuestion", q, self.main.currentCard)
|
||||||
self.write(self.center(self.mungeQA(self.main.deck, q), height))
|
self.write(self.center(self.mungeQA(self.main.deck, q), height))
|
||||||
if self.state != self.oldState and not nosound:
|
if self.state != self.oldState and not nosound:
|
||||||
playFromText(q)
|
playFromText(q)
|
||||||
|
|
@ -170,7 +170,7 @@ class View(object):
|
||||||
def drawAnswer(self):
|
def drawAnswer(self):
|
||||||
"Show the answer."
|
"Show the answer."
|
||||||
a = self.main.currentCard.htmlAnswer()
|
a = self.main.currentCard.htmlAnswer()
|
||||||
a = runFilter("drawAnswer", a)
|
a = runFilter("drawAnswer", a, self.main.currentCard)
|
||||||
if self.main.currentCard.cardModel.typeAnswer:
|
if self.main.currentCard.cardModel.typeAnswer:
|
||||||
try:
|
try:
|
||||||
cor = stripHTML(self.main.currentCard.fact[
|
cor = stripHTML(self.main.currentCard.fact[
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue