mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 08:46:37 -04:00
make sure cramming works if there are no selected groups
This commit is contained in:
parent
31427f0133
commit
464eb2b684
2 changed files with 12 additions and 5 deletions
14
anki/cram.py
14
anki/cram.py
|
@ -62,14 +62,18 @@ class CramScheduler(Scheduler):
|
|||
maxlim = "and due <= %d" % (self.today+1+self.max)
|
||||
else:
|
||||
maxlim = ""
|
||||
if self.gids:
|
||||
extra = "and gid in "+ids2str(self.gids)
|
||||
else:
|
||||
extra = ""
|
||||
self.newQueue = self.db.list("""
|
||||
select id from cards where queue = 2 and due >= %d
|
||||
%s
|
||||
and gid in %s order by %s limit %d""" % (self.today+1+self.min,
|
||||
maxlim,
|
||||
ids2str(self.gids),
|
||||
self.order,
|
||||
self.reportLimit))
|
||||
%s order by %s limit %d""" % (self.today+1+self.min,
|
||||
maxlim,
|
||||
extra,
|
||||
self.order,
|
||||
self.reportLimit))
|
||||
self.newCount = len(self.newQueue)
|
||||
|
||||
def _resetRev(self):
|
||||
|
|
|
@ -383,6 +383,9 @@ def test_cram():
|
|||
d.sched.answerCard(c, 3)
|
||||
assert c.ivl == 1
|
||||
assert c.due == d.sched.today + 1
|
||||
# users should be able to cram entire deck too
|
||||
d.cramGroups([])
|
||||
assert d.sched.counts()[0] > 0
|
||||
|
||||
def test_cramLimits():
|
||||
d = getEmptyDeck()
|
||||
|
|
Loading…
Reference in a new issue