patch: http://nzvle.eduforge.org/stats/stats.patch (this is against today's 1.5)
screenshots:
explanation:
Three new tables are created, to contain data that comes from processing moodle's log table, for daily, weekly and monthly statistics. Moodle's cronjob will populate these. There are a few new config settings, to enable stats collection at all, and how far back to process moodle's logs the first time the cronjob runs. If your site has a lot of traffic, and there are a lot of logs, processing these for the first time can be quite resource heavy, so if you're on shared hosting, it may be a good idea not to go back too far, You can set it to none, all, or a few time periods in between.
Once there's some statistics in there, each course has a new item in the menu next to logs, called statistics, which will let you view some basic data about the course, with a table and some pretty graphs. For the site course, in addition to the normal reports, you can see logins and unique logins over time.
So far, the reports I have done are:
Logins/Unique logins
Views - teachers vs students
Posts - teachers vs students
All activity - teachers vs students
Student activity - views vs posts
Teacher activity - views vs posts
In this contents, 'vs' means that the two datasets are both graphed.
Views/posts - views means anything that doesn't save back to the database, posts means anything that does (forum posts, assessment uploads etc etc)
Here is a list of all the data that gets saved in the three tables:
* id
* courseid
* date period ended
* number enrolments
* number teachers assigned
* number active students
* number active teachers
* total course reads by students (views)
* total course writes by students(everything else - excludes errors)
* total course reads by teachers
* total course writes by teachers
* logins - 'site' course only
* unique logins - 'site' course only
Some other reports could be added really, like number of teachers to number of students, number active teachers to number active students etc.
Also , all these reports are course centric right now. Going forward it might be useful to do some sort of ranking of different reports across courses. Like, top 10 participatory courses (based on views/posts or enrolled students/active students)
-- Penny
Edit! To force the db upgrade, manually bump version.php to 2005031000
For us to track what type of brwser usually get errors...
Currently, the user agent isn't stored even in moodle's log table, and my stats are like a less granular version of those, so your short answer is no.
I guess the normal log table could start to store the user agent, or at least parse the user agent string and store the browser and version number, although that can be pretty hard... and then if that were there, my stats could figure out the most common browser per course.
This data in is the http server logs.
We have done this with Analog, you can see what comes out
at http://atsosxdev.doit.wisc.edu/moodle/statistics
We haven't tuned this report and didn't put the browser report in there.
It's the "out of the box" report. Updates once/day, our httpd logs are cummulative. We also now are adding in Report Magic
(does better graphs), but haven't gotten around to that here.
At some point, I'll have someone do analysis on how to get some better reports
out. Daily, Weekly, Monthly. These would complement what Penny has done. It would be quite possible to share the Analog setup to generate specific reports.
Analog is a very common web stats analyzer and is often provided by web hosting services. Actually, it would be not-so-hard to add it into a "standard install" for Moodle or as an added feature.
To clarify -- the stats package is complementary to the web log analyzer. Server log analysis is useful to gauge traffic and server usage, but useless to see what courses are being used, how active users are, etc. The stats package provides application level usage, much more useful to actual Moodle users (admins and teachers).
We aren't looking into integrating analog... Any hosting company worth its salt is running analog or something comparable for you already.
I feel as if I am about to ask a really stupid question,so please bear with me as Im new
How is your patch implemented. It came through as a text file. Am I to assume I make these changes to my files manually or is this file part of an automated process?
Sorry again for asking the obvious as I think I know the answer. But please confirm it for me.
* - For those wondering how to read it... it tells you the file being changed, then the range of lines, then shows a bit of context, and then removed lines (start with "-") and added lines (start with "+").
I think this addition will be welcome in the corporate world. I read more and more about Enterprises and Corporations that use Moodle as a tool for internal communication and training. They usually ask for this kind of reporting feature.
Last days we have discussed in Spanish forums about how to measure the time spent by each user on Moodle. This is useless from a teaching point of view, but Corporations have their own administrative rules. Accountants want to know how much of a working day the employee has been in Moodle vs. attending his job (and employees can use moodle as an excuse for laziness, too. At least, that's what employers fear) .
I will have a look into your work. I am sure there will be a lot of good ideas there.
- Enrique -
http://moodle.org/mod/forum/discuss.php?d=16384#82397
It's pretty complicated actually, we had a big whiteboarding session about it and decided on a sort of sliding window approach, between a user's login time and the last record in the log table for that user up until the next login time is the amount of time you have to play with total, but when you're actually processing it if they're in the middle of a session you have to discard it and then do it in the next run...
And for each session you need to know how long they spend in each course, and what to do if they flick between one course and the next.. so we made it stage 2.
Sorry that probably made no sense. I have a picture in my mind though :p
Anyway, if you're interested in the patch, get the latest one from http://nzvle.eduforge.org/stats/stats.patch
And ! I should probably have pointed out that if you want to apply the patch, you'll probably also want the icon:
(Going to stop talking to myself now )
This time I have updated the patch For The Last Time (tm).
Penny,
I have installe your stats patch and am having issues getting the data to generate. I run my cron.php and get the following results
Starting activity modules
Finished activity modules
Running backups if required...
Checking backup status...INACTIVE
Backup tasks finished.
Running rssfeeds if required...
Generating rssfeeds...
assignment: ...NOT SUPPORTED (file)
choice: ...NOT SUPPORTED (file)
forum: generating ...OK
chat: ...NOT SUPPORTED (file)
journal: ...NOT SUPPORTED (file)
label: ...NOT SUPPORTED (file)
lesson: ...NOT SUPPORTED (file)
quiz: ...NOT SUPPORTED (file)
resource: ...NOT SUPPORTED (file)
scorm: ...NOT SUPPORTED (file)
survey: ...NOT SUPPORTED (file)
wiki: ...NOT SUPPORTED (file)
workshop: ...NOT SUPPORTED (file)
scheduler: ...NOT SUPPORTED (file)
hotpot: ...NOT SUPPORTED (file)
glossary: generating ...OK
mail: ...NOT SUPPORTED (file)
Ending rssfeeds......OK
Rssfeeds finished
Cron script completed correctly
Execution took 0.101779 seconds
Obviously stats data has not come through. I have attatched my cron file in case I have missed something.
The tables do exist in my sql for the data to reside in. Any ideas what has happened?
Are you running this against 1.5 or 1.4.x?
Did you change the two config settings? Stats will NOT RUN at all until you've changed them. You need to set enablestats to 'yes' and pick a value for statsfirstrun. If you've patched 1.5 then you should find them in your config -> variables page. If you've patched 1.4.x you can put them into your moodle config table manually, or set them in config.php.
What did you set the first time run to be? Did you set it to none? Thinking about it, there may be a bug with 'none', but I don't want to investigate until you confirm that is indeed your config.
Here are my setting Penny
Statistics
|
Here are my settings:
enablestats: yes
statsfirstrun: 1 month
I have tried different first run durations but none have made any impact
The stats cron can take quite some time to run the first time around, so it creates a 'lockfile' in the form of a record in prefix_config. Because cron.php died the first time, the lockfile was never deleted, so every time he tried to run it after that, it thought there was another process already running and wouldn't start.
In this case, it was a simple matter of running the following query:
select * from prefix_config where name like '%stats%';
if there are any results with obvious lockfile titles (if it dies on the first time there could be two - firstrun lock & normal lock) then just delete them and run again. That sorted out the problem for Julian.
Edit: it's worth mentioning that the normal run lock is time sensitive. That is, it has a duration (3 hours), and after that, the lock will get clobbered and things will run normally again.
The first run lock, because the length of the first run is hugely dependent on your config settings and how much data you have, gets set to not be clobbered, because it could take a very long time before it should actually be considered stale. Our first run over a busy site with 6 months of data took 10 hours, for example. At any rate, these locks can always be deleted manually.
Hi Penny,
I seem to be getting the same problem in that my stats package will not run in cron. You mentioned runing: select * from prefix_config where name like '%stats%'; but i'm not sure how i run this and where from. Consider me a newbie. Any help will be appreciated. i have followed this whole forum and got correct settings in place but nothing.
Any help will be greatly appreciated. I just downloaded Moodle 1.6 two days ago and am trying to run the stats on that.
Thanks
Umar
Besides, did you see anything in related to the stats package when you run the cron job?
Thanks for the reply. I realised it was an SQL statement and had already tried running it in PhpMyAdmin but it gave an error. My mistake was that i didn't know what you originally meant by changing my "prefix". Change "prefix" at prefix_config to the prefix at your site. I now figured this means change "prefix_config" to the original "mdl_config" and then run the SQL statement.
Now when i ran the statement it gave me 9 entries from the query as below;
The 1st and 9th row was initally set to "0" and as you have stated i changed this to "null" and ran the Cron Job again (no mention of stats in the job) and then upon clicking the stats icon in moodle i still get no luck. It just says "0 days done and 7 pending".
And yes when i initially last ran the cron job i did see a some kind of note regarding the stats package. It mentioned something about the lockfile.
Any news on whether this will be in 1.5?
Cheers,
Mark
Mark
Allow me to give you some feedback based on requirements from
the University of Wisconsin. I was the lead for this requirements gathering.
I'm attaching a spreadsheet that is breaking this down into "feature requests".
This has been going around to the "site admins" of Learn@UW (http://learnuw.wisconsin.edu), and you see the relative priorities that they have set
by mutual agreement.
I should add that the term "org" here stands for "org unit" or "organizational unit".
In the system we are currently running, D2L, you can organize things hierarchically by "org unit". Not that I'm lobbying for Moodle to do this same thing (please don't , which I've posted about elsewhere).
At a high level, here's what the reporting needs look like as questions to
be answered.
Initial Breakdown
Reports of -
Courses:
Number of Active Courses
Number of Total Courses
Number of Inactive courses?
Courses by file space used
Courses by creation date
User:
Logons and log outs, Usage reports per hour, day, week, term, arbitrary time intervals.
report of users by roles (including custom roles). At Org level, and role enrollment at department and course levels.
Complete course enrollment per student/instructor
At Org level and per course enrollment:
Number of active users
Number of total users
Number of inactive users?
Tools:
Logging actions per tool. Use per user, per tool. Usage reports per hour, day, week, term, arbitrary time intervals. At Org and Course level.
This looks excellent, good work
Has there been any movement on this or are the links you provided still valid?
Regards
H
First, stats has changed quite a bit since those patches, but it is in CVS HEAD, which means it will be in moodle 1.6!
Cheers
Penny
I (being brave or stupid) am running moodle 1.6 at our school now..and have to say I love the stats package and how you have integrated it with logs.
Trust me when I say that 1.6 is shaping up to be one hell of a release
Great work Penny
Thanks!
Might have to pluck up the courage to dive in there and give it a try!
Regards
H
Hi Penny,
This looks pretty impressive, are there installation instructions somewhere?
Regards,
Mark
I too would be interested in some installation instructions for this. It looks fantastic.
With my best regards,
Kunal
Ok. As of around now I would NOT recommend running it from the patch I posted earlier as it's changed a lot since then.
It WILL be in moodle 1.6, if you're brave you can run it now but bear in mind it is the development version and there will be bugs and things have a habit of changing before they stabilise ;)
So, I say, wait for 1.6 to be out and then just follow the instructions in the admin config variables screen.
Thanks.
Peter