Damien Elmes 2020-01-19 15:41:58 +10:00
parent fbf0f94bcc
commit a9c93d933c
2 changed files with 27 additions and 1 deletions

View File

@ -798,7 +798,13 @@ did = ? and queue = {QUEUE_TYPE_DAY_LEARN_RELEARN} and due <= ? limit ?""",
lastLeft: int,
) -> None:
lastIvl = -(self._delayForGrade(conf, lastLeft))
ivl = card.ivl if leaving else -(self._delayForGrade(conf, card.left))
if leaving:
ivl = card.ivl
else:
if ease == 2:
ivl = -self._delayForRepeatingGrade(conf, card.left)
else:
ivl = -self._delayForGrade(conf, card.left)
def log():
self.col.db.execute(

View File

@ -1281,3 +1281,23 @@ def test_negativeDueFilter():
c.load()
assert c.due == -5
# hard on the first step should be the average of again and good,
# and it should be logged properly
def test_initial_repeat():
d = getEmptyCol()
f = d.newNote()
f["Front"] = "one"
f["Back"] = "two"
d.addNote(f)
d.reset()
c = d.sched.getCard()
d.sched.answerCard(c, 2)
# should be due in ~ 5.5 mins
expected = time.time() + 5.5 * 60
assert expected - 10 < c.due < expected * 1.25
ivl = d.db.scalar("select ivl from revlog")
assert ivl == -5.5 * 60