[Userscript] Self-Study Quiz

Sure, when I get some time, I’ll add that as an option.
I assumed people would prefer their synonyms over the built-in words, but your explanation also makes sense.

It won’t be full reverse, but rather, built-ins first (in built-in order), followed by synonyms in the order Wanikani reports them. I’m assuming Wanikani reports them in the order they were added.

:point_right: [v3.0.20] - Add option for synonym order in Help hint

W00t that is a great way to handle this! Thank you!

Also - any plans to add different sources for reviewing? Maybe like from a csv file or something? :slight_smile:

Mark

1 Like

re: different sources,
I built in the ability for external scripts to load additional items, but I don’t plan to do it myself. If any other scripters want to work on it, I’d be happy to give some insight, though.

1 Like

Is there anyway to pick or exclude certain items? There are many times where I may know some apprentice items and it wastes time going though them when I want to focus on others.

No. But you can use ctrl + right-arrow to skip items.

You could also ask in the “what do you want now” thread if someone is willing to write an Open Framework filter to select items. Maybe by combining it with the Item Marker script? Or maybe ask @seanblue in his Additional Filters thread if it’s something he wants to add to his filter pack.

1 Like

@rfindley For 優れる, when I answer with “to excel” for some reason it tells me the answer is slightly off.

Interesting… and for some reason this sounds familiar. I think there was another item that had something goofy going on, though I fixed that one.

Anyway, I’ll check it out in the next day or two.

1 Like

I wonder if there’s whitespace or something else wrong with the data being returned by the API?

Now that you say that, I think that’s what was wrong the last time. It wasn’t in the API, though… it was in some HTML that I was scraping, which found its way into a database. I think it was on wkstats, though, not a script.

@rfindley When doing a pre-programmed self study quiz, is there a way to get the results from the quiz once it has finished? Maybe by passing in a callback that is called when the quiz popup is closed and is passed the results?

@seanblue,
I actually had plans to do that for the sake of supporting 3rd-party item tracking, SRS, etc. But in order to stay focused on the stats site, I decided to wait until someone asked for this.

ss_quiz.open() takes an optional custom_options object that could be used to specify a callback for passing back quiz results. It doesn’t do so currently, but should be relatively easy to add.

Something like:

ss_quiz.open({onResults: some_function});

Edit:
Line 1536 is where the user is on the Summary screen and either clicks Re-quiz or starts another round. That would be a good place to call the callback, with either quiz.original_items or quiz.requiz_items accordingly.

There’s something I’d like to experiment with that would require that functionality. When you have time, could you look at adding it?

Will do. I’m finishing up a project today, and should be able to come up with something tomorrow.

1 Like

Sorry if this has been previously addressed before but I was not able to find a similar question. Instead of adding filters like the ones @seanblue has, would it be possible to create an editable list of items for self-study? In Genki I, I’m learning lots of verbs and vocabulary that sometimes they correspond to WaniKani levels way above my current level so the idea is to create an editable list of (locked) items for self-study.

The filter/source interface is the intended way of adding lists, including editable ones. If you can put together a list of Wanikani vocab and kanji by Genki 1 & 2 chapter, maybe someone like seanblue would be willing to add a filter-by-genki-chapter. Unfortunately, I won’t have time for a while.

1 Like

Great! I will take a look at the code and see if I can do it by myself first. I just wanted to know if it was possible before trying to learn some script/language/markup.

@sergiop,

While waiting for a big program to install, I modified one of my test scripts for you. You’ll just need to fill in the lists of vocab and kanji.

It will show up in the filters list inside Self-Study Quiz, and you can just add a comma-separated list of Genki chapters to include in the quiz.

Click to view code
// ==UserScript==
// @name		WKOF Genki1 Filter
// @namespace   rfindley
// @description Filter Wanikani items by Genki chapter.
// @version 	1.0.0
// @include 	https://www.wanikani.com/*
// @copyright   2018+, Robin Findley
// @license 	MIT; http://opensource.org/licenses/MIT
// @run-at  	document-end
// @grant   	none
// ==/UserScript==

(function() {

    wkof.ready('ItemData').then(install_filters);

    var kanji_by_genki1_chapter = {
        1: ['人', '山'],
        2: [],
        3: [],
    };
    var vocabulary_by_genki1_chapter = {
        1: ['学校', '先生'],
        2: [],
        3: [],
    };

	function split_list(str) {return str.replace(/^\s+|\s*(,)\s*|\s+$/g, '$1').split(',').filter(function(name) {return (name.length > 0);});}

    function install_filters() {
        wkof.ItemData.registry.sources.wk_items.filters.genki1_chapter = {
            type: 'text',
            label: 'Genki 1 Chapters',
            hover_tip: 'A comma-separated list of Genki Chapters to include.',
            default:'1',
            filter_value_map: split_list,
            filter_func: is_in_genki1_chapter
        };
    }

    function invert(items_by_chapter) {
        var items_list = [];
        var chapters = Object.keys(items_by_chapter);
        chapters.forEach(function(chapter) {
            chapter = Number(chapter);
            var items = items_by_chapter[chapter];
            items.forEach(function(item) {
                items_list[item] = chapter
            });
        });
        return items_list;
    }

    var genki1_lists = {
        kanji: invert(kanji_by_genki1_chapter),
        vocabulary: invert(vocabulary_by_genki1_chapter)
    };

    function is_in_genki1_chapter(chapter_list, item) {
        var list = genki1_lists[item.object];
        if (!list) return false;
        var chapter = list[item.data.slug];
        if (!chapter) return false;
        return true;
    }

})();
1 Like

Thank you so much !!!

So I started really to get demotivated by WK in the last weeks as I started to review always the same items and getting them wrong times and again. I really needed to start working on my leeches (which count up to a number I’m too ashamed to share :flushed:).
Today I finally got the hang of the self-study quiz and all the possibilities it offers and this will do the trick, I’m sure. This script is really a lifesaver and I hope to cut down on my guru items in the next two weeks.
Just a big thank you for this script!:kissing_heart:

Little feature request:
There is the possibility to auto-show the correct answer after having entered a wrong answer. Would you mind implementing a checkbox to show the correct answer even if the entered answer was correct, so that I could repeat the alternatives?
Thanks again!

1 Like