mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
new 'learn more' handling
This commit is contained in:
parent
f8b6d18dff
commit
2550d3ec08
1 changed files with 6 additions and 8 deletions
10
anki/deck.py
10
anki/deck.py
|
|
@ -134,7 +134,7 @@ class Deck(object):
|
||||||
self.sessionStartReps = 0
|
self.sessionStartReps = 0
|
||||||
self.sessionStartTime = 0
|
self.sessionStartTime = 0
|
||||||
self.lastSessionStart = 0
|
self.lastSessionStart = 0
|
||||||
self.extraNewCards = 0
|
self.newEarly = False
|
||||||
self.reviewEarly = False
|
self.reviewEarly = False
|
||||||
|
|
||||||
def modifiedSinceSave(self):
|
def modifiedSinceSave(self):
|
||||||
|
|
@ -217,7 +217,7 @@ limit 1""")
|
||||||
|
|
||||||
def _maybeGetNewCard(self):
|
def _maybeGetNewCard(self):
|
||||||
"Get a new card, provided daily new card limit not exceeded."
|
"Get a new card, provided daily new card limit not exceeded."
|
||||||
if not self.newCountToday:
|
if not self.newCountToday and not self.newEarly:
|
||||||
return
|
return
|
||||||
return self._getNewCard()
|
return self._getNewCard()
|
||||||
|
|
||||||
|
|
@ -405,9 +405,6 @@ where id != :id and factId = :factId""",
|
||||||
entry.writeSQL(self.s)
|
entry.writeSQL(self.s)
|
||||||
self.modified = now
|
self.modified = now
|
||||||
self.setUndoEnd(undoName)
|
self.setUndoEnd(undoName)
|
||||||
# decrease new card boost
|
|
||||||
if self.extraNewCards:
|
|
||||||
self.extraNewCards -= 1
|
|
||||||
|
|
||||||
# Interval management
|
# Interval management
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
@ -627,7 +624,7 @@ type = 0 and isDue = 1 and combinedDue <= :now""", now=time.time())
|
||||||
stmt % 2, now=time.time()).rowcount
|
stmt % 2, now=time.time()).rowcount
|
||||||
self.newCountToday = max(min(
|
self.newCountToday = max(min(
|
||||||
self.newCount, self.newCardsPerDay -
|
self.newCount, self.newCardsPerDay -
|
||||||
self.newCardsToday()), 0) + self.extraNewCards
|
self.newCardsToday()), 0)
|
||||||
|
|
||||||
def rebuildQueue(self):
|
def rebuildQueue(self):
|
||||||
"Update relative delays based on current time."
|
"Update relative delays based on current time."
|
||||||
|
|
@ -668,6 +665,7 @@ type = 0 and isDue = 1 and combinedDue <= :now""", now=time.time())
|
||||||
if ids:
|
if ids:
|
||||||
self.updatePriorities(ids)
|
self.updatePriorities(ids)
|
||||||
self.reviewEarly = False
|
self.reviewEarly = False
|
||||||
|
self.newEarly = False
|
||||||
self.flushMod()
|
self.flushMod()
|
||||||
self.checkDue()
|
self.checkDue()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue