mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
improve failed card handling
This commit is contained in:
parent
3b2ba252cd
commit
a342c73887
1 changed files with 50 additions and 0 deletions
50
anki/deck.py
50
anki/deck.py
|
@ -1539,6 +1539,46 @@ where id = :id""", pending)
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
# Failed card handling
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
def setFailedCardPolicy(self, idx):
|
||||||
|
if idx == 5:
|
||||||
|
# custom
|
||||||
|
return
|
||||||
|
self.collapseTime = 0
|
||||||
|
if idx == 0:
|
||||||
|
d = 600
|
||||||
|
self.collapseTime = 1
|
||||||
|
elif idx == 1:
|
||||||
|
d = 600
|
||||||
|
elif idx == 2:
|
||||||
|
d = 28800
|
||||||
|
elif idx == 3:
|
||||||
|
d = 259200
|
||||||
|
elif idx == 4:
|
||||||
|
d = 0
|
||||||
|
self.delay0 = d
|
||||||
|
self.delay1 = d
|
||||||
|
|
||||||
|
def getFailedCardPolicy(self):
|
||||||
|
if self.delay0 != self.delay1:
|
||||||
|
return 5
|
||||||
|
d = self.delay0
|
||||||
|
if self.collapseTime == 1:
|
||||||
|
if d == 600:
|
||||||
|
return 0
|
||||||
|
return 5
|
||||||
|
if d == 600:
|
||||||
|
return 1
|
||||||
|
elif d == 28800:
|
||||||
|
return 2
|
||||||
|
elif d == 259200:
|
||||||
|
return 3
|
||||||
|
elif d == 0:
|
||||||
|
return 4
|
||||||
|
return 5
|
||||||
|
|
||||||
# Media
|
# Media
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
|
@ -2515,3 +2555,13 @@ def revCardOrderLabels():
|
||||||
2: _("Review cards in order due"),
|
2: _("Review cards in order due"),
|
||||||
3: _("Review cards in random order"),
|
3: _("Review cards in random order"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def failedCardOptionLabels():
|
||||||
|
return {
|
||||||
|
0: _("Show failed cards soon"),
|
||||||
|
1: _("Show failed cards in 10 minutes"),
|
||||||
|
2: _("Show failed cards in 8 hours"),
|
||||||
|
3: _("Show failed cards in 3 days"),
|
||||||
|
4: _("Show failed cards at end"),
|
||||||
|
5: _("Custom failed cards handling"),
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue