0.2.3 (just released) should fix that - it was an oversight on my part It also adds a checkbox to enable/disable item packs!
Ok, I tried all new features out now:
Enabling and disabling decks works fine, but in order for the review button to display the correct amount of reviews after enabling/disabling a deck, you need to refresh the site. Iām not sure if thatās intended, but I wanted to point that out
I saw that you also added an option to add a meaning and reading explanation! After testing it, I was about to comment that it didnāt safe my information, but then I noticed that there was an update that fixes that lol
Regarding loading the item informations, it works now again for both custom as well as WK items!
Btw, is it somehow possible to add the information which radicals a kanji consists of?
(Also, it appears like the stroke order script works with the custom items, which is really cool!)
Thanks for testing it out! I did indeed push an update to fix the explanations not being saved.
For sure, along with linking vocab that kanji are in, kanji in vocab, and kanji that use a radical. Iāve started work on them but slightly lower priority than e.g. context sentences! I also plan to, at some point, add a button to auto-fill details using a Japanese dictionary API like Jotoba/Jisho.
Ah - thanks for pointing that out. Iāll get it fixed
0.2.6 released, with pack export/import added! Iāve tested it a bunch but I likely missed a couple of bugs so it would be amazing if you could try it out at some point! Here is a quick example I exported, you should be able to copy-paste it into the import field which you get to from the packs menu:
Test Pack
{"name":"Test 1","author":"Test Author","version":"0.3","items":[{"id":0,"type":"Radical","subject_category":"Radical","characters":"äøäø","meanings":["Double grounds","ground"],"auxiliary_meanings":[],"srs_stage":0,"last_reviewed_at":0,"meaning_explanation":"The ground - but twice!","kanji":[]},{"id":1,"type":"Kanji","subject_category":"Kanji","characters":"ē«","meanings":["cattivas","cat 2","second cat"],"auxiliary_meanings":[],"srs_stage":0,"last_reviewed_at":0,"meaning_explanation":"There's cats - but two!","primary_reading_type":"onyomi","onyomi":["ć"],"kunyomi":[],"nanori":[],"radicals":[],"vocabulary":[],"reading_explanation":"Read the same as cat, hmm"}],"active":true,"nextID":2}
One warning: unfortunately there was a bug with how I was storing item identifiers before, so if in your test pack you at any point removed any items other than the very last one then itāll be bugged. If you want to fix it without having to remake the pack from scratch you can export it, then paste it into Notepad or something and CTRLF to find all the "id":
fields (one per item) to make sure that theyāre numbered 0, 1, 2, 3, etc. without any gaps.
Thanks for letting me know! I will test it out tomorrow, as I donāt have any more reviews today anymore!
Do you spoof WKOF data? Omega uses WKOF for sorting and filtering
Maybe you could intercept the HTTP request and return custom data?
For anything that makes web calls I intercept them and add in my data there. Unfortunately AFAIK userscripts canāt intercept the initial page HTML and WK seems to like putting data such as the queue in that initial HTML, so for that I have to wait for the DOMContentLoaded, take the queue out, modify it, then replace it (not ideal because it visibly flashes the changeā¦). But for submitting items / getting item info etc. I intercept the web requests to add in custom data in the same format as WK does.
Iām not really sure what the WKOF data looks like? Does it just pull from the queue? Or does it store extra info?
They seem to have the reviews page set to redirect if the server detects thereās no reviews, and AFAIK thereās no way to prevent the redirect and get the original page⦠Right now the best I can think of is always taking one WK review item (the latest due for review) out of review sessions so that thereās always at least one review due - obviously not ideal but wouldnāt affect stuff too much as long as I made sure to always just get the latest item due for review so that itās not one item getting infinitely delayed (obv would mention it in the script description and would probably aim for non-level-blocking items like vocab). But if anyone has a better idea Iād love to hear it!
It just assembles the paged results of each WK API endpoint into a single array (for each endpoint), and stores that directly in indexeddb. If you want to inject your data into WKOF, you could either capture (i.e. put a wrapper around) the WKOF Wk fetcher function, which is in wkof.ItemData.registry.sources.wk_items.fetcher(), or add your own data source, which would allow users to select those items separately.
If I recall correctly, the minimum requirement for adding a data source is:
wkof.ItemData.registry.sources['custom_srs'] =
{
description: 'Custom SRS',
fetcher: custom_srs_fetcher_function
}
And I think the fetcher function needs to return a promise that returns an item array formatted similar to WKās /subjects endpoint, because other scripts will expect many of those item fields to be present.
Thanks for the info!
Iāll have to take a closer look at it - I assume the main use of that would be to improve compatibility with other scripts? Or would it have other benefits Iām missing? (I assume it doesnāt have a way to solve my doing-reviews-when-thereās-no-WK-reviews issue right?)
I admittedly originally considered looking into whether using WKOF could make this script easier but decided that it would take longer to learn the codebase for it than to just write the parts I needed myself lmao
Yeah, the primary benefit is that scripts that use WKOF as a data source will, in many cases, automatically pull in your data. For example, your items will show up in Self-Study Quiz and Item Inspector. Double-Check may be able to work with your items seamlessly (I canāt remember how much data it pulls from WKOF versus the quiz queue, though).
Double-Check seems to work fine so far - but it does sound like a good idea to get it to work with other scripts. Iāll take a look over the next few days. Thanks!
Indeed, it does, at least for me!
I now tested importing the pack, and it seems to work fine, apart from the double cat being a single cat and the reading for it being ć instead of ćć lol
I also tested the bug you mentioned, and it seems like itās indeed bugged; I deleted the double ground from the pack and then did the review for the cattivas, and when I got it to Apprentice 1, WK told me that I lost connection and had to refresh. Luckily, it didnāt mess up the review session.
The fix you mentioned for the bug also works, but I have a question: Iām absolutely no expert regarding this, but shouldnāt one also fix the nextID
fields so that they are numbered 1, 2, 3, 4 etc.?
Also, another thing I wanna mention: The script seems to interrupt the reordering of the Reorder Omega script, as instead of having the radicals first, they seem to have not been reordered at all. So it looks like itās not 100% compatible with the Reorder Omega yet.
Hmm, Iāll look into that, I thought Iād fixed it on this latest update. Although it could be an unrelated bug maybeā¦
Thereās one nextID
field in each pack - the idea is that it stores the location of the next unused ID. When you delete an item my idea currently is for that ID to not be reused, so that I can correctly relate the items in an imported pack to those of an earlier version of the same pack, allowing importing updates that remove / add items while maintaining the userās SRS levels for the items that havenāt been removed / added. So that field should always be the maximum ID thatās ever been used in that pack + 1.
Yeah Reorder Omega definitely has some issues still, Iāll look into it in the next few days after first getting some more basic features sorted!
Thanks again for helping me with testing this script!
EDIT: Ah - Iāve found the new bug thatās happening when you remove items. Iāll get it fixed asap!
Thanks for the explanation, that makes sense!
No problem, I really like it and want to help as much as possible!
I think I found another bug. If I click on a day on my heatmap where I did reviews, it usually displays the items I reviewed on that day and some additional information, like this:
However, if I try to click on a day were I did reviews of custom items as well, I donāt get this information displayed.
Hmm, not sure why that would be happening as currently I donāt touch any of the WKOF data which Iād assume the heatmap uses. Could possibly be because itās auto-saving all reviews sent via the event that fires when completing an item and doesnāt know how to handle / doesnāt check for negative IDs which is what Iām using for items in this script? @Kumirei
In other news, 0.2.7 released! Looks like the bug with the IDs I said I fixed last time wasnāt fully fixed, so old packs might be bugged again I promise this wonāt be a common occurrence, Iāll try to keep new versions back-compatible as much as possible, especially once the script is a bit more complete!
- Loads of bug fixes
- Add option to change item SRS level
- Prevent flashing with item change at the start of custom review session (not final solution, will improve it over time)
Here's a test pack in case it's easier for you to just import it to test than making one yourself
{"name":"Test Pack","author":"Hubbit200","version":"0.3","items":[{"id":0,"type":"Radical","subject_category":"Radical","characters":"äøäøäø","meanings":["Triple ground"],"auxiliary_meanings":[],"srs_stage":0,"last_reviewed_at":0,"meaning_explanation":"The ground - but three times!","kanji":[]},{"id":1,"type":"KanaVocabulary","subject_category":"Vocabulary","characters":"ćććŖ","meanings":["Fish","fishes"],"auxiliary_meanings":[],"srs_stage":0,"last_reviewed_at":0,"meaning_explanation":"Fish kanji, same as vocab","readings":[""],"reading_explanation":"Kana vocab is pronounced as per the kana, so no need to learn any other readings!"},{"id":2,"type":"Kanji","subject_category":"Kanji","characters":"ē«","meanings":["cattiva","second cat"],"auxiliary_meanings":[],"srs_stage":0,"last_reviewed_at":0,"meaning_explanation":"Cat, like vocab.","primary_reading_type":"onyomi","onyomi":["ć"],"kunyomi":["ćć"],"nanori":[],"radicals":[],"vocabulary":[],"reading_explanation":"Read the same as cat, hmm"}],"active":true,"nextID":3}
Thanks for letting me know! Here are some observations that I made:
-
I think the option to set a word as kana vocab is new?
-
The first review item isnāt always a custom one anymore
-
I now see a button for doing custom reviews, even if I donāt have any WK reviews; However, it doesnāt work lol, I get redirected to the dashboard
-
I noticed that when I go to my reviews and have a custom item as my first review, the custom item fade in (and even with the correct color)!
-
When I do my reviews and my first review is not a custom item, the WK items fade out, and Iām left with āghost reviewsā. I can still do them, but I canāt see what I am reviewing anymore.
Also, in that screenshot, the number of the remaining reviews is kinda bugged: While it is loading the page, it goes up to 48 reviews (WK items + Custom ones), but when it is finished loading, it goes back to 45 reviews (WK items only).
(Unimportant, but: I can see which item Iām reviewing if Iām able to drag it with the mouse like a picture (not sure if thatās what it is called; I clicked with the mouse on the item, moved the cursor somewhere else while continuing pressing the mouse, and after some attempts, I saw a copy of the item), but I didnāt always get the whole item at vocabs, so Iām really thankful for the double check script lol)
Anyway, since the remaining review counter acted like I described, I went through a review session of 5 items the way I described in the spoiler, and the custom items did indeed not show up in the session.
However, this is only the case if the first item is not a custom item. If the first item is a custom item, everything seems to work fine.
TL;DR: If the first item in a review session is not a custom item, I canāt see the WK items + the custom items donāt show up in my reviews. If the first item is a custom item, everything seems to work fine (I havenāt done any reviews yet when the first item is a custom one, but I was able to see the item, and the remaining reviews count included the custom items as well, so I guess it works).
I wanna note that this happened while having set ćććŖ as Apprentice 1 to test the feature of setting the SRS stage. It might be related, but Iām not sure.
Regarding features: Do you think it is possible to display the time until the next review of an item, but make it optional so that you can decide whether you want to use such a feature? Iām not sure if everyone would like to have it displayed, but Iām sure some people would like that. And after all, Iām sure the settings page isnāt there for no reason
(I might have found more, but I ran out of reviews, unfortunately So this might not be all there is)
Thank you for testing it out!
- Kana vocab isnāt new, but it wasnāt working properly before
- The first review item should always be a custom one - if itās not then that suggests thereās an issue with a specific change I made. What browser do you use (just in case itās that)?
- The review button is indeed now fixed to allow clicking when thereās custom reviews (although it looks like I need to still work on it a bit to change the text etc.) but yep, it doesn0t actually work yet!
- The fading should only happen when you have custom items to review - and in those cases the custom item should always be first. So fixing the custom items not being first should hopefully also fix your issue of ghost reviews.
- Iām very curious as to why the remaining counter is acting like you describe, Iāll need to look into that.
A setting to show time until review definitely sounds like a good idea, and should be quick to implement. It will be in the next update today/tomorrow
EDIT: Oh also just to check, did you have any reordering script enabled when testing it?
Whoops, must have overlooked it somehow then
Iām on Firefox. Since the last update of the script, the first item wasnāt always a custom one anymore, but if it was a custom one, it had the right color, so thatās good, I guess? In any way, I think it isnāt related to the browser
Yes, I never disable it It is the first time that it behaved like this, though, despite that I had activated the reorder omega script in previous versions as well.
Hmm, Iāll test it out with Omega / Firefox to see if either of those are causing the issue, as Iām having trouble replicating it. In the last update I changed the method I use to add in the custom items but if itās causing issues Iāll likely just change it back to how it was before, as it didnāt end up really improving much!
I will also work on proper Omega compatibility, but I first need to get it working with custom items not being the first in the review session Iāll probably add a setting to choose if theyāre placed at the beginning or randomly mixed in.
I just tested disabling Omega, but the issue still happens. So, itās either Firefox or one of the 1340934 other scripts I installed lol