## Activities: Engagement analytics

mod_engagement
Maintained by Adam Olley, Ashley Holman
This is the indicator component of the Engagement analytics suite. Make sure to also get the report and block!
10k
Moodle 2.2, 2.3, 2.4, 2.5

Moodle Engagement Analytics for Moodle 2

* IMPORTANT *

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

* CREDITS *

Code: Ashley Holman <ashley.holman@netspot.com.au>
Concept: Phillip Dawson <phillip.dawson@monash.edu>
Indicator Algorithms: Phillip Dawson <phillip.dawson@monash.edu>

### Sets

This plugin is part of set Engagement Analytics.

### Contributors

Phillip Dawson: Concept & Algorithms

• Mon, May 5, 2014, 11:15 PM
How to install this plugin for moodle 2.6?
• Fri, May 16, 2014, 2:03 AM

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?
• 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.
• Wed, May 21, 2014, 2:03 PM
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
• 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 ;) )
• Wed, May 21, 2014, 11:36 PM

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
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,
Bei
• Mon, May 26, 2014, 8:34 AM
Hi all,

• Tue, May 27, 2014, 3:09 AM

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,
)]
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.

Thanks,
Bei
• 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 .
• 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?

• 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:
https://github.com/danmarsden/moodle-engagementindicator_attendance

As for developer documentation, I did write some up when this was released, you can find it here:
http://docs.moodle.org/dev/report/analytics/api
It includes a couple basic examples of things that I hope are helpful
• 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!
• Wed, Apr 1, 2015, 7:57 PM
Hi, I have installed engagement analytics in moodle 2.6 (mod, block, report).
The results for assessment and login are exact, while in the forum section of the report users either have 100% risk (even if they have read posts), either 69% risk that doesn' t change no matter if some students have made many posts or if i change the settings (e.g. Min risk 0.1 (posts, read, etc), max 0). The problem (standard percentages that don't differentiate for each user) exists for all the forum indicators (posts, total posts, replies).... Thanks!