Updates to Lessons, Reviews, and Extra Study

Scott, do you see any issues with something like this:

let quiz_queue = Stimulus.getControllerForElementAndIdentifier(
                 document.querySelector('#quiz-queue'),'quiz-queue');

do_some_sort_of_reordering(); // ...by manipulating the tags containing the subjects/subjectIDs
quiz_queue.completeSubjectsInOrderValue = true;
quiz_queue.questionOrderValue = 'readingFirst';
quiz_queue.initialize();
quiz_queue.nextItem();

I’ve tested this, it works, and I haven’t noticed any side-effects yet, but I’m new to Stimulus.

As far as I can tell, all the resources from prior calls to initialize(), such as QuizAPI and QuizQueue, should be junk-collected.

Of course, if a userscript does this after the user has already answered some items, it should also keep track of the answered items and make sure they are removed from the initial <script> tags, and I think the other scripters are already aware of that.

2 Likes