Hey, I’m new to creating addons in Anki but I’m really well motivated to learn how to do that. My goal is to show a message box every time the reviewer finishes ansewring a card with a number of cards done on a given day. I don’t know why but my hook doesn’t work:
from aqt import mw
from aqt.utils import showInfo
from anki.hooks import addHookdef testFunction(reviewer, card, ease):
cardCount = int(mw.col.db.scalar("""SELECT strftime('%s','now', 'localtime', 'start of day');""")) * 1000 totalreviews = mw.col.db.scalar("select count(id) from revlog where id >= %d" % cardCount) # show a message box showInfo("Card count: %s" % totalreviews)
addHook(“reviewer_did_answer_card”, testFunction)