mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
card.timeLimit()
This commit is contained in:
parent
b9cc9bf0b2
commit
d8a9a5ea1f
1 changed files with 6 additions and 2 deletions
|
@ -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)
|
|
||||||
|
|
Loading…
Reference in a new issue