Forum Discussion
Course completion with a code block?
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
- 6 months ago
- 13 days ago