From e5d7a69631b6c61808b291f3838a1bbff517d1f5 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 30 Oct 2013 23:28:52 +0900 Subject: [PATCH] fix an issue where non-new cards were not reset on export only happened for cards in a filtered deck --- anki/sched.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/anki/sched.py b/anki/sched.py index 82d78414d..8562cd34d 100644 --- a/anki/sched.py +++ b/anki/sched.py @@ -1359,11 +1359,17 @@ usn=:usn, mod=:mod, factor=:fact where id=:id and odid=0 and queue >=0""", def resetCards(self, ids): "Completely reset cards for export." + sids = ids2str(ids) + # we want to avoid resetting due number of existing new cards on export nonNew = self.col.db.list( "select id from cards where id in %s and (queue != 0 or type != 0)" - % ids2str(ids)) + % sids) + # reset all cards self.col.db.execute( - "update cards set reps=0, lapses=0 where id in " + ids2str(nonNew)) + "update cards set reps=0,lapses=0,odid=0,odue=0" + " where id in %s" % sids + ) + # and forget any non-new cards, changing their due numbers self.forgetCards(nonNew) self.col.log(ids)