reapply failure mult on failures in lrn queue

This commit is contained in:
Damien Elmes 2012-12-22 07:32:49 +09:00
parent 243c2b11ed
commit e27cbd2cb7
2 changed files with 31 additions and 10 deletions

View file

@ -528,7 +528,6 @@ did = ? and queue = 3 and due <= ? limit ?""",
# failed
else:
card.left = self._startingLeft(card)
if card.odid:
resched = self._resched(card)
if 'mult' in conf and resched:
# review that's lapsed
@ -536,7 +535,7 @@ did = ? and queue = 3 and due <= ? limit ?""",
else:
# new card; no ivl adjustment
pass
if resched:
if resched and card.odid:
card.odue = self.today + 1
delay = self._delayForGrade(conf, card.left)
if card.due < time.time():

View file

@ -1144,3 +1144,25 @@ def test_norelearn():
d.sched.answerCard(c, 1)
d.sched._cardConf(c)['lapse']['delays'] = []
d.sched.answerCard(c, 1)
def test_failmult():
d = getEmptyDeck()
f = d.newNote()
f['Front'] = u"one"; f['Back'] = u"two"
d.addNote(f)
c = f.cards()[0]
c.type = 2
c.queue = 2
c.ivl = 100
c.due = d.sched.today - c.ivl
c.factor = 2500
c.reps = 3
c.lapses = 1
c.startTimer()
c.flush()
d.sched._cardConf(c)['lapse']['mult'] = 0.5
c = d.sched.getCard()
d.sched.answerCard(c, 1)
assert c.ivl == 50
d.sched.answerCard(c, 1)
assert c.ivl == 25