SQL for "Users course time dedication"

SQL for "Users course time dedication"

by Andrew Solomon -
Number of replies: 5
Please accept accept my apologies as this is a bit of a newbie question...


I've just installed the configurable reports block and I'm pretty sure the "Users course time dedication" is the data I was looking for, but I'd really like to know how the calculations take place so I can be sure. How do I see the SQL which defines this report?

Thanks in advance,

Andrew

Average of ratings: -
In reply to Andrew Solomon

Re: SQL for "Users course time dedication"

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

I am not sure where the SQL is for this but I believe it looks at the time that a student is logged in and it assigns a certain amount of time after a last interaction/mouse click so that if you have a long timeout set on the site, it doesn't skew the numbers too badly.


Average of ratings: Useful (1)
In reply to Andrew Solomon

Re: SQL for "Users course time dedication"

by Ezael Bello -

Having a SQL example for this would be great. Been searching for days how this is being calculated, but still no clue... can't even find the tables on the database where this is stored sad

In reply to Andrew Solomon

Re: SQL for "Users course time dedication"

by Randy Thornton -
Picture of Documentation writers


According to a comment in the code (components/columns/userstats/plugin.class.php), Juan borrowed the logic and code for how to calculate the Course dedication time column from the Course Dedication block https://moodle.org/plugins/block_dedication.

On the plugin page this is outlined as:

<< 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. >>

There is no SQL per se in the code, it's all PHP doing math on the data from the logs.

See also discussion forum here: https://moodle.org/mod/forum/discuss.php?d=109487 for more on the details of the calculations.


Average of ratings: Useful (1)