calculate # days studied using rev log instead

This commit is contained in:
Damien Elmes 2011-02-18 14:39:53 +09:00
parent 9421a037f6
commit 77029c4ee6

View file

@ -467,13 +467,12 @@ class DeckStats(object):
return html return html
def getDaysReviewed(self, start, finish): def getDaysReviewed(self, start, finish):
now = datetime.datetime.today() today = self.deck.failedCutoff
x = now + datetime.timedelta(start) x = today + 86400*start
y = now + datetime.timedelta(finish) y = today + 86400*finish
return self.deck.s.scalar( return self.deck.s.scalar("""
"select count() from stats where " select count(distinct(cast((time-:off)/86400 as integer))) from reviewHistory
"day >= :x and day <= :y and reps > 0", where time >= :x and time <= :y""",x=x,y=y, off=-self.deck.utcOffset)
x=x, y=y)
def getRepsDone(self, start, finish): def getRepsDone(self, start, finish):
now = datetime.datetime.today() now = datetime.datetime.today()