mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
when regenerating cards, use fact's creation date
This commit is contained in:
parent
e1c3cc7b5c
commit
01cb3a4b7d
2 changed files with 5 additions and 4 deletions
|
@ -68,7 +68,7 @@ cardsTable = Table(
|
|||
class Card(object):
|
||||
"A card."
|
||||
|
||||
def __init__(self, fact=None, cardModel=None, due=None):
|
||||
def __init__(self, fact=None, cardModel=None, created=None):
|
||||
self.tags = u""
|
||||
self.id = genID()
|
||||
# new cards start as new & due
|
||||
|
@ -77,8 +77,9 @@ class Card(object):
|
|||
self.timerStarted = False
|
||||
self.timerStopped = False
|
||||
self.modified = time.time()
|
||||
if due:
|
||||
self.due = due
|
||||
if created:
|
||||
self.created = created
|
||||
self.due = created
|
||||
else:
|
||||
self.due = self.modified
|
||||
self.combinedDue = self.due
|
||||
|
|
|
@ -1115,7 +1115,7 @@ select count(id) from cards
|
|||
where factId = :fid and cardModelId = :cmid""",
|
||||
fid=fact.id, cmid=cardModel.id) == 0:
|
||||
card = anki.cards.Card(
|
||||
fact, cardModel, due=fact.created+cardModel.ordinal)
|
||||
fact, cardModel, created=fact.created+cardModel.ordinal)
|
||||
self.updateCardTags([card.id])
|
||||
self.updatePriority(card)
|
||||
self.cardCount += 1
|
||||
|
|
Loading…
Reference in a new issue