adlnet / xAPIWrapper

Wrapper to simplify communication to an LRS
https://adlnet.gov/projects/xapi/
Apache License 2.0
214 stars 114 forks source link

Can't send xAPI statements from H5PStandalone #178

Open sloopint opened 3 years ago

sloopint commented 3 years ago

Hello, Using H5PStandalone, I try to adapt Ben de Vries’ solution to send xAPI data to my LRS. (https://www.bendevries.com/2020/09/02/connecting-moodle-h5p-content-with-an-lrs.html) Unfortunately, it doesn’t work. I get a 400 Error (Bad request). I suspect event.data.statement.actor, event.data.statement.verb, event.data.statement.object and event.data.statement.result not to be supported. Indeed it does work when I replace var stmt in the previous file with a manual statement that looks like

    var stmt = new ADL.XAPIStatement(
    'mailto:steve.vergenz.ctr@adlnet.gov',
    'http://adlnet.gov/expapi/verbs/launched',
    'http://vwf.adlnet.gov/xapi/virtual_world_sandbox'
    );
   {
     "actor": {
                     "objectType": "Agent", "mbox": "mailto:steve.vergenz.ctr@adlnet.gov" },
     "verb": {"id": "http://adlnet.gov/expapi/verbs/launched" },
     "object": {
                     "objectType": "Activity", "id": "http://vwf.adlnet.gov/xapi/virtual_world_sandbox" }}
    )

Is there a way to send a more complete set of data using H5PStandalone? Thanks a lot for your help. Capture d’écran 2021-06-21 à 11 38 34