Javascript and LMS information

Apr 13, 2018

Hello community,

I am hoping someone on here can help answer this question.

I have a Storyline 360 course on a Moodle (version 3.2) platform. I published in in a SCORM (1.2) package and uploaded to the LMS. In the Storyline course is the following JavaScript function:
var lmsAPI = parent
var name = lmsAPI.GetStudentName();
var nameArray = name.split(",");
var fullName = nameArray[1] + " " + nameArray[0];
var player = GetPlayer();
player.SetVar("printUserName",fullName);

and this JavaScript function:
var player = GetPlayer();
var myName = lmsAPI.GetStudentName();
var array = myName.split(',');
var newName = array[1];
player.SetVar("newName", newName);

The issue I am having is that when I published the course as a Flash presentation the JavaScript function worked fine. The JavaScript pulls the learners name from the LMS without any issues. But when I publish as an HTML5 file, it stops working.

Any thoughts on this? Does JavaScript not work in an HTML5 presentation?

Thanks for any help.

 

Be the first to reply

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