Measures real time students activity: Timestat Block

TimeStat block is a plugin maintained by Łukasz Sanokowski, which can measure the real time activity of students and the time is increased only when Moodle tab is active in student’s browser window.

Measured activity time is incremented only when Moodle tab in web browser is active (it is done via Javascript). It also allows to check time spent in each module separately.

Timestat Block
Timestat Block


To install the TimeStat block to your Moodle site, you need to change the core Moodle code which is not recommended.

    • Download and extract the TimStat block in the your_moodle_site/blocks and visit the notifications page as an administrator and finish the installation process.
    • Open the file your_moodle_site/lib/outputrenderers.php in a text editor and Add following line of code at end of function standard_end_of_body_html()


so it should look like:

public function standard_end_of_body_html() {
global $CFG;


return $output;

  • Also make sure that you have JavaScript in your browser as it will works only on the JavaScript enabled browsers.
  • Add the block to any course using “Add a block” with the Editing Mode On.

To download the latest version of the TimeStat Block please check out the link:


Jaswinder Singh

Jaswinder Singh, passionate about using Moodle in improving the Indian Education System and reaching the students in far flung areas where still education seems to be a impossible prospect of life. He is the author of the popular Moodle Book "How to use Moodle 2.7". In October 2016, Jaswinder was elected as the Moodle User's Association Committee member - the first to make it from India.

Related Articles