如何从 SCORM 云中获取 completion_status 值?

How do I get completion_status value from SCORM cloud?

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

如果我启动并完成课程,课程会正确显示为已完成,沙盒注册状态会显示运行时数据 > cmi.completion_status:已完成。

以下是调试日志的节选,显示正在设置的 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

所以在这一点上,一切看起来都很好。但是,如果我再次启动课程,结果未知。

- [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,它正在正确更新进度显示,并正确出现在注册状态。同样,再次启动课程时,这个数据也是空的。

作为参考,我将完成状态设置如下;

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

进度指标如下(s.progress为小数0-1);

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

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

任何人都可以提出这里可能发生的事情吗?

非常感谢,

巴普斯。

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

您可以在此处的 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 Cloud 服务的人。