Trigger URL form post upon SCORM module completion

Re: Trigger URL form post upon SCORM module completion

by Justin Kuch -
Number of replies: 0

Thanks Matteo. 

I'm poring over API documents now trying to wrap my head around this and I'm just having difficulty getting started. I've got a local plugin framework installed, and I think the event I'm after will be mod_scorm\event\status_submitted

Both mod_scorm\event\status_submitted and mod_scorm\event\scoreraw_submitted events are both recognizing my plugin as an observer.

If the submitted status equals passed, I want to then capture the fields I'm after: userid, scormid, element cmi.core.score.raw, and element cmi.core.total_time and dump them somewhere... even just to an error log for now!

I'm thinking this might be easier to do with database triggers...

It doesn't help that I can't seem to get PHP debugging working. All the options are enabled for debugging in PHP, also enabled in IIS just in case. phpinfo() is pointing me to the right log file, everything should be working with regards to that, but I have no idea if my observer.php is doing anything.

Here it is in its rudimentary state:

class local_tointelex_observer

{

    public static function send_scores(mod_scorm\event $event)

    {

        $event_data = $event->get_data();

        var_dump($event_data);

        error_log($event_data);

die();

    }

}