Holy crap! Sounds amazing already. Thank you rfindley!
Yessssssss! Iām excited for this :3
You rule big time!
Awesome!! Thank you
@rfindley You often recommend spending more time to front in lessons. Have you considered for the new version allowing quizzes during lessons themselves or on the lesson summary page?
Or at the very least, would this be an easy thing for someone to plug in via a function (i.e. studying all items that had their lesson done less than X hours ago)? Perhaps you could add that as one of the pre-canned options since itās not subjective like leeches is.
Yeah, we could have a way to binge the items learned right after the lessons. I always do that with kanji and it does help me a lot.
In that case, you could select current-level items at Apprentice 1. You might catch some that have fallen back from higher srs levels (though still on the same level), but that wouldnāt be a bad thing to add to your queue.
And like you said, if you wanted to add an additional filter for unlocked_at, you could do that easily enough.
Hello! Thanks rFindley for the great script. I just found it today and look forward to using it more.
I tried out the audio quiz, however the audio doesnāt play. I have the settings set to how you have them in the picture you uploaded and my volume is up. Could you help with this?
(Also, Iām running the Opera browser. Do you know how often Opera might not be compatible with userscripts, considering itās not a very popular browser?)
The usual reason for missing audio is the realization that audio only exists for vocab. Beyond that, make sure the audio icon is enabled in the upper-left of the quiz window.
Iāll be releasing a new version in the next few days.
I donāt have a feel for current Opera compatibility. For my own scripts, I try to write code with compatibility in mind based on previous compatibility experiences, but to be honest itās been quite a while since Iāve tested them on multiple browsers. (I already spend more free time than I should on WK scripts >_> )
Alright, thanks. Iāll play around with it.
Donāt work too hard on scripts!! haha
Once you release the update Iāll try making an unlocked at function to register. If it works well Iāll post the code here so you can consider if you want to bundle it in.
Can type
be an object? In my hacked together leech script that I added into the old self study script, I let you specify the ātime until reviewā to filter by per srs level. For example, you could set it to never review Enlightened items, review Master items that are 25 or more days until review, and so on. Itās a bit complicated, but Iām still curious if I could replicate that with the plugin functionality youāre adding. If not, I could still let users customize that aspect in my script that adds the leech filter, but ideally they could set that in the UI instead of by editing the script.
The simplest would be to use a text box with comma-separated parameters, and just parse each section.
code
// Function to clean up a comma-separated list
function split_list(str) {return str.replace(/^\s+|\s*(,)\s*|\s+$/g, '$1').split(',').filter(function(name) {return (name.length > 0);});}
function parse_time(text) {
var sections = split_list(text.toLowerCase());
var time = 0;
sections.forEach(function(section){
var months = ((section.match(/^(\d+)\s*(mo|month|months)$/)) || [0,0])[1];
var weeks = ((section.match(/^(\d+)\s*(w|week|weeks)$/)) || [0,0])[1];
var days = ((section.match(/^(\d+)\s*(d|day|days)$/)) || [0,0])[1];
var hours = ((section.match(/^(\d+)\s*(h|hr|hrs|hour|hours)$/)) || [0,0])[1];
var minutes = ((section.match(/^(\d+)\s*(m|min|mins|minutes)$/)) || [0,0])[1];
time += months*30*86400 + weeks*7*86400 + days*86400 + hours*3600 + minutes*60;
});
return time;
}
Result:
parse_time('1 week, 2 days, 3 hours'); // 788400 seconds
parse_time(' 1w ,2d, 3 hrs '); // 788400 seconds
If you really need something complex, I was planning to support a 'button'
type, which would call a function when clicked, then your callback would be responsible for displaying a more complex filter settings dialog.
wkof.ItemData.registry.sources.wk_items.filters['time_until_review'] = {
type: 'button',
label: 'Time until review',
filter_func: time_until_review_filter_function,
hover_tip: 'Filter items based on their next review time',
filter_func: my_filter_function,
on_click: open_my_filter_settings_dialog
};
The on_click
callback would be passed an on_save
callback that your filter dialog should call if the user saves the settings of your filter.
function open_my_filter_settings_dialog(on_save_callback) {
// TODO: Display a dialog box with my filter's complex settings.
...
// Tell the framework that the user changed my filter's settings.
dialog.on_save = on_save_callback;
}
The button approach will probably work out well. Itāll be more intuitive than a comma separated string. And by adding it as a filter, I could actually support the time until review filter separately from the leech filter.
Rather than everyone making their own threads for their filters (like normal script threads), do you think it might make sense for you to have a section in your main post for the additional filters? Then people could just post them here and you could add them to the main post. Theyād still be scripts of course, but it might be more organized this way.
Actually, the ideal place for filter discussions is in the Open Framework Discussion thread. These filters are generic. Any script can make use of them in choosing a set of items for whatever reason⦠for example, a script that exports items to csv, where you can choose items by level, by leech score, by SRS level, etc.
Also, regarding complexity of text boxes, there are two parameters that are useful for helping the user understand how to use it:
placeholder: '(e.g. "1-3,5")'
hover_tip: 'Filter by Wanikani level\nExamples:\n "*" (All levels)\n...'
Instead of opening a dialog, would there be a way to still edit the ācomplexā filter values on the Self Study dialog? Iām thinking maybe a collapsible section so itās not overwhelming, but then still allowing everything to be in one place. So perhaps the type
is section
or something like that, and the on_click
function gives you the html to add, or something like that. I havenāt thought through the details, but what do you think at a high level?
Hi I think I encountered a bug,
It wonāt accept the right answer.
[v2.1.1] - Strip spaces after reading in Wanikani data
@rfindley Any update on when you expect to release the new version?
Later today or tomorrow. I was delayed by a huge refactoring of the code, but now itās a lot easier to read and modify.