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, 'newOrder': 1,
'newSpread': NEW_CARDS_DISTRIBUTE, 'newSpread': NEW_CARDS_DISTRIBUTE,
'revOrder': REV_CARDS_RANDOM, 'revOrder': REV_CARDS_RANDOM,
'collapseTime': 600, 'collapseTime': 1200,
'repLim': 0, 'repLim': 0,
'timeLim': 600, 'timeLim': 600,
} }

View file

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

View file

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

View file

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