differentiate easy button more when reviewing early

apply half the easy bonus post ivl calculation, or else very early
reviews with longer intervals appear to have the same intervals as
answering 'good'
This commit is contained in:
Damien Elmes 2018-07-11 22:18:46 +10:00
parent 1a617e6d60
commit 9e8648bed7
2 changed files with 8 additions and 8 deletions

View File

@ -963,7 +963,7 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)"""
conf = self._revConf(card)
easyBonus = 0
easyBonus = 1
# early 3/4 reviews shouldn't decrease previous interval
minNewIvl = 1
@ -975,15 +975,15 @@ select id from cards where did in %s and queue = 2 and due <= ? limit ?)"""
elif ease == 3:
factor = card.factor / 1000
else: # ease == 4:
factor = card.factor / 1000 * conf['ease4']
# add an extra day, so early reviews have an easy interval nominally
# different from the good answer
easyBonus = 1
factor = card.factor / 1000
ease4 = conf['ease4']
# 1.3 -> 1.15
easyBonus = ease4 - (ease4-1)/2
ivl = max(elapsed * factor, 1)
# cap interval decreases
ivl = max(card.ivl*minNewIvl+easyBonus, ivl)
ivl = max(card.ivl*minNewIvl, ivl) * easyBonus
ivl = self._constrainedIvl(ivl, conf, prev=0, fuzz=False)

View File

@ -679,7 +679,7 @@ def test_filt_reviewing_early_normal():
assert d.sched.nextIvl(c, 1) == 600
assert d.sched.nextIvl(c, 2) == int(75*1.2)*86400
assert d.sched.nextIvl(c, 3) == int(75*2.5)*86400
assert d.sched.nextIvl(c, 4) == int(75*2.5*1.3)*86400
assert d.sched.nextIvl(c, 4) == int(75*2.5*1.15)*86400
# answer 'good'
d.sched.answerCard(c, 3)
@ -702,7 +702,7 @@ def test_filt_reviewing_early_normal():
assert d.sched.nextIvl(c, 2) == 60*86400
assert d.sched.nextIvl(c, 3) == 100*86400
assert d.sched.nextIvl(c, 4) == 101*86400
assert d.sched.nextIvl(c, 4) == 114*86400
def test_filt_keep_lrn_state():
d = getEmptyCol()