diff --git a/Answer_Key_Cascade.py b/Answer_Key_Cascade.py index 3b81cad..2b1881f 100644 --- a/Answer_Key_Cascade.py +++ b/Answer_Key_Cascade.py @@ -1,3 +1,31 @@ -""" Name: Answer Key Cascade Filename: Answer_Key_Cascade.py Version: 0.5 Author: Kenishi Desc: 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 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 \ No newline at end of file +""" +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