Forum Discussion
Course completion with a code block?
Hi all!
I know that unlocking a continue button with the code block is in the works -- but how about sending course completion?
I attempted to add the script below to a button in my custom code block's JS, but it did not seem to work. Not sure if I'm just missing something? Is this possible?
SCORM2004_CallSetValue('cmi.completion_status', 'completed')
5 Replies
Thanks John_Reddinger !
We are considering this. It would require authors to add the same code snippet we'll be providing to integrate code blocks with continue blocks. Then selecting something like "Track using Code block" in your export settings.
Thoughts on that approach?- John_ReddingerCommunity Member
Hi Kyle_Clements -- sorry, I somehow missed this reply a few weeks ago! Busy month :)
Yeah this would be great!
My use case is that I have an embed block at the end of my course, where I embed a satisfaction survey. The embed block always has some extra white space at the bottom, which often causes a few users to fail to scroll all the way to 100%.
At first I tried to mitigate this by setting the completion percentage a bit lower, which kinda worked but was a bit too inexact for my liking.
Now I'm trying to use a Storyline block with a completion at the start of the timeline -- it seems like on mobile you have to click the play button to get the timeline to start, though. I'm currently trying to figure out a way to make this work -- might just be a matter of making the storyline block literally say "click here to complete the course", I guess.
In any case, the control freak in me would just love to be able to pass completion with anything I want! LOL.
- ChloeArntzenAUCommunity Member
I know this is an old thread... but with the enhancements that have been made over time to the code block it would be AMAZING to be able to have it as an option for tracking course completion.
Having to add Storyline blocks as well adds more maintenance than necessary to the course.- AndrewBlemings-Community Member
If you're comfortable with code blocks, it is possible to use the function call John_Reddinger provided. The SCORM API lives "higher up" than the code block so we just have to prepend the call like so:
window.top.SCORM2004_CallSetValue('cmi.completion_status', 'completed');I just made a quick Rise course with a code block that calls the above function when a button in the code block is clicked, and SCORM cloud registered the completion no problem.
- SamHillLegend
Hi all,
If you want to set completion of a course in Rise using a code block, the cleanest way I have found to do it, is just using a little bit of JavaScript to target the completion function. The completion function will determine which API is being used (SCORM 1.2/2004, AICC, xAPI etc).
Just insert a code block where you want the course to be marked as completed, and make the block as small as possible (it's just there to house JavaScript) and add the following script directly into the block (no upload needed).<!-- This is inserted directly into a Rise code block (not via upload) to trigger the course completion event and set the module complete --> <script> // get the scope const scope = window.parent.parent; // Try and set the module complete try{ scope.parent.SetReachedEnd(); }catch(e){ console.info(`SetReachedEnd failed`, e); } </script>
I would not recommend targeting window.top, as this can result in the incorrect browser frame/window being targeted to execute the function.
I just added the function to a try/catch just in case it fails so you can get debug information.
** DISCLAIMER **
This is undocumented, and the function named "SetReachedEnd" has not been made public by Articulate could be changed in future.
A change would not affect published content. It would only affect content that was published after a change.
Cheers,
Sam
Related Content
- 11 months ago
- 13 days ago
- 6 months ago