mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 16:26:40 -04:00
ensure cards are scheduled past cutoff, more
- because the cutoff adds a few hours past midnight, it's possible for a card that's scheduled for 1.0 days ahead to fall within the current cutoff, so we need to make sure that doesn't happen - set spaceUntil=0 when answering card again - fix randomizeNewCards() query. the whole codebase needs auditing for type references which need updating
This commit is contained in:
parent
61610d8351
commit
9d6b0f35f4
1 changed files with 4 additions and 2 deletions
|
@ -763,6 +763,7 @@ where id in """
|
|||
card.due = self.nextDue(card, ease, oldState)
|
||||
card.isDue = 0
|
||||
card.lastFactor = card.factor
|
||||
card.spaceUntil = 0;
|
||||
if lastDelay >= 0:
|
||||
# don't update factor if learning ahead
|
||||
self.updateFactor(card, ease)
|
||||
|
@ -780,8 +781,9 @@ where id in """
|
|||
self.newCount -= 1
|
||||
# card stats
|
||||
anki.cards.Card.updateStats(card, ease, oldState)
|
||||
# update type
|
||||
# update type & ensure past cutoff
|
||||
card.type = self.cardType(card)
|
||||
card.due = max(card.due, this.dueCutoff+1)
|
||||
# allow custom schedulers to munge the card
|
||||
if self.answerPreSave:
|
||||
self.answerPreSave(card, ease)
|
||||
|
@ -985,7 +987,7 @@ where id in %s""" % ids2str(ids), now=time.time(), new=0)
|
|||
def randomizeNewCards(self, cardIds=None):
|
||||
"Randomize 'due' on all new cards."
|
||||
now = time.time()
|
||||
query = "select distinct factId from cards where type = 2"
|
||||
query = "select distinct factId from cards where reps = 0"
|
||||
if cardIds:
|
||||
query += " and id in %s" % ids2str(cardIds)
|
||||
fids = self.s.column0(query)
|
||||
|
|
Loading…
Reference in a new issue