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.