Here's a few reports I have fudged, but would like to see properly integrated:
Activity of all courses in a category, grouped by the top level category, i.e., school or department activity
Activity of all courses in a category, i.e., sub-department or area activity
Activity by hour of the day
Of course I have a few I'm working on that I'd like too. Top of the list is:
Course Activity compared to last year - I've got this working in a MySQL script, but I'm struggling to integrate it into Moodle
Red
Activity of all courses in a category, grouped by the top level category, i.e., school or department activity
SELECT REPLACE(substring(cats.path, 2, 2),'/','') AS toplevel, cats2.name, ".$param->fields
FROM ".$CFG->prefix."course_categories cats, ".$CFG->prefix."course mc, ".$CFG->prefix."stats_".$param->table." msd, ".$CFG->prefix."course_categories cats2"
WHERE timeend >= ".$param->timeafter.' AND stattype = \'activity\''
AND mc.id = msd.courseid AND mc.category = cats.id"
AND cats2.id = REPLACE(substring(cats.path, 2, 2),'/','')"
GROUP BY toplevel"
ORDER BY ".$param->orderby
Activity of all courses in a category, i.e., sub-department or area activity
SELECT courseid,".$param->fields.", ".$CFG->prefix."course.category, ".$CFG->prefix."course_categories.name"
FROM (".$CFG->prefix.'stats_'.$param->table." INNER JOIN ".$CFG->prefix."course"
ON ".$CFG->prefix."stats_".$param->table.".courseid = ".$CFG->prefix."course.id)"
INNER JOIN ".$CFG->prefix."course_categories ON ".$CFG->prefix."course_categories.id = ".$CFG->prefix."course.category"
WHERE timeend >= ".$param->timeafter.' AND stattype = \'activity\''
GROUP BY category "
ORDER BY ".$param->orderby
Activity by hour of the day
SELECT Count('x') AS line1, DATE_FORMAT(FROM_UNIXTIME(time),'%H:00 to %H:59') AS Hour"
FROM ".$CFG->prefix."log"
WHERE time >= '".$param->timeafter."'"
GROUP BY Hour
Hmm, the more I think about this the more I think it would be surprisingly difficult to do in a generically customisable way, especially with the dreadfully difficult 'who is a student of course x' problem we have at the moment
.
It'd be great if we could get a wide variety of use case statements for this - just something simple like:
etc
- A report which tells me how many instances of each resource/module there is across the whole site.
- A report which counts the total number of assignments marked in a specific course category
etc