Take results from a multiple choice test
Submitted by Alexk90 on Fri, 11/08/2019 - 16:02
Forums:
Hi everyone.
I want to take H5P content result(such as right or wrong answer, date, e.t.c) in a .txt
I have create a logger.php file and i try to put the logger in some .php files in drupal folder structure to take values from a varieble
I create a looger.php file and this line to put it somewhere in the code of a php file logger("/var/www/html/logger.txt","$example");
Does anybody know where i must put this line to get values from a varieble
otacke
Fri, 11/08/2019 - 18:23
Permalink
Hi Alex!I think you have two
Hi Alex!
I think you have two simple choices.
1) The answers are evaluated in JavaScript and the results are emitted using the xAPI standard. You could catch the xAPI events, use AJAX to bring them to the server level and then log them. See https://h5p.org/documentation/x-api for details on using xAPI with H5P or https://github.com/otacke/h5pxapikatchu for an implementation that makes use of this idea.
2) Probably simpler if you don't require all the xAPI information: Choose your host system, install the mods plugin and implement the alter_user_result hook that gives you data and some ids as variables.
Best,
Oliver
Alexk90
Sun, 11/10/2019 - 10:58
Permalink
Thanks OliverI will follow
Thanks Oliver
I will follow the first advice
Alexk90
Sun, 11/10/2019 - 10:59
Permalink
Thanks OliverI will follow
Thanks Oliver
I will follow the first advice