Triggering a Drupal 7 rule when an interactive content is solved

serettig's picture

Hi,

I want Drupal 7 to trigger a rule whenever a user successfully solves an interactive content node (he/she has scored full points). Drupal seems to store the user's score in a field, which is visible in the Results View of the node. But how can I trigger a rule when the score is awarded? I can't see any condition for comparing field values in the rules configuration section.

Or do I have to use the TinCan API? I've already set up the H5P TinCan Bridge, the TinCan LRS Server, but triggering a rule from TinCan seems pretty complex, so it'd be great if I could avoid TinCan.

Thanks
sr258

debbie leance's picture

Hi, any update on when the drupal 8 compability will be working with H5P?? Thanks :)

tomaj's picture

The Drupal 8 H5P plugin was updated last week with Release Candicate 1, so it's getting closer to completion.

Feel free to test it, and file bug reports, if you find any bugs.

- Tom

tim's picture
debbie leance's picture

Nice question also. I'm interested in hearing the result of this conversation. Thanks for posting. 

icc's picture

Hi sr258,

Unfortunately, there is no integration with rules, yet. Though I do think this sounds very useful – and it shouldn't be that hard or too much work.

serettig's picture

Hi icc,

I've done a very basic rules integration that triggers a newly defined event when a piece of interactive content is solved. It seems to work fine, but I'm going to test it on my project soon to see if there are any unexpected issues. You can find my work on GitHub.

If someone else wants to test this, the easiest way to patch the H5P module for Drupal 7.x-1.32 is to copy the two files h5p.module and h5p.rules.inc from my repository into the root folder of the installed h5p module into the Drupal directory. h5p.module should already be in the directory and must be replaced. Alternatively, it should also work if you download the repository as a zip file and install it in Drupal manually.

sr258

icc's picture

This is great, awesome work!

When you figure out what works for you, perhaps you could provide a patch so we can get it into the module as well?

Does anyone know if it would be much work to get this to work with the latest H5P module version?

 

serettig's picture

Patching the current H5P module should work fine as the changes in https://github.com/sr258/h5p-drupal are pretty self-contained. You can't install the regular module then, however, but must change it specifically for your installation. You require some understanding in programming, though.

Thanks, I'm not much of a programmer but starting to learn.