从scorm 1.2连接到lms

问题描述

我正在尝试从我的SCORM软件包连接到LMS,但是没有连接发生,并且无法获取任何数据,这是我使用的简化SCORM,这是我的连接代码

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

解决方法

Simplify Scorp 不处理与 LMS 的通信。这留给开发者。

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

您当然可以收听许多事件。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...