Search code examples
c#tin-can-apixapi

Open xAPI content at last bookmarked slide


I am currently opening xAPI content in our own LMS. We do not use a LRS but store statements in our own database. This will change soon as we want to build our own LRS.

When opening content, I build a string comprising the content, endpoint auth token and actor.

This will always open the content at the beginning.

If I connect to a LRS, the content is opened at the last bookmarked slide, and shows the percentage of progression.

On looking at calls made in Fiddler I can see 3 main calls being made to the LRS where the state_Id passed in is suspend_data, cumulative_time or bookmark.

Bookmark returns the Id of the last slide, and suspend data returns a load of numbers in json format.

My issue is that I can easily get the last slide Id from my database, but I cannot get the percentage or set the completed items in the package as complete (with the tick). I'm guessing the returned values from suspend_data may have something to do with setting these.

Can anyone advise on what I should be doing to open the content properly at it's bookmark?


Solution

  • The content itself would be in charge of opening itself to the right place based on the returned values from the queries. The content is using the State API document resources to capture those values, see https://xapi.com/blog/deep-dive-state-activity/, and then to read them back at launch so that it can set the correct state for the learner. This will also be specific to the type of content that is being run, in this case likely from a major authoring tool which has determined how it wants to store those values. Content from other authoring tools will not necessarily use those same methods. xAPI does not provide for any specifics around these details, it only defines what the LRS must support, so you will be best off implementing the LRS endpoints in the way they were intended or you'll be customizing for every kind of content you have. Also, you likely should be providing more information to the content at launch time, for instance a base activity id and a registration value.

    https://xapi.com/building-a-learning-record-store/ may be a good resource to review before creating an LRS.