Forum Discussion
Unable to pull student names from Workday Learning LMS
Here's the information I shared with our eLearning developers previously along with the above configuration from Workday. This is 3 years old though!
"What variable do I need to setup to pass learner name to a SCORM package?"
A JavaScript that they used in Storyline;
//See if we're connected to an LMS
function findLMSAPI(win) {
if (win.hasOwnProperty('GetStudentID')) {
return win;
} else if (win.parent == win) {
return null;
} else {
return findLMSAPI(win.parent);
}
}
//Read data from the LMS
var studentName = lmsAPI.GetStudentName(); //returns Last, First
var studentID = lmsAPI.GetStudentID();
//Get the Storyline player
var player = GetPlayer();
//Set Storyline variables
player.SetVar('student_name',studentName);
player.SetVar('student_id',studentID);
//Separate first name and last name
var splitNames = studentName.split(',');
var firstName = splitNames[1];
var lastName = splitNames[0];
//Set more Storyline variables
player.SetVar('first_name', firstName);
player.SetVar('last_name', lastName);