Experimental ::: block_timestat
Maintained by Picture of Łukasz SanokowskiŁukasz Sanokowski
Timestat block measures users real activity time. Time is increased only when Moodle tab is active in browser.
Latest release:
149 sites
22 fans
Moodle 2.5, 2.6, 2.7

Timestat application measures time of real activity done by Moodle users. 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.

Legacy log must be enabled in your system.


This plugin is part of set Seeking new maintainer.


Screenshot #0
Screenshot #1


Picture of Łukasz Sanokowski
Łukasz Sanokowski (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Stefano Rossi
    Fri, Nov 20, 2015, 10:53 PM

    Good morning,
    I installed its plugin, made various changes and php activated log_legacy, the problem is that does not count the right time.

    For example we have entered a time MINIMUM to complete a lesson, 2 hours, in order to unlock the voice CERTIFICATE and download a certificate of course completion.
    But when I go to counted per time with timestat it tells me 12 minutes, when it is impossible to complete the lesson because you have to put two hours, and I see that log_standard began the lesson at 13:04 and ended at 15:30.

    Why timestat makes me a count wrong?
  • Picture of Anderson Hsu
    Sat, Apr 16, 2016, 9:04 AM
    Dear partners,
    We found after install timestat blocks, the speed of moodle website become a little slow. Is there any suggestion for adjust the question ? Thank you.
  • Picture of Łukasz Sanokowski
    Mon, Apr 18, 2016, 4:35 PM
    Hi Anderson

    Timestat have some influence on overall Moodle performance. It have to store data (amount of time spent online) in database. The query is executed on exit of every displayed webpage (for example on reload, going to another url etc.). During this there is executed query which find latest record in log table of particular user in particular course. If the log table is big, this query can take some time, especially on slow server. If the speed now is too slow for you, consider improving performance of your server (that is the obvious answer ;), or reduce size of the log table - timestat works on legacy log table, there is a parameter named "loglifetime" when you can set a maximum lifetime of log entries.

  • Picture of Sudhanshu Gupta
    Wed, Feb 15, 2017, 7:28 PM
    Your plugin is not working in Moodle 3.1 as you are retrieving the data from legacy log which is disable in 3.1 version. so do we have any method to resolve this issue.

    Looking forward for your reply.
  • Picture of Anderson Hsu
    Tue, May 9, 2017, 8:50 PM
    Dear partners,
    If there sql example which we can join mdl_block_timestat and mdl_log table to list time spent by course or account ? Thanks a lot.
  • Picture of Łukasz Sanokowski
    Wed, May 10, 2017, 3:19 PM
    Hello Anderson

    There is no fixed SQL query build in. The query is generated dynamically with use of parameters set in this app form.
  • Picture of Anderson Hsu
    Wed, May 10, 2017, 9:57 PM
    Dear Łukasz Sanokowski
    I can use phpmyadmin or other plugin to use sql query, but I don't know it's relationship between mdl_log and mdl_block_timestat. (I don't know the field definition of mdl_block_timestat)
    Thanks a lot.
  • Picture of Łukasz Sanokowski
    Thu, May 11, 2017, 3:11 PM
    The table mdl_block_timestat contains a "log_id" field which references to particular record in mdl_log table. The "timespent" field is a time, measured in second, which was spent on Moodle site, on page which is described in "mdl_log" table with "mdl_log.id" = "mdl_block_timestat.log_id"
  • Picture of Anderson Hsu
    Sun, May 14, 2017, 4:41 PM
    Dear Łukasz Sanokowski,
    What is the unif of timespent field in the mdl_block_timestat table ? It's by minute or second or hour, how to count it's real time ? Thanks a lot.
  • Picture of Łukasz Sanokowski
    Tue, May 16, 2017, 7:50 PM
    Time stored in database field is in seconds format.
  • Picture of Bed Prasad Dhakal
    Tue, Jun 6, 2017, 6:00 PM
    I am using Moodle 2.7 and installed Timestat (block_timestat_moodle26_2014041101) and I have added it to one course and it is calculating nothing!

    Why this is happening? Looking forward to get help!
  • Picture of Łukasz Sanokowski
    Thu, Jun 8, 2017, 5:06 PM

    I don't remember if there is an legacy log present in Moodle 2.7 version, please check it, as it is required for this app to work.
  • Picture of Matt Watson
    Sun, Jul 16, 2017, 4:26 AM
    Lukasz, do you have any plans to update this plugin for Moodle 3.3?
  • Picture of Łukasz Sanokowski
    Mon, Jul 24, 2017, 3:58 PM
    Unfortunately, at present I have absolutely no free time to do this - updating from legacy log to current log API requires rewriting most of the code.
  • Picture of Łukasz Sanokowski
    Wed, Feb 12, 2020, 5:22 PM
    Hi All interested in using of this block, please take a look here: https://moodle.org/mod/forum/discuss.php?d=396939#p1600618
1 2 3 4 5
Please login to post comments