xAPI connectivity

Been playing around with hype 3 for some time and now looking into xAPI but I can’t seem to get hype3 to send or receive statements using the xAPI into an LRS. Does anyone have an example script? I found this file SCORM & LMS - Embedding a Hype Element but even this seems to give me errors when I try to send any statements.

What LMS service are you communicating with? Do you have any example code you can share?

Actually it is connecting to an LRS. learning record store from learning locker. I have test scripts from tincan that work but trying to get the script I posted to work just seems to fail. No idea why.

I don’t really know anything about this, so sharing what you have will help me help you find where this is not working.

Daniel, I guess what would help me is if you can elaborate what you posted at this link
SCORM & LMS - Embedding a Hype Element Do you know what it would take to make this work in its simplest form?

That document communicates with the Tin Can servers, and would likely need a valid key to properly record information. On scene load, it runs a Tin Can-specific set of functions that records information about the Hype scene which was loaded:

var tincan = new TinCan (
            {
                url: window.location.href,
                activity: {
                    id: GolfExample.CourseActivity.id + "/HavingFun/HowToBeStylish.html",
                    definition: {
                        name: {
                            "en-US": "How to be Stylish"
                        },
                        description: {
                            "en-US": "Some tips for how to be stylish on the golf course."
                        }
                    }
                }
            }
        );

        tincan.sendStatement(
            {
                verb: "experienced",
                context: GolfExample.getContext(
                    GolfExample.CourseActivity.id
                )
            },
            function () {}
        );

You don't need to reuse these functions or even understand them -- they were borrowed from the Tin Can documentation as an example of how to log that something has been 'experienced'. Those functions work because Tin Can's JS functions are included in the head of the document. While this document doesn't actually do any thing, it shows the workflow required for communicating with a LMS/LRS:

  1. Load any required JS functions as part of th eHype document load process by including them in the head of the document as a reference to an external server, or by dragging+dropping the JS files into the resource library
  2. Run functions in response to actions, for example when a scene has been exited or entered.
  3. Verify that the actions have been recorded in the LRS.

So that's what you also need to do. This looks like a great place to start: Learning Record Store | Learning Pool

1 Like

That is as far as I have reached but I I am not sure where you have loaded the LRS endpoints. I have tried to load a config file as the scene loads but still no connection. I will keep digging and report back if I make any head way.