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...
StevenPascoe-cc
6 years agoCommunity Member
Hi, can anyone help me?
This code works for Scorm 1.2.
How do I convert this to Tin Can?
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();
var array = myName.split(',');
var newName = array[1] + ' ' + array[0];
player.SetVar("newName", newName);
Appreciated!