Learner/user's name not displaying on the Certificate from LMS in SCORM 2004 4th Edition Feb 18, 2019 By Swapnil Bharsakale I have added certificate in Storyline 3 and added below script in execute JavaScript window: var player = GetPlayer(); var myName = lmsAPI.GetStudentName(); var array = myName.split(','); var newName = array[1] + ' ' + array[0]; player.SetVar("newName", newName); Also, made variable as "newName" I have published the package as SCORM 2004 - 4th Edition as per client requirement. But, the user/learner's name is not displaying on the certificate when it's view on cornerstone LMS. It is working fine in Cloud SCORM LMS. Please advise for the same. Thanks, Swapnil
krishna paralkar almost 5 years ago05/04/19 at 8:39 am (UTC) Hi Swapnil, We are facing the same issue on our modules on cornerstone. Did you achieve any success? Best Regards, Krishna
Russell Killips almost 5 years ago05/04/19 at 1:59 pm (UTC) Try removing these two lines of code. They are for switching Lastname, Firstname to: Firstname Lastname The switching may not be needed in your LMS. var array = myName.split(','); var newName = array[1] + ' ' + array[0]; Then change the player.SetVar line of code to: player.SetVar(“newName”,myName);
Zsolt Olah Hero krishna paralkar almost 5 years ago05/05/19 at 12:36 pm (UTC) To troubleshoot add the following lines: var player = GetPlayer(); console.log("lms",lmsAPI); var myName = lmsAPI.GetStudentName(); console.log("myName", myName); var array = myName.split(','); console.log("namearray", array); var newName = array[1] + ' ' + array[0]; player.SetVar("newName", newName); When you run the code, open the console (on Chrome it's in Developer tools Ctrl+Shift+I). And see what the output is in the console. Here are the potential problems: - if lms displays undefined, the whole lmsAPI is missing - if myName displays an empty string or nothing than then you name is not returned from the lms - if myName does not have a comma "Zsolt Olah" then you don't need the array part, you can just set the the SL variable newName to the myName Or just take a screenshot and post it here :)
3 Replies
Hi Swapnil,
We are facing the same issue on our modules on cornerstone. Did you achieve any success?
Best Regards,
Krishna
Try removing these two lines of code. They are for switching Lastname, Firstname to: Firstname Lastname
The switching may not be needed in your LMS.
var array = myName.split(',');
var newName = array[1] + ' ' + array[0];
Then change the player.SetVar line of code to:
player.SetVar(“newName”,myName);
To troubleshoot add the following lines:
var player = GetPlayer();
console.log("lms",lmsAPI);
var myName = lmsAPI.GetStudentName();
console.log("myName", myName);
var array = myName.split(',');
console.log("namearray", array);
var newName = array[1] + ' ' + array[0];
player.SetVar("newName", newName);
When you run the code, open the console (on Chrome it's in Developer tools Ctrl+Shift+I). And see what the output is in the console.
Here are the potential problems:
- if lms displays undefined, the whole lmsAPI is missing
- if myName displays an empty string or nothing than then you name is not returned from the lms
- if myName does not have a comma "Zsolt Olah" then you don't need the array part, you can just set the the SL variable newName to the myName
Or just take a screenshot and post it here :)
This discussion is closed. You can start a new discussion or contact Articulate Support.