tin-can-apilrs

Tin can api (xAPI) launch not working


I have a xAPI course created in Storyline which I'm trying to launch in the browser. After referring to the documentation on the internet I performed following steps:

1) Configured the Learning locker LRS locally.

2) Created the launch URL with the LRS end point, key and secret details.

Launch URL:

http://xapi.local.lcl/launcher.html?endpoint=http://192.168.168.66/data/xAPI/%26auth=Basic%20YWMwMWQ1NzliNmUzMWZlYzUwYTE3ZTI1NzBjMzI2ZmEwMjhjZTJkMjpjNzUzMGUwZTJjYjVjYWJmODFkOTYwZDIyODFhYTI5ZmZlN2EzYjAx%26actor%3D%7B%22objectType%22%3A%22Agent%22%2C%20%22name%22%3A%20%5B%22Test%20User%22%5D%2C%22mbox%22%3A%5B%22mainto%3Atet%40user.com%22%5D%7D%26registration%3D4b12bc8c-5347-46fa-99f3-e7bb91970c8%26activity_id%3Dhttp://5hJJBo0Cl3j_course_id

But when I opened the launch URL it's giving me following error:

Uncaught TypeError: Cannot read property 'asVersion' of null
    at TinCan.LRS.retrieveState (app.min.js:13)
    at TinCan.getState (app.min.js:13)
    at Object.getItem (app.min.js:14)
    at Object.initResumeData (app.min.js:18)
    at Object.initialize (app.min.js:18)
    at Array.O (app.min.js:45)
    at h (app.min.js:8)
    at Object.fireWith [as resolveWith] (app.min.js:8)
    at Object.<anonymous> (app.min.js:8)
    at h (app.min.js:8)

I'm new to xAPI so don't know how to proceed. I googled but couldn't find any approriate solution for the issue.

Any help would be highly appreciated.


Solution

  • The launch URL you pasted appears to be incorrectly encoded. The %26 at the end of the endpoint should be a literal &, so that the next query parameter, auth is separated. This is the case on through actor which is what I'm guessing is giving the null reference error when Storyline (and the underlying library, TinCanJS) is trying to serialize the Agent when making the xAPI State retrieve request.