mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
fix rounding error in rev history graphs
This commit is contained in:
parent
dd12431806
commit
fa7536ca36
1 changed files with 6 additions and 6 deletions
|
@ -342,18 +342,18 @@ group by day order by day""" % (self._limit(), lim),
|
||||||
tf = 3600.0 # hours
|
tf = 3600.0 # hours
|
||||||
return self.col.db.all("""
|
return self.col.db.all("""
|
||||||
select
|
select
|
||||||
(cast((id/1000 - :cut) / 86400.0 as int))/:chunk as day,
|
(cast((id/1000.0 - :cut) / 86400.0 as int))/:chunk as day,
|
||||||
sum(case when type = 0 then 1 else 0 end), -- lrn count
|
sum(case when type = 0 then 1 else 0 end), -- lrn count
|
||||||
sum(case when type = 1 and lastIvl < 21 then 1 else 0 end), -- yng count
|
sum(case when type = 1 and lastIvl < 21 then 1 else 0 end), -- yng count
|
||||||
sum(case when type = 1 and lastIvl >= 21 then 1 else 0 end), -- mtr count
|
sum(case when type = 1 and lastIvl >= 21 then 1 else 0 end), -- mtr count
|
||||||
sum(case when type = 2 then 1 else 0 end), -- lapse count
|
sum(case when type = 2 then 1 else 0 end), -- lapse count
|
||||||
sum(case when type = 3 then 1 else 0 end), -- cram count
|
sum(case when type = 3 then 1 else 0 end), -- cram count
|
||||||
sum(case when type = 0 then time/1000 else 0 end)/:tf, -- lrn time
|
sum(case when type = 0 then time/1000.0 else 0 end)/:tf, -- lrn time
|
||||||
-- yng + mtr time
|
-- yng + mtr time
|
||||||
sum(case when type = 1 and lastIvl < 21 then time/1000 else 0 end)/:tf,
|
sum(case when type = 1 and lastIvl < 21 then time/1000.0 else 0 end)/:tf,
|
||||||
sum(case when type = 1 and lastIvl >= 21 then time/1000 else 0 end)/:tf,
|
sum(case when type = 1 and lastIvl >= 21 then time/1000.0 else 0 end)/:tf,
|
||||||
sum(case when type = 2 then time/1000 else 0 end)/:tf, -- lapse time
|
sum(case when type = 2 then time/1000.0 else 0 end)/:tf, -- lapse time
|
||||||
sum(case when type = 3 then time/1000 else 0 end)/:tf -- cram time
|
sum(case when type = 3 then time/1000.0 else 0 end)/:tf -- cram time
|
||||||
from revlog %s
|
from revlog %s
|
||||||
group by day order by day""" % lim,
|
group by day order by day""" % lim,
|
||||||
cut=self.col.sched.dayCutoff,
|
cut=self.col.sched.dayCutoff,
|
||||||
|
|
Loading…
Reference in a new issue