From 8e0077335a6f1fc03b8045b41fe916bd9dab912d Mon Sep 17 00:00:00 2001 From: Arthur-Milchior Date: Tue, 20 Nov 2018 21:50:36 +0100 Subject: [PATCH] Change order of new cards This commit corrects the following bug: * Create a note N in an empty deck D of type basic (reverse), with only some back, no front. Only card 2 will be generated. * Edit the note, add a front. Card 1 will be generated. * In the main window, try to learn deck D. In anki, currently, you'll see Card 2 first. According to the manual (and to my common sens), it should be Card 1 first. This commit correct this bug, and ensure that new cards are seen according to their order, and not to their creation date. --- anki/sched.py | 2 +- anki/schedv2.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/anki/sched.py b/anki/sched.py index bdc83bc9c..5e8add3a5 100644 --- a/anki/sched.py +++ b/anki/sched.py @@ -352,7 +352,7 @@ did = ? and queue = 0 limit ?)""", did, lim) if lim: # fill the queue with the current did self._newQueue = self.col.db.list(""" -select id from cards where did = ? and queue = 0 order by due limit ?""", did, lim) + select id from cards where did = ? and queue = 0 order by due,ord limit ?""", did, lim) if self._newQueue: self._newQueue.reverse() return True diff --git a/anki/schedv2.py b/anki/schedv2.py index 74bba3183..087fb56e5 100644 --- a/anki/schedv2.py +++ b/anki/schedv2.py @@ -353,7 +353,7 @@ did = ? and queue = 0 limit ?)""", did, lim) if lim: # fill the queue with the current did self._newQueue = self.col.db.list(""" -select id from cards where did = ? and queue = 0 order by due limit ?""", did, lim) + select id from cards where did = ? and queue = 0 order by due,ord limit ?""", did, lim) if self._newQueue: self._newQueue.reverse() return True