gpt4 book ai didi

javascript - 如何从 SCORM 云获取completion_status 值?

转载 作者:行者123 更新时间:2023-11-28 17:42:46 25 4
gpt4 key购买 nike

我一直在使用 pipwerks SCORM API wrapper 尝试一些自定义 SCORM 内容。在本例中,我使用的是 SCORM 2004 第 4 版软件包。

如果我启动并完成类(class),类(class)将正确显示为已完成,并且沙盒注册状态显示运行时数据 > cmi.completion_status:已完成。

Course info

以下是调试日志的摘录,显示了正在设置的completion_status 和最终提交。

- [14:01:43.632] SetValue('cmi.completion_status', 'completed') returned 'true' in 0 seconds
[14:01:43.632] CheckForSetValueError (cmi.completion_status, completed, cmi.completion_status, , )
[14:01:43.632] Element is: completion_status
[14:01:43.632] Call is error free.
[14:01:43.632] StoreValue (cmi.completion_status, completed, cmi.completion_status, , )
[14:01:43.632] Element is: completion_status
- [14:01:43.632] Commit('') returned 'true' in 0.004 seconds
[14:01:43.632] Checking for Commit Error
[14:01:43.632] Call is error free.
[14:01:43.636] CompletedByMeasure is not enabled, using the completion status recorded by the SCO-completed
[14:01:43.636] Scaled Passing Score is not specified, using the success status recorded by the SCO-unknown
[14:09:29.134] Close Out Session
[14:09:29.134] Mode = normal
[14:09:29.134] Credit = credit
[14:09:29.134] Recorded CompletionStatus = completed
[14:09:29.134] Recorded SuccessStatus = unknown
[14:09:29.134] ScaledPassingScore = null
[14:09:29.134] Score = null
[14:09:29.134] CompletedByMeasure = false
[14:09:29.134] Progress Measure = 1
[14:09:29.134] Session Time: (0 hundredths)
[14:09:29.134] Previous Time: PT0H0M0S (0 hundredths)
[14:09:29.134] New Total Time: PT0H0M0S (0 hundredths)
[14:09:29.135] New Tracked Total Time: PT8M13.59S
[14:09:29.135] CompletedByMeasure is not enabled, using the completion status recorded by the SCO-completed
[14:09:29.135] Scaled Passing Score is not specified, using the success status recorded by the SCO-unknown

所以现在看来​​一切都很好。但是,如果我第二次启动该类(class),结果是未知的。

- [14:19:20.067] GetValue('cmi.completion_status') returned 'unknown' in 0.003 seconds
[14:19:20.069] Checking for GetValue Error
[14:19:20.069] Element is: completion_status
[14:19:20.069] Call is error free.
[14:19:20.070] RetrieveGetValueData (cmi.completion_status, cmi.completion_status, , )
[14:19:20.070] Element is: completion_status
[14:19:20.070] CompletedByMeasure is not enabled, using the completion status recorded by the SCO-unknown

我还存储 cmi.progress_measure ,它正确更新进度显示,并正确显示在注册状态中。同样,当再次启动类(class)时,该数据也是空的。

作为引用,我将完成状态设置如下;

pipwerks.SCORM.status("set", "completed");
pipwerks.SCORM.save();

进度测量如下(其中 s.progress 是小数 0-1);

pipwerks.SCORM.data.set("cmi.progress_measure", s.progress);
pipwerks.SCORM.save();

从调试日志和注册状态来看,这些似乎运行正常,但当我重新启动类(class)时,我无法再次获取这些值。

任何人都可以建议这里可能发生什么吗?

非常感谢,

巴普斯。

最佳答案

您遇到的问题可能是“模式”(退出模式)设置为正常。根据 SCORM 规范,如果您以“正常”模式退出类(class),然后重新启动类(class),所有运行时数据都将被重置。如果您进入 SCORM 包装器并将退出模式更改为“挂起”,则运行时数据将在两次启动之间保留。

您可以在 pipwerks 网站上找到有关此问题的讨论:

https://pipwerks.com/2008/05/10/cmicoreexit-cmiexit/

以及如何在 pipwerks 包装器中设置退出状态的示例 (SCORM 2004):

//the status gets set by your course code
var courseStatus = "incomplete";
function quit(){
if(courseStatus === "completed"){
scorm.set("cmi.exit", "logout");
} else {
scorm.set("cmi.exit", "suspend");
}

scorm.quit();
}

如果您有更多问题,可以联系support@scorm.com。这将使您与 Rustici Software 的人员取得联系。我们也是提供 SCORM 云服务的人。

关于javascript - 如何从 SCORM 云获取completion_status 值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47555134/

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