Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions Answer_Key_Cascade.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
"""Name: Answer Key CascadeFilename: Answer_Key_Cascade.pyVersion: 0.5Author: KenishiDesc: By defualt Anki 2 now reduces the button count depending on card age. Cards can now have anywhere from 2 to 4 buttons max depending on age. Answering a card with 2 buttons requires you to press 1 or 2 if you are using hotkeys. This can interfere with review speed if you don't realize its 2 buttons and answer 3/4. This addon makes it so answering with a higher ease than possible will answer with the actual highest. *Example* 3 Button card: You press "4", the addon answers with "3".
Thanks go to ospalh(https://github.com/ospalh) for simpler implementation (should also eliminate state bugs) Report bugs to https://github.com/Kenishi/Answer-Key-Cascade """
from aqt.reviewer import Reviewerfrom aqt import mwdef AKC_answerCard(self, ease): cnt = mw.col.sched.answerButtons(mw.reviewer.card) # Get button count if ease > cnt: #Is answer > button count? ease = cnt __oldFunc(self, ease)__oldFunc = Reviewer._answerCardReviewer._answerCard = AKC_answerCard
"""
Name: Answer Key Cascade
Filename: Answer_Key_Cascade.py
Version: 0.5
Author: Kenishi
Desc: By default Anki 2 now reduces the button count depending on card age.
Cards can now have anywhere from 2 to 4 buttons max depending on age.
Answering a card with 2 buttons requires you to press 1 or 2 if you are using hotkeys.
This can interfere with review speed if you don't realize its 2 buttons and answer 3/4.
This addon makes it so answering with a higher ease than possible will answer with the actual highest.

*Example* 3 Button card: You press "4", the addon answers with "3".

Thanks go to ospalh(https://github.com/ospalh) for simpler implementation (should also eliminate state bugs)

Report bugs to https://github.com/Kenishi/Answer-Key-Cascade


"""

from aqt.reviewer import Reviewer
from aqt import mw

def AKC_answerCard(self, ease):
cnt = mw.col.sched.answerButtons(mw.reviewer.card) # Get button count
if ease > cnt: #Is answer > button count?
ease = cnt
__oldFunc(self, ease)

__oldFunc = Reviewer._answerCard
Reviewer._answerCard = AKC_answerCard