mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
fix leech criteria, fix html appearing
This commit is contained in:
parent
a539c636f8
commit
e74539a7da
1 changed files with 7 additions and 3 deletions
|
@ -427,7 +427,7 @@ Please do not file a bug report with Anki.<br>""")
|
|||
self.deck.s.expunge(self.currentCard)
|
||||
# answer
|
||||
self.deck.answerCard(self.currentCard, quality)
|
||||
if self.currentCard.reps > 15 and self.currentCard.successive == 0:
|
||||
if self.isLeech():
|
||||
self.handleLeech()
|
||||
self.lastScheduledTime = anki.utils.fmtTimeSpan(
|
||||
self.currentCard.due - time.time())
|
||||
|
@ -441,6 +441,9 @@ Please do not file a bug report with Anki.<br>""")
|
|||
self.save()
|
||||
self.moveToState("getQuestion")
|
||||
|
||||
def isLeech(self):
|
||||
return not self.currentCard.successive and self.currentCard.noCount > 15
|
||||
|
||||
def handleLeech(self):
|
||||
self.deck.refresh()
|
||||
tags = self.currentCard.fact.tags
|
||||
|
@ -453,9 +456,10 @@ Please do not file a bug report with Anki.<br>""")
|
|||
self.deck.updatePriority(card)
|
||||
self.deck.refresh()
|
||||
self.setNotice(_("""\
|
||||
%s... is a <a href="http://ichi2.net/anki/wiki/Leeches">leech</a>
|
||||
<b>%s</b>... is a <a href="http://ichi2.net/anki/wiki/Leeches">leech</a>
|
||||
and has been suspended.""") %
|
||||
stripHTML(self.currentCard.question)[0:30])
|
||||
stripHTML(self.currentCard.question)[0:30].\
|
||||
replace("\n", " "))
|
||||
|
||||
def startRefreshTimer(self):
|
||||
"Update the screen once a minute until next card is displayed."
|
||||
|
|
Loading…
Reference in a new issue