WaniKani Lesson Ordering II (obsolete, does not work)

NOTE – October 3, 2021 – this script is no longer working due to recent changes to the WaniKani website. I’m happy that so many people used and loved this script since 2014, but I’ll no longer be able to support it. Instead, please try one of the newer reordering scripts, such as Reorder Ultimate II or WaniKani Lesson Filter. Thank you, and がんばれ!


https://greasyfork.org/scripts/232

Inspired by Alucardeck’s original lesson-ordering script and some recent user requests, I’ve put together this new version.



This script will allow you to move the radicals & kanji to the front if you want to get started on a new level right away… or, move the vocabulary items to the front if you just want to finish out your previous level before tackling a newly unlocked one.

The entire lesson queue is reordered across all batches, so there’s no need to keep refreshing and reordering after every quiz.



7 Likes

Awesome! Just a few days ago I was annoyed by the fact that I couldn’t order them both ways. Thanks - unfortunately I have no lessons to test it with right now.

i have 65! can’t wait to try it out, thanks!

Nice, testing it right now and it seems perfect!

Awesome, will test out when i level up. Too bad i just did, guess ill have to wait 8 days

I have a few questions and observations.

What happens when I click “radical/kanji first” when I have no radical/kanji? I see my lesson queue get shuffled around anyways. Why?
What happens when I click “vocabulary items first” when all I have is vocabulary in my lessons anyways? The queue shuffles around. Why?
What happens when I have vocab lessons from many previous levels and I click “vocab items first”?
Is it possible to order vocab based on lvl the vocab is in? Like I should see lvl 33 vocab before I start seeing lvl 34 vocab.

Saponutti said... I have a few questions and observations.

What happens when I click "radical/kanji first" when I have no radical/kanji? I see my lesson queue get shuffled around anyways. Why?
I probably should check the numbers and disable the button if it's not applicable.   I started with someone else's script in order to add the vocab-first option, and then I made a couple of other improvements, but that wasn't one of them.  Next version maybe.

What happens when I click "vocabulary items first" when all I have is vocabulary in my lessons anyways? The queue shuffles around. Why?
 Same answer as above.  The algorithm currently doesn't do a lot of fancy pre-checking, it just shuffles the queue around if and when you tell it to.  It doesn't do any harm, it just gives you some new vocab at the front if you didn't like the ones you saw first ;p

The only time you can really screw yourself up with this is if you press the buttons during a quiz.  Don't do that!  (It will start quizzing you on items you probably haven't learned yet.)

What happens when I have vocab lessons from many previous levels and I click "vocab items first"?
Is it possible to order vocab based on lvl the vocab is in? Like I should see lvl 33 vocab before I start seeing lvl 34 vocab.
 Right now it doesn't make any distinction based on what level the items are from.  It just mixes everything together.  I'll take a look at this idea.

The only extension I’ve ever used… perfect! 

Thank you I can’t live without it

gth99 said...
What happens when I have vocab lessons from many previous levels and I click "vocab items first"?
Is it possible to order vocab based on lvl the vocab is in? Like I should see lvl 33 vocab before I start seeing lvl 34 vocab.
 Right now it doesn't make any distinction based on what level the items are from.  It just mixes everything together.  I'll take a look at this idea.
 So I took a look at the code, and I think it might be possible. Only thing is that you'll need to get the user's API key. Since I don't know anything about how API's function, I thought I'd give you the general idea of what can be done so you don't have to think so hard yourself and then possibly implement. =D

First you'll need to get user's API key. Store it(cookie or something) so user doesn't need to keep inputting the key every time he does lessons.
While going through lesList.length-1 and then checking if(it.voc), while doing the splice and push, use the user's api to locate the vocab I think like this: For example, to access a vocabulary specific page, use the URLhttps://www.wanikani.com/vocabulary/{SLUG_NAME}, where {SLUG_NAME} is the vocabulary's character.
Add the level of the character to "it"s properties.
So after adding a "level" property to "it", run a sort function by level on lesList, from lowest level to highest level.
Then I think you won't need to .reverse() the list since it'll already be in ascending level order.
Saponutti said...
gth99 said...
What happens when I have vocab lessons from many previous levels and I click "vocab items first"?
Is it possible to order vocab based on lvl the vocab is in? Like I should see lvl 33 vocab before I start seeing lvl 34 vocab.
 Right now it doesn't make any distinction based on what level the items are from.  It just mixes everything together.  I'll take a look at this idea.
 So I took a look at the code, and I think it might be possible. [...]
 Thanks for the ideas... Honestly, it seems like more trouble than it's worth!  I'm not sure I see a huge need for that feature.

But I did make a small update to hide the buttons if the user starts working on a lesson without having pressed them.  As soon as one of the "item-read" markers at the bottom gets filled in, the buttons go away.  So, they won't be sitting there as a distraction if they're not needed, and there won't be any danger of pressing them during a quiz (which would be bad.)
gth99 said... Thanks for the ideas... Honestly, it seems like more trouble than it's worth!  I'm not sure I see a huge need for that feature.
 Noooo, people need this! ;-;
 People who let too much vocab pile up and are trying to get rid of older vocab before getting rid of newer vocab need this!
My idea might not be the most optimal/easy solution, so it could be easier than it seems.
Saponutti said...
 People who let too much vocab pile up
Don't do that :)


Saponutti said... trying to get rid of older vocab before getting rid of newer vocab 
 What difference does it make?  If a vocab item is in your lesson queue, it means you've gurued all of its components, so you should be able to learn it.  There are no order dependencies among the vocab items in there. 
gth99 said...
Saponutti said...
 People who let too much vocab pile up
Don't do that :)
A bit hypocritical coming from a person providing a script that more or less encourages it ;)

Saponutti said... trying to get rid of older vocab before getting rid of newer vocab 
 What difference does it make?  If a vocab item is in your lesson queue, it means you've gurued all of its components, so you should be able to learn it.  There are no order dependencies among the vocab items in there. 
Not entirely true.  There are vocab where the mnemonic provided is based around the reading of a different vocabulary word.  There may also be some compound vocab were you would learn the compound word (which would tell you to think of the individual words readings/meanings) before learning the individual words.  All in all, however, I agree that the majority would make no difference in the order.

Actually, the idea of the script is to enable people to start the clock on their next level’s radicals and kanji ASAP… or to delay starting that clock so they can slow down and finish up their vocab items first.

I myself like to get the clock going right away, and then finish up the vocab over the next 2-3 days.

If someone cares about finishing their levels in order, I don’t see why they would keep racing to level up while there are still multiple levels’ worth of vocab in their lesson queue.  Those would be the people I would expect to hit the Vocab-First button, and let the new radicals and kanji sit for awhile.

1 Like

Oh goodness this is awesome thank you so much! I always wished there was a way I could finish the vocabulary from a my previous lesson first instead of running into the next :slight_smile:

So here’s an issue I found with both the reorder radicals/kanji and vocab.
So like I’ll start with this, with it showing me the lesson for 塔:
塔, 群馬県, 泊める, 擦る
Then I’ll press reorder and get this:
俺ら, 封, 髪, 沈む
but I’m still doing the lesson for 塔. When I finish 塔 lesson, I move onto 封 and completely skip 俺ら.
Then when I get to the quiz, I get quizzed on 俺ら, 封, 髪, 沈む, but not 塔.

This line in both reorder functions where you remove active item queue, 

    for(var i=0;i<actList.length;i++){
        var it = actList[i];
        actList.splice(i–,1);
        lesList.push(it);
        removedCount++;
    }
should start at var i = 1, because the page doesn’t refresh when you reorder, so you’re stuck looking at a wrong lesson after the reordering and then you get quizzed on a lesson that you didn’t actually do.

Thank you for this script! Much needed addition!

One thing though: currently the version on userscripts.org has:
@include       https://www.wanikani.com/lesson/session

However, my lessons at least run under http://www.wanikani.com/lesson/session so I had to add the URL manually.


Naerro said... Thank you for this script! Much needed addition!
One thing though: currently the version on userscripts.org has: @include https://www.wanikani.com/lesson/session

However, my lessons at least run under http://www.wanikani.com/lesson/session so I had to add the URL manually.

 What, HTTP still works!?
I thought it had been HTTPS only for weeks now. Some scripts don't even specify "http://" in their includes anymore.
looki said...  What, HTTP still works!?
I thought it had been HTTPS only for weeks now. Some scripts don't even specify "http://" in their includes anymore.
 Yeah, I was surprised too. However, the script failed to start for me at all. Then I noticed the URL actually started with HTTP, added that and now it works. Maybe it's connected to the maintenance yesterday?