[Userscript] Self-Study Quiz

Found another issue. Some icons have “watermarks”:

That is because the script uses classnames of the form icon-*, and Wanikani has a style [class^="icon-"], [class*=" icon-"] { background-image: ...:

This looks like it was done unintentionally. Or the Wanikani stylesheet changed. After removing the icon-* classnames, the sizes, indents or postioning might change a bit, but it looks tolerable in this case. If not, they can be adjusted using other selectors.

The patch for this issue, along with other patches can be found here:

2 Likes

@yk7,
Thanks for the heads-up! I’ll address them as I get some time.

1 Like

i’m sorry, but I tried it and is it normal not to have audio after a correct answer? edit: I use Chrome, everything works just fine, no audio though.

1 Like

You’ll only get audio on vocab (not kanji or radicals) and I think only after answering a ‘reading’ question. And you have to have audio enabled. Check the speaker icon in the upper-left corner of the quiz window to see if it’s yellow (enabled) or gray (disabled).

2 Likes

Hey there I love using this for audio quiz’s as it’s the only way I’ve ever found to test my listening that matches my WK lvl. I even downloaded Mozilla on mobile, loaded tampermonkey, and this script to add it to my mobile devices. The issue is that my phone screen size does not play well with the sizing of the quiz window. I know barely anything about scripts… Saw how each segment has its own px size but didn’t look too much into it.

Tldr would there happen to be a line where I can edit the entire quiz window size all together? Nonetheless I thank you for your work and the community support.

edit:just saw another post how mobile isn’t supported with the same issue as me. Just wondering if there is an easy “change these numbers and voila, smaller window”

All of the CSS styling in the script is in the function install_css(), starting on line 529.
I’d suggest starting with the following changes:

Line 533:  #ss_quiz {...}
   Change the width from "573px" to "360px"

Line 545:  #ss_quiz .cfgbar {...}
   Remove "white-space:nowrap;"
   Add "text-align:left;"

Line 573:  #ss_quiz[data-qtype="characters"] .question {...}
   Change font-size from "2em" to "1em"

Line 576:  #ss_quiz .atype {...}
   Change font-size from "1.75em" to "1.25em"

Line 602:  #ss_quiz .qwrap {...}
   Change height from "8em" to "5em"

Line 539:  #ss_quiz .prev, #ss_quiz .next {...}
   Change line-height from "8em" to "5em"

2 Likes

Perfect. Looks good now. Only thing is it’s always centered (which makes part of it hidden when the keyboard comes up). Tried messing around with alignments/positions but just borked random elements :grimacing:. But everything can be accessed. Thanks.

Line 731 sets the distance from the top of the screen. Instead of the formula, you could assign a fixed number like 20.

dialog.css('top', 20);
1 Like

:grin:

Hey @rfindley I was just wondering, if you have 5 min at some point, might you consider making a small change for the item colors in SSQ?

#ss_quiz[data-itype="radical"] .qwrap, #ss_quiz .summary .que[title~="Radical"] {background-color:#0af;}
#ss_quiz[data-itype="kanji"] .qwrap, #ss_quiz .summary .que[title~="Kanji"] {background-color:#f0a;}
#ss_quiz[data-itype="vocabulary"] .qwrap, #ss_quiz .summary .que[title~="Vocabulary"] {background-color:#a0f;}
#ss_quiz[data-itype="kana_vocabulary"] .qwrap, #ss_quiz .summary .que[title~="Vocabulary"] {background-color:#a0f;}

Specifically here (lines 603-606), it would be great if instead of hardcoding the colors you’d consider using the built-in WK CSS variables (--color-radical, --color-kanji, --color-vocabulary) for them. So, for example for the radicals:

#ss_quiz[data-itype="radical"] .qwrap, #ss_quiz .summary .que[title~="Radical"] {
        background-color: var(--color-radical) }

(or if you wanted to keep the hardcoded one just in case: background-color: var(--color-radical, #0af)
This small change would both make sure the colors are consistent with WaniKani’s and also make any user styles (such as Breeze Dark 2 which I’m working on) not need to manually change the colours for SSQ. And as far as I can tell there should be no side-effects right?
Please let me know if you’d be willing to make that change, thanks! :slight_smile:

1 Like

done

3 Likes

I used to be able to open Self Study Quiz from the Kanji screen and study only Kanji from a particular level via the popup window but can’t seem to do this now. I think there used to be a button? Does anyone know how to do it?

That requires the companion script “Self-Study Hide Info”:

I haven’t tested it recently, but it still worked last I checked. Let me know if it doesn’t.

1 Like

So… I checked Self-Study Hide Info today, and I see what you’re talking about. I had assumed your snapshot above was from sometime in the past, and that you are no longer seeing the Hide Info bar. But now I realize that you still have the Hide Info bar (which means that script is installed, of course), but it’s just missing the Quiz button.

As it turns out, WK made a change recently that causes the Quiz button to move behind the page header.

So, I’ve changed the script to remove the conflict. You can update Self-Study Hide Info [here].

4 Likes

Your a legend Robin! Thank you so much for all your hard work.

Is there a way to view the info (mnemonic) of a wrong answer somewhere? Or am I just too blind to find it?

No there is no way to display this information from SSQ.

Hi, the script is really amazing. The options to customize the quizes are great.
Is there a way to change the size (of the window)? Especially to make it bigger? The windows is super small on my laptop. It uses only 1/6 or even less of the display.

Hi - I love this script, but I had to reset Windows and reinstall, and now I don’t seem to be able to get it to work (no problems the first time though)

I know TamperMonkey is working because scripts are running fine for other sites, but either this script or maybe the Open Framework Installation is giving me trouble. I’ve tried resetting, uninstalling and reinstalling, restarting Firefox, and now I’m out of ideas

Can anyone think of anything else I could try? Are there any Firefox or other settings that would be interfering with it?

@rfindley I think this should be marked as correct?