Javascript 如何从SCORM云获取完成状态值?
我一直在尝试使用一些自定义SCORM内容。在本例中,我使用的是SCORM 2004第四版软件包 如果启动并完成课程,则课程正确显示为已完成,沙盒注册状态显示Runtime Data>cmi.completion\u状态:completed 下面是调试日志的摘录,显示了正在设置的完成状态和最终提交Javascript 如何从SCORM云获取完成状态值?,javascript,scorm,scorm2004,Javascript,Scorm,Scorm2004,我一直在尝试使用一些自定义SCORM内容。在本例中,我使用的是SCORM 2004第四版软件包 如果启动并完成课程,则课程正确显示为已完成,沙盒注册状态显示Runtime Data>cmi.completion\u状态:completed 下面是调试日志的摘录,显示了正在设置的完成状态和最终提交 - [14:01:43.632] SetValue('cmi.completion_status', 'completed') returned 'true' in 0 seconds [14:01:
- [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\u measure,它正确地更新进度显示,并正确地显示在注册状态。再次启动课程时,此数据也是空的
作为参考,我将完成状态设置为:
pipwerks.SCORM.status("set", "completed");
pipwerks.SCORM.save();
进度度量如下所示(其中s.progress为十进制0-1)
从调试日志和注册状态来看,这些功能似乎正常运行,但在重新启动课程时,我无法再次获取这些值
有人能告诉我这里可能发生了什么吗
非常感谢,
Baps。您遇到的问题可能是“模式”(退出模式)设置为正常。根据SCORM规范,如果您以“正常”模式退出课程,然后重新启动课程,所有运行时数据都将重置。如果进入SCORM包装器并将退出模式更改为“挂起”,则在启动之间将保留运行时数据 你可以在pipwerks网站上找到关于这个问题的讨论: 以及如何在pipwerks包装器中设置退出状态的示例(SCORM 2004):
如果您有更多问题,可以联系support@scorm.com. 这将使您与Rustici软件公司的人员取得联系。我们也是提供SCORM云服务的人员。您遇到的问题可能是“模式”(退出模式)设置为正常。根据SCORM规范,如果您以“正常”模式退出课程,然后重新启动课程,所有运行时数据都将重置。如果进入SCORM包装器并将退出模式更改为“挂起”,则在启动之间将保留运行时数据 你可以在pipwerks网站上找到关于这个问题的讨论: 以及如何在pipwerks包装器中设置退出状态的示例(SCORM 2004):
如果您有更多问题,可以联系support@scorm.com. 这将使您与Rustici软件公司的人员取得联系。我们也是提供SCORM云服务的人。设置退出模式确实可以跨会话持久保存数据。实际上,pipwerks包装中的terminate方法在1.2和2004中都涵盖了这一点。谢谢你,托马斯!设置退出模式似乎确实可以跨会话持久化数据。实际上,pipwerks包装中的terminate方法在1.2和2004中都涵盖了这一点。谢谢你,托马斯!
pipwerks.SCORM.data.set("cmi.progress_measure", s.progress);
pipwerks.SCORM.save();
//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();
}