when deck is finished stop timeboxing timer

This commit is contained in:
Damien Elmes 2011-02-03 00:18:42 +09:00
parent f3a336a4e4
commit 340b5864c8

View file

@ -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