简体   繁体   English

从xAPI包获取xAPI语句

[英]Getting xAPI statements from an xAPI package

I'm trying to get my head around the workings of an xAPI package authored in Rise which has been supplied to me so I can build a test PoC app. 我试图了解一下在Rise中创建的xAPI包的工作原理,这个包已经提供给我,所以我可以构建一个测试PoC应用程序。

I can see the functions built into the index.html page, and that things like progress and quiz scores are genrated, but where do I find the end-point for a LRS within the package? 我可以看到index.html页面中内置的函数,并且像进度和测验分数这样的东西是生成的,但是我在哪里可以找到包中LRS的终点?

I have incorporated the package into a test app I built, but rather than generate and send statements myself I would like use what comes as part of the package. 我已经将软件包整合到我构建的测试应用程序中,但是我自己不想生成和发送语句,而是希望使用作为软件包的一部分。

If I import and play the package in SCORM Cloud, I get generated statements returned. 如果我在SCORM Cloud中导入并播放包,则返回生成的语句。

The only thing I can see is an entry in the tincan.js file, this.recordStores=[] other than that I'm unsure where to go next, any suggestions? 我唯一能看到的是tincan.js文件中的一个条目, this.recordStores=[]除了我不确定下一步该去哪里,有什么建议吗?

Generally this kind of package implements a set of guidelines that were released with the 0.9 version of the specification (at the time named the Tin Can API and then later changed to xAPI). 通常,这种类型的包实现了一套使用0.9版规范发布的指南(当时命名为Tin Can API,然后更改为xAPI)。 Those guidelines provide for a packaging and launch mechanism which is what Rise has implemented. 这些指导方针提供了Rise实施的包装和发射机制。 The launch mechanism indicates that the endpoint and authentication credentials will be passed on the query string to the launched content where it can retrieve them. 启动机制指示端点和身份验证凭据将在查询字符串上传递到可以检索它们的已启动内容。 The TinCanJS library used by Rise implements functionality to digest the query string and set up objects, those you find in this.recordStores to communicate with the xAPI LRS identified in the query string parameters. Rise使用的TinCanJS库实现了消化查询字符串和设置对象的功能,您可以在this.recordStores找到这些对象,以便与查询字符串参数中标识的xAPI LRS进行通信。

You have two primary options, 你有两个主要选择,

  1. Get the query string parameters directly from the launch URL and process it yourself, potentially using the same global library objects ( TinCan.LRS ) already available to get an LRS object that you can then interact with as you see fit, 直接从启动URL获取查询字符串参数并TinCan.LRS处理,可能使用已经可用的相同全局库对象( TinCan.LRS )来获取LRS对象,然后您可以根据需要与之交互,
  2. Leverage the object already created for you via the this.recordStores list that is already prepared by the package itself 通过包本身已准备好的this.recordStores列表来利用已经为您创建的对象

There are pros/cons to both methods and they largely depend on your familiarity with JavaScript and how flexible you need/want to be. 两种方法都有优点/缺点,它们在很大程度上取决于您对JavaScript的熟悉程度以及您需要/想要的灵活性。

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

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