Forum Discussion
Getting student name from the LMS and using it in Articulate
I know this is an old thread but I'm hoping someone can help me here. I'm very much a beginner.
I have used the code below (from earlier in this thread) and it works great. The student ID bit isn't working for me, it just shows on the LMS as 'undefined', which is fine because I don't want the ID, I only want the name but have no idea how to amend the code to remove the ID bit.
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);
Any help would be really appreciated. Thanks :)