From d4f5d1153f4a1a966c5ee482cd0bb7d307e3d0f3 Mon Sep 17 00:00:00 2001 From: Bastian Heist Date: Tue, 21 Aug 2018 17:51:55 +0200 Subject: [PATCH] BUGFIX: Fix a bug in the example xAPI script and make the docs clearer. --- Configuration/Settings.yaml | 8 +++++--- Resources/Public/Scripts/xAPIExample.js | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Configuration/Settings.yaml b/Configuration/Settings.yaml index 41b57e7..cc281af 100644 --- a/Configuration/Settings.yaml +++ b/Configuration/Settings.yaml @@ -46,13 +46,15 @@ Sandstorm: # https://h5p.org/documentation/x-api # If you do not need xAPI, set this to an empty array: "xAPI: []" xAPI: - # set to TRUE to log all xAPI statements to the console. + # Set to TRUE to log all xAPI statements to the console. debugMode: false - # set this to a script path that should be loaded in the xAPI scope. This is the place where you put your - # custom xAPI integration script. + # Set this to a script path that should be loaded in the xAPI scope. + # Replace this with your custom xAPI integration script. integrationScript: 'resource://Sandstorm.NeosH5P/Public/Scripts/xAPIExample.js' # These settings will be forwarded to your integration script and will be available on the window under # window.NeosH5PxAPI. + # "yourLRSEndpoint" is just an example that is used in our example xAPI integration + # script. You can configure anything you want here, and remove "yourLRSEndpoint". integrationSettings: yourLRSEndpoint: 'http://example.com' diff --git a/Resources/Public/Scripts/xAPIExample.js b/Resources/Public/Scripts/xAPIExample.js index 45edacd..b7ca320 100644 --- a/Resources/Public/Scripts/xAPIExample.js +++ b/Resources/Public/Scripts/xAPIExample.js @@ -26,7 +26,7 @@ H5P.jQuery(function ($) { // // This is the example taken from the config - define your own integration settings here, they will be // // injected as a JSON object. // url: window.NeosH5PxAPI.yourLRSEndpoint, - // data: event.data.statement, + // data: JSON.stringify(event.data.statement), // dataType: "json", // success: onXAPIPostSuccess, // error: onXAPIPostError