Giter Club home page Giter Club logo

h5pxapikatchu's Introduction

banner

SNORDIAN's H5PxAPIkatchu

This Wordpress plugin is a simple solution to catch 'em all, those xAPI statements that have been sent by H5P content types. It allows you to store (the most relevant) xAPI properties in the database of WordPress. It also allows you to view, filter and export these data as a CSV file for further processing.

Please cmp. Gotta catch ’em all! and Collecting and analyzing data with H5P — and opening up education maybe for the ideas behind the plugin.

This plugin is NOT intended to work as a replacement for a decent Learning Record Store. It will work well for smaller platforms, but if you are expecting to track many xAPI statements, you will probably run into trouble with displaying all the data at some point.

This plugin is NOT intended to forward xAPI statements sent by H5P to a Learning Record Store. Please use WP-H5P-xAPI if you need that functionality.

This plugin is NOT intended to replace the H5P plugin's reporting or provide functionality for analysis, etc. There is no point in recreating what is already available in Learning Record Stores or what you can do yourself with a spreadsheet software, scikit-learn, etc.

If you need more, you should give Learning Locker a shot. It's open, free and shiny.

PLEASE NOTE: H5P IS A REGISTERED TRADEMARK OF JOUBEL. THIS PLUGIN WAS NEITHER CREATED BY JOUBEL NOR IS IT ENDORSED BY THEM.

Features

  • Store important values of xAPI statements emitted from H5P content types in your database.
  • View and export the data for further analysis.
  • Optionally limit capturing to particular H5P content types only.
  • Optionally store the complete xAPI statements as a string - know what you're doing ...

Install/Usage

Install H5PxAPIkatchu from the Wordpress Plugin directory or via your Wordpress instance and activate it. Done.

The most important parts of the xAPI statements that are emitted by H5P content types on your system should now be stored in your database. You can view and download them via the new WordPress menu item.

Screenshots

You can change some options to your particular needs.

options

You cannot only view the stored data, but also download them as an CSV file.

table_view

Customizing

Capabilities

Some capabilities can be set for WordPress user roles in order to specify who should be allowed to do what:

  • manage_h5pxapikatchu_options: Capability to change the plugin's options
  • view_h5pxapikatchu_results: Capability to view results of content types that have been created by current user and that were stored by H5PxAPIkachu
  • view_others_h5pxapikatchu_results: Capability to view results of all content types that were stored by H5PxAPIkachu
  • download_h5pxapikatchu_results: Capability to download the results stored by H5PxAPIkachu and accessible to current user
  • delete_h5pxapikatchu_results: Capability to delete ALL data stored by H5PxAPIkachu

Hooks and filters

H5PxAPIkachu provides some hooks and filters that developers can use to customize the behavior or to use H5PxAPIkachu as the basis of their own plugin.

Hooks

  • h5pxapikatchu_on_activation: Triggered on activation of H5PxAPIkachu
  • h5pxapikatchu_on_deactivation: Triggered on deactivation of H5PxAPIkachu
  • h5pxapikatchu_on_uninstall: Triggered on uninstall of H5PxAPIkachu
  • h5pxapikatchu_insert_data: Triggered when data are supposed to be inserted into the database
  • h5pxapikatchu_insert_data_pre_database: Triggered right before data will be inserted into the database
  • h5pxapikatchu_delete_data: Triggered when data are supposed to be deleted from the database

Filters

  • h5pxapikatchu_insert_data_actor: Allows to filter/retrieve the xAPI actor object when it is supposed to be inserted into the database
  • h5pxapikatchu_insert_data_verb: Allows to filter/retrieve the xAPI verb object when it is supposed to be inserted into the database
  • h5pxapikatchu_insert_data_object: Allows to filter/retrieve the xAPI object object when it is supposed to be inserted into the database
  • h5pxapikatchu_insert_data_result: Allows to filter/retrieve the xAPI result object when it is supposed to be inserted into the database
  • h5pxapikatchu_insert_data_xapi: Allows to filter/retrieve the complete xAPI statement string when it is supposed to be inserted into the database

Example filters

Not saving certain verbs

In certain situations, one may only be interested in xAPI statements with particular verbs. The plugin does not provide a list to define what should be listend to and what should not (as in LRS logic one would rather do this by filtering the data later on), but one can do this by adding a filter to one's WordPress environment.

Please note: Despite not trying to be a gradebook replacement, people seem to be using H5PxAPIkatchu as such. They are only interested in "scores and answers". However, the whole point of xAPI is to be able to gain deeper knowledge about what the user is experiencing. If one is only interested in storing scores and answers, one should rather amend the original H5P plugin (or create a separate plugin for this job), so only the relevant values are stored which then then can be displayed easily using https://github.com/h5p/h5p-php-report.

Nevertheless, if you're interested in "scores and answers" only and want to do this using H5PxAPIkatchu, filtering for verbs may not be the proper approach - one would rather filter for statements that contains a results property, because there's no fixed list of verbs that could pop up with xAPI, and content types could as well use other verbs than completed or answered and yet the statements could contain "scores and answers".

add_filter( 'h5pxapikatchu_insert_data_verb', 'filter_h5pxapikatchu_insert_data_verb', 10 );
function filter_h5pxapikatchu_insert_data_verb( $verb ) {
  if ( is_array( $verb ) && in_array( $verb['display'], array( 'interacted', 'attempted' ) ) ) {
    wp_die();
  }

  return $verb;
}

License

H5PxAPIkatchu is is licensed under the MIT License.

GDPR

Please note that as of May 25, 2018 you may have to comply with the General Data Privacy Regulation (GDPR).

H5PxAPIkatchu supports the functions that WordPress offers to

  • use suggestion for your privacy statement text,
  • export personal data of a user, and
  • delete personal data of a user.

Background: If you're using H5PxAPIkachu, by processing the xAPI statements you're processing at least these personal data items according to art. 4 GDPR:

  • xAPI statement: Actor/name (Full name of the Agent)
  • xAPI statement:Actor/Inverse Functional Identifier (email address, openID or account data within the host system)
  • WordPress user id (ID given by the WordPress host system)

Please make sure to account for these items in your GDPR processes and documentation.

h5pxapikatchu's People

Contributors

bernhardkaindl avatar damienromito avatar otacke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

h5pxapikatchu's Issues

Add hooks/filters

Add hooks and filters so others can better customize the plugin. In particular: "insert data"

Record a timestamp with each xAPI event

There seems to be no timestamp associated with xAPI events. It would be great to have one, so the exact chronology of the events could be recorded (would be nice to know if or where a user spends more time in the H5P apps).

Add capabilities

  • manage_h5pxapikatchu_options
  • view_h5pxapikatchu_results
  • view_others_h5pxapikatchu_results
  • delete_h5pxapikatchu_results

Deprecation notice on PrivacyPolicy::register_h5pxapikatchu_eraser()

Aloha, we noticed the following warning when interacting with the Personal Data Erasure tool in WordPress. Probably just needs to be updated for the latest API:
https://developer.wordpress.org/plugins/privacy/adding-the-personal-data-eraser-to-your-plugin/

Warning:
Deprecated: Non-static method H5PXAPIKATCHU\PrivacyPolicy::register_h5pxapikatchu_eraser() should not be called statically in /var/www/html/wp-includes/class-wp-hook.php on line 287

Example:
Screen Shot 2020-06-01 at 3 19 01 PM

WP multisite mode missing

Hi Oliver,

hope you are well, OSA from Freiburg calling. :)

I tested this plugin for the Online Studychoice Assessments (Online Studienwahl Assistenten) at the University of Freiburg and had to made a few adjustments for make it work on a multisite installation. Now it works just great and gives us a deeper insight into the H5P test results (anonymous as you don't have to log in for doing the tests) - really useful.

For multisite installations we need a flexible way for storing the configuration of H5PxAPIkatchu plugin. Be aware that the H5P content id could be the same in different multisite blogs.

So my idea is to create different config files to store the settings of H5PxAPIkatchu plugin for each blog separately. As each blog has its own id, we could add this blog id to the name of the config file to distinguish it easily.

For example instead of
/js/h5pxapikatchu-config.js
in a WP multisite installation this would be
/js/h5pxapikatchu-config2.js
/js/h5pxapikatchu-config3.js
/js/h5pxapikatchu-config4.js
where 2, 3, 4 and so on are the blog ids.

I tested it successfully on our WP multisite installation. You can check my customizations here :

https://github.com/osa-freiburg/h5pxapikatchu/tree/multisite-mode

What do you think about it? If you could take a peek at it sometime, I'd really appreciate some feedback.
Thanks, and take care!
Anja

Statements not being stored

Hey Oliver,

I am trying to get the statements to be stored and am having no luck. I turned on the console debugging, and statements are being captured via h5pxapikatchu but they don't seem to be displayed in the WP back-end (wp-admin/admin.php?page=h5pxapikatchu_options). I get the following message:

There is no xAPI information stored.

I've checked my database, and the tables are being created:
wp_h5pxapikatchu, wp_h5pxapikatchu_actor, wp_h5pxapikatchu_result, wp_h5pxapikatchu_verb.

There are statements being stored in the wp_h5pxapikatchu table. Belong is an example:

{"actor":{"name":"ivadmin","mbox":"mailto:[email protected]","objectType":"Agent"},"verb":{"id":"http://adlnet.gov/expapi/verbs/interacted","display":{"en-US":"interacted"}},"object":{"id":"http://name.com.au/clients/name/wp-admin/admin-ajax.php?action=h5p_embed&id=6?subContentId=b535852c-7543-4b8a-bd08-93eb094f123c","objectType":"Activity","definition":{"extensions":{"http://h5p.org/x-api/h5p-local-content-id":6,"http://h5p.org/x-api/h5p-subContentId":"b535852c-7543-4b8a-bd08-93eb094f123c"},"name":{"en-US":"Where should you store Gavin and the gang to keep them fr..."}}},"context":{"contextActivities":{"parent":[{"id":"http://name.com.au/clients/name/wp-admin/admin-ajax.php?action=h5p_embed&id=6","objectType":"Activity"}],"category":[{"id":"http://h5p.org/libraries/H5P.MultiChoice-1.10","objectType":"Activity"}]},"extensions":{"http://id.tincanapi.com/extension/ending-point":"PT33S"}}}

I have tried enabling Store complete statements in-case that was causing an issue but that did not resolve it either.

Am I looking in the wrong place for this data?

Thanks for creating this plugin!

Code cleaning

At least the following things should be done:

  • Check PHP and JavaScript against WordPress styleguide (possibly add eslint config)
  • Only load JavaScript when actually required

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.