[Userscript] WK Anki Mode

  • Problem with kanji and vocabulary items with multiple readings readings: it shows the answer for the reading but when I want to hit the shortcut for “I know this” it shakes like it usually does when you are entering an incorrect answer and does not accept the input. It works fine if you submit only one reading.

  • Mixing up reading and meaning: It will sometimes show the reading although WK asks for the meaning of a vocabulary item. But apparently it can be accepted as correct anyway. Update: I currently can’t reproduce this anymore. I’ll keep an eye open if it still happens.

This is the most important script for me (dear Anki mode: I :heart: you so much!) so if this isn’t resolved by Monday I will try to look into it myself but I’m a bit busy until then. I had a look myself. See below.


Edit: ok, this seems to be the cause:


Edit 2: depending on how complicated you want to make it you could just show the first reading and be done with it. This is a bit of a shame since it was so nice to see all possible readings but for now I’m just happy to have it fixed.

Workaround, starting in line 122:

  if (currentItem.voc) {
                //change here
                answer += currentItem.kana[0];
/*                for(i=0;i<(currentItem.kana.length - 1);i++){
                    answer += currentItem.kana[i] + ", ";
                }
                answer += currentItem.kana[currentItem.kana.length - 1];*/
            }
else if (currentItem.emph == 'kunyomi') {
                //change here
                answer += currentItem.kun[0];
/*                for(i=0;i<(currentItem.kun.length - 1);i++){
                    answer += currentItem.kun[i] + ", ";
                }
                answer += currentItem.kun[currentItem.kun.length - 1];*/
            } else if (currentItem.emph == 'nanori') {
                 //change here
                 answer += currentItem.nanori[0];
/*
                for(i=0;i<(currentItem.nanori.length - 1);i++){
                    answer += currentItem.nanori[i] + ", ";
                }
                answer += currentItem.nanori[currentItem.nanori.length - 1];*/
            } else {
                 //change here
                 answer += currentItem.on[0];
/*             for(i=0;i<(currentItem.on.length - 1);i++){
                    answer += currentItem.on[i] + ", ";
                }
                answer += currentItem.on[currentItem.on.length - 1];*/
            }

I made a little modified copy of this script to show buttons so that it is usable on mobile. I implemented the workaround there: Wanikani Anki Mode (irrelephant mod with buttons)

2 Likes