Your Moodle version

Activities: Engagement analytics

Maintained by Picture of Adam Olley Adam Olley, Picture of Ashley Holman Ashley Holman
This is the indicator component of the Engagement analytics suite. Make sure to also get the report and block!

Moodle Engagement Analytics for Moodle 2


This plugin is useless on its own, you should also get the report and block plugins that are part of the set.


Code: Adam Olley <>
Code: Ashley Holman <>
Concept: Phillip Dawson <>
Indicator Algorithms: Phillip Dawson <>


This plugin is part of set Engagement Analytics.


Picture of Adam Olley
Adam Olley (Lead maintainer)
Picture of Phillip Dawson
Phillip Dawson: Concept & Algorithms
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Achal Saraiya
    Mon, May 5, 2014, 11:15 PM
    How to install this plugin for moodle 2.6?
  • Matt Bury
    Fri, May 16, 2014, 2:03 AM
    Hi Adam & Ashley,

    Thanks for contributing this. It looks promising. Before I install it and try it out, can you please explain why report_engagement & mod_engagement are available for Moodle 2.6 but block_engagement is? Is there an issue with Moodle 2.6 and these plugins?
  • Picture of Adam Olley
    Fri, May 16, 2014, 7:47 AM
    Hi Matt,

    I recently updated the plugins to work on 2.7. That's why the mod & report both have a 2.7 version. The block didn't require any alteration to work on 2.7, so I made the assumption it must work on 2.6. I can't guarantee that the report and mod work on 2.6.
  • Picture of Caitlyn Duggan
    Wed, May 21, 2014, 2:03 PM
    Hi Adam
    We'd like to continue to use this plugin when we upgrade to Moodle 2.6 but the 2.7 version fails the compatibility test. The 2.5 version also fails. Will there be a version for 2.6? If no, we will withdraw it until our December upgrade to 2.7. Many thanks
  • Picture of Adam Olley
    Wed, May 21, 2014, 2:23 PM
    Hi Caitlyn,

    I could look at making a 2.6 version available. Are you able to provide some more detail on how its failing exactly on 2.6 (it may well be the case I'll see the problem straight away when I try it, but doesn't hurt to ask ;) )
  • Picture of Bei Chapman
    Wed, May 21, 2014, 11:36 PM
    Hi Adam,

    I am on the same boat as Caitlyn, installed 2.5 version of report and mod of engagement and 2.6 version of block of engagement, but it didn't work in my 2.6.2 moodle env.

    The error that I got is:

    When I go into Plugins>>Reports>>Engagement Analytics, I get the following error….
    Manage indicators
    Coding error detected, it must be fixed by a programmer: PHP catchable fatal error
    More information about this error
    Debug info: Argument 1 passed to report_engagement_renderer::display_indicator_list() must be an instance of plugin_manager, instance of core_plugin_manager given, called in [dirroot]/report/engagement/manage_indicators.php on line 73 and defined
    Error code: codingerror
    Stack trace:
    • line 393 of /lib/setuplib.php: coding_exception thrown
    • line 119 of /report/engagement/renderer.php: call to default_error_handler()
    • line 73 of /report/engagement/manage_indicators.php: call to report_engagement_renderer->display_indicator_list()

    Many thanks,
  • Picture of Adam Olley
    Mon, May 26, 2014, 8:34 AM
    Hi all,

    Latest version uploaded just now finally supports mod_assign in the assessment indicator. Thanks go to eugeneventer for his pull request.
  • Picture of Bei Chapman
    Tue, May 27, 2014, 3:09 AM
    Hi Adam,

    Our Moodle is using Oracle 11g, so I got the following error when I go to course->report-engagement analytics:

    Debug info: ORA-00933: SQL command not properly ended

    SELECT rawdata
    FROM m_engagement_cache
    WHERE indicator = :o_param1
    AND courseid = :o_param2
    AND timestart = :o_param3
    AND timemodified > :o_param4
    ORDER BY timemodified DESC
    LIMIT 1
    [array (
    'o_param1' => 'assessment',
    'o_param2' => 482,
    'o_param3' => '1335844800',
    'o_param4' => 1401127527,
    Error code: dmlreadexception
    Stack trace:

    line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
    line 271 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->query_end()
    line 1122 of /lib/dml/oci_native_moodle_database.php: call to oci_native_moodle_database->query_end()
    line 1428 of /lib/dml/moodle_database.php: call to oci_native_moodle_database->get_records_sql()
    line 1056 of /lib/dml/oci_native_moodle_database.php: call to moodle_database->get_record_sql()
    line 1501 of /lib/dml/moodle_database.php: call to oci_native_moodle_database->get_record_sql()
    line 156 of /mod/engagement/indicator/indicator.class.php: call to moodle_database->get_field_sql()
    line 132 of /mod/engagement/indicator/indicator.class.php: call to indicator->get_cache()
    line 111 of /mod/engagement/indicator/indicator.class.php: call to indicator->get_risk_for_users()
    line 94 of /report/engagement/index.php: call to indicator->get_course_risks()

    The fix I have put in mod/engagement/indicator/indicator.class.php is:

    $rawdata = $DB->get_field_sql('
    ! SELECT rawdata from
    ! (SELECT rawdata
    FROM {engagement_cache}
    WHERE indicator = ?
    AND courseid = ?
    AND timestart = ?
    AND timemodified > ?
    ! ORDER BY timemodified DESC)
    ! where rownum = 1', $params);

    Not sure whether you can integrate it into your plugins or not. Just wanted to let you know.

  • Picture of Bei Chapman
    Tue, May 27, 2014, 3:12 AM

    Other than that error, the engagement analytics plugins version 2.6 is working fine in our Moodle 2.6.2 .
  • Matt Bury
    Tue, Jun 24, 2014, 2:25 AM
    Thanks for the updates Adam. I now have the mod, report, and block running on Moodle 2.6. I think these plugins are useful and have great potential so thank you for contributing them.

    I have a number of dummy accounts enrolled on a course for testing purposes, they have example info on their profile pages and profile pictures (edited by me as an admin) but I've never logged in under those accounts. The course has forums, chats, and wikis on it.

    From the sitewide config page: moodle/report/engagement/manage_indicators.php?contextid=1 I see that it only monitors Assessment (presumably pushed grades?), Forum, and Login activity. Are there any plans to include other core Moodle activity modules?

    Also, it'd be nice to have some documentation collated somewhere so that it's easier to get started and to understand how it works, e.g. How does it calculate the percentages it shows?

    Thanks in advance smile
  • Picture of Adam Olley
    Tue, Jun 24, 2014, 8:03 AM
    Hi Matt,

    There are no immediately plans for me to make additional indicators right now. That said, nothing stopping people making their own to share, like Dan Marsden did for the attendance module:

    As for developer documentation, I did write some up when this was released, you can find it here:
    It includes a couple basic examples of things that I hope are helpful smile
  • Picture of Christopher Molnar
    Mon, Oct 20, 2014, 7:38 PM
    Hi, I am wondering is there any more recent documentation available for writing additional plugins. I really need to have an indicator based on downloading (opening) course related material as well. While this is not strictly engagement in our case it is an indicated of success as we use Moodle to host all class handouts and activities as well. Would someone be able to post me in the correct direction? Thanks!
Please login to post comments