mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
REVLOG_RELRN
This commit is contained in:
parent
dd5d73f3a3
commit
e1a283b168
4 changed files with 9 additions and 8 deletions
|
@ -72,6 +72,7 @@ BUTTON_FOUR = 4
|
|||
# Revlog types
|
||||
REVLOG_LRN = 0
|
||||
REVLOG_REV = 1
|
||||
REVLOG_RELRN = 2
|
||||
|
||||
# Labels
|
||||
##########################################################################
|
||||
|
|
|
@ -558,7 +558,7 @@ did = ? and queue = 3 and due <= ? limit ?""",
|
|||
if card.odid and not card.wasNew:
|
||||
type = 3
|
||||
elif card.type == 2:
|
||||
type = 2
|
||||
type = REVLOG_RELRN
|
||||
else:
|
||||
type = REVLOG_LRN
|
||||
leaving = False
|
||||
|
|
|
@ -608,7 +608,7 @@ did = ? and queue = {QUEUE_TYPE_DAY_LEARN_RELEARN} and due <= ? limit ?""",
|
|||
def _answerLrnCard(self, card: Card, ease: int) -> None:
|
||||
conf = self._lrnConf(card)
|
||||
if card.type in (2, CARD_TYPE_RELEARNING):
|
||||
type = 2
|
||||
type = REVLOG_RELRN
|
||||
else:
|
||||
type = REVLOG_LRN
|
||||
# lrnCount was decremented once when card was fetched
|
||||
|
|
|
@ -155,7 +155,7 @@ select count(), sum(time)/1000,
|
|||
sum(case when ease = 1 then 1 else 0 end), /* failed */
|
||||
sum(case when type = {REVLOG_LRN} then 1 else 0 end), /* learning */
|
||||
sum(case when type = {REVLOG_REV} then 1 else 0 end), /* review */
|
||||
sum(case when type = 2 then 1 else 0 end), /* relearn */
|
||||
sum(case when type = {REVLOG_RELRN} then 1 else 0 end), /* relearn */
|
||||
sum(case when type = 3 then 1 else 0 end) /* filter */
|
||||
from revlog where id > ? """
|
||||
+ lim,
|
||||
|
@ -551,13 +551,13 @@ select
|
|||
sum(case when type = {REVLOG_LRN} then 1 else 0 end), -- lrn count
|
||||
sum(case when type = {REVLOG_REV} and lastIvl < 21 then 1 else 0 end), -- yng count
|
||||
sum(case when type = {REVLOG_REV} 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 = {REVLOG_RELRN} then 1 else 0 end), -- lapse count
|
||||
sum(case when type = 3 then 1 else 0 end), -- cram count
|
||||
sum(case when type = {REVLOG_LRN} then time/1000.0 else 0 end)/:tf, -- lrn time
|
||||
-- yng + mtr time
|
||||
sum(case when type = {REVLOG_REV} and lastIvl < 21 then time/1000.0 else 0 end)/:tf,
|
||||
sum(case when type = {REVLOG_REV} and lastIvl >= 21 then time/1000.0 else 0 end)/:tf,
|
||||
sum(case when type = 2 then time/1000.0 else 0 end)/:tf, -- lapse time
|
||||
sum(case when type = {REVLOG_RELRN} then time/1000.0 else 0 end)/:tf, -- lapse time
|
||||
sum(case when type = 3 then time/1000.0 else 0 end)/:tf -- cram time
|
||||
from revlog %s
|
||||
group by day order by day"""
|
||||
|
@ -758,10 +758,10 @@ select count(), avg(ivl), max(ivl) from cards where did in %s and queue = 2"""
|
|||
return self.col.db.all(
|
||||
f"""
|
||||
select (case
|
||||
when type in ({REVLOG_LRN},2) then 0
|
||||
when type in ({REVLOG_LRN},{REVLOG_RELRN}) then 0
|
||||
when lastIvl < 21 then 1
|
||||
else 2 end) as thetype,
|
||||
(case when type in ({REVLOG_LRN},2) and ease = 4 then %s else ease end), count() from revlog %s
|
||||
(case when type in ({REVLOG_LRN},{REVLOG_RELRN}) and ease = 4 then %s else ease end), count() from revlog %s
|
||||
group by thetype, ease
|
||||
order by thetype, ease"""
|
||||
% (ease4repl, lim)
|
||||
|
@ -856,7 +856,7 @@ select
|
|||
sum(case when ease = 1 then 0 else 1 end) /
|
||||
cast(count() as float) * 100,
|
||||
count()
|
||||
from revlog where type in ({REVLOG_LRN},{REVLOG_REV},2) %s
|
||||
from revlog where type in ({REVLOG_LRN},{REVLOG_REV},{REVLOG_RELRN}) %s
|
||||
group by hour having count() > 30 order by hour"""
|
||||
% lim,
|
||||
cut=self.col.sched.dayCutoff - (rolloverHour * 3600),
|
||||
|
|
Loading…
Reference in a new issue