Hello Anki community,
I’ve been searching for an addon that includes an “Evaluate” button functionality within the review interface. Ideally, this feature would allow me to quickly assess my knowledge retention based on how quickly I can recall the answer to a flashcard.
Here’s how I envision its functionality:
- When I click on the “Evaluate” button during a review session:
- If I recall the answer within 1 second, it should mark the card as “Easy”.
- If I recall the answer within 2-10 seconds, it should mark the card as “Good”.
- If I recall the answer in 11 seconds or more, it should mark the card as “Hard”.
- The addon should integrate seamlessly into the Anki interface, ideally adding the “Evaluate” button to the review toolbar.
I attempted to implement this functionality myself using Python, but unfortunately, I’ve encountered issues with my code. Here’s a simplified version of what I’ve tried:
from aqt import mw
from aqt.qt import *
from anki.hooks import wrap
from anki.cards import Card
from aqt.reviewer import Reviewer
# Function to add Evaluate button to the toolbar
def addEvaluateButton(self):
evaluate_action = self._addButton("Evaluate", self.onEvaluateClicked)
self._bottomLayout.addWidget(evaluate_action)
# Function called when Evaluate button is clicked
def onEvaluateClicked(self):
self._answerButtonTimer.start()
self.nextCard()
# Function to evaluate the card based on response time
def myAnswerCard(self, ease):
if self.timeTaken < 2:
ease = 4 # Easy
elif 2 <= self.timeTaken <= 10:
ease = 3 # Good
else:
ease = 2 # Hard
return _answerCard(self, ease)
# Hooking functions into the Reviewer class
Reviewer._addButton = addEvaluateButton
Reviewer.onEvaluateClicked = onEvaluateClicked
Card._answerCard = wrap(Card._answerCard, myAnswerCard, "around")
Could anyone kindly provide insights into why it might not be working as expected? Additionally, if there’s an existing addon that provides similar functionality, I’d greatly appreciate your input!
Thank you in advance for your help.