mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
derive autoplay from original deck
This commit is contained in:
parent
1fa4e6c946
commit
a4e6db9498
1 changed files with 6 additions and 2 deletions
|
@ -142,7 +142,7 @@ function _typeAnsPress() {
|
||||||
c = self.card
|
c = self.card
|
||||||
# grab the question and play audio
|
# grab the question and play audio
|
||||||
q = c.q()
|
q = c.q()
|
||||||
if self.mw.col.decks.confForDid(self.card.did)['autoplay']:
|
if self._autoplay(c):
|
||||||
playFromText(q)
|
playFromText(q)
|
||||||
# render & update bottom
|
# render & update bottom
|
||||||
q = self._mungeQA(q)
|
q = self._mungeQA(q)
|
||||||
|
@ -155,6 +155,10 @@ function _typeAnsPress() {
|
||||||
# user hook
|
# user hook
|
||||||
runHook('showQuestion')
|
runHook('showQuestion')
|
||||||
|
|
||||||
|
def _autoplay(self, card):
|
||||||
|
return self.mw.col.decks.confForDid(
|
||||||
|
self.card.odid or self.card.did)['autoplay']
|
||||||
|
|
||||||
# Showing the answer
|
# Showing the answer
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
@ -163,7 +167,7 @@ function _typeAnsPress() {
|
||||||
c = self.card
|
c = self.card
|
||||||
a = c.a()
|
a = c.a()
|
||||||
# play audio?
|
# play audio?
|
||||||
if self.mw.col.decks.confForDid(self.card.did)['autoplay']:
|
if self._autoplay(c):
|
||||||
playFromText(a)
|
playFromText(a)
|
||||||
# render and update bottom
|
# render and update bottom
|
||||||
a = self._mungeQA(a)
|
a = self._mungeQA(a)
|
||||||
|
|
Loading…
Reference in a new issue