[Userscript]: Double-Check (Version 2.x)

Hmm. Try typing ‘doublecheck’ in the Javascript console (again, without quotes) to see if the double-check script is at least loading.

Are you seeing a gear menu at all on the Reviews page?

Try this on the Javascript console (while on the Reviews page):

wkof.Menu.insert_script_link({name:'testlink',submenu:'Settings',title:'Test Link',on_click:function(){console.log('Test link clicked')}})

That should add a test link to the gear menu, and it should print a message in the Javascript console when you click the test link.

Nope, script is not even loading even though it’s enabled on tamper monkey. So it says undefined.

Update - I redownloaded the script and everything works now. Very odd.

1 Like

hi! does this take a certain amount of time to work? i’ve downloaded everything and it doesn’t seem to show any of those buttons

On the Reviews screen, do you see a gear icon in the upper-left corner? The Double-Check settings are in there. You’ll need to enable at least one of the options (Allow retyping, Allow changing to correct, Allow changing to incorrect). If you don’t see the gear icon, open the Javascript Console (press F12 and click on the Console tab) and post any errors you see there.

wait, i’m stupid. i’m doing my lessons.

1 Like

I can totally relate. I’m sure I’ve done this.

Unfortunately however, I’m on the review page and no DoubleCheck.

It appears like it’s not matching even though I do have it installed. e.g. It is not in the matching scripts dropdown.

And the script doesn’t appear in the settings dropdown from the gear icon.

I don’t see anything obvious in the console.

I had used DoubleCheck in a responsible manner prior to Great WaniKani Rewrite and then had not updated because I figured I’d try to use the site the way Tofugu wants me to, but the absolute refusal of WaniKani staff to implement a native undo combined with my inability to type and quick Enter button reflexes has left me immensely frustrated.

It seems ViolentMonkey isn’t even attempting to run it. Maybe try removing Double-Check from ViolentMonkey and re-adding it :man_shrugging:. Just in case something got corrupted somehow.

(Side question: Are you running both GreaseMonkey and ViolentMonkey??)

Weird. Restaring firefox caused it to recognize and run the script.

You caught me! :slight_smile: I had GreaseMonkey for “reasons” before I started WaniKani and I seem to recall the WK Open Framework script wouldn’t work with GreaseMonkey or some such thing, so I installed ViolentMonkey also and never bothered migrating the scripts I had installed under GreaseMonkey. They seem to have worked fine side by side for a few years now.

1 Like

Hey, Double Check suddenly stopped working today, without any changes on my side (that I am aware of). Any reasons why that might be? I’m using a Chromium based browser

@Chrisstar56,
I had some kana-vocab reviews this morning, so I tested Double-Check. It’s working fine for me. (I’m using Brave, which is a Chrome variant).

So, what do you mean by “stopped working”? Are you able to get into the Double-Check Settings menu? Are the Retype or Mark Right/Wrong buttons missing? Try opening the Javascript Console (press F12 and click on the Console tab) and post any errors you see there.

Also, just as a sanity check… you’re on the Reviews page, not the Lessons quiz, right?

Hey, thanks for the reply!

It now seems to work again, I don’t really know what was wrong yesterday. I was definitely on the review page but several other plugins also seemed to not work (not even the menu was showing up), so idk what was going on then.

But as it’s working again, it doesn’t matter anymore

1 Like

Just wanted to drop in here with a small request for Double-Check. I use Userscripts to manage my extensions since it works on both iOS and Mac, but Userscripts looks for the @uploadURL and @downloadURL tags when figuring out when a script needs to be updated (docs on this are here: GitHub - quoid/userscripts: An open-source userscript manager for Safari). You can also check out the following script that uses the two tags (https://github.com/mwil/wanikani-userscripts/raw/master/wanikani-similar-kanji/wk_niai.user.js).

Could you add these tags so Userscripts is able to auto-update your script?

@rfindley hi quick question, I’m working on an end-of-review summary screen script, and use the didAnswerQuestion event to count how many meaning / reading questions are answered for each item, and would like it to be compatible with Double Check.

But Double-Check seems to send out additional didAnswerQuestion events when going on to the next question or resubmitting an answer, meaning my script counts more than it should. Can you think of any way I could distinguish Double-Check’s “real” didAnswerQuestion event (when continuing on to the next question) from the surplus ones?

No worries if not, I just thought I’d ask just in case :smile:

EDIT: I suppose I could maybe try using the willShowNextQuestion instead of didAnswerQuestion if it’s broadcast before actually changing the characters on screen and Double-Check doesn’t broadcast additional ones? I’ll have a look at that…

I don’t think I can remove the didAnswerQuestion for preliminary submits, but I can easily add other events if there’s something in particular you’d like to see. For example, I already have a didUnanswerQuestion. That one is sent when the user uses the Retype feature.

I could add a didFinalAnswer, if that helps. Then you could check if double-check is running by checking for the existence of window.doublecheck. And if it’s present, only count the answer upon receiving didFinalAnswer.

2 Likes

If you really don’t mind, adding a didFinalAnswer like you suggest would be incredibly useful.

Is there any chance it could broadcast the same detail info as didAnswerQuestion? It’s not completely essential if it’s not possible for some reason, as I can also check .quiz-input__input-container[correct='true'] to see if the answer was correct or not, but as well as making that easier with the detail > results > passed info, it would also be useful because it contains detail > subjectWithStats > id so I could count the answers on a per-word basis.
image

Thanks for your help, I appreciate it! Double-Check is an incredible script so I really want to make sure it’s compatible :slight_smile:

1 Like

Done. I’m capturing the final didAnswerQuestion event, and immediately generating a didFinalAnswer with the copied detail.

1 Like

Thank you, that works perfectly! :smiley:

Will this work without Double Check installed?

In Omega I have been using this line

if (event.constructor.name !== 'DidAnswerQuestionEvent') return // Only count real WK events
1 Like

Yep, how I have it at the moment works fine without double check installed. I’m checking whether or not it’s installed and setting the event listener’s event based on that:

 let eventToObserve = window.doublecheck == null ? "didAnswerQuestion" : "didFinalAnswer";
window.addEventListener(eventToObserve, function(e) {
    ...
}

I can't test it out today unfortunately so I could easily be wrong - wouldn't that conditional you suggest count the original WK events (so whenever a question is answered) and ignore the ones broadcast by Double Check? In the case of my summary script, if Double Check is installed I only want to take into account the one broadcast by Double Check when you move on from a question, because as far as I understand that's the "real" one, allowing DC to undo / change the answer before then.

So for example if the user retypes an answer by pressing backspace then it’ll refire didAnswerQuestion on submission, but I would only want to count them as one answer rather than two, as I assume if you’re using DC to undo an answer you consider that previous answer grading to be wrong for whatever reason (ie. if you get it wrong but choose to retype because for whatever reason you consider it was right, then you don’t want the first incorrect submission to count)

1 Like