mirror of
https://github.com/ankitects/anki.git
synced 2025-09-20 06:52:21 -04:00
add timeToday() and repsToday()
This commit is contained in:
parent
174b13f7df
commit
201e27dd58
1 changed files with 12 additions and 0 deletions
|
@ -58,6 +58,18 @@ class Scheduler(object):
|
|||
# FIXME: should learn count include new cards due today, or be separate?
|
||||
return (self.learnCount, self.revCount)
|
||||
|
||||
def timeToday(self):
|
||||
"Time spent learning today, in seconds."
|
||||
return self.deck.db.scalar(
|
||||
"select sum(taken) from revlog where time > ?",
|
||||
self.dayCutoff-86400)
|
||||
|
||||
def repsToday(self):
|
||||
"Number of cards answered today."
|
||||
return self.deck.db.scalar(
|
||||
"select count() from revlog where time > ?",
|
||||
self.dayCutoff-86400)
|
||||
|
||||
def cardQueue(self, card):
|
||||
return card.queue
|
||||
|
||||
|
|
Loading…
Reference in a new issue