mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
fix zero div issue, lim=0 turns off detection
This commit is contained in:
parent
eda8c2011a
commit
479b0b6ed5
1 changed files with 10 additions and 3 deletions
|
@ -452,9 +452,16 @@ Please do not file a bug report with Anki.<br>""")
|
||||||
|
|
||||||
def isLeech(self):
|
def isLeech(self):
|
||||||
no = self.currentCard.noCount
|
no = self.currentCard.noCount
|
||||||
max = self.deck.getInt('leechFails')
|
fmax = self.deck.getInt('leechFails')
|
||||||
return (not self.currentCard.successive and
|
if not fmax:
|
||||||
no >= max and (max - no) % (max/2) == 0)
|
return
|
||||||
|
return (
|
||||||
|
# failed
|
||||||
|
not self.currentCard.successive and
|
||||||
|
# greater than fail threshold
|
||||||
|
no >= fmax and
|
||||||
|
# at least threshold/2 reps since last time
|
||||||
|
(fmax - no) % (max(fmax/2, 1)) == 0)
|
||||||
|
|
||||||
def handleLeech(self):
|
def handleLeech(self):
|
||||||
self.deck.refresh()
|
self.deck.refresh()
|
||||||
|
|
Loading…
Reference in a new issue