Damien Elmes 2019-06-14 09:15:48 +10:00
parent 9369e99b2a
commit 9fc4b55575

View File

@ -1595,13 +1595,20 @@ else type end),
due = odue, odue = 0, odid = 0, usn = ? where odid != 0""",
self.col.usn())
def _removeAllFromLearning(self):
def _removeAllFromLearning(self, schedVer=2):
# remove review cards from relearning
if schedVer == 1:
self.col.db.execute("""
update cards set
due = odue, queue = 2, type = 2, mod = %d, usn = %d, odue = 0
where queue in (1,3) and type in (2, 3)
""" % (intTime(), self.col.usn()))
else:
self.col.db.execute("""
update cards set
due = %d+ivl, queue = 2, type = 2, mod = %d, usn = %d, odue = 0
where queue in (1,3) and type in (2, 3)
""" % (self.today, intTime(), self.col.usn()))
# remove new cards from learning
self.forgetCards(self.col.db.list(
"select id from cards where queue in (1,3)"))
@ -1637,5 +1644,5 @@ where queue < 0""" % (intTime(), self.col.usn()))
def moveToV2(self):
self._emptyAllFiltered()
self._removeAllFromLearning()
self._removeAllFromLearning(schedVer=1)
self._remapLearningAnswers("ease=ease+1 where ease in (2,3)")