apply selective study to review early

This commit is contained in:
Damien Elmes 2011-01-17 01:36:19 +09:00
parent 3d5a427f85
commit 98fb0f5bb9

View file

@ -503,16 +503,19 @@ where type >= 0
def _rebuildRevEarlyCount(self): def _rebuildRevEarlyCount(self):
# in the future it would be nice to skip the first x days of due cards # in the future it would be nice to skip the first x days of due cards
extraLim = "" self.revCount = self.s.scalar(
self.revCount = self.s.scalar(""" self.cardLimit(
select count() from cards where type = 1 and combinedDue > :now "revActive", "revInactive", """
%s""" % extraLim, now=self.dueCutoff) select count() from cards c where type = 1 and combinedDue > :now
"""), now=self.dueCutoff)
def _fillRevEarlyQueue(self): def _fillRevEarlyQueue(self):
if self.revCount and not self.revQueue: if self.revCount and not self.revQueue:
self.revQueue = self.s.all(""" self.revQueue = self.s.all(
select id, factId from cards where type = 1 and combinedDue > :lim self.cardLimit(
order by combinedDue limit %d""" % self.queueLimit, lim=self.dueCutoff) "revActive", "revInactive", """
select id, factId from cards c where type = 1 and combinedDue > :lim
order by combinedDue limit %d""" % self.queueLimit), lim=self.dueCutoff)
self.revQueue.reverse() self.revQueue.reverse()
# Learn more # Learn more