make sure daysLate() works with review cards in a cram deck

This commit is contained in:
Damien Elmes 2012-03-16 19:08:13 +09:00
parent b5cafd370f
commit 4c369ba6af

View file

@ -687,7 +687,8 @@ did = ? and queue = 2 and due <= ? limit ?""",
def _daysLate(self, card): def _daysLate(self, card):
"Number of days later than scheduled." "Number of days later than scheduled."
return max(0, self.today - card.due) due = card.odue if card.odid else card.due
return max(0, self.today - due)
def _updateRevIvl(self, card, ease): def _updateRevIvl(self, card, ease):
"Update CARD's interval, trying to avoid siblings." "Update CARD's interval, trying to avoid siblings."