get learner's details from LMS

Mar 31, 2022

Hello,

I’m trying to get the learner’s details from the LMS, using java script.

I used the following code:

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);

// *** The following code is working ***

var myName = lmsAPI.GetStudentName();

var myID =  lmsAPI.GetStudentID();

 

// *** The following code is NOT working ***

var myChunk = lmsAPI.GetDataChunk();

var myLaunchData = lmsAPI.GetLaunchData();

var myLNG = lmsAPI.GetLanguagePreference();

The functions reference appears in the link below:

http://rustici-docs.s3.amazonaws.com/driver/Function-List.html#shared-state

for some reason, the learner’s name and ID was passed successfully, but all 3 other functions did not.

Does anyone know how to solve this?

Thank you.

2 Replies
Joseph Francis

As your referenced document states at the top:

Functions marked with an asterisk (*) may not be supported on all LMSs.

While several SCORM data elements are required for communication between content object and LMS, many more are not. DataChunk, LaunchData, and LanguagePreference, while nice to have, are entirely up to the LMS vendor to either provide or not provide.

If you know your LMS is providing these data elements, then I would get in contact with the vendor to see if there are other requirements to access/update them.