Retrieve name variable from Cornerstone and display it in a Storyline course

Hi,

I am having trouble with retrieving a user's name from the LMS and inserting it into a Storyline 2 course.  I am using Cornerstone LMS and building courses in SCORM 1.2 (I would use SCORM 2004 but Cornerstone have issues with that...)

Below is the JS I've tried, any ideas?

var player = GetPlayer();
var myName  = lmsAPI.GetStudentName();
var array  = myName.split(',');
var newName = array[1] + '  ' + array[0];
player.SetVar("newName", newName);

var player = GetPlayer(); 
var myName = SCORM_GetStudentName();
var array = myName.split(',');
var newName = array[1] + ' ' + array[0];
player.SetVar("newName", newName);

I've got a variable in Storyline called newName and the JS triggers when the timeline starts, or failing that, when the user presses a button on screen.

10 Replies
Kamil Nowek

Nick, please check if something is getting from your LMS using function alert:

var player = GetPlayer();
var lmsAPI = parent;
var myName = lmsAPI.SCORM_GetStudentName();
alert("my name "+myName);

Now you're able to see if LMS let you get something. And please check your course using other LMS f.e. cloud.scorm.