[Userscript] Self-Study Quiz

:point_right: [v3.0.8]

  • Added 3-state audio icon (hover over the icon to see the following description)
    • Red - Never play audio
    • Gray - Audio questions only
    • Yellow - Audio questions, After correct reading, Opening help for reading
  • Moved ‘typos’ to settings window.
  • When making changes in the settings window, don’t restart the quiz unless the changes require it.
  • Better defaults for the first time the script is run.
1 Like

@rfindley Please remove “Recently Failed Items” from your description of my add-on. I haven’t implemented that yet. :slight_smile:

Oops
 Got it.

Thanks!

Is there a way to automatically show the correct answer when you get it wrong? Always having to press the icon is really cumbersome and the shortcut only works when I click into the window first after each item.

1 Like

The current version should accept the F1 key at any time for opening the help, even without clicking in the window. Is that not working for you? (And if not, what browser and script host are you using?)

I’ll look into adding an option tonight to auto-open the help.

1 Like

Nope same thing with F1. It seems like the window gets out of focus or something.
I’m running Firefox 59.0.2 with Tampermonkey 4.6.5757.

hmm
 I’m capturing keys all the way up at the <body> tag, so theoretically any key should be captured at all times. I’ll try out Firefox tonight.

1 Like

In agreement with Powerpuncher on this one. Although for whatever reason, I’m also using Firefox w/ Tampermonkey and F1 does indeed work for me. Still, I know that personally, if I get an answer wrong I will always want the correct answer shown. There should definitely be an option to auto show it.

Thanks

1 Like

@Powerpuncher @Torere,

:point_right: [v3.0.9] - Added an option to auto-show the correct answer when you answer incorrectly.

2 Likes

:hugs::heart:

1 Like

Thanks a lot!

1 Like

I’m so happy with this script, @rfindley, thank you so much. My requirements have been fulfilled better than I could ever hope. Now I have just one thing on my wish list: the ability to export/import preferences/items. For multiple machines. I don’t need “export to file,” a simple (json) string would already be enough for me.

The Open Framework technically has the ability for someone to create a Sync script to sync settings for all scripts. But in the meantime, you can gather the settings from the Javascript console.

Export settings to console:

wkof.file_cache.load('wkof.settings.ss_quiz').then(function(settings){
    console.log(JSON.stringify(settings));
});

Import settings from console:

var settings = [paste your settings here without the square brackets];
wkof.file_cache.save('wkof.settings.ss_quiz', settings);
1 Like

Excellent! Thank you!

There’s definitely something wrong with the synonyms. I’m doing a quiz now for an item and it doesn’t have synonyms that I added months ago.


I have a suggestion. At the end of a quiz, you allow a requiz of just the wrong items. But the wrong items don’t stay from one round to the next. I would like to be able to go through multiple rounds of all items, and then drill the items I got wrong in any round, not just the last round.


Also, not sure why there is one remaining when the quiz is finished.

image

1 Like

The input issue is still persisting. Everytime I submit an answer with enter, all input for the quiz window stops working:

input

I’ve tried disabling all other scripts and even all add-ons to no avail. Clearing cache also did nothing. No errors/warnings in console either.

@Powerpuncher,
Since my key handler is attached to the <body> tag, which is the topmost element of the page hierarchy, all key events should bubble up to the <body> and be captured, no matter what has focus, and indeed that seems to be working for everyone else. So, there has to be something different about your system somehow.

We can run some tests to narrow down what’s going on, depending on your level of comfort with digging into code.

On line 1600 of the latest version of the script, you’ll find the key handler function:

function quiz_key_handler(e) {

Right after that, add a logging line, which will tell me if it’s reaching the key handler and doing something wrong, or if it’s just not reaching the handler at all:

function quiz_key_handler(e) {
    console.log('quiz_key_handler()');

Save the changes and reload the page. Then, open the Javascript console (press F12 and click the Console tab) and start doing the quiz. It should print “quiz_key_handler()” each time you press a key, including while you are having your issue. Tell me what you discover, and that will cut the range of possible causes in half.

1 Like

What I’ve found is that after hitting enter to submit, no input is captured at all. Only after I click back into the window it captures input again.
It only seems to happen when I submit the answer.
I also noticed, that when I input something in the answer field, for every character I type, the function is called twice and for hot keys just once.

I just trying actually doing the requiz and was disappointed to find out that it only requizzed the failed items once. Wouldn’t it be better to do that on a loop (until the user ends it) to really drill the failed items?

To add to this topic, I actually have been experiencing a very similar ‘issue’. Whenever I hit enter when the question is wrong, this happens to me. I have to click back in the window to regain keyboard input. However, if the answer is correct, it’s business as usual. I laughed when I saw this comment, because I had been telling myself to mention it for probably a week or so but kept forgetting lol. (Firefox, MacOS ElCap)

@Powerpuncher beating me to the punch (lol) again.

1 Like