reset rep/lapse count on export

This commit is contained in:
Damien Elmes 2012-08-23 16:57:08 +09:00
parent 500dff04c8
commit 6c1239ee9c
2 changed files with 7 additions and 1 deletions

View file

@ -161,7 +161,7 @@ class AnkiExporter(Exporter):
data) data)
else: else:
# need to reset card state # need to reset card state
self.dst.sched.forgetCards(cids) self.dst.sched.resetCards(cids)
# models # models
for m in self.src.models.all(): for m in self.src.models.all():
if int(m['id']) in mids: if int(m['id']) in mids:

View file

@ -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""", usn=:usn, mod=:mod, factor=:fact where id=:id and odid=0""",
d) 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 # Repositioning new cards
########################################################################## ##########################################################################