garemoko / moodle-report_tincan

2 stars 2 forks source link

not working #3

Open stephenlane opened 9 years ago

stephenlane commented 9 years ago

I have already asked this and got it working once.

The plugin has stopped working since I last used it, any ideas. The events arent firing at all.I have already asked this and got it working once.

The plugin has stopped working since I last used it, any ideas. The events arent firing at all.

garemoko commented 9 years ago

Logged on as admin? Try a learner.

stephenlane commented 9 years ago

im logged in as a student, I have tried everything that I can think of and the plugin events wont fire. :(

garemoko commented 9 years ago

What version of Moodle are you using?

Have you tried turning debugging errors to maximum to see if you get any errors?

stephenlane commented 9 years ago

2.8 didnt have issues previously, have also tried 2.6.8.

Debugging is on max and dont get any error just the plugin events arent firing

stephenlane commented 9 years ago

actually just saw this error now

Invalid 'includefile' detected in /var/www/html/moodle/report/tincan/db/events.php observer definition

line 293 of /lib/classes/event/manager.php: call to debugging()
line 236 of /lib/classes/event/manager.php: call to core\event\manager::add_observers()
line 103 of /lib/classes/event/manager.php: call to core\event\manager::init_all_observers()
line 75 of /lib/classes/event/manager.php: call to core\event\manager::process_buffers()
line 721 of /lib/classes/event/base.php: call to core\event\manager::dispatch()
line 79 of /mod/quiz/view.php: call to core\event\base->trigger()

Invalid 'includefile' detected in /var/www/html/moodle/report/tincan/db/events.php observer definition

line 293 of /lib/classes/event/manager.php: call to debugging()
line 236 of /lib/classes/event/manager.php: call to core\event\manager::add_observers()
line 103 of /lib/classes/event/manager.php: call to core\event\manager::init_all_observers()
line 75 of /lib/classes/event/manager.php: call to core\event\manager::process_buffers()
line 721 of /lib/classes/event/base.php: call to core\event\manager::dispatch()
line 79 of /mod/quiz/view.php: call to core\event\base->trigger()
garemoko commented 9 years ago

Where is the plugin installed? What folder name?

stephenlane commented 9 years ago

Its installed in the report folder. /report/tincan

garemoko commented 9 years ago

What have you changed between when it was working and now?

stephenlane commented 9 years ago

Nothing that I can think of, I've gone to backups that I had and it still won't wont.

garemoko commented 9 years ago

How do you know the event isn't firing? Are you just looking at statements in the LRS or have you put in PHP code to echo stuff out?

stephenlane commented 9 years ago

put in php code to echo out and the event never fires. The lrs set up code does fire everytime so I know the plugin is installed. However when I go to start a new quiz the plugin event for the attemp_started doesnt fire.

garemoko commented 9 years ago

If it wasn't for the fact that you said it was previously working, I'd say this was a Moodle version issue. Events have changed a lot in recent Moodle versions so it wouldn't surprise me if this code was not compatible with Moodle 2.8. It may be worth forgetting the fact that it used to work and re-writing the events code following the latest guidelines for Moodle 2.8.

Two other things to try:

  1. Make sure you are uninstalling and reinstalling the plugin so that the events get registered. Check in the Moodle database to make sure the events are registered. I don't know the table name, but they are in there somewhere! It might be something like "mdl_core_events" but I don't recall exactly. There might even be an admin interface to see registered events in Moodle 2.8.
  2. Find the code that triggers the event in the quiz and make sure that is running.
stephenlane commented 9 years ago

I have the plugin running but not the prettiest or best way, I'm basically just calling the events directly from the appropriate quiz files. I have been looking at re-writing bits and pieces of the plugin but its getting my head around how the events fire is my problem.

I will have a look in the events table and see if there is anything there, is it the moodle events I am or looking for, or the plugin events.

garemoko commented 9 years ago

I'm not sure the difference? This may be a question best asking on the Moodle forum as it relates more generically to events in Moodle rather than the specifics of this plugin. Tin Can, rather than Moodle is really be area of expertise.

stephenlane commented 9 years ago

Im not either :) all the event tables are empty anyway :(

garemoko commented 9 years ago

If the tables are empty, that means the code at https://github.com/garemoko/moodle-report_tincan/blob/master/db/events.php is not running when you uninstall and reinstall the plugin. It could be that there's a Moodle version specific issue there, or you're not fully uninstalling the plugin?

stephenlane commented 9 years ago

ill have a dig around and see what I find :)