[Userscript] Self-Study Quiz

xslt said... I've noticed that there's an error with the get_api function in the code of the latest version. I don't know if its an isolated case but I tested it on Chrome and Firefox and got the same error. I had to comment out a bunch of lines and hard code my api and the localstorage.set_item part to get the quiz function to work.

Is there something I'm missing?

Do you think you might be able to put the code on github so users in the community can submit fixes or improvements and even help with debugging?

It's an excellent script though, so thanks.
 Although I tested the API code at one point, it's certainly possible that the code 'decayed' at some point without me noticing, since I haven't deleted my API key in a long time.

I'll consider github, though to be honest I've not used the collaboration features of it enough to be proficient.  In the short term, I'd be happy to take emailed code and use my familiar tools to make merges/changes quickly. Besides, the code is quite messy right now since I just wanted to get it out there.  So if there are many requested changes/additions, I'd probably do a lot of refactoring along the way.

Anyway... I'll be heading to my computer within the hour to take a look at the script... hopefully will have some fixes soon, if I can manage to replicate the problem(s).
rfindley said...
xslt said... I've noticed that there's an error with the get_api function in the code of the latest version. I don't know if its an isolated case but I tested it on Chrome and Firefox and got the same error. I had to comment out a bunch of lines and hard code my api and the localstorage.set_item part to get the quiz function to work.

Is there something I'm missing?

Do you think you might be able to put the code on github so users in the community can submit fixes or improvements and even help with debugging?

It's an excellent script though, so thanks.
 Although I tested the API code at one point, it's certainly possible that the code 'decayed' at some point without me noticing, since I haven't deleted my API key in a long time.

I'll consider github, though to be honest I've not used the collaboration features of it enough to be proficient.  In the short term, I'd be happy to take emailed code and use my familiar tools to make merges/changes quickly. (rfindley at usa dot net)  Besides, the code is quite messy right now since I just wanted to get it out there.  So if there are many requested changes/additions, I'd probably do a lot of refactoring along the way.

Anyway... I'll be heading to my computer within the hour to take a look at the script... hopefully will have some fixes soon, if I can manage to replicate the problem(s).
Github has their own gui client to simplify things if you aren't comfortable or familiar with command line stuff. I wouldn't call myself a power user as far as git is concerned but its pretty easy to get started. I'd definitely recommend checking out their tutorial as I think it would take some pressure off you for being the singular developer whilst still allowing you to manage the code submissions yourself (and maintain ownership). It would certainly make things much easier for the people wanting to contribute as well.

If you can't replicate the bug on your end I'll try and email you a fix for the api error (that breaks the quiz function) but I'm not overly familiar with javascript or the source code for that matter so I can't promise the best code quality. Anyways, keep us posted.

xslt said...Github has their own gui client to simplify things if you aren't comfortable or familiar with command line stuff. I wouldn't call myself a power user as far as git is concerned but its pretty easy to get started. I'd definitely recommend checking out their tutorial as I think it would take some pressure off you for being the singular developer whilst still allowing you to manage the code submissions yourself (and maintain ownership). It would certainly make things much easier for the people wanting to contribute as well.

If you can't replicate the bug on your end I'll try and email you a fix for the api error (that breaks the quiz function) but I'm not overly familiar with javascript or the source code for that matter so I can't promise the best code quality. Anyways, keep us posted.
 https://github.com/rfindley/wk_self-study_quiz_edition

It's not that github is difficult... it's pretty similar to most other software configuration management (SCM) tools.  It's mainly that I've only used the collaboration features (i.e. pull-requests) maybe three times briefly, and haven't had enough reason to really sit down and understand what's going on under the hood, which is a necessity for me.  

Moreso, I've been spoiled by some really nice professional SCM tools... stream-based code management, three-way merge, remote interactive edit-in-place diff/merge, drag-n-drop change packages, easy visualization of large project development, etc.   Github is professional quality, of course, but the functionality is still pretty rudamentary.

v2.0.1 - Fixed apikey-fetching issue.

Well, that was quick and easy.  Hopefully that solves most of the issues.

rfindley said... v2.0.1 - Fixed apikey-fetching issue.

Well, that was quick and easy.  Hopefully that solves most of the issues.
 All is working on my end.

Thanks for the quick fix!

v2.0.2 - Fixed display issue, re: newly-unlocked item badges on top of quiz.

Thanks @reiv  (@xslt on WK, I assume)

v2.0.3 - Fix synonyms; shake for wrong answer type; scroll errors
  * 
Fixed problem with synonym handling, which caused items with synonyms to be skipped.
  * Added shake for [meaning instead of reading] and [reading instead of meaning].
  * Improved scrolling in error summary.

rfindley said...
aragonsr said... Super minor bug. But I thought I'd just point it out.
On the quiz, the arrows and the items are not centered like your screen shots. They are off to the right side for some reason.
I'm on mac using chrome version 50.0.2661.102 (64-bit).
Could you post a screen-shot?  Seeing the exact position might help me determine which CSS rule isn't working.  Also, could you confirm whether any other scripts are running?  That's not likely the cause, but you never know..
I'm also using the same version of Chrome (and tested under latest Firefox, too) 
 https://www.dropbox.com/s/2fier63nwcgzmam/01.png?dl=0

Apparently I can't post a screenshot, but I can give you a link....
aragonsr said... https://www.dropbox.com/s/2fier63nwcgzmam/01.png?dl=0

Apparently I can't post a screenshot, but I can give you a link....
 My rendering (when I zoom to 200% to match your image) is nearly identical to yours, except the shifted 'question' area.  The only difference I can see is the font.  Yours isn't pulling in the same font for the stats in the upper-right, which makes sense since you're on a Mac.  Unfortunately, I don't have access to a Mac to test on.

I've checked all the elements I can think of that might cause a block reflow problem, which is what I'm guessing is going on.  But I don't see anything... :-(.  Of all the development/testing tools I have, Apple is my weak spot.  Maybe I should buy a Mac mini one of these days, but I can't justify it at the moment.

If you're interested in doing a web-share session, I can probably figure it out quickly.  If so, email me ([email address removed])

v2.0.4 - Added hotkeys:  Skip forward or backward through quiz with ctrl-right / ctrl-left.

rfindley said...
aragonsr said... https://www.dropbox.com/s/2fier63nwcgzmam/01.png?dl=0

Apparently I can't post a screenshot, but I can give you a link....
 My rendering (when I zoom to 200% to match your image) is nearly identical to yours, except the shifted 'question' area.  The only difference I can see is the font.  Yours isn't pulling in the same font for the stats in the upper-right, which makes sense since you're on a Mac.  Unfortunately, I don't have access to a Mac to test on.

I've checked all the elements I can think of that might cause a block reflow problem, which is what I'm guessing is going on.  But I don't see anything... :-(.  Of all the development/testing tools I have, Apple is my weak spot.  Maybe I should buy a Mac mini one of these days, but I can't justify it at the moment.

If you're interested in doing a web-share session, I can probably figure it out quickly.  If so, email me (rfindley at usa dot net)
I did a little digging real quick.
If I turn off the "Helvetica Neue" font (or remove it) from the body tag, it centers it again.
The font on the black border changes though.
aragonsr said...I did a little digging real quick.
If I turn off the "Helvetica Neue" font (or remove it) from the body tag, it centers it again.
The font on the black border changes though.
Thanks, that helps a lot!

Before I make any changes:
In Chrome's CSS editor (i.e. when you right-click an element and select "Inspect"), click on the "computed" tab of the CSS window, and scroll all the way to the bottom.  It should show you exactly which font your browser selected from the list.

Could you tell me which fonts your browser is using for each section of the quiz window?  On Windows, I'm seeing "Ariel" as the main English font, and "Meiryo" on the Japanese.  FontAwesome is always used for the icons, and I end up with "consolas" for the scoreboard section in the upper-right.

I expect several of those will be different on Mac.  What interests me most is what font you're ending up with when you disable the"Helvetica Neue".

Just wanted to say thank you for this script, it’s really brilliant and so useful! I’m rather new here, but I can already say that finding this one was the best that could happen to me!

Hey, thanks for the work :slight_smile:
It will be an immense help for me while studying on Wanikani
To see community members make such an awesome learning tools, makes me greatly motivated for studying further :slight_smile:
While I’m still beginner I do really appreciate what you’re doing!

i’m a noob, i know, but how do i use this exactly? i downloaded the file but i’m not sure how to use it

Demarco92 said... i'm a noob, i know, but how do i use this exactly? i downloaded the file but i'm not sure how to use it
 If you're using Chrome browser, install Tampermonkey.  If you're using Firefox, install Greasemonkey.  I think the one for Safari browser is called Greasekit.  If you're using IE, install Chrome or Firefox :-)

Once you have one of the script managers above installed, go back to the userscript link, and click the Install button.
rfindley said...I think the one for Safari browser is called Greasekit.
FYI Safari users should install Tampermonkey as well.
cplaverty said...
rfindley said...I think the one for Safari browser is called Greasekit.
FYI Safari users should install Tampermonkey as well.
 Good to know, thanks!

v2.0.5:
  * Added button on quiz summary screen to re-quiz only your wrong answers.
  * Added hotkey to re-shuffle deck and restart quiz at any time (Ctrl-Shift-S)

Note:  These two new features are separate.  Don’t use ‘shuffle’ while doing a re-quiz, because shuffle resets the whole deck with a fresh set of items.



1 Like

I seriously need this in my life - i’ve forgotten like 30% of everything I’ve learned on wk - the reviews will be brutal once I deactivate vacation mode.