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