only look at the last 10 answers for time

This commit is contained in:
Damien Elmes 2011-04-24 13:32:30 +09:00
parent 0bbdd722c2
commit 3327c27d81

View file

@ -105,13 +105,14 @@ order by due""" % self._groupLimit(),
"A very rough estimate of time to review." "A very rough estimate of time to review."
(cnt, sum) = self.deck.db.first(""" (cnt, sum) = self.deck.db.first("""
select count(), sum(taken) from (select * from revlog select count(), sum(taken) from (select * from revlog
order by time desc limit 100)""") order by time desc limit 10)""")
if not cnt: if not cnt:
return 0 return 0
avg = sum / float(cnt) avg = sum / float(cnt)
c = self.counts() c = self.counts()
# Here we just assume new/lrn will require 3x the number of reviews. A # Here we just assume new/lrn will require 3x the number of reviews.
# more complex solution can be added in the future. # To improve on this we'll need to make grade count down so we can get
# a decent picture of required steps.
return (avg*c[0]*3 + avg*c[1]*3 + avg*c[2]) / 1000.0 return (avg*c[0]*3 + avg*c[1]*3 + avg*c[2]) / 1000.0
# Counts # Counts