Forum Discussion
Saving checkboxes in Rise
Hey guys,
I saw Mike Amelang’s inventive solution to create a Learning Journal in Rise, and it inspired me to post something similar!
Recently our team built an observational checklist in Rise, only to discover that Rise doesn’t save the value of checkbox lists between sessions! ☹️ I’ve seen other people on these forums disappointed by this as well, so I thought I would share our hotfix solution. This will make it so that your Rise course will keep checkboxes ticked/unticked between sessions.
What you’ll need:
- My checkbox.js script (Right click > Save As…)
How to use it:
- Unzip your Rise SCORM .zip file and
- Navigate to the '[RISE COURSE]\scormcontent\' subfolder
- Copy 'checkboxes.js' into this folder
- Open 'index.html' in a text editor (e.g. Notepad++)
- Search for the following line of code:
<script type="text/javascript" src="lib/lzwcompress.js"></script>
And paste this line below it:<script type="text/javascript" src="checkboxes.js"></script>
- Search for the following line of code:
const data = JSON.parse(stringData);
And REPLACE it with these lines:stringData = stringData.split("checkbox");
convertSuspendedData(stringData[1]);
const data = JSON.parse(stringData[0]); - Search for the following lines of code:
function concatLMSData(data) {
And REPLACE it with these lines:
assign(cache, data);
LMSProxy.SetDataChunk(compress(cache));
}function concatLMSData(data) {
assign(cache, data);
saveCheckboxes();
checkboxData = JSON.stringify(checkboxMap);
LMSProxy.SetDataChunk(compress(cache) + "checkbox" + checkboxData);
} - Re-zip your course and upload to your LMS
NOTE: This script only tracks “Checkbox list” block types.
How it works (for those interested):
Identifying and tracking checkboxes
Blocks in Rise are loaded procedurally as the user scrolls, and each lesson is effectively a separate webpage which animates in and out as the user navigates.
This immediately throws up obstacles for identifying when and where certain blocks are used in a course because they will rarely be displayed ‘all at once’. As a result, using JavaScript to find and keep track of all the checkboxes in a course isn’t as simple as just accessing the DOM to count each checkbox element on the page. Instead, the script keeps track of each checkbox as it loads in and out of existence (as well as their respective states, and respective lesson associations).
When a user accesses a lesson in Rise, the lesson ID will be appended at the end of the page URL:
By using JavaScript, each checkbox on the page is associated with its respective lesson ID by appending it as an additional attribute:
When the user jumps to another lesson, the lesson ID in the URL changes with it. This is when the script counts the checkboxes again, but this time excludes the checkboxes with the old lesson ID. It then assigns the new lesson ID to the new checkboxes loading onto the page.
At the same time, these lessons IDs and checkboxes get saved into a variable (called checkboxMap), where the lesson ID is used as a property, and the corresponding checkboxes are saved into its value as an array.
checkboxMap variable:
Every time the user navigates, the script cross-checks this variable with the lesson ID from the URL to determine whether or not the lesson had already been visited. If the lesson ID is not found in the variable, it will be added as a parameter and will continue to track the checkbox states as normal. However, if the lesson ID is found, it will reference the values in the array next to it and mark each of the boxes and checked/unchecked.
Appending this information to the suspend data
The checkbox data needs to be converted into a simpler format so that it could be transmitted and stored by the LMS. The JSON.stringify() method does this automatically by converting object variables into text strings. After converting the checkboxMap variable into a string, it gets appended onto the end of Rise’s suspend data:
Modified suspend data output:
White = Rise’s auto-generated suspend data
Blue = Separator keyword
Yellow = Custom checkbox suspend data
These two chunks of data also get separated immediately upon resuming a course. Otherwise, Rise would attempt to parse the checkbox information (which it doesn’t understand) and corrupt the session. This is done using the split() method with the separator keyword:
After separating the checkbox data, it gets converted back into the checkboxMap variable using the JSON.parse() method. The script then continues to operate as normal – counting checkboxes in each lesson and applying the checked/unchecked states to them.
Further reading:
Forum discussions:
https://community.articulate.com/discussions/rise-360/forcing-completion-of-a-checkbox-list
Suspend data:
https://articulate.com/support/article/Rise-Exceeding-SCORM-Suspend-Data-Limits
https://elearningindustry.com/getting-started-with-scorm-tracking-course-specific-data
https://scorm.com/scorm-explained/technical-scorm/run-time/run-time-reference/
LinkedIn post:
Let me know if you have any questions or suggestions to improve the script! 😊 I know this method is not ideal for most people, so it would be great if Articulate implements this as an official feature at some point.
- EmilyRardinCommunity Member
Hi Ben,
My teammate and I were thrilled to find this code, thank you so much for sharing it!
We are currently running into an issue where the final checkbox that was checked will not save if the learner doesn't advance to the next lesson. It doesn't matter how many or few boxes are selected or the location within the list, the final checkbox will always appear blank when the course relaunches.
I'd love to know if you've seen this happen before or have any advice on a solution. I'm a newbie with code so this is uncharted waters.
- KristenConoleyCommunity Member
Hi Emily! Curious if you all every determined why the last checkbox selected wasn't saving? I'm running into the same thing with my course, and was wondering if you all every found a solution, and if so, if you'd be open to sharing? Thanks so much!
- RobertBadgerCommunity Member
Hi Ben, this is absolutely fantastic!
Thank you for sharing, works perfectly!!- DrewKlassenCommunity Member
I,m also finding similar bug, I am getting checkboxes to save, though have issues within a lesson if not all checkboxes are ticked before the user exits. I think I've seen it sometimes save checkboxes, and other times not save them. Something Im sure related to what you've mentioned in response to Jennifer above.
Really appreciate your expertise in making this!
- JennaHilliard-0Community Member
Hello Ben. Thank you so much for sharing this - this has been a great time saver as I thought I was going to have to re-do my course in storyline to make our 90 day onboarding checklists work properly.
- MaggieAllanCommunity Member
This is exactly what I am looking for, however I am not so great on computers and steps 1-5 are slightly confusing to me. Can anyone help? How do I unzip a scorm file?
- JonathanCatl968Community Member
Hi Ben, is there a way to add this code into a Rise course that has been exported as a web page?
- KirstyClarkCommunity Member
Hi Ben, thanks so much for this solution! Would love to know if there is a way to 'clear' all the checks. I'm looking to use my check boxes as a process they can repeat so would also need to be able to clear them.
Thanks again - love seeing people coming up with great workarounds. - MaryBethPerrow-Community Member
Beautiful - this is exactly what I needed - thanks for sharing!!!
- BelleGarciaCommunity Member
Hi guys! Please, we added this code to different files and it seems the behavior is not consistent. It only worked for 1 of the files. Has anyone experienced anything similar?
- MiguelBaranda-5Community Member
I haven't tried this work around, but you're right. It would be absolutely useful if Rise creates tracked observation checklists.
It would be even better if an observer could:
- add comments about each checklist item, or
- in a comment box at the end of the checklist.
- AmberRominger-1Community Member
One of my checkboxes won't save, but the others do. Any solution yet?