Pulling cmi.interaction values

Hi,

 

I need to pull this cmi.completion_status from the LMS and display it on storyline. I know  that we need to use JS to do this but can you guide me the right codes? 

Here is my sample codes:

function findLMSAPI(win)
{
// look in this window
if (win.hasOwnProperty("GetStudentID")) return win;
// all done if no parent
else if (win.parent == win) return null;
// climb up to parent window & look there
else return findLMSAPI(win.parent);
}

var player = GetPlayer();
var lmsAPI = findLMSAPI(this);
var myName = lmsAPI.GetStudentName();
var newID = lmsAPI.GetStudentID();
var compSYS = lmsAPI.LMSGetVar("cmi.completion_status");
player.SetVar("newName", myName);
player.SetVar("newID", newID);
player.SetVar("dialog", compSYS );

 

Please help.

Thank you very much,

Vowie

 

 

1 Reply
Russell Killips

Hello,

cmi.completion_status is a data element of SCORM 2004. Therefore, your project will need to be published for SCORM 2004.

var compSYS = lmsAPI.SCORM2004_CallGetValue("cmi.completion_status");

Here is a sample project for you to take a look at. I tested it in the SCORM Cloud.