JavaScript Scorm 1.2 API

发布于 2024-07-24 09:50:46 字数 1542 浏览 11 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

十级心震 2024-07-31 09:50:46

我最近创建并提供了一个简单的 SCORM(1.2) API,您可以免费下载和使用 - 您可以从这里下载:

https://github.com/gabrieldoty/simplify-scorm

I recently created and made available a simple SCORM(1.2) API you can download and use freely - you can download from here:

https://github.com/gabrieldoty/simplify-scorm

你如我软肋 2024-07-31 09:50:46

看看这个:http://scormpool.com/search/player.aspx

我能够下载他们的 JavaScript 文件并玩我自己的 SCORM 1.2 以及 2004 课程。

确保下载两个不同的 API.js 文件,一个用于 1.2,另一个用于 2004。

Check this out: http://scormpool.com/search/player.aspx

I was able to download their JavaScript files and play my own SCORM 1.2 as well as 2004 courses.

Make sure you download two different API.js files, one for 1.2 and another for 2004.

相思故 2024-07-31 09:50:46

曾经有一个名为“escorte4js”的示例 SCORM 运行时 API 实现,但它不再可以从其创建者的网站下载。 您可以尝试搜索它,看看在应用程序中使用它的人是否仍然有可以发送给您的副本。

您还可以查看 ADL 示例运行时环境。 它是一个开源应用程序,包含 SCORM 1.2 的参考实现。

还有一些开源 LMS 已经实施了 SCORM 1.2(取得了不同程度的成功)。 你可以看看 Moodle、Illias 或 Sakai。

实现真正兼容的 SCORM 播放器比乍看起来要困难。 实施规范只是第一步。 SCORM(或实际上任何互操作性标准)的真正技巧是找出其他人以不同方式解释标准的所有微妙方式,并确保您的实施足够灵活以适应所有这些差异。 我最近写了一篇关于该主题的博客文章这可能会让您感兴趣。 查看同一站点的 SCORM 解释部分,了解更多免费 SCORM 资源。

麦克风

There used to be a sample SCORM run-time API implementation called "escorte4js" but it is no longer downloadable from its creator's site. You might try searching for it to see if somebody who used it in an application still has a copy they can send you.

You can also take a look at the ADL Sample Run-time Environment. It is an open source application that contains a reference implementation of SCORM 1.2.

There are also several open source LMS's that have implemented SCORM 1.2 (to varying degrees of success). You could look at Moodle, Illias or Sakai.

Implementing a truly compatible SCORM player is harder than it first looks. Implementing the specification is just the first step. The real trick to SCORM (or really any interoperability standard) is figuring out all of the subtle ways in which others have interpreted the standard differently and ensuring that your implementation is flexible enough to accommodate all of those differences. I recently wrote a blog post on that topic that might interest you. Look under the SCORM Explained side of that same site for more free SCORM resources.

Mike

川水往事 2024-07-31 09:50:46

Michael,

好消息 - SCORM 1.2 的大部分内容都是可选的(请参阅下面我的细分文档)。 现在取决于构建与购买,其他帖子是正确的。 价格各不相同,并且通常它们附带一些针对 .NET/Java 或其他方式预先创建的平台代码。

我只构建了 JavaScript 部分,但它仍然需要您将其与 LMS 后端服务器端脚本或 API 进行交互。

我将尝试快速分解这一切是如何工作的,并为您节省阅读数百页白皮书的时间。

主要部分

  1. 服务器端您需要解压称为 CAM 或 PIF 包的 SCORM 包。 其中包括小型便携式网站和 imsmanifest.xml。
  2. 您需要能够解析此 imsmanifest.xml,以便提取标题以及内容使用的资源。 通常,您将它们放入内容共享中,并可能将数据点存储到数据库或 NOSQL 选项中。
  3. imsmanifest 中可能包含启动数据或启动参数,这些启动数据或启动参数会在 SCO 启动时添加。 启动参数像查询字符串一样添加到 URL 中 (index.html?name=value&sky=blue)
  4. 您必须在 LMS 中构建目录视图或课程查看器。 当学生单击所需的模块时,您将需要获取学生对 SCORM 1.2 的尝试。 我使用 JSON 来支持 CMI 对象。 有些内容暂停,有些内容只是启动然后终止。
  5. 一旦您让学生尝试该课程,您将需要公开“API”JavaScript 运行时,并支持对学生尝试(CMI 对象)的读/写。 SCORM 有一些关于该对象的进出的规则,并且运行时 API 强制执行它。
  6. 有一些关键因素会触发您将学生尝试存储到后端服务器。 我在 LMSCommit 上执行此操作。 如果您对每个 LMSSetValue 执行此操作,您将开始对您的服务器进行 DDoS 攻击。 DNS 响应时间最终将滞后超过 250 毫秒,并且您的用户体验可能很差。
  7. 一旦 SCO 触发 LMSFinish,即表示您可以结束学生尝试,并可能卸载 SCO。

还有更微妙的部分维护内容的启动/重新启动。 LMS 总时间(运行内容)。 如果您选择支持目标和交互。 如果您寻求 100% 的全面支持,那么规范中几乎没有什么问题。 内容开发人员在将内容转移到其他 LMS 平台时不可避免地会遇到其中的一些问题。

SCO SCO

通常包含必要的 JavaScript,用于查找您通过弹出窗口、新窗口、选项卡或 IFRAME 在 LMS(在网页上)公开的“API”变量。 它有一个算法来扫描 DOM。 这就是为什么我在上面告诉您,您的 LMS 需要在启动 SCO 之前公开学生尝试和“API”。 如果不这样做,很可能会导致 SCO 以非持久模式运行。

SCORM 1.2 的运行时

您需要创建的 JavaScript 基本概念。
您需要一个名为“API”的 JavaScript 函数对象。
这需要支持方法:

  • LMSInitialize()
  • LMSGetValue(key)
  • LMSSetValue(key, value)
  • LMSCommit()
  • LMSFinish(
  • LMSGetLastError()
  • LMSGetErrorString()
  • LMSGetDiagnostic()

我在 https://github.com/cybercussion/SCOBot/wiki 以及完整的 SCORM 1.2, 2004 细分。
https://dl.dropboxusercontent.com/u/ 3459294/SCOBot-Content-API-Standards-Breakdown.pdf

提示

因此,如果您知道自己在做什么,那么您可以在几天到一周内完成一些工作。 如果没有任何知识,这可能需要几个月的时间才能完善。 正如我在上面试图强调的那样,还有很多其他依赖项。 SCO、imsmanifest.xml、运行时 API、学生尝试以及所有管理以及了解要侦听或触发的内容。 这是这种更大的努力花费美元的主要原因。 尝试从 Moodle 等开源项目或上面发布的一些古老链接中挑选和提取只会让您到目前为止。 老实说,它们中的大多数与 LMS 紧密结合,您会花更多的时间来梳理它,而不是从头开始编写自己的代码。
我从 2009 年到 2015 年建造了我的。 我从根据知识共享许可提供的内容 API 开始。 我将运行时 API 与它一起构建为单元测试的形式。 后来,决定通过 USB 棒或服务器将其作为螺栓捆绑到其他人的平台、Android/iOS 项目、Electron/NodeJS 应用程序上。

祝你好运。

Michael,

Good news - most of SCORM 1.2 is optional (see my breakdown doc below). Now depending on build vs buy, the other posts are correct. This can range in price, and commonly they come with some pre-created platform code either for .NET/Java or otherwise.

I built out just the JavaScript portion but it still requires you interface that with your LMS backend server side scripts or API's.

I will attempt to quickly break down how this all works and save you a little time reading hundreds of pages of a white paper.

Main parts

  1. Server side you'll need to unzip SCORM Packages called CAM or PIF packages. These include the little portable website, and a imsmanifest.xml.
  2. You'll need to be able to parse this imsmanifest.xml so you can extract the Title, and resources used by the content. Typically, you toss these into a content share, and possibly store the data points into your Database or NOSQL option.
  3. There possibly are launch data or launch parameters contained within the imsmanifest which get added when the SCO is launched. Launch Parameters get tacked into the URL like a query string (index.html?name=value&sky=blue)
  4. You have to build out a TOC view or Lesson Viewer in your LMS. When the student clicks a desired module you'll need to obtain the student attempt for SCORM 1.2. I use JSON to support the CMI Object. Some content suspends, some just launches and terminates.
  5. Once you have the student attempt for that lesson, you'll need to expose the "API" JavaScript Runtime, and support read/writes to the student attempt (CMI Object). SCORM has some rules about the in's and out's of that object and the Runtime API enforces it.
  6. There are key things that trigger you to store the student attempt to your backend server. I do this on LMSCommit. If you do it on every LMSSetValue, you'll begin to do a DDoS attack on your server. DNS response times will end up lagging over 250ms and you can potentially have a poor UX.
  7. Once the SCO triggers a LMSFinish, that is a sign you can end the student attempt, and possibly unload the SCO.

There are more subtle parts maintained launch/relaunch of content. LMS total time (running the content). If you opt to support Objectives and Interactions. There are little gotchya's in the specification if you go for a full 100% support. Content Developers inevitably run into some of these when taking their content to other LMS Platforms.

The SCO

The SCO commonly contains the necessary JavaScript to find the "API" variable you've exposed at your LMS (On the web page) via a popup, new window, tab or IFRAME. It has a algorithm to scan the DOM for it. This is why I informed you above that your LMS needs to have the student attempt and the "API" exposed before you launch the SCO. Failure to do that will most likely result in the SCO running in a non-persisted mode.

The Runtime for SCORM 1.2

Base concept of the JavaScript you'll need to create.
You need a JavaScript Function Object called "API".
This needs to support methods:

  • LMSInitialize()
  • LMSGetValue(key)
  • LMSSetValue(key, value)
  • LMSCommit()
  • LMSFinish(
  • LMSGetLastError()
  • LMSGetErrorString()
  • LMSGetDiagnostic()

I have a bunch of Wiki docs on https://github.com/cybercussion/SCOBot/wiki as well as the complete SCORM 1.2, 2004 breakdown.
https://dl.dropboxusercontent.com/u/3459294/SCOBot-Content-API-Standards-Breakdown.pdf

Tips

So ballpark time if you know what you are doing you could stand something up in a few days to a week. Without any knowledge, this could take you a few months to perfect. As I've tried to highlight above there are a lot of other dependancies. The SCO, the imsmanifest.xml, The Runtime API, the Student Attempt and all the management and knowing what to listen for or trigger. This is the main reason this larger effort costs $$. Attempting to pick and pull from open source projects like Moodle or some of those ancient links posted above will only get you so far. Honestly, most of them are so tightly coupled with the LMS you would spend more time teasing it out than just writing your own from scratch.
I built mine from 2009-2015. I started with the content API which I supply under a Creative Commons license. I built the Runtime API in conjunction with it as a form of a unit test. Later, deciding to bundle it as a bolt on to other peoples platforms, Android/iOS projects, Electron/NodeJS apps via USB Stick or Server.

Good luck.

笑,眼淚并存 2024-07-31 09:50:46

我找到了这个 http://www.jcasolutions.com/simple-scorm-lms -适配器,但它不是免费的(5.000 美元);-(

I have found just this one http://www.jcasolutions.com/simple-scorm-lms-adapter, but it's not free ($5.000) ;-(

迷鸟归林 2024-07-31 09:50:46

如果有人像我一样是 SCORM 新手,请了解您的 LMS 可能会内置 SCORM。 您可能会摆弄 SCORM,因为您的客户陷入了黑暗时代。 找出他们正在使用的 LMS 并安装它。 然后您(很可能)可以通过 LMS 访问 SCORM 1.2 API。

If anyone lands here a total SCORM newb like me, understand that your LMS will likely have SCORM built into it. You're likely fiddling with SCORM because your client is stuck in the dark ages. Find out what LMS they're using and install it. Then you'll (most likely) have access to a SCORM 1.2 API via the LMS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文