From c6ca43cdfbdad9f6ca3bafdb7d4e41e8c061b289 Mon Sep 17 00:00:00 2001 From: kirkj Date: Wed, 15 Nov 2017 14:41:48 -1000 Subject: [PATCH 1/5] Added video verbs --- js/h5p-x-api-event.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index e5d6368..8e6d7b8 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -309,6 +309,12 @@ H5P.XAPIEvent.allowedXAPIVerbs = [ 'suspended', 'terminated', 'voided', + + // Custom verbs for video events + 'played', + 'paused', + 'seeked', + 'initialized', // Custom verbs used for action toolbar below content 'downloaded', From 459234859f7eb3bcc67fbc30b81c6199302085be Mon Sep 17 00:00:00 2001 From: kirkj Date: Wed, 15 Nov 2017 14:52:55 -1000 Subject: [PATCH 2/5] =?UTF-8?q?Removed=20duplicate=20=E2=80=98initialized?= =?UTF-8?q?=E2=80=99=20verb?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/h5p-x-api-event.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index 8e6d7b8..36b9965 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -314,7 +314,6 @@ H5P.XAPIEvent.allowedXAPIVerbs = [ 'played', 'paused', 'seeked', - 'initialized', // Custom verbs used for action toolbar below content 'downloaded', From f7de4603ebf98999e2a180b6fed4febca4decc42 Mon Sep 17 00:00:00 2001 From: kirkj Date: Wed, 22 Nov 2017 10:45:02 -1000 Subject: [PATCH 3/5] Add verb finished --- js/h5p-x-api-event.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index 36b9965..aa11889 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -314,6 +314,7 @@ H5P.XAPIEvent.allowedXAPIVerbs = [ 'played', 'paused', 'seeked', + 'finished', // Custom verbs used for action toolbar below content 'downloaded', From 8ecba8a2e7e8cc0e9653be3bd37dd68682ce94a3 Mon Sep 17 00:00:00 2001 From: kirkj Date: Wed, 22 Nov 2017 11:05:10 -1000 Subject: [PATCH 4/5] Remove trailing whitespace --- js/h5p-x-api-event.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index aa11889..c6004b1 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -309,7 +309,7 @@ H5P.XAPIEvent.allowedXAPIVerbs = [ 'suspended', 'terminated', 'voided', - + // Custom verbs for video events 'played', 'paused', From d71ed1afdc86f81a8af2b93e693efaba2b3e6fe1 Mon Sep 17 00:00:00 2001 From: Paul Ryan Date: Tue, 6 Feb 2018 15:31:47 -1000 Subject: [PATCH 5/5] Refactor xAPI Video verb creation to get correct id URI --- js/h5p-x-api-event.js | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/js/h5p-x-api-event.js b/js/h5p-x-api-event.js index c6004b1..f17f7ba 100644 --- a/js/h5p-x-api-event.js +++ b/js/h5p-x-api-event.js @@ -77,6 +77,14 @@ H5P.XAPIEvent.prototype.setVerb = function (verb) { } }; } + else if (H5P.jQuery.inArray(verb, H5P.XAPIEvent.allowedXAPIVideoVerbs) !== -1) { + this.data.statement.verb = { + 'id': 'https://w3id.org/xapi/video/verbs/' + verb, + 'display': { + 'en-US': verb + } + }; + } else if (verb.id !== undefined) { this.data.statement.verb = verb; } @@ -310,14 +318,20 @@ H5P.XAPIEvent.allowedXAPIVerbs = [ 'terminated', 'voided', - // Custom verbs for video events - 'played', - 'paused', - 'seeked', - 'finished', - // Custom verbs used for action toolbar below content 'downloaded', 'accessed-embed', 'accessed-copyright' ]; + +/** + * List of video verbs defined at {@link https://w3id.org/xapi/video/|xAPI Video Profile} + * + * @type Array + */ +H5P.XAPIEvent.allowedXAPIVideoVerbs = [ + 'played', + 'paused', + 'seeked', + 'finished', +];