自动向LMS发送SCORM数据
Automatically send SCORM data to LMS
到目前为止我有这个代码…
function sendData() {
// this work out where I am and construct the 'cmi.core.lesson.location' variable
computeTime();
var a = "" + (course.length - 1) + "|";
for (i = 1; i < course.length; i++) {
a = a + qbin2hex(course[i].pages).join("") + "|";
if (iLP == 1) {
a = a + course[i].duration + "|";
a = a + course[i].timecompleted + "|"
}
}
SetQuizDetails();
a = a + course[0].quiz_score_running + "|0|0|0|0|0|0|";
objAPI.LMSSetValue("cmi.core.lesson_location", "LP_AT7|" + a);
bFinishDone = (objAPI.LMSCommit("") == "true");
objAPI.LMSCommit("");
console.log("Data Sent!");
}
setTimeout(sendData(), 1000);
然而,它似乎没有像预期的那样工作。数据应该每1000毫秒发送一次到服务器,但事实并非如此。我遗漏了什么?
作为我的旁注,这是SCORM 1.2。
调用
setTimeout(sendData(), 1000);
相当于
var foo = sendData();
setTimeout(foo, 1000);
看到sendData
不返回任何值,这就等价于
setTimeout(undefined, 1000);
你的意思可能是:
setTimeout(sendData, 1000);
相关文章:
- 用程序搜索JQuery数据表中的文本
- 要求输入在数据列表中
- 正在将数据主题添加到所有项目
- 函数参数中的数据与指定变量之间的任何性能差异
- 在VanillaJS中模拟模型双向数据绑定
- CSS-如何定位内容数据标题
- 使用电话间隙在Android应用程序中显示SQL Lite的数据
- 无法在数据endVal中设置值=“”;{{ucount}}”;使用Angular JS的CountUp
- 序列化数据属性中对象的最可靠方法
- 如何将JSON数据导入我的ejs模板
- 不显示带有本地json文件数据的谷歌地图脚本
- 如何将json数据显示为html
- 画布数据到图像
- 使用jquery将mysql数据获取到新的表行中
- 使用html中的外部javascript进行数据验证
- 有时数据是't显示在浏览器中
- 将数据从 SCORM 播放器发送到 LMS
- SCORM:这是向LMS提交数据的正确行为吗?
- 自动向LMS发送SCORM数据
- 访问scorm数据/包