mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
ensure failed mature come at the start of the future day
- this fixes a state where cards failed on that future day could end up with an earlier due date that the rest of the failed mature cards, leading to the newly failed cards being repeated prematurely - this leads to non-deterministic scheduling of the mature bonus fails, so they are effectively randomized which is probably what most users want
This commit is contained in:
parent
4859778d2c
commit
6860bba0de
1 changed files with 7 additions and 7 deletions
14
anki/deck.py
14
anki/deck.py
|
@ -936,13 +936,13 @@ and type between 1 and 2""",
|
|||
def nextDue(self, card, ease, oldState):
|
||||
"Return time when CARD will expire given EASE."
|
||||
if ease == 1:
|
||||
if oldState == "mature":
|
||||
# FIXME: magic value until we have old clients updated
|
||||
if self.delay1 == 600:
|
||||
d = 0
|
||||
else:
|
||||
d = self.delay1
|
||||
due = d*86400
|
||||
# 600 is a magic value which means no bonus, and is used to ease
|
||||
# upgrades
|
||||
if oldState == "mature" and self.delay1 and self.delay1 != 600:
|
||||
# user wants a bonus of 1+ days. put the failed cards at the
|
||||
# start of the future day, so that failures that day will come
|
||||
# after the waiting cards
|
||||
return self.failedCutoff + (self.delay1 - 1)*86400
|
||||
else:
|
||||
due = 0
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue