[Userscript] WK Anki Mode

Really? I’m using the same combination, but it still happens to me. Maybe I should still give it another try.

Unfortunately, it is all way above my knowledge level. I use Anki mode maybe twice a week without problems.

1 Like

It’s ok, thank you for still trying to help me! ^^

1 Like

@nandeyanen I made a copy of a copy of this script to modify the buttons (because honestly I didn’t even know that Mempos script already had buttons, I must have missed that), I uploaded it here: https://greasyfork.org/en/scripts/36746-wanikani-anki-mode-irrelephant-mod-with-buttons

The shortcuts in my version of the script are “K” for (“oKAY, I know this”) and “L” (for “I LOSE, I don’t know this”; stupid mnemonics but it is all about mnemonics here).
I use it every day in Chrome on desktop and Firefox with violentmonkey on an Android device (that I’m using only for this one purpose) and don’t want to do reviews without the Anki mode anymore. So I’m planning on supporting this in the future (until I reach level 60 at least, which will take yeeeeears anyway).

Does that version work for you maybe? If not, I might need help to reproduce your issue but I’ll try and fix it.

2 Likes

Wonderful, I’ll give it a try!

Okay, I tried it.

The same problem stays, oddly enough. Mempo’s doesn’t have buttons, but by buttons I meant that the actual keys on the keyboard work randomly for the script (number keys 1 and 2). Sometimes the key that’s supposed to mark it right, marks it wrong, and vice versa.

With your version pretty much the same happened too :pensive: Sometimes K marked answers wrong. With a shortish try, L seems to mark everything wrong as it should. Marking the answer wrong with K seems to happen only with the meanings of vocab/kanji/radicals, not the readings.

@nandeyanen
Sorry, forgot about this. There won’t be any fix for Firefox and Greasemonkey. There’s something wrong with Greasemonkey, so it might not even be the script that’s broken.

People that have problems with GM are advised to switch to Tampermonkey, because everything still seems to work on that. I have no experience with Violentmonkey, but if it runs correctly for other people, then the problem might be on your end.

I suggest you disable all other scripts that run during reviews. Maybe one of them interferes with the keybinding? Idk. If that doesn’t solve the problem, it’s something really strange. Or maybe you installed multiple copies of the script, or run both Violentmonkey and Greasemonkey at the same time?

1 Like

It’s alright! :slight_smile:

I tried disabling all other scripts again, although I thought I had done it already. I’m starting to think I only disabled some of them… Oops. Anyway, found the problem! The Anki Mode script doesn’t seem to work with Double Check script, which is alright, since one wouldn’t use them at the same time. I just need to remember to turn off the other when using the other. Thank you :sweat_smile:

  • 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: https://greasyfork.org/en/scripts/36746-wanikani-anki-mode-irrelephant-mod-with-buttons

2 Likes

Thanks for this! :smiley: I was a bit bummed that this “broke” in my last level before the promised holy land (60) and was too busy to fix it myself, so this saves my *ss right now :smiley:

1 Like

Yea, too bad I had to change the script. Now it’ll only show the first reading of a kanji/vocab, so keep that in mind please. Don’t see a way around this, but if someone comes up with a fix, let me know!

Is there any chance that a Java port could be possible so that it can be added inside of the android application?The only way that your script can be used is IN firefox on android and the address bar always bothered me and you can’t use this script in Chrome (I love the “Add to home screen” feature) so unless you can inject the script in the HTML and execute that every time or firefox actually get’s this feature, it’s not ideal to me

I don’t know anything about the Android application but I’m not planning on doing a port. I usually use iOS and was only using Android for this because you can install userscripts there. But tampermonkey doesn’t work in Chrome? That’s unfortunate.

I could swear that I saw no address bar in Firefox and I had added it to my home screen as an icon which would open Firefox. But that was my only interaction with Android other than using it as a fallback device during travel so you probably know better what options you have.

Apparently there was a Firefox extension to hide the address bar but it is not working anymore with Firefox quantum. Maybe that was what I was using.

(I‘m not using it on Android anymore since I found a way to inject it on iOS via a custom AlliCrab build; my Android device hasn’t been in use ever since)

But all in all it is not a super complicated thing to do. You would have to ask the author of the Android application if they would consider supporting it.

I was thinking about creating a dom element somewhere else that would show all possible answer options. Or maybe showing all options but at the moment it is submitted: change the value back to just the first item so that the response is valid.

But I was just glad to have it working again and didn’t try any of these yet.

Thanks, yea, WaniKani reviews don’t scroll since it;s all on one page so it doesn’t trigger the address bar to hide and “Adding a page shortcut” just does exactly that. I’ll try to install an older version of FireFox quantum to see if I get the same result you had. As for the application, both developers have stopped supporting it but I see that the scripts like ignore are .java ports so I figured one could copy and paste a Anki Mode port into Ignorebutton.java for example and compile it. My Java sucks with anything outside of JFrames so I didn’t know what other options I had since Dolphin Tampermonkey and the Tampermonkey app both don’t work with it.

I appreciate your response all the same

Just wanted to thank you (and @Mempo) for these scripts. I have a bad left wrist which makes it uncomfortable to type, and that’s been making wk inaccessible to me recently. Being able to (mostly) cut the typing out is – while not ideal for learning I’m sure – a lifesaver for people with tendinitis like me :slight_smile:

3 Likes

Hey guys, I made an update to the script. This one shows all readings of the kanji (on, kun, nanori). When the user presses “know”, it will submit the first item of the possible answers as @irrelephant mentioned.

3 Likes

Similar issue here - I have carpel tunnel, so typing answers causes flareups. This script will really help!

so i’m bound to my phone for 4 more days. android, using firefox/violentmonkey.

how exactly do i use it? turn it on, then switch to my number keyboard?
it does have space tho…

1 Like

tested it again right now, and anki mode hides my keyboard, no input possible.

please send help.

1 Like