Events "Web Hook"

Events "Web Hook"

by Josh Willcock -
Number of replies: 0
Picture of Core developers Picture of Plugin developers

Hi there,


I have been looking through the Events API as I need to create something to run after somebody "exits" a resource. If it was a scorm they would close it, if it was a like they'd click it. The logical way to do this from my experience with WHMCS mainly would be to utilize web hooks. I am not sure if this exact feature is available in Moodle or if it is I cannot find very much information on this. I have found some events which appear to fulfill my needs, but my question is how is the best approach to trigger a function if these events are fired?

Module updated - Core\event\course_module_updated

Module updated - mod_data\event\record_updated


EXAMPLE:

Fred opens a scorm - Fred does some stuff in a scorm - Fred closes scorm
I want to then run a function module_closed($userid, $scormid);

Not dependant on a particular type of Mod just that a mod has been updated - but can this be done automatically or where do we 'tap into' in order to trigger this?

One option would be to watch the events logs but I am hoping there may be a more intelligent solution?


Thankyou in advanced.


Josh

Average of ratings: -