Questionaire xAPI statements
Submitted by btopro on Tue, 10/04/2016 - 18:36
Forums:
Questionaire is throw tons of statements out, especially with the open ended response. It's polling and seemingly sending every other character typed on the keyboard. :)
answers to questions also aren't coming across (multi-choice). And it appears to be trying to write to a database but that part seems pretty Drupal specific.
thomasmars
Wed, 10/05/2016 - 11:27
Permalink
Hi,
This is by design:
The events are not saved anywhere, you must have an LRS or similar in order to pick up these events and make use of them.
Do you think that any of these events are incorrect or should be sent/handled differently ?
wie
Sun, 04/22/2018 - 22:12
Permalink
swith to another subContentId
Hi, is it possible to switch to another activity within a questionnaire based on the result?
Example: I read out the result of a multiple question and the user answers with "does not apply", which makes the answering of the next five questions obsolete. I work with xAPI-data.statements and as I understand from the documentation, it would be nice to do something like (in pseudocode):
repeat five times:
object = this.object;
trigger(object.answered)
object.next()
OR
activity.activate(subContentId);
Is there a syntax that allows to skip tasks, depending on user action?
Thank you very much.
Thomas
thomasmars
Wed, 05/16/2018 - 11:35
Permalink
Hi, there is no functionality
Hi, there is no functionality for swapping out an H5P in the iFrame, but the other functionality is possible.
You can for instance listen for xAPI events, if the xAPI that you catch fulfills certain criterias you can navigate them to a new page that has a different H5P.
We're also currently working on a content type called "Branching Scenario" that is designed to fulfill exactly these types of use-cases, allowing you to guide students to different H5Ps depending on their answer. This content type will not require any technical knowledge or working with the xAPI statements, it will all be handled for you.
Best regards, Thomas
wie
Mon, 04/23/2018 - 11:04
Permalink
as illustration
<pre class="jscript:lang">
(function($) {
$(function() {
<?php
echo("var workspaceLink = '/bibliothek/webroot/h5p/".$h5p->name."';") ?>
$('.h5p-container').h5p({
id: 1,
frameJs: '/bibliothek/webroot/h5p/dist/js/h5p-standalone-frame.min.js',
frameCss: '/bibliothek/webroot/h5p/dist/styles/h5p.css',
h5pContent: workspaceLink
});
});
})(H5P.jQuery);
var answer = {};
var result = {};
var id = '';
var textarea = '';
var objectId = '';
var eventListe = [];
H5P.externalDispatcher.on('xAPI', function (event) {
result = event.data.statement.result;
id = this.subContentId; //questionnaire containing subContentIds F1 to F4
eventListe.push(event);
if (typeof result != 'undefined' && typeof id != 'undefined') {
if (result['response'].length > 10) {
if (id == "F1") {
textarea = this.parent.questionnaireElement.lastElementChild.childNodes[1].childNodes[0];
textarea['maxLength'] = '10'; alert('Nur zehn Zeichen');
}
}
if (id == "F2") {
//somehow trigger skipping of F3, loading event F4
alert('hallo');
}
answer[id]=result['response'];
}
console.log(id);
console.log(event.getVerb());
if(event.getVerb()==='completed') {console.log(answer);console.log(eventListe);}
});
<pre>