How to detect SCORM version in javascript within a Storyline 360 course?
Nov 05, 2018
Good Day!
I am currently building a project in Storyline 360 and among the requirements were to have a multi-version compatibility among SCORM 1.2, SCORM 2004 and AICC. I have a javascript within my Storyline course which uses the SCORM_GetStudentName() function from the LMS and was published as SCORM 1.2 which worked fine.
For my second test, I've added SCORM2004_GetStudentName() along with my previous code assigned them to a variable and checked for null which I I thought should be working (but didn't) since all of the js files are in the LMS.
My question is: How do I check for the SCORM version within javascript inside my Storyline course.
So far this is my code but it does not work for every SCORM version. I uploaded my course through SCORM Cloud.
var player = GetPlayer();
var tempS2004 ="";
var tempS1 ="";
var tempA="";
var student="";
var suspendData =SCORM2004_GetDataChunk();
tempS1 = SCORM_GetStudentName();
tempS2004 = SCORM2004_GetStudentName();
tempA = AICC_GetStudentName();
alert(tempS1+" "+tempS2004+" "+tempA);
if(!suspendData){
player.SetVar("userName",student);
}else{
player.SetVar("userName",suspendData);
}
var username= player.GetVar("userName");
AICC_SetDataChunk(username);
SCORM2004_SetDataChunk(username);
SCORM_SetDataChunk(username);
Any help would be very much appreciated.
3 Replies
Hi Christian and welcome to E-Learning Heroes :)
I see that you were able to reach out to our support team as well and work with Jon.
Looks like you were able to identify a solution that worked for you on your own!
Thanks for checking up on me, yes I found a solution that worked for me. I used an lmsAPI function which was apparently a wrapper for the different learning standards.
You can use this code to get the scorm version.
This discussion is closed. You can start a new discussion or contact Articulate Support.