only bump lrn count when cramming if card not immediately graduated

This commit is contained in:
Damien Elmes 2011-03-24 10:13:41 +09:00
parent cfd4198503
commit 63d1448d1e
2 changed files with 5 additions and 0 deletions

View file

@ -33,6 +33,8 @@ class CramScheduler(Scheduler):
if card.queue == 2:
card.queue = 1
card.edue = card.due
if ease < 3:
self.lrnCount += 1
if card.queue == 1:
self._answerLrnCard(card, ease)
else:

View file

@ -343,6 +343,8 @@ def test_cram():
assert c.ivl == 100
d.sched.answerCard(c, 1)
assert c.ivl == 100
# and should have incremented lrn count
assert d.sched.counts()[1] == 1
# reset ivl for exit test, and pass card
d.sched.answerCard(c, 2)
delta = c.due - time.time()
@ -353,6 +355,7 @@ def test_cram():
d.sched.answerCard(c, 2)
assert c.queue == -3
assert c.ivl == 100
assert c.due == d.sched.today + c.ivl
# and if the queue is reset, it shouldn't appear in the new queue again
d.reset()
assert d.sched.counts() == (0, 0, 0)