mirror of
https://github.com/ankitects/anki.git
synced 2025-11-13 08:07:11 -05:00
add card.isEmpty()
This commit is contained in:
parent
aedf88ee6d
commit
50464b514a
1 changed files with 7 additions and 1 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from anki.utils import intTime, hexifyID, timestampID
|
from anki.utils import intTime, hexifyID, timestampID, joinFields
|
||||||
from anki.consts import *
|
from anki.consts import *
|
||||||
|
|
||||||
# Cards
|
# Cards
|
||||||
|
|
@ -156,3 +156,9 @@ lapses=?, left=?, odue=?, odid=?, did=? where id = ?""",
|
||||||
"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)
|
||||||
return min(total, self.timeLimit())
|
return min(total, self.timeLimit())
|
||||||
|
|
||||||
|
def isEmpty(self):
|
||||||
|
ords = self.col.models.availOrds(
|
||||||
|
self.model(), joinFields(self.note().fields))
|
||||||
|
if self.ord not in ords:
|
||||||
|
return True
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue