[Anki Deck Template] WK Anki, Crihak's Flavor

Looking closer, it seems the py variable is not set even though I am on a desktop. Now to figure out why it isn’t set and seeing if there is a workaround.

EDIT: After playing around with it, I have a workaround to get the multiple choice working. It’s still buggy, meaning I have to “refresh” the script multiple times, but it does work. The code changes are as follows:

In _wk_multichoice.py, added var py = {}; to line 2. So it should be:

var BOX_COUNT = 4;
var py = {};

function bindMultichoice(el) {
...

In _wk_persist.js, set usePy = true; right before the line with #front.
NOTE: Only do this if you are on desktop, this will break the Android version.

usePy = true;
if ($('#front').length) {
  initStorage();
}

Create a file in the same folder called _my_wk_multichoice.js. Inside, add the following two lines:

mcel = $('#choices');
bindMultichoice(mcel);

Finally, in the deck, edit the Card front code. This is Study Now -> Edit -> Cards.... In both the Front Template and Back Template text box, scroll all the way down till you see a line with this:
<!-- SCRIPTS -->

Delete all the code underneath so that it is empty and replace with the following code chunk:

<script src="_jquery-3.1.1.min.js"></script>
<script src="_wk_persist.js"></script>
<script src="_wk_wordlist.js"></script>
<script src="_wk_countdown.js"></script>
<script>
	if (typeof py === "undefined") {
		var script = document.createElement('script');
		script.src = "_wk_multichoice.js";
		script.async = false;
		document.head.appendChild(script);
	}
	
	var script = document.createElement('script');
	script.src = '_my_wk_multichoice.js';
	script.async = false;
	document.head.appendChild(script);
	document.head.removeChild(script);
</script>

Last step, after pasting the code above in both Front Template and Back Template, look at the Back Template. From the code above, you need to change the THIRD line in ONLY THE BACK TEMPLATE.

So the line

<script src="_wk_wordlist.js"></script>

becomes

<script src="_wk_modify_input meaning.js"></script>

in the BACK TEMPLATE.

With all the code changes done, you can now open the Kana section and should be greeted with a timer and the word, but where’s the multiple choice?! Well, it’s a bit buggy, so you have to go through “Edit → Cards …” and close the boxes again to refresh(?) the JS while in the “Study Now” mode. Do this 1-2 times and the multiple choice, as I’ve tested, will work for the entire session. Once you leave Study Mode, the multiple choice will disappear and you have to do the “Edit → Cards…” trick again.

I hope this helps someone in the future who wants to give this awesome template a try.

1 Like

Is there any way to get permission to still access this?

Google changed something and recently I get an email every time someone wants access, which I’ve tried to grant pretty quickly…

I’ve re-shared the file and updated the post with the new link… I don’t know if this will work without manual work on my part or not…

Was just able to download it now, it looks great, thanks!

Thank you, I eventually did get access.

For anyone trying to use this in Anki 2.1, this plugin has been working for me as a replacement for JSBooster (although I haven’t been using multiple choice): https://ankiweb.net/shared/info/458841364

I would appreciate it a lot if I could get access to the kana only deck as well. I am searching for something like that because at the moment all the decks I wanted to use use Kanji but I want to learn them in Wanikani as I progress. But at the same time I want to improve my amount of vocabulary quickly. So common Kana only would be perfect.

I got the access. Thank you so much

I’m still not very knowledgable with Anki. What do I have to to If I wanted the audio to work?
Maybe you could explain what kind of note you are using for your deck?