mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
maxIvl, ivlFct
- limit ivl on rev and cram scheduling, default to 100 years - ivlfct -> ivlFct for consistency
This commit is contained in:
parent
d6bce7c873
commit
1d92961e97
2 changed files with 11 additions and 14 deletions
|
@ -67,8 +67,8 @@ defaultConf = {
|
||||||
'ease4': 1.3,
|
'ease4': 1.3,
|
||||||
'fuzz': 0.05,
|
'fuzz': 0.05,
|
||||||
'minSpace': 1,
|
'minSpace': 1,
|
||||||
# in beta11+
|
'ivlFct': 1,
|
||||||
'ivlfct': 1
|
'maxIvl': 36500,
|
||||||
},
|
},
|
||||||
'maxTaken': 60,
|
'maxTaken': 60,
|
||||||
'timer': 0,
|
'timer': 0,
|
||||||
|
|
|
@ -800,10 +800,12 @@ did = ? and queue = 2 and due <= ? limit ?""",
|
||||||
# apply interval factor adjustment
|
# apply interval factor adjustment
|
||||||
interval = self._ivlWithFactor(conf, interval)
|
interval = self._ivlWithFactor(conf, interval)
|
||||||
# must be at least one day greater than previous interval; two if easy
|
# must be at least one day greater than previous interval; two if easy
|
||||||
return max(card.ivl + (2 if ease==4 else 1), int(interval))
|
interval = max(card.ivl + (2 if ease==4 else 1), int(interval))
|
||||||
|
# interval capped?
|
||||||
|
return min(interval, conf['maxIvl'])
|
||||||
|
|
||||||
def _ivlWithFactor(self, conf, ivl):
|
def _ivlWithFactor(self, conf, ivl):
|
||||||
return ivl * conf.get('ivlfct', 1)
|
return ivl * conf.get('ivlFct', 1)
|
||||||
|
|
||||||
def _daysLate(self, card):
|
def _daysLate(self, card):
|
||||||
"Number of days later than scheduled."
|
"Number of days later than scheduled."
|
||||||
|
@ -927,7 +929,9 @@ did = ?, queue = %s, due = ?, mod = ?, usn = ? where id = ?""" % queue, data)
|
||||||
assert card.factor
|
assert card.factor
|
||||||
elapsed = card.ivl - (card.odue - self.today)
|
elapsed = card.ivl - (card.odue - self.today)
|
||||||
factor = ((card.factor/1000.0)+1.2)/2.0
|
factor = ((card.factor/1000.0)+1.2)/2.0
|
||||||
return int(max(card.ivl, elapsed * factor, 1))
|
ivl = int(max(card.ivl, elapsed * factor, 1))
|
||||||
|
conf = self._revConf(card)
|
||||||
|
return min(conf['maxIvl'], ivl)
|
||||||
|
|
||||||
# Leeches
|
# Leeches
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
@ -1007,15 +1011,8 @@ did = ?, queue = %s, due = ?, mod = ?, usn = ? where id = ?""" % queue, data)
|
||||||
# normal deck
|
# normal deck
|
||||||
if not card.odid:
|
if not card.odid:
|
||||||
return conf['rev']
|
return conf['rev']
|
||||||
# dynamic deck; override some attributes, use original deck for others
|
# dynamic deck
|
||||||
oconf = self.col.decks.confForDid(card.odid)
|
return self.col.decks.confForDid(card.odid)['rev']
|
||||||
return dict(
|
|
||||||
# original deck
|
|
||||||
ease4=oconf['rev']['ease4'],
|
|
||||||
ivlfct=oconf['rev'].get('ivlfct', 1),
|
|
||||||
minSpace=oconf['rev']['minSpace'],
|
|
||||||
fuzz=oconf['rev']['fuzz']
|
|
||||||
)
|
|
||||||
|
|
||||||
def _deckLimit(self):
|
def _deckLimit(self):
|
||||||
return ids2str(self.col.decks.active())
|
return ids2str(self.col.decks.active())
|
||||||
|
|
Loading…
Reference in a new issue