Moodle plugins directory: Count of user log records | Moodle.org
Count of user log records
Reports ::: report_rawrecordscount
Maintained by Eloy Lafuente (stronk7)
One simple report counting the log records per user in a given course. Exportable to ods/xls/txt.
Latest release:
24 sites
5 downloads
1 fans
Current versions available: 2
Useful links
Contributors
Eloy Lafuente (stronk7) (Lead maintainer)
Please login to view contributors details and/or to contact them
Please use English in the comments, it helps everybody to understand them.
Ciao
"SELECT $ufields , count(l.id) as count
FROM {user} u
JOIN ($esql) je ON je.id = u.id
LEFT JOIN {log} l on l.userid = u.id AND l.course = :course
WHERE u.id $msql
GROUP BY " . user_picture::fields('u') . "
ORDER BY u.lastname, u.firstname"
and i am novice to moodle so please keep that in mind.
// Get the list of all users having moodle/course:manageactivities capability
// in order to take out them later from the report (to try to get "students" only).
if
($havemanage = get_users_by_capability($context, 'moodle/course:manageactivities', 'u.id') ){
$havemanage = array_keys($havemanage);
}
now i want to see what is inside havemanage,then How i can do that?
How can i print contents of havemanage on my moodle page,
This line is from report plugin rawrecordscount!
sorry for the delay, I just saw today that there were a bunch of messages from you here.
First of all let me point you to the main course "Moodle in English" where there are sections to ask and discuss about development and other matters. I'd suggest you to ask there when you get "blocked" at any time when playing with Moodle code.
Said that... about your questions... that query is really not complex. It's a simple join getting information from the users table (name, email, picture...) for all the enrolled users in a course not being managers. So it will provide the list of "students" (more or less), independently of how the roles are named/configured in the site.
And then, for every user in that list, it simply returns the number of records in the log table. And that's exactly what the report does: To return the list of "students" in a course with their number of logs (actions performed in the course).
About how to view the contents of any variable... you can use any IDE (Netbeans...) able to set break points and debug... or alternatively... use/add print_r() or print_object() manual calls in the code to see the contents of any variable at any point.
Hope it helps... again, sorry for the delay... ciao
I would like to ask if anyone can shed a light about how to use the installed add-on.
I am new to moodle and I don't know where to look on the platform to create the count of users logs.
Is there a standard path where the add-ons go or it depends on the specific add-on? In this specific case how do I create the report?
Thank you in advance for your help.
Stefano
Is the plugin suitable for Moodle 2.8 version ? Thank you.