card.timeLimit()

This commit is contained in:
Damien Elmes 2012-03-12 14:04:22 +09:00
parent b9cc9bf0b2
commit d8a9a5ea1f

View file

@ -134,8 +134,12 @@ lapses=?, left=?, odue=?, did=? where id = ?""",
def startTimer(self): def startTimer(self):
self.timerStarted = time.time() self.timerStarted = time.time()
def timeLimit(self):
"Time limit for answering in milliseconds."
conf = self.col.decks.confForDid(self.odid or self.did)
return conf['maxTaken']*1000
def timeTaken(self): def timeTaken(self):
"Time taken to answer card, in integer MS." "Time taken to answer card, in integer MS."
total = int((time.time() - self.timerStarted)*1000) total = int((time.time() - self.timerStarted)*1000)
conf = self.col.decks.confForDid(self.odid or self.did) return min(total, self.timeLimit())
return min(total, conf['maxTaken']*1000)