Course dedication

Blocks ::: block_dedication
Maintained by Dan Marsden, Catalyst IT
This block allows to calculate estimated dedication time of participants within a course.
Latest release:
6624 sites
213 fans
Current versions available: 6

NOTE: This plugin has a new maintainer.

Thanks to the University of Canterbury for sponsoring the upgrade work to support Moodle 4.0 and the new report builder API.


This block allows to see the estimated dedication time to a Moodle course by the participants of the course.

How dedication time is estimated?

Time is estimated based in the concepts of Session and Session duration applied to Moodle's log entries:

  • Click: every time that a user access to a page in Moodle a log entry is stored.
  • Session: set of two or more consecutive clicks in which the elapsed time between every pair of consecutive clicks does not overcome an established maximum time.
  • Session duration: elapsed time between the first and the last click of the session.


This block is intended to be used only by teachers, however the block can be configured to show dedication time to students too.

Teachers can use a tool to analyse dedication time within a course. The tool provides three reporting methods:

  • Dedication time of the course: calculates total dedication time, mean dedication time and connections per day for each student, which you can filter by course group if required.
  • Dedication of a student: detailed sessions for a student with start date & time, duration and ip.
  • Report builder source: The plugin includes a custom report builder source to allow for site-level reporting to be generated.

Original developed by Aday Talavera, CICEI at Las Palmas de Gran Canaria University
Updated to support Moodle 1.9 - Moodle 3.X 
by Borja Rubio Reyes.
Support for Moodle 4.0 was sponsored by the University of Canterbury.


Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3
Screenshot #4


Dan Marsden (Lead maintainer)
Borja Rubio Reyes: previous author
Aday Talavera: previous maintainer
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Dan Marsden
    Fri, Feb 23, 2024, 4:10 PM
    @Flemming - best to create a new post in the forums - the comments here aren't ideal for general moodle support - thanks!
  • Juan Antonio Moreno Carmona
    Sun, Mar 3, 2024, 2:46 AM
    Hi Dan. Thank you very much for your plugin. I wonder if the plugin also computes the time spent in the course when the user enters a course from the mobile app. Some users complain that all the time spent on the course does not appear. And those users use the app from time to time.
  • Dan Marsden
    Thu, Mar 7, 2024, 2:02 PM
    @Juan - the plugin generates the time-spent using Moodle logs table - not all interactions within the mobile app will generate a log entry associated with the user in the logs so we are limited to the usage that generates data within the logs. Students and staff should treat the time-spent calciulations as informational and a general approximation, it is very hard to improve the accuracy of this data. We do have other future improvements we'd like to make that would improve the stats and we could also look to include mobile app usage within this as well, but we'd need likely need someone to fund that development effort - feel free to reach out if you are that organisation who has the funding to put towards tihs!
  • Aca G
    Wed, Mar 20, 2024, 2:22 AM
    Hi, great block. In Spain the state-subsidised courses require a record of the time spent, so this block is widely used. Without it we would not know what to do.
    Any idea why a course that used to show correctly the time spent by each student now seems to have been "reset" and counted again from zero?
  • Aca G
    Wed, Mar 20, 2024, 2:38 AM
    I add to the previous message:

    could it be because it is affected by the general "logstore_standard | loglifetime" time settings ?
  • Dan Marsden
    Wed, Mar 20, 2024, 5:18 AM
    @Aca - there's a site wide setting called "allloglifetime" in the admin> blocks > dedication that clears out older logs so if you have that set low then yes, it will clear out data used to display how long the student would have spent in the course, not sure what else would do it.
  • Macrocap E-Learning
    Sat, May 11, 2024, 3:38 AM
    Greetings, first of all, thank you for your work to improve the efficiency of our platforms. My question is about a modification that was made to version 4 of this plugin (latest version), and it is that students who have not entered or participated in the course can no longer be seen in the report, since it ignores the sessions less than 2 minutes...based on that, is there any way to modify the plugin code to make that data appear again?...what would be the file that should be "intervened"?...we thank you in advance for your response, best regards.
  • Dan Marsden
    Mon, May 13, 2024, 5:56 AM
    @Macrocap - that's a site-level admin setting that you can definitely change - unfortunately it doesn't currently re-caclculate the historical data when you make the change, but you could manually delete the existing data and run the CLI script included within the plugin to regenerate the data manually.
  • Giacomo Coletta
    Wed, May 15, 2024, 6:46 PM
    Hi Dan,
    Could you please elaborate more on the answer you gave to Macrocap?
    To remove any minimum session duration, do you need to set "Ignore session limit" to 0 minutes?
    Morover, how do I manually delete historical data?
    Thanks for your time
  • Dan Marsden
    Thu, May 16, 2024, 9:32 AM
    @Giacomo - yes - setting the ignore session limit to 0 minutes will only affect "future" data and not existing data already generated.
    You will need an experienced user to delete the data within the dedication tables using a sql query and that understands how to run CLI scripts - the dedication plugin includes a CLI script that allows you to re-generate data. If you work with a Moodle Partner they should be able to help with this.
  • Matthew Marinovich
    Mon, May 27, 2024, 9:51 PM
    Hi there, sorry if this is not the best place to seek support...
    We have installed this block on a site with around 60k users and we found that the background task generated a LOT of database activity. So much that we deactivated the background task until we understand better how the block / background task is meant to behave. We have a few questions about the task:
    * Is it normal for the task to drive high database load?
    * Is there any way to moderate / reduce the amount of processing it is doing?
    * Would the task (when installed on an existing busy site) have an initial period of high database load (processing historical log data) followed by a more moderate database load profile once it has processed all historical data (caught up)?
    * Is there a way to filter the courses that this task runs for and perhaps whitelist / filter those that it should caluclate for?
    Many thanks - please advise if this kind of query should be added somewhere else instead of here =/
  • Dan Marsden
    Tue, May 28, 2024, 10:40 AM
    @Matthew - yes the first time the task runs it processes the last 12 weeks of data which can take some time on a busy site - you can see that set here:

    There is also a cli task which you can run manually if you would like to generate further historical data.

    There is always room for improving how a plugin works - if you have internal development capablities, pull requests are always welcome, alternatively feel free to reach out privately if you would like to fund further development on the plugin.
    Wed, May 29, 2024, 10:39 PM
    Hello, I created a new role, and I would like this role, like the teacher role, to be able to see everyone's dedication. Is there a way to do this? I have already tried giving the role permissions but it doesn't work.
  • Didier Journois
    Sat, Jun 8, 2024, 7:31 PM
    Hi ! Is there a way , in addition to first name + name, to get the id (username) in the exported data of all users ? Thanks for your advice
  • Dan Marsden
    Mon, Jun 10, 2024, 7:44 AM
    @Didier - this plugin includes a custom report source that allows you to build a report with a wide range of user fields - for documentation on how to use custom reports in moodle see:
1 2 3 4 5 6 7 8 9 10 11 12 13
Please login to post comments