separate max timer and show timer options

This commit is contained in:
Damien Elmes 2012-03-24 19:56:05 +09:00
parent ccb0c08c9c
commit 4b77d1a08d

View file

@ -137,10 +137,12 @@ lapses=?, left=?, odue=?, odid=?, did=? where id = ?""",
def timeLimit(self): def timeLimit(self):
"Time limit for answering in milliseconds." "Time limit for answering in milliseconds."
conf = self.col.decks.confForDid(self.odid or self.did) conf = self.col.decks.confForDid(self.odid or self.did)
if not conf['timer']:
return 0
return conf['maxTaken']*1000 return conf['maxTaken']*1000
def shouldShowTimer(self):
conf = self.col.decks.confForDid(self.odid or self.did)
return conf['timer']
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)