This is a third-party script/app and is not created by the WaniKani team. By using this, you understand that it can stop working at any time or be discontinued indefinitely.
Important: Please ensure that you have installed 0.10.0 or later. Older versions of this script may not work with WaniKani in its current form, particularly during lessons.
I wrote a script to stop the automatic acceptance of close answers.
If an answer is close it asks for it again (it basically re-purposes the built in on-yomi/kun-yomi functionality).
Mainly because WK was saying I was right when entering passive verbs instead of active ones and ‘typos’ that were really just similar words with different meanings.
and then, the “did you know this item has multiple possible readings” thing sticks around until i do the next item.
I was aware of this, but it was a cosmetic problem that I figured I would fix later when I had time to learn about mutation observers. That time is now. 0.5 uses the recommended mutation observers, rather than the depreciated mutation events, which seemed to have problems capturing the exception and changing the text (from “WaniKani is looking for…”).
I even cleaned up the lingering notices, however note that this part is a bug in the website, not my script. Enter the unwanted reading on a Kanji review multiple times (spam the enter key) and you will observe the same effect.
Technical explanation: When WK adds a div with id=“answer-exception” (“WK is looking for…” and “Did you know this item…”), it does so without checking if there is already one with that id on the page, it only removes one of the these divs at a time (probably with getElementById or querySelector) under certain circumstances which include (but may not be limited to) opening the item info window, and moving the next review. Do one of these enough times (spam the ‘F’ key), and the divs with that id will eventually all be removed.
var highLanders = document.querySelectorAll("#answer-exception"); if (highLanders.length > 1){ // There can be only one!!! for (hL=1; hL<highLanders.length; hL++){ highLanders[hL].parentNode.removeChild(highLanders[hL]) } }
I even cleaned up the lingering notices, however note that this part is a bug in the website, not my script. Enter the unwanted reading on a Kanji review multiple times (spam the enter key) and you will observe the same effect.
Send in a patch to Koichi for the multiple divs problem
"Your answer was a bit off" script
I'd really like this to be a native option in WaniKani.
I've been contemplating enhancing the answer matcher with a negative list. (i.e. if it's one of these answers it fails). But really what I just need is to disallow being close enough.
I’ve been using this and I love it. However, I would make a soft suggestion to match http*:// instead of https. I had to add it locally to mine to get it to work for the most recent session. It seems that the site still isn’t always consistent with its security handling.
Inserio said...
I've been using this and I love it. However, I would make a soft suggestion to match http*:// instead of https. I had to add it locally to mine to get it to work for the most recent session. It seems that the site still isn't always consistent with its security handling.
Noted, will do.
One of my other userscripts was having some sort of trouble (I don't remember) under the http protocol so I wrote in a forced redirect to https. since then I've just been using https.
This sounds great, but could I get some assistance installing the script? Using Firefox I get the following error.
Could not parse script error. Specifically "Ignoring @ match pattern http*://www.wanikani.com/review/session* because: Error: @ match: Could not parse the pattern., Ignoring @match