Edit the most recently seen card

Many times a day, after failing a card, I undo the review to improve it or to record my incorrect answer in a special field.

This takes time and interferes with the stats for the card.

Opening the Browser for it would add steps and probably make me see the answer for the current or some some other card.

Is there any better way to edit the last reviewed card?

You could use the last card info and then copy cid and use cid:(paste) to do what you want, perhaps. Yes, this is maybe longer than you intended, but at least the review data will not be affected.

Perhaps, an add-on could be created to add an option to the menu to do this process much easier.

1 Like

The add-on AJT Flexible Grading can add a button to the top bar that displays information about the previous review. You can also click on it to search for the corresponding card in the Browser.

I personally use the following add-on, which I created with the help of AI (it may not be perfectly written, so if anyone has suggestions, help is welcome). The add-on adds a few custom search strings to the Card Browser. For example, you can search for the last card you reviewed using cidd:last or shorthand versions like c:l (see the code for more details). The “previous review” will reset if you perform certain actions, such as syncing your collection or closing the Reviewer.

from aqt import gui_hooks, mw
from aqt.utils import showInfo

def on_browser_will_search(context):
    search_text = context.search.strip()
    
    def replace_custom_key(search_text, keys, replacement_value):
        """Replaces multiple keys with the same replacement value."""
        for key in keys:
            search_text = search_text.replace(key, replacement_value)
        return search_text
        
    # search for the current card/note (Reviewer)

    if mw.reviewer is not None and mw.reviewer.card is not None:
        current_card = mw.reviewer.card
        search_text = replace_custom_key(search_text, ["nidd:current", "nidd:c", "n:current", "n:c"], f"nid:{current_card.nid}")
        search_text = replace_custom_key(search_text, ["cidd:current", "cidd:c", "c:current", "c:c"], f"cid:{current_card.id}")
        
    # search for the previous card/note (Reviewer)

    if mw.reviewer is not None and mw.reviewer.previous_card is not None:
        previous_card = mw.reviewer.previous_card
        search_text = replace_custom_key(search_text, ["nidd:last", "n:last", "n:l"], f"nid:{previous_card.nid}")
        search_text = replace_custom_key(search_text, ["cidd:last", "cidd:l", "c:last", "c:l"], f"cid:{previous_card.id}")
        
    context.search = search_text


gui_hooks.browser_will_search.append(on_browser_will_search)
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.