mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
when generating cards in ordered mode, set due = fact creation + ordinal
This commit is contained in:
parent
8e92a4dfc8
commit
09e002c8d6
2 changed files with 8 additions and 4 deletions
|
@ -68,7 +68,7 @@ cardsTable = Table(
|
|||
class Card(object):
|
||||
"A card."
|
||||
|
||||
def __init__(self, fact=None, cardModel=None):
|
||||
def __init__(self, fact=None, cardModel=None, due=None):
|
||||
self.tags = u""
|
||||
self.id = genID()
|
||||
# new cards start as new & due
|
||||
|
@ -77,8 +77,11 @@ class Card(object):
|
|||
self.timerStarted = False
|
||||
self.timerStopped = False
|
||||
self.modified = time.time()
|
||||
self.due = self.modified
|
||||
self.combinedDue = self.modified
|
||||
if due:
|
||||
self.due = due
|
||||
else:
|
||||
self.due = self.modified
|
||||
self.combinedDue = self.due
|
||||
if fact:
|
||||
self.fact = fact
|
||||
if cardModel:
|
||||
|
|
|
@ -1033,7 +1033,8 @@ where type = 2 and priority in (1,2,3,4)""") or 0
|
|||
select count(id) from cards
|
||||
where factId = :fid and cardModelId = :cmid""",
|
||||
fid=fact.id, cmid=cardModel.id) == 0:
|
||||
card = anki.cards.Card(fact, cardModel)
|
||||
card = anki.cards.Card(
|
||||
fact, cardModel, due=fact.created+cardModel.ordinal)
|
||||
self.updateCardTags([card.id])
|
||||
self.updatePriority(card)
|
||||
self.cardCount += 1
|
||||
|
|
Loading…
Reference in a new issue