mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
set the initial factor when card graduates, not when it's created
This commit is contained in:
parent
1d6dbf9900
commit
8e40fdcb18
3 changed files with 7 additions and 5 deletions
|
@ -69,7 +69,8 @@ class Card(object):
|
||||||
self.modelId = fact.modelId
|
self.modelId = fact.modelId
|
||||||
self.cardModel = cardModel
|
self.cardModel = cardModel
|
||||||
self.groupId = group.id
|
self.groupId = group.id
|
||||||
self.factor = group.config['initialFactor']
|
# placeholder; will get set properly when card graduates
|
||||||
|
self.factor = 2500
|
||||||
# for non-orm use
|
# for non-orm use
|
||||||
self.cardModelId = cardModel.id
|
self.cardModelId = cardModel.id
|
||||||
self.ordinal = cardModel.ordinal
|
self.ordinal = cardModel.ordinal
|
||||||
|
|
|
@ -21,13 +21,13 @@ defaultConf = {
|
||||||
'new': {
|
'new': {
|
||||||
'delays': [0.5, 3, 10],
|
'delays': [0.5, 3, 10],
|
||||||
'ints': [1, 7, 4],
|
'ints': [1, 7, 4],
|
||||||
|
'initialFactor': 2.5,
|
||||||
},
|
},
|
||||||
'lapse': {
|
'lapse': {
|
||||||
'delays': [0.5, 3, 10],
|
'delays': [0.5, 3, 10],
|
||||||
'ints': [1, 7, 4],
|
'ints': [1, 7, 4],
|
||||||
'mult': 0
|
'mult': 0
|
||||||
},
|
},
|
||||||
'initialFactor': 2.5,
|
|
||||||
'suspendLeeches': True,
|
'suspendLeeches': True,
|
||||||
'leechFails': 16,
|
'leechFails': 16,
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,17 +187,18 @@ limit %d""" % self.learnLimit, lim=self.dayCutoff)
|
||||||
else:
|
else:
|
||||||
# normal remove
|
# normal remove
|
||||||
int_ = conf['ints'][2]
|
int_ = conf['ints'][2]
|
||||||
self.rescheduleAsReview(card, int_)
|
self.rescheduleAsReview(card, conf, int_)
|
||||||
|
|
||||||
def graduateLearnCard(self, card, conf):
|
def graduateLearnCard(self, card, conf):
|
||||||
if card.type == 1:
|
if card.type == 1:
|
||||||
int_ = None
|
int_ = None
|
||||||
else:
|
else:
|
||||||
int_ = conf['ints'][0]
|
int_ = conf['ints'][0]
|
||||||
self.rescheduleAsReview(card, int_)
|
self.rescheduleAsReview(card, conf, int_)
|
||||||
|
|
||||||
def rescheduleAsReview(self, card, int_):
|
def rescheduleAsReview(self, card, conf, int_):
|
||||||
card.queue = 1
|
card.queue = 1
|
||||||
|
card.factor = conf['initialFactor']
|
||||||
if int_:
|
if int_:
|
||||||
# new card
|
# new card
|
||||||
card.type = 1
|
card.type = 1
|
||||||
|
|
Loading…
Reference in a new issue