change default lrn timing; leechAction doesn't need an array

This commit is contained in:
Damien Elmes 2011-04-24 12:26:12 +09:00
parent 754dcef4f7
commit 19fd581839
4 changed files with 12 additions and 9 deletions

View file

@ -27,7 +27,7 @@ defaultQconf = {
'newOrder': 1,
'newSpread': NEW_CARDS_DISTRIBUTE,
'revOrder': REV_CARDS_RANDOM,
'collapseTime': 600,
'collapseTime': 1200,
'repLim': 0,
'timeLim': 600,
}

View file

@ -7,21 +7,21 @@ from anki.utils import intTime
defaultConf = {
'new': {
'delays': [0.5, 3, 10],
'delays': [1, 10],
'ints': [1, 7, 4],
'initialFactor': 2500,
},
'lapse': {
'delays': [0.5, 3, 10],
'delays': [1, 10],
'mult': 0,
'minInt': 1,
'relearn': True,
'leechFails': 16,
# [type, data], where type 0=suspend, 1=tagonly
'leechAction': [0],
# type 0=suspend, 1=tagonly
'leechAction': 0,
},
'cram': {
'delays': [0.5, 3, 10],
'delays': [1, 5, 10],
'resched': True,
'reset': True,
'mult': 0,

View file

@ -559,7 +559,7 @@ queue = 2 %s and due <= :lim order by %s limit %d""" % (
f.addTag("leech")
f.flush()
# handle
a = conf['leechAction'][0]
a = conf['leechAction']
if a == 0:
self.suspendCards([card.id])
card.queue = -1

View file

@ -79,8 +79,7 @@ def test_newBoxes():
d.reset()
c = d.sched.getCard()
d.sched.answerCard(c, 2)
d.sched.answerCard(c, 2)
assert c.grade == 2
assert c.grade == 1
d.sched._cardConf(c)['new']['delays'] = [0.5]
# should handle gracefully
d.sched.answerCard(c, 2)
@ -97,6 +96,7 @@ def test_learn():
# sched.getCard should return it, since it's due in the past
c = d.sched.getCard()
assert c
d.sched._cardConf(c)['new']['delays'] = [0.5, 3, 10]
# it should have no cycles and a grade of 0
assert c.grade == c.cycles == 0
# fail it
@ -277,6 +277,8 @@ def test_nextIvl():
f['Front'] = u"one"; f['Back'] = u"two"
d.addFact(f)
c = f.cards()[0]
d.sched._cardConf(c)['new']['delays'] = [0.5, 3, 10]
d.sched._cardConf(c)['lapse']['delays'] = [0.5, 3, 10]
# cards in learning
##################################################
ni = d.sched.nextIvl
@ -394,6 +396,7 @@ def test_cram():
conf['resched'] = False
assert d.sched.counts() == (1, 0, 0)
c = d.sched.getCard()
d.sched._cardConf(c)['cram']['delays'] = [0.5, 3, 10]
assert d.sched.counts() == (0, 0, 0)
# check that estimates work
assert d.sched.nextIvl(c, 1) == 30