From a728595c1d5d8fadfd57b86af2411dd8fd2627fc Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 27 Jul 2018 14:59:45 +1000 Subject: [PATCH] use scheduled ivl in lapse calculation reverting to 2.0 behaviour https://anki.tenderapp.com/discussions/effective-learning/1300-lapse-duration-not-being-honored-for-lapses-of-multi-stepday-relearn-cards --- anki/schedv2.py | 5 +---- tests/test_schedv2.py | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/anki/schedv2.py b/anki/schedv2.py index 3883f1551..2514bce00 100644 --- a/anki/schedv2.py +++ b/anki/schedv2.py @@ -856,10 +856,7 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)""" return delay def _lapseIvl(self, card, conf): - due = card.odue or card.due - elapsed = card.ivl - (due - self.today) - ivl = min(elapsed, card.ivl) - ivl = max(1, conf['minInt'], ivl*conf['mult']) + ivl = max(1, conf['minInt'], card.ivl*conf['mult']) return ivl def _rescheduleRev(self, card, ease, early): diff --git a/tests/test_schedv2.py b/tests/test_schedv2.py index 30c25efd6..f666f91f2 100644 --- a/tests/test_schedv2.py +++ b/tests/test_schedv2.py @@ -1107,10 +1107,8 @@ def test_failmult(): c = d.sched.getCard() d.sched.answerCard(c, 1) assert c.ivl == 50 - # failing again, the actual elapsed interval is 0, - # so the card is reset to new d.sched.answerCard(c, 1) - assert c.ivl == 1 + assert c.ivl == 25 def test_moveVersions(): col = _getEmptyCol(schedVer=1)