gpt4 book ai didi

javascript - 不正确的闪存包

转载 作者:行者123 更新时间:2023-12-03 08:54:10 26 4
gpt4 key购买 nike

我有一个 SCORM 包,由几个 swf 和播放器组成。然而,当用户从 LMS 启动内容时,播放器初始化不正确或损坏,当然它无法按预期工作和运行。有一个包的控制台日志可以提供一个想法。

Synchronous XMLHttpRequest on the main thread is deprecated because of its   detrimental effects to the end user's experience. For more help, check     

http://xhr.spec.whatwg.org/.
Initializing SCORM class...ExternalInterface.available evaluates true.
SCORM.isAvailable() evaluates true. SCORM class file check, ready.
SCORM.connect() called from class file
connection.initialize called.
SCORM.API.find: API found. Version: 2004
API: [object Object]
SCORM.data.get(cmi.completion_status) value: unknown
__connectionActive: true
SCORM.data.get(cmi.location) failed.
Error code: 403
Error info: hata
SCORM.data.get(cmi.location) value:
SCORM.get(cmi.location) failed.
Error code: 403
Error info: hata
public function get returned:
SCORM.data.get(cmi.entry) value: ab-initio
public function get returned: ab-initio
SCORM.data.get(cmi.location) failed.
Error code: 403
Error info: hata
SCORM.data.get(cmi.location) value:
SCORM.get(cmi.location) failed.
Error code: 403
Error info: hata
public function get returned:
SCORM.data.get(cmi.learner_name) value: test test
public function get returned: test test

最佳答案

日志表明类(class)正确启动。 “错误”实际上是正确的行为:如果类(class)是 ab-initio(首次启动),则请求书签 (cmi.location) 将导致错误。没有书签,因为尚未创建。

如果您希望类(class)有书签——即您正在重新启动类(class),但它的行为仍然像是从头开始——我猜您没有正确使用Commit(将数据发布到 LMS 后,和/或不发出 Terminate (scorm.quit)在关闭类(class)之前。

根据下面的评论进行更新

如果您的类(class)检查 cmi.entry 并看到 ab-initio,则无需查找书签。您应该使用条件语句来防止错误并减少 LMS 和类(class)之间的干扰:

var bookmark = "my default";
var entry = scorm.get("cmi.entry");
var location; //wait for it...

if(entry !== "ab-initio"){

//not querying cmi.location unless we're sure this isn't the first visit
location = scorm.get("cmi.location");

//Wrapping in a conditional in case cmi.location returns false or an empty string
if(location){ bookmark = location; }

}

courseFunctionThatUsesBookmarkValue(bookmark);

关于javascript - 不正确的闪存包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32580734/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com