From 6860bba0de26ca2ddbdde2ee132a88bc4895ce19 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 21 Jan 2011 09:36:04 +0900 Subject: [PATCH] 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 --- anki/deck.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/anki/deck.py b/anki/deck.py index 4051342ef..ebcd0e737 100644 --- a/anki/deck.py +++ b/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: