Forum Discussion
AdamTrosper
8 years agoCommunity Member
lmsAPI Functionality in HTML5 Output
Hey all,
I've been searching through the forums and haven't been able to find anything solid. I'm using Storyline 360, outputting to both HTML5 and Flash to cover my bases, since the audience doe...
ChrisPerez-f9f6
7 years agoCommunity Member
Just wanted to report in - this is the working code for Cornerstone LMS using HTML5 and SCORM 2004 publishing in Storyline 360 if you just want the first name (variable in SL would be 'newName'):
var player = GetPlayer();
function findLMSAPI(win) {
// look in this window
if (win.hasOwnProperty("GetStudentID")) return win;
// all done if no parent
else if (win.parent == win) return null;
// climb up to parent window & look there
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
var myName = lmsAPI.GetStudentName();
// remove last name from array
var array = myName.split(' ');
var newName = array[0];
player.SetVar("newName", newName);