[Userscript] Self-Study Quiz


#304

@roar2000 In the settings you should be able to create a saved filter with Item Type set to Kanji and Level set to +1. If you hover over the input, it gives you a hint for what values you can enter. By saving that filter, you shouldn’t have to worry about setting it each time.

With that say, I’m level 42, but using +1 selected level 40 kanji. Using +0 selected level 39 kanji, and so on. @rfindley It seems like the script is convinced that I’m level 39 for some reason.


#305

@roar2000,
The next thing on my agenda is to add the ability to open the quiz from another script with specific settings. Then I can create a separate “Hide Info” script that looks similar to the old quiz bar (on the Levels page), and open the Quiz with the specific items selected.

For now, as @seanblue said, you could achieve the what you’re asking by just setting up a filter once:

  1. Open the quiz settings, Items tab
  2. Click ‘New’ in the presets
  3. Name the preset (“Current Level Kanji”)
  4. Enable the Item Type filter, select Kanji (or just disable this filter if you want all item type)
  5. Enable the Level filter, and enter “+0” in the field, which means “current level”
  6. Save the settings
  7. Select your new preset in the right drop-down box.

Now you can just leave that preset selected, and it will always quiz your current-level items.


#306

:+1:

Was kind of a pain to have to figure out it’s in the menu now, but that’s made up for by the cool new things you can do. It looks much more sleek as well.


#307

It probably works out the same in practice, but it at least feels like more work to quiz a certain level of r/k/v with the new version than it did before, and with the script being hidden away in a menu now, I think I might be less likely to remember to use it.

That said, I definitely appreciate the ability to quiz more than one level at a time now. And as always, I absolutely appreciate all the hard work that goes into something like this.


#308

@seanblue,

I made some changes related to your feedback.

  • You can only change an answer via Backspace
  • Key presses don’t bubble through the Settings dialog

I double-checked the typo tolerance, and it seems to be working fine for me. Did you maybe enter ‘examplee’ for 例えば, which should be ‘for example’ rather than ‘example’? If you can give me an exact question/answer that fails, I’ll try to replicate it with that. I have a ‘slug’ filter that lets me select specific items.

[more improvements coming…]


#309

I’m seeing inconsistent behavior with this. What I thought I saw this time was it work on the first “slightly off” answer, but not work for the next vocab. But now I’m having trouble reproducing that too. I’ll keep an eye on it.


#310

Here is an image I took of one time it didn’t work:

image


#311

@rfindley The script is capturing F5 so I can’t refresh the page if the quiz is open and a quiz is active.


#312

This is awesome!


#313

Looks like I’m going to need your help debugging this one. It works fine for me:
image

The relevant setting is:

wkof.settings.ss_quiz.allow_typos

And the corresponding code is around line 1282. It uses the jw_distance() function, which is a Jaro-Winkler distance metric.

I guess I’d recommend temporarily modifying the code to see the distance score, good_answer, answer, and pass/fail:

if (answer === good_answer) {
	is_correct = true;
	is_exact = true;
	break;
} else if (allow_typos) {
	var distance = jw_distance(good_answer, answer);
	if (distance > 0.9) is_correct = true;
	console.log('jw_distance("'+good_answer+'", "'+answer+'") = '+distance+' ('+(is_correct?'pass':'fail')+')');
}

#314

Thanks for all the work you’ve put into these scripts, really appreciate it!

I just skimmed over some of the more recent posts so forgive me if i’m not fully versed in attempted functionality here.

In reference to backspace:
I feel like I’m fairly proficient with touch typing and feel like I type very fast. As a result I often start typing an answer halfway, realizing as I do so that the last key I pressed was incorrect and immediately correct myself pressing backspace and move on.

After attempting to begin self study today I realized that backspace seems to have absolutely no effect on anything within the text input. This is driving me insane lol. Now instead of fixing my simple mistake in less than a second I have to stop, pick up the mouse double click the text and re-type the entire word. (The delete key has no effect on text either). I’m not sure what the reasoning is here but my its driving my ocd wild lol.


#315

I’ll post a fix in a few minutes.


#316

Okay… give [this] a try.


#317

:hugs: Like a charm, thank you!


#318

uhhh back again lol.

So unrelated, but I thought this was odd.


#319

I’m guessing this is related to the issue @seanblue had.
I’ll look into it.
Thanks!


#320

:point_right: [v3.0.5] - Fix wrong answers due to case mismatch


#321

Checked with しがつ again & it seems to be working! Thanks.


#322

It could be a UI bug of some sort. Like the UI indicates that “close enough” is enabled but it’s actually not. Or related to that, maybe there’s a problem with how you are saving/loading the settings. Eventually the bug stopped happening for me, and I’m wondering if the setting just got “unstuck” and was finally being used properly.


#323

For any scripters who are interested, the Self-Study Quiz can now be opened programmatically with a specific set of items. Here’s an example from the [Self-Study Hide Info] script:

// Check if the Quiz script is installed and ready.
if (wkof.get_state('ss_quiz') === 'ready') {

	// Specify the items to quiz
	var level = '1';
	var item_type = 'vocabulary';

	var custom_options = {
		ipreset: {name: 'Level 1 Vocabulary', content: {
			wk_items: {enabled: true, filters: {
				level: {enabled: true, value: level},  //Specify Level
				item_type: {enabled: true, value: item_type},  // Specify item type
			}},
		}},
	};

	// Open the quiz
	ss_quiz.open(custom_options);
}