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

I’m not a fan of AnkiMobile to be honest. It has more compatibility issues than the PC app does. That being said I did work on a dedicated deck for Droid if you would like to give that a try.

To avoid confusion you can reach out to me on my 10k thread in the future if you like.

Just be aware that I’m not really using Anki much anymore as I have moved on to a different flashcard app. So I may not be able to answer all your questions but I will do what I can.

3 Likes

@crihak sorry to trouble you more but where would I go to update the _wk_countdown.js file?

It looks like there is a newer version on http://wanakana.com/

No problem :slight_smile:

But I don’t think I understand… the _wk_countdown.js file is just where I dumped my own javascript code for the countdown feature… wanakana is the tofugu-made script that replaces your input with kana.

@crihak oops I pasted the wrong name, my bad. I meant the _wanakana.min.js file.

Have you tried simply replacing the one that resides in the collection:media directory with the newer version?

If this doesn’t work, it may be because AnkiDroid caches the file, and if that is the case I think you may have to rename the file and then update the link in all the card templates…

I don’t know what file or data to replace it with from the website.

I ended up cutting out all the scripts because of the broken HTML errors. Now I just have Rec + Recall cards for the 10k deck and 2k Kana deck.

I also used the template and imported a 10k Katakana deck! I’m rather happy with it! Here are some screenshots.

I have the audio set to play for when you flip the cards over. It’s pretty basic but does everything I want without going overboard. Also while I study I steal the mnemonics off WaniKani haha. Thanks for giving me a good jumping off point @ crihak

1 Like

@crihak I can’t seem to get the _wk_countdown.js option to work on the desktop. I added in the line (data-coundown=“15”) next to (data-countdown-mobile=“10”) but nothing happnend.

Does it not work without JS Booster?

Pretty much nothing works without js booster, since it’s what allows you to link to js files in the first place :slight_smile:

@crihak

I’m using your template now.

When I’m typing in kana, the answer input pulls the correct answer from the “Kana Reading” field but I would like to change it to the “Reading” field.

How can I change it to that?

@crihak I was trying to use AnkiWeb to study and the front/back portions of the cards from your deck do not display at all. What might cause that?

It seems you should just be able to replace it with https://unpkg.com/wanakana@4.0.2/umd/wanakana.min.js (the file that opens when you click “download”)

1 Like

In the bottom of the back template there should be a section like this:

<!-- HIDDEN DATA STUFF -->

<div id="correctAnswer" style="display:none">{{Reading}}</div>
<p id="altread" style="display:none;">{{Alt Reading}}</p>

The stuff inside the <div id="correctAnswer" ... > and <p id="altread" ... > tags is what will be checked against what you typed.

In my case those are the fields “Reading” and “Alt Reading”.

So basically, make sure one of those contain {{Reading}} for you as well.

What do you mean by the front/back portions? It sounds like you mean the front and back side, but in that case nothing would show at all :thinking:

I never use AnkiWeb so I may not be able to help you understand the weird things it may get up to…

@crihak Ok, thanks for the help!

One more thing, how can I get this circled part to display the kanji when the correct answer is typed in?

hinekidori’s deck does it, like so:

That’s one part of his deck that I chose not to implement. IIRC it basically works by checking what you’ve typed against the correct answer at all times, and replacing it if they line up.

I didn’t want this since it pretty much tells me straight away whether or not I’ve entered the correct answer (again, as I understand it, there’s no way to make it replace everything you might type with suitable kanji, only the correct answer)

@crihak

Is there a way I can edit the mobile overlap timer feature to overlap the entire card instead of just the main portion? Thank you your help, as always.

Hi, sorry about the delay. I’m not really able to test it on the mobile version, but fiddling around a bit on the desktop version it seems like this might work:

The actual overlay element looks like this in the code:

<div class="overlay"></div>

The javascript basically works by just gradually changing the height of this element from 0% to 100%.

I think it should suffice if If you move this one outside of the main div like so:

<div class="overlay"></div>
<div id="front" class="vocab reading" data-countdown-mobile="9">
    <div id="main">
       ...

If this is not the case, unfortunately, I think you may have to fiddle around a bit for yourself until you find the solution…

1 Like

I am getting an error below (for the WK Kana card, but maybe others):
Invalid HTML on card: ReferenceError: bindMultichoice is not defined

This is whenever it tries to load. I confirmed that the script tags are all there and all I did was import the file, I didn’t make any changes. I also checked my media folder to make sure all the script files are there. Any suggestion?

Could it be that you haven’t installed the js booster plugin? Without it I don’t think you can use external js files.

Hi @crihak ,

I’ve stumbled upon your Anki template and am trying to get the multiple choice feature of Kana to work. I am using Anki 2.1.13 where JS Booster can’t be added as a plugin since scripts are asynchronously loaded.

So, at first, I was getting the same error as @pnewelljr above for the Kana section. Upon looking through the code, I tried a workaround similar to this reddit post here. In essence, I tried taking your “bindMultichoice” call from the front side of the card, putting it in it’s own JS file, and then loading the file that way.

Good news, Kana section shows up with audio working and no error. Bad news, no multiple choice selection.

I know at this point it is really minor, but having the multiple choice would be really neat. Let me know your thoughts.

For those that just want a working Kana section, edit the front and back of the card by commenting out the call to bindMultichoice. So from bindMultichoice(cel); to #bindMultichoice(cel);