WaniKani SRS Reorder Button

Ok, thanks for the info!

hey i added functionality to this script:
-option to sort automatically
-keybind default is the number 3
-update the counter when finishing a card
https://pastebin.com/hy7LpRmj
@Towe pls update the greasefork and unlocalise the link lol. not everyone speaks polish

also for me the reading for meaning does not work

I love this script! I’ve been looking for something like this for a long time. Don’t know how I didn’t find this one haha

Thank you!

Hi, thanks for your contribution! I’ve played with your changes, modified them a bit and everything seems to be working fine. Also, good point about the localisation, I haven’t even noticed it’s in the URL.

Besides, what do you mean by “reading for meaning”? Is it some other script?

i have no clue what i meant.

anyway, i have added one more quick and dirt change. i wanted to have some randomness in the order. so i randommised the first 10 items to be tested.
i saved the random function to keep the original and not get into problems if other scripts mess with it
const ornd = Math.random;
and i changed one line to add the shuffle
$.jStorage.set('activeQueue', items.slice(0, 10).sort(() => ornd( )-0.5));

edit. hm that seems to dirty as it separates meaning and reading. if i have more time i might make a better randomiser. i think the best way would be instead of sorting the hole array to sort it into pots that all have the same sorting priority and the these can simply be shuffeled

Isn’t the order random already? I mean, when you refresh the page, it’s different every time and when you use the reorder button it only sorts items enough to enforce rules defined in the script but besides that the randomness should be preserved.

yeah but i use ignore script for typos and it also has the sideeffect that a wrong asnwer will directly be asked again which is not helpful. so its much better for me to have a bit of randomness in there for the case, but that gives me an idea. i guess i will do the shuffle before the sorting

hey guys, hopefully someone can help, since I am terrible with code. I would like to have the items come in in reverse SRS order, i.e. burn items first. What exactly do I need to change in the script to allow that?

Edit: These are the standard settings and I guess I need to change something here, but I don’t know what to.

/* Settings */

const questionTypeOrder = 1; // 1 - reading first, 2 - meaning first, 3 - random
const itemTypeOrder = 1; // 1 - rad->kan->voc, 2 - voc->kan->rad, 3 - random
const ascendingSRS = true; // low-level items first
const priotitizeSRS = true; // SRS order more important than item type order
const force1x1 = true; // meaning and reading directly next to each other
const sortOnStartup = false; // sort items on startup
const hotkey = ‘Digit3’ // keyboard shortcut (key code)

@sirati97 Not to hijack this thread, but my reorder script might be closer to what you want. Or at the very least, the code may help you figure out what to do to tweak this script so it does what you want.


@Saida This is just a guess based on the setting names, but try setting ascendingSRS to false.

1 Like

i do get that you might think that, but i had an exodus from wanikani and had like 5000 review about 3 weeks ago, i am down to 3000 now making sure to revise every item i revised the last days before going to new ones.

i do not want to reset because with kanji i am nearly done learning just vocab is where i so far behind, so for me it doesnt really apply because i do enough a day to revise everything due anyway and the levels in wanikani do not mean too much because of my break if they are below master

I thought that might be an option. I’ll try it out when I get back to my laptop later. Thanks!

1 Like

@seanblue just wanted to let you know that it worked. (It took me a while to find the save edit button, though, haha)

I’m very, very new to all of this, but I think I found a way. Further down in the code it has this under utilities:

function itemComparator(itemA, itemB) {
const srsOrder = ascendingSRS ? itemA.srs - itemB.srs : itemB.srs - itemA.srs;
const typeOrder = itemTypeOrder === 3 ? 0 : (getTypePriority(itemA) - getTypePriority(itemB)) * (3 - itemTypeOrder * 2);
return priotitizeSRS ? srsOrder || typeOrder : typeOrder || srsOrder;

I switched the bold items to show:

itemB.srs - itemA.srs : itemA.srs - itemB.srs

and it seems to work just fine.

1 Like

Thanks for going to the trouble. I got it working already, though

Heya, just recently read this portion of the thread. I started working on a fork of this last night since it was going to just be a small change for personal use, but it felt weird not having it version controlled so I published the fork to a personal repo (linking to your original posts).

The changes I coincidentally address the request @Saida made later in the thread for a descending order. I describe this in the page I made for the fork here.

Would you want me to contribute my changes to your original script or leave them in my fork? I’m fine with either, but would seriously want to keep code publicly versioned controlled if so. I don’t have an account on GreaseMonkey, but if it’s able to do that, then I can totally contribute through there.

1 Like

Please leave them in your fork. I’m not using WK right now and I don’t know if I ever will again, so I don’t really want to spend time on maintaining the scripts I made. Feel free to use my code in your fork and share it with other users if you’ve made some changes that can be useful for them :slight_smile:

2 Likes

could you explain what the number mean? sorry if I’m asking the stupid questions here but I just don’t get it

I take it to mean that Towe doesn’t want to spend any time on maintaining this script, so Sonarius should just publish their changes as a new script rather than having Towe update the original.

In case you missed it Sonarius did publish their script here

3 Likes

Like Kumirei pointed out, I’m maintaining a fork of this project as Towe is retiring theirs. If you have new questions, feel totally free to ask on the thread for my fork since I’ll be monitoring for alerts on it to answer new questions.

The quick answer though is: the numbers count the amount of items left at each SRS level for the current review session. There are 4 apprentice levels, 2 guru levels, 1 master level, and 1 enlightened level.

2 Likes

Thank you !

1 Like