connect to lms from scorm 1.2

551 Views Asked by At

i am trying to connect to LMS from my SCORM package but no connection happen and could not get any data i am using Simplify SCORM and this is my connection code

window.API.LMSInitialize();
        window.API.apiLogLevel = 1;

        console.log('window.API ',  window.API)
        console.log('window.API.cmi ', window.API.cmi)
        console.log('student id ' , window.API.cmi.core.student_id);

        window.API.on("LMSSetValue.cmi.core.student_id", function(CMIElement, value) {
            console.log('hi ', CMIElement , ' ',value)
        });

        window.API.on("LMSInitialize", function() {
            console.log("LMSInitialized ")
            console.log('window.API.cmi ', window.API.cmi)
            console.log('student id ' , window.API.LMSGetValue('student_id'));
        });
1

There are 1 best solutions below

0
On

Simplify Scorm doesn't handle communications with the LMS. That is left to the developer.

window.API.on("LMSCommit", function() {
  console.log("LMSCommit ")
  // use jquery, fetchAPI or XMLHTTPRequest to communicate with LMS
});

You could of course listen to a number of events.