This script makes the SRS popup in reviews more detailed to show exactly which SRS level the item lands on when you complete it. Normally WK only shows Apprentice/Guru instead of the individual Apprentice 1-4 or Guru 1-2 levels.
I am checking this now with the team and I’ll let you know what they say.
Update: Overall we don’t think that showing the exact SRS stages is very helpful for learning, because we want learners to focus on the content to be learned (not the exact SRS stage). We also want the option of having different numbers of stages for different items, so we want to keep the visible stages to a minimum.
You just beat me to it. I also made a script for this yesterday which I was going to upload today. Yours looks a lot better though. I did not know how to intercept the didChangeSRS event and redo all the required calculations, so I found the function that generates it and changed that instead.
@rfindley Do you think it would be possible for you to ensure that your fake didAnswerQuestion is fired before the native didChangeSRS event? I use didAnswerQuestion to figure out which item is being updated in didChangeSRS
One of the reasons I did not publish mine yet is because it also does not work with doublecheck by default. I have it working on my end by changing a few lines in my copy of doublecheck, but that didn’t seem very user friendly. Doublecheck grabs pointers (or whatever the javascript equivalent is) to many of it’s hooks into wanikani, but creates it’s own instance of the srs manager for some reason. My script modifies the global srs manager, so that change gets ignored if doublecheck is also running.
The other unfinished issue I was still having is that it only works if I start the script with a sleep for several seconds. I have no clue what I am waiting on, which makes it a bit hard to find a better option.
I have uploaded a copy here. This was my first attempt at javascript or anything web related, so there might be other problems as well.
I think I didn’t know how to get to the global SRS manager. It’s going to be probably a week before I have much time to spend more than a few minutes on scripts, but if you have a change for Double-Check that uses the global SRS manager, I can look into merging your changes sooner than that.
The SRS manager is a part of the quiz_queue, which you already extracted.
So I just replaced
if (quiz_queue.hasSubjectIdsWithSRSTarget) {
srs_map = new Map(JSON.parse(quiz_queue.subjectIdsWithSRSTarget.textContent));
let SRSManager = (await importShim('controllers/quiz_queue/srs_manager')).default;
srs_mgr = new SRSManager(srs_map);
}
Ahh, I see. The reason I didn’t use the srsManager in quiz_queue is because it was a private variable at the time that I updated my script, so it wasn’t accessible. I know tofugu-scott changed most things to public variables for now, but I know he’s been doing so at least partly to aid in troubleshooting problems, so I hadn’t changed any of my script to take advantage of that in case he decides to switch things back to private. But I suppose I now have a snapshot that I could revert to if I ever needed to fall back to it, so I can switch to using the now-accessible srsManager in quiz_queue.
The outer ‘if’, by the way, is to check if we are on the Reviews page (which has SRS info) versus Lessons or Extra Study (which don’t have SRS info).