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...
philMek
6 years agoCommunity Member
Bravo Matthew !
it works !
Thank you very much.
I changed a few things, as I only need (at this time) the firstname.
Also, my LMS return no space after the comma in studentname().
Here is your code with small modificaitons :
function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);
}
var lmsAPI = findLMSAPI(this);
var name = lmsAPI.SCORM2004_GetStudentName();
var nameArray = name.split(',');
var firstName = nameArray[1];
// var lastName = nameArray[0];
// var fullName = firstName + ' ' + lastName;
var player = GetPlayer();
player.SetVar("Name",firstName);
Do you know why in specification it is said : "cmi.learner_name", and in getting the value : GetStudentName() ?
I am not dying for the answer, just curiosity.
Anyway, you saved me, Talensoft support was unable to answer.
Have a nice day
Philippe