I want count for how many users have accessed the site

I want count for how many users have accessed the site

by sandesh nirulkar -
Number of replies: 5

I am new at moodle, I have tried configurable report block but I couldn't achieve my requirement. Basically I want how many users are accessing the site, here I should select the duration, e.g. weekly, monthly.

Average of ratings: -
In reply to sandesh nirulkar

Re: I want count for how many users have accessed the site

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

You could try going to Site Admin, Users, Browse list, sort by last access.

In reply to sandesh nirulkar

Re: I want count for how many users have accessed the site

by Melanie Scott -
Picture of Particularly helpful Moodlers

You can do a configurable report which identifies how many discrete users have visited during a time frame.  You just have to do it with a sql report rather than one of the 'simple' ones.  I know this because I've done it.  I don't currently use the plug in (changed jobs), else I would share that sql code.  Once you've created one time frame, it is easy to copy the code to a new report and modify the time frame to another one.  My report was for pretty specific time frames (August 2016, for example), but I'm sure there are ways to do it differently.

And, just a note, I'm not very techie.  I learned a little sql in self-defense some time ago...it really isn't my thing.  Mostly I steal code from other people and make it do what I want.  As I recall, I got a lot of good info looking at stackoverflow sql questions, too.  And there might be some pregen reports in the configurable reports forum.  I may have even posted this one at one point (or part of it)...that was a long time ago.  So, I'm just saying, while it isn't easy, it is not impossible.

In reply to Melanie Scott

Re: I want count for how many users have accessed the site

by sandesh nirulkar -

Please see you can find the code and provide me, I will be thankful.

In reply to sandesh nirulkar

Re: I want count for how many users have accessed the site

by Melanie Scott -
Picture of Particularly helpful Moodlers

Unfortunately, I doubt I can get a hold of it...I left that job five months ago and they have since migrated to a different LMS.  If I did post it, it would be in the config reports forum area...I found this post I put out and some help I got: https://moodle.org/mod/forum/discuss.php?d=349920.  It might point you in the right direction. 


I printed copies of some of my final, regularly used code (the cool stuff) but that wasn't one of them.

In reply to sandesh nirulkar

Re: I want count for how many users have accessed the site

by Rick Jerz -
Picture of Particularly helpful Moodlers Picture of Testers

In configurable report format, try my code below.  You still need to decide what dates you are interested in seeing, and how you want to group them.  (When I run this, for example, dates shown as "1969" are for users who have never accessed the site.)

SELECT firstname, lastname,  

from_unixtime(lastaccess)

FROM prefix_user

order by lastaccess desc