From e073ef08b9644308ca4a2e9757c27a19ff245a6b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Tue, 5 Feb 2019 12:30:01 +1000 Subject: [PATCH] shift revlog eases when turning v2 sched on/off fixes old 'good'/'easy' answers showing up as 'hard'/'good' in the graphs --- anki/schedv2.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/anki/schedv2.py b/anki/schedv2.py index d8ac04712..5bf4bb9b9 100644 --- a/anki/schedv2.py +++ b/anki/schedv2.py @@ -1617,13 +1617,20 @@ where queue < 0""" % (intTime(), self.col.usn())) def _moveManuallyBuried(self): self.col.db.execute("update cards set queue=-2,mod=%d where queue=-3" % intTime()) + # adding 'hard' in v2 scheduler means old ease entries need shifting + # up or down + def _remapLearningAnswers(self, sql): + self.col.db.execute("update revlog set %s" % sql) + def moveToV1(self): self._emptyAllFiltered() self._removeAllFromLearning() self._moveManuallyBuried() self._resetSuspendedLearning() + self._remapLearningAnswers("ease=ease-1 where ease in (3,4)") def moveToV2(self): self._emptyAllFiltered() self._removeAllFromLearning() + self._remapLearningAnswers("ease=ease+1 where ease in (2,3)")