Automatically categorising grades with a block's cronjob

Automatically categorising grades with a block's cronjob

by Mike Worth -
Number of replies: 3
I am having an issue with gradebooks becoming far too wide. As discussed here, I think it would be good to automatically categorise grades by month (then the months can be collapsed).

I am thinking that the cleanest way to do this would be a block which doesn't actually do anything if added to a course, but has a cronjob which runs regularly to do this categorisation. There is an issue that if I hide the block (the whole thing via manage blocks, not just one instance) the cronjob won't run, but if I don't hide the block it will show up on lists and possibly confuse teachers.

Is this really the best solution or am I missing something?

Thanks,
Mike
Average of ratings: -
In reply to Mike Worth

Re: Automatically categorising grades with a block's cronjob

by Mike Worth -
Well I've gone ahead and written this block, it finds all uncategorised grades and puts them into categories for each month. It also sets aggregatesubcats=1 for the course categories so that the course total is not effected by the categorisation. It runs every 5 mins on cron, but will take quite a while first time (if you've got lots of uncategorised grades that is) but takes a negligable amount of time thereafter.

Still got the issue of it showing up on add block lists though

Mike
In reply to Mike Worth

Re: Automatically categorising grades with a block's cronjob

by Paul Holden -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Have you tried adding the following method to your block class:

function applicable_formats() {
return (array('all' => false));
}

That should prevent it showing up in any add block lists.