Captivate - LMS - SCORM 通信问题
我正在开发符合 SCORM 标准的 LMS,但在使用 Captivate 生成的内容时遇到一些问题。
基本上,行为是:如果您快速看到 SCO(吸引生成的内容),例如 15 张幻灯片,每张幻灯片中有 1 个问题,则我的 lms 不会跟踪所有 15 个问题,只会跟踪前 3 或 4 个问题。最后的时间很长,或者如果你慢慢地阅读内容,效果很好。
经过大量的谷歌搜索、调试和跟踪,最后,我发现了两个主要问题:
1)Captivate - SCORM API通信是异步的(与flash - javascript通信相同)。所以,当用户快速看到内容时,函数调用会越来越延迟,最后,可能用户正在回答第 15 题,而内容正在发送第 4 题信息。我无法更改 Flash 或 JS-Flash 界面,因为这是由 Captivate 提供的。
有办法让这个同步吗?我的意思是,以某种方式强制闪光灯等待?
2)函数每次调用的时间变长,例如setValue第一次调用需要7毫秒,最后一次调用需要200毫秒。
为了理解这个问题,这里有一些背景知识: Captivate 内容(实际上是所有内容,但更迷人)多次调用特定函数,即 SetValue 函数,SCORM API 函数之一。该函数有两个参数(fieldName,value),第一个是要设置的字段的名称,第二个是新值。在我的实现中,该函数首先使用正则表达式验证值,然后在对象中设置该值。
好吧,我可以添加更多信息,但我不知道真正重要的是什么,我不希望你在没有看到它的情况下修复我的代码,但我没有想法,需要新的意见、想法、方向....也许有人问了正确的问题...帮助:)
谢谢
I'm developing a SCORM compliant LMS, and having some problems with Captivate generated contents.
Basically, the behavior is: If you see a SCO (captivate generated content) with for example 15 slides and 1 question in each slide quickly, my lms is not tracking all the 15 question, only the first 3 or 4. If you wait a long time at the end, or if you take the content slow, it works fine.
After a lot of google searches, and debugging and tracing, finally, I found two main issues:
1) Captivate - SCORM API communication is asynchronous (is the same than flash - javascript communication). So, when the user see the content quickly, the function calls get more and more dealayed, and at the end, maybe the user is answering question 15, and the content is sending question 4 information. I cannot change the Flash or JS-Flash interface, because this is provided by Captivate.
There is a way to make this sync?? I mean, to force the flash wait some way?
2) The functions are taking longer each time they are called, for example, setValue takes 7 milliseconds the first time and 200 the last time is called.
To understand this problem, here is a little background:
Captivate contents (all contents really but more captivate) calls a specific function many times, the SetValue function, one of the SCORM API functions. This function takes two parameters (fieldName, value) the firstone is the name of the field to be set, and the second the new value. In my implementation, this function first validate the value using a regular expression, and then set the value in an object.
Ok, I can add a lot more info, but I don't know what is really important, I'm not hoping you fix my code without seeing it, but I'm out of ideas, and need new opinions, ideas, directions.... maybe that sombody ask the right question... help :)
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
针对 SCORM 进行发布时,Captivate 不使用同步通信方法。* 根据浏览器的不同,Captivate 使用 FSCommand 或老式
getURL
方法与 HTML 文件进行通信;然后,HTML 文件使用 JavaScript 通过 SCORM API 将数据转发到 LMS。响应(如果有)从 JavaScript 中继到 FSCommand 或代理 SWF(对于
getURL
),然后通过回调函数在 Captivate 中进行内部监控。此回调函数使用计时器,这可能就是您的问题所在。如果您将
g_intAPIType
设置为 0,则会强制浏览器使用 FSCommand,但并非所有浏览器和操作系统都支持 FSCommand。将g_intAPIType
设置为 1 意味着您强制浏览器使用getURL
,它是跨浏览器的,但有一些缺点(包括大量的点击声)。在这两种情况下,数据都是通过内部队列脚本发送的,该脚本使用
waitForResponse
回调函数。您遇到的性能问题可能是由于排队造成的,而异步通信由于附加到
waitForResponse
的计时器而使问题变得更加复杂。更改g_intAPIType
可能只会对性能问题产生轻微影响,但使用getURL
(g_intAPIType=1
) 可能有助于提高浏览器与浏览器。无论
g_intAPIType
设置如何,您都无法阻止内部跟踪机制使用异步waitForResponse
函数,因此无法阻止 Captivate 在获取/设置数据时使用计时器;经过一段时间,您可能会开始注意到越来越长的延迟,就像您所描述的那样,尤其是。如果您向 LMS 拨打大量电话。(* 小例外:我已被告知,如果项目是在 AS3 中构建并针对 SCORM 2004 发布的,Captivate 4 和 5 使用ExternalInterface,但看起来队列和
waitForResponse
计时器基本上仍在使用像上面列出的异步方法一样对待ExternalInterface。)When publishing for SCORM, Captivate does not use synchronous communication methods.* Depending on the browser, Captivate uses either FSCommand or the old-school
getURL
method to communicate with the HTML file; the HTML file then uses JavaScript to relay the data to the LMS via the SCORM API.The response (if any) is relayed from JavaScript to either FSCommand or a proxy SWF (for
getURL
), which is then monitored internally in Captivate via a callback function. This callback function uses timers, and that's probably where your problem lies.If you're setting
g_intAPIType
to 0, you're forcing the browser to use FSCommand, which isn't supported in all browsers and operating systems. Settingg_intAPIType
to 1 means you're forcing the browser to usegetURL
, which is cross-browser but has a few drawbacks (including lots of clicking sounds).In both cases, the data is sent via an internal queue script, which uses the
waitForResponse
callback function.The performance problems you're encountering are likely due to the queuing, and the asynchronous communication compounds the problem because of timers attached to
waitForResponse
. Changingg_intAPIType
will probably only have a minor effect on your performance issues, though usinggetURL
(g_intAPIType=1
) may help improve consistency from browser to browser.Regardless of the
g_intAPIType
settings, you cannot prevent the internal tracking mechanism from using the asynchronouswaitForResponse
function, so there is no way to stop Captivate from using timers when getting/setting data; over a period of time you will probably start to notice longer and longer delays like the ones you described, esp. if you're making a lot of calls to the LMS.(* Small exception: I've been informed Captivate 4 and 5 use ExternalInterface if the project is built in AS3 and is published for SCORM 2004, but it appears the queue and
waitForResponse
timers are still used, basically treating ExternalInterface like the asynchronous methods listed above.)一些选项:
您可以改变做题的方式。将所有问题放在 1 帧上,而不是每帧 1 个。
否则,您将需要在 SCORM 播放器 JavaScript 中执行一些 JavaScript 魔法。我首先会使用 JSMin 之类的工具来最小化 JS 代码。
然后尝试缓存 JS 文件,以便它们只加载一次。我怀疑每一帧都会一遍又一遍地调用这些文件。
Some Options:
You could change how you are doing the questions. Instead of 1 per frame put all the questions on 1 frame.
Otherwise, you will need to do some JavaScript magic in your SCORM Player JavaScript. I would start with minimizing the JS code with a tool like JSMin.
Then try to cache the JS files so they are only loaded once. I suspect that the files are being called over and over with each frame.
“有办法实现同步吗?我的意思是,以某种方式强制闪光灯等待?”
显然,问题出在这个:
“Captivate 是唯一异步调用 SCORM JavaScript 函数的 SCO。Firefox 是唯一不强制 SCO 与支持的 JavaScript 之间进行同步通信的浏览器。当在 Firefox 上运行的 Captivate SCO 向其中一个 JS 提交状态更新时,由于 Captivate 的通信非常冗长,并且 JavaScript 不是多线程的,因此 Captivate 不会在提交下一个状态更新之前等待成功或失败响应,因此测验状态提交可能会叠加并相互覆盖。数据 - 特别是对于较长的测验。[...]
如果您想了解任何其他 LMS 的异步问题,请使用 Firefox 进行较长的 Captivate 测验并非常快速回答其中的一些问题。临近结束时的问题将被删除..”(interzoic.com 论坛)
也许是一个解决方案:
“当我强制 g_intAPIType 为 0(进入
.htm 文件),因此它强制 Captivate 进行通信,就像在 IE 中一样。”
"There is a way to make this sync?? I mean, to force the flash wait some way?"
Apparently, the problem is this one :
"Captivate is the only SCO that calls SCORM JavaScript functions asynchronously. Firefox is the only browser that does not force synchronous communications between the SCO and the supporting JavaScript. When a Captivate SCO, running on Firefox, submits a status update to one of the JS functions, Captivate does not wait for a success or fail response before submitting the next status update. Since Captivate is quite verbose in its communications and JavaScript is not multithreaded, quiz status submissions can stack up and overwrite each other. This can cause a loss of data - especially for longer quizzes. [...]
If you'd like to see the asynchronous problem with any other LMS, take a long Captivate quiz using Firefox and answer the questions very quickly. Some of the questions near the end will get dropped.. " (interzoic.com forum)
And maybe a solution :
"The slow issue is resolved when I force the g_intAPIType to 0 (into the
.htm file), so it force Captivate to communicate as if it was into IE."
在 captivate 中,在发布 scorm 时,您将看到选项“最后发送跟踪数据”,
使用此选项,它将解决您的问题。
In captivate, while publishing a scorm you will see option "Send tracking data at the end",
Use this option, it will resolve your problem.