diff --git a/anki/exporting.py b/anki/exporting.py index 0a1317612..53de4490c 100644 --- a/anki/exporting.py +++ b/anki/exporting.py @@ -161,7 +161,7 @@ class AnkiExporter(Exporter): data) else: # need to reset card state - self.dst.sched.forgetCards(cids) + self.dst.sched.resetCards(cids) # models for m in self.src.models.all(): if int(m['id']) in mids: diff --git a/anki/sched.py b/anki/sched.py index a6a0a0957..364a168a2 100644 --- a/anki/sched.py +++ b/anki/sched.py @@ -1216,6 +1216,12 @@ update cards set type=2,queue=2,ivl=:ivl,due=:due, usn=:usn, mod=:mod, factor=:fact where id=:id and odid=0""", d) + def resetCards(self, ids): + "Completely reset cards for export." + self.col.db.execute( + "update cards set reps=0, lapses=0 where id in " + ids2str(ids)) + self.forgetCards(ids) + # Repositioning new cards ##########################################################################