LMS Course Name JavaScript Action

Aug 08, 2023

Morning all,

I am hoping someone will be able to support me here, I am trying to have a JavaScript action that will set my "CourseName" the code i am using is as follows;

var player=GetPlayer();
var course=player.GetVar("CourseName");

player.SetVar("CourseName");

 

I use an LMS and this story-line certificate is embedded in to a Rise package, i have managed to get the Student Name and Date to all pull through from the LMS but i cannot get the Course Name to do the same (example of student name is below incase this is needed)

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

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

26 Replies