Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from anki.hooks import wrap
- from anki.sched import Scheduler
- from aqt import mw
- from aqt.utils import tooltip
- threshold_interval = 7
- threshold_field = u"Learned"
- threshold_suspend_tag = u"suspendable"
- def threshold(self, card, ease):
- f = card.note()
- if (card.ivl >= threshold_interval):
- if threshold_field in mw.col.models.fieldNames(f.model()) and not f[threshold_field]:
- f[threshold_field] = 'Yes'
- if f.hasTag(threshold_suspend_tag) and card.queue != -1:
- mw.col.sched.suspendCards([card.id])
- f.delTag(threshold_suspend_tag)
- f.flush()
- return True
- Scheduler.answerCard = wrap(Scheduler.answerCard, threshold)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement