[Userscript] Self-Study Quiz

Another cool option to add to “Settings => Items” would be something like “Remove unlearned items”.

Problem: I leveled up today and unlocked 27 new kanji. I only did the lessons for 18. However, the best I can do right now is remove the kanji still locked from the list. I can’t remove the not learned ones from the list. This would facilitate users’ reviewing.

I believe that’s something WaniKani changed on their end months ago. There may not be a way to differentiate between them now, at least not in APIv1.

If they added those details to v2 it would be great. @rfindley, do you know if APIv2 would support differentiating between learned and unlearned items (when both sets are unlocked)? If not, it might be something worth requesting.

1 Like

Yep :frowning:

Don’t they now have a Apprentice 0 or something? :thinking:

Good question! I don’t know offhand.

Yes. I don’t think it was intentionally exposed that way, according to a brief discussion in the forums with Viet (if I recall correctly), but I’ve noticed some SRS level 0 items on my test account via APIv2. I think it was called “Initiate”.

Anyway, the item selection will probably look drastically different when I convert it for the Open Framework (which uses APIv2). Much of the ItemData module interface was designed with this script in mind.

1 Like

Speaking of which, I’m already working on converting scripts now that the framework is at initial release. Burn Manager is first since it’s currently broken. I’m mostly done with it, but I’m only getting an hour here and there to work on stuff since I’m spending most of my time with our exchange student, who is here for a return visit.

(I highly recommend being a host family, by the way. It’s been a great experience for us, and our student is like a remote daughter now.)

1 Like

Any update on this please @rfindley?

I’m actively working on it. This is the first script that’s really going to use the full extent of the Open Framework, so it’s actually triggering a lot of additional improvement to the framework itself. At my current pace, I’m guessing it will still be a few weeks before I’m done. It’s actually the settings and data-selection dialogs that are taking most of the development time. There’s a lot of new interface for selecting exactly what material you want to quiz.

3 Likes

Great! Really looking forward to it. :+1:

@rfindley, No question to ask. I just wanted to thank you for this script. I’ve been using it for awhile, but only today thought about using the Listening part of the quiz. Hearing the audio and then trying to remember the meaning is excellent, and uses a whole other part of my brain which should really make new words stick better. Love it!

3 Likes

For some reason this script stopped working for me despite it still working around a month ago. When I click on quiz now it gets stuck on ‘Loading…’, but it never actually loads the quiz. Anyone else experiencing this issue?

Could be a cache issue related to API key.
Open your Javascript console by pressing F12, then clicking on the Console tab. Enter the command below and press Enter, then refresh the web page and try again.

delete localStorage.apiKey

That fixed it, thanks!

Just curious, do you plan on doing something related to leeches? :slight_smile:

2 Likes

Honestly, I don’t know enough about what makes something a Leech, and based on what I’ve read in a few threads, it seems people disagree on the specifics.

But it’s actually going to be very easy to add a Leech criteria for generating a quiz. You’d simply register a function with the Open Framework:

// Tell the Open Framework about our function for selecting specific Wanikani items.
wkof.ItemData.registry.sources.wk_items.filters['my_leech_script'] = {
    type: 'number',
    default: 0.95, //or whatever
    label: 'Leech Pro™ Threshold',
    filter_func: my_leech_filter_function,
    hover_tip: 'Select items that exceed the specified leech threshold',
};

// Called for each Wanikani item.  Return 'true' if we want to quiz on this item.
function my_leech_filter_function(filter_value, item) {
    // TODO: Make a function to calculate leech value for this item
    var item_leech_value = calculate_leech_value(item);

    var threshold = filter_value;

    if (item_leech_value >= threshold)
        return true;
    else
        return false;
}

The code above produces this in the Quiz Settings window:

2 Likes

So basically we’ll be able to make our own criteria for leeches and then add those items to the Quiz? XD

1 Like

Exactly. As long as you’re able to write a filter function that returns ‘true’ for items you want to quiz, and ‘false’ for items you don’t, you can write any type of item selection criteria.

2 Likes

I see :slight_smile: Thanks!

1 Like

Hey! Sorry if you get this a lot but I have read through some messages and can’t figure out where to find the quiz after installing it? Maybe I missed it or am just stupid haha
Thank you!

For the current version, go to the “Levels” pages from the Wanikani menu, or to the “Radicals”, “Kanji”, or “Vocabulary” pages (grouped by 10 levels). There will be a small button-bar above each group of items, including a Quiz button.

A new version will be released this week that will be accessed from any page (other than the forums) via the user menu.

4 Likes