mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -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
|
@ -62,12 +62,16 @@ class CramScheduler(Scheduler):
|
||||||
maxlim = "and due <= %d" % (self.today+1+self.max)
|
maxlim = "and due <= %d" % (self.today+1+self.max)
|
||||||
else:
|
else:
|
||||||
maxlim = ""
|
maxlim = ""
|
||||||
|
if self.gids:
|
||||||
|
extra = "and gid in "+ids2str(self.gids)
|
||||||
|
else:
|
||||||
|
extra = ""
|
||||||
self.newQueue = self.db.list("""
|
self.newQueue = self.db.list("""
|
||||||
select id from cards where queue = 2 and due >= %d
|
select id from cards where queue = 2 and due >= %d
|
||||||
%s
|
%s
|
||||||
and gid in %s order by %s limit %d""" % (self.today+1+self.min,
|
%s order by %s limit %d""" % (self.today+1+self.min,
|
||||||
maxlim,
|
maxlim,
|
||||||
ids2str(self.gids),
|
extra,
|
||||||
self.order,
|
self.order,
|
||||||
self.reportLimit))
|
self.reportLimit))
|
||||||
self.newCount = len(self.newQueue)
|
self.newCount = len(self.newQueue)
|
||||||
|
|
|
@ -383,6 +383,9 @@ def test_cram():
|
||||||
d.sched.answerCard(c, 3)
|
d.sched.answerCard(c, 3)
|
||||||
assert c.ivl == 1
|
assert c.ivl == 1
|
||||||
assert c.due == d.sched.today + 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():
|
def test_cramLimits():
|
||||||
d = getEmptyDeck()
|
d = getEmptyDeck()
|
||||||
|
|
Loading…
Reference in a new issue