mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
when deck is finished stop timeboxing timer
This commit is contained in:
parent
f3a336a4e4
commit
340b5864c8
1 changed files with 5 additions and 0 deletions
|
@ -660,6 +660,8 @@ limit %s""" % (self.cramOrder, self.queueLimit)))
|
||||||
id = self.getCardId()
|
id = self.getCardId()
|
||||||
if id:
|
if id:
|
||||||
return self.cardFromId(id, orm)
|
return self.cardFromId(id, orm)
|
||||||
|
else:
|
||||||
|
self.stopSession()
|
||||||
|
|
||||||
def _getCardId(self, check=True):
|
def _getCardId(self, check=True):
|
||||||
"Return the next due card id, or None."
|
"Return the next due card id, or None."
|
||||||
|
@ -2902,6 +2904,9 @@ select id from facts where spaceUntil like :_ff_%d escape '\\'""" % c
|
||||||
self.sessionStartTime = time.time()
|
self.sessionStartTime = time.time()
|
||||||
self.sessionStartReps = self.getStats()['dTotal']
|
self.sessionStartReps = self.getStats()['dTotal']
|
||||||
|
|
||||||
|
def stopSession(self):
|
||||||
|
self.sessionStartTime = 0
|
||||||
|
|
||||||
def sessionLimitReached(self):
|
def sessionLimitReached(self):
|
||||||
if not self.sessionStartTime:
|
if not self.sessionStartTime:
|
||||||
# not started
|
# not started
|
||||||
|
|
Loading…
Reference in a new issue