简体   繁体   English

在用户离开的地方打开 xAPI package

[英]Open xAPI package at the point where the user left off

After successfully launching our xAPI based LMS I now have a requirement to launch any package at the point where the user last viewed it.成功启动基于 xAPI 的 LMS 后,我现在需要在用户上次查看的位置启动任何 package。

So for example if the package contains 20 slides, we have already recorded the id of each slide opened and that they are 50% of the way through, but how can I use this information to open the package at this point?例如,如果 package 包含 20 张幻灯片,我们已经记录了打开的每张幻灯片的 id 并且它们已经完成了 50%,但是此时我如何使用这些信息打开 package?

thanks谢谢

Generally with xAPI you would use the State API document resource to capture any ephemeral data of this nature (a bookmark).通常使用 xAPI,您将使用 State API 文档资源来捕获任何这种性质的临时数据(书签)。 A State API document is stored based on an actor, activity, and registration along with a profile ID that you coin yourself. State API 文档基于参与者、活动和注册以及您自己创建的个人资料 ID 进行存储。 The content of the document can be anything, though there is a small amount of special handling for JSON objects.文档的内容可以是任何内容,尽管对 JSON 对象有少量特殊处理。 For your case I would store a "bookmark" profile with a JSON object as the content with a property of slide or similar with a value of the slide number.对于您的情况,我将存储一个带有 JSON object 的“书签”配置文件作为具有slide属性或类似幻灯片编号值的内容。 Then when the content is launched you can retrieve the State document.然后,当内容启动时,您可以检索 State 文档。 In the case of a 404 (or unrecognized or invalid data) you can assume it is the first launch and start them at the beginning, otherwise you should have a slide number and automatically jump them to that point.在 404(或无法识别或无效数据)的情况下,您可以假设这是第一次启动并从头开始启动它们,否则您应该有一个幻灯片编号并自动将它们跳转到该点。

The original Tin Can Prototypes golf example has a sample of how to achieve this, see: https://github.com/RusticiSoftware/TinCan_Prototypes/blob/master/GolfExample_TCAPI/index.html#L48原始的 Tin Can Prototypes 高尔夫示例有一个如何实现此目的的示例,请参阅: https://github.com/RusticiSoftware/TinCan_Prototypes/blob/master/GolfExample_TCAPI/index.html#L48

Summary of the document APIs: https://xapi.com/blog/deep-dive-document/ More about State API: https://xapi.com/blog/deep-dive-state-activity/ Summary of the document APIs: https://xapi.com/blog/deep-dive-document/ More about State API: https://xapi.com/blog/deep-dive-state-activity/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM