Forum Discussion
Getting student name from the LMS and using it in Articulate
Thanks for the fast reply Matthew. You can tell I'm very new to javascript.
The problem I am getting is that at the start of the name it says 'undefined'. I tried a code from another thread on here to only show the first name and that worked fine (pasted below), but for things like certificates etc it would be nice to have the full name pull through.
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);ar("newName", newName);
I'm using the most up to date version of storyline 360, and exporting the to scorm 1.2.
Thank you