Storyline 360 and Java Script

Oct 18, 2017

I have an eModule in Storyline 360 which generates a certificate at the end of the course with the participants name printed on the certificate. However, I cannot get the participants name to show on the certificate when the course is viewed in Safari, Google Chrome, or Microsoft Edge. The only time the certificate works properly is when viewing the course in the Internet Explorer browser. Does anyone have a solution for this issue? Thank you!

Diana Rayburn

1 Reply
Matthew Bibby

There have been some changes to the way Storyline works behind the scenes. As a result, JavaScript that previously grabbed the username may not do so anymore.

This should do the trick:

function findLMSAPI(win) {
if (win.hasOwnProperty("GetStudentID")) return win;
else if (win.parent == win) return null;
else return findLMSAPI(win.parent);
}

var player = GetPlayer();
var lmsAPI = findLMSAPI(this);
var userName = lmsAPI.GetStudentName();
var array = userName.split(',');
var name = array[1] + ' ' + array[0];
player.SetVar("Student_Name", name);

You'll need a text variable called Student_Name in Storyline for this to work.

See this thread for a full discussion.

This discussion is closed. You can start a new discussion or contact Articulate Support.