Lock Grader Report Category Total from being Overridden (Moodle 2.3.1)

Lock Grader Report Category Total from being Overridden (Moodle 2.3.1)

by Juan F -
Number of replies: 5

Greetings moodlers!

I'm interested in locking the grader report Category Total from being overridden by faculty.  For some reason, they are changing these totals by accident.  Is it possible to disallow or lock this?

Thanks!

In reply to Juan F

Re: Lock Grader Report Category Total from being Overridden (Moodle 2.3.1)

by Debbie Unterseher -

Have you found an answer to this?  I called two other universities using Moodle, and they are all having problems with the Category and Course total being overridden - whether it is accidently by teachers or grades, or a bug in Moodle, I'm not sure.  

If I knew how to put in a bug tracker, I would, but I haven't narrowed it down yet.

In reply to Debbie Unterseher

Re: Lock Grader Report Category Total from being Overridden (Moodle 2.3.1)

by Erin Bard -

We are seeing this issue as well, and are not sure if it is a bug or if the faculty are doing it themselves.

If you'd like a quick and dirty code fix to stop teachers from modifying those columns, here is the code we modified that prevents teachers from updating the course total or category total columns in the Grader Report. We just went live with this change today, so it is untested - use at your own risk!

In /grade/report/grader/lib.php @line 1037, change this:

if ($this->get_pref('quickgrading') and $grade->is_editable()) {

To:

if ($this->get_pref('quickgrading') and $grade->is_editable() and $item->itemtype != 'category' and $item->itemtype != 'course') {

And at line 1528, immediately after the $editicon = ''; line, add this:

if( $element['type'] == 'grade' && ($element['object']->grade_item->itemtype == 'category' || $element['object']->grade_item->itemtype == 'course') )
{
return '<div class="grade_icons" />';
}

if(strpos($element['type'], 'category') !== FALSE || strpos($element['type'], 'course') !== FALSE)
{
return '<div class="grade_icons" />';
}

That should completely prevent the teachers (and anyone else) from modifying those columns of the grade report. It should be possible to add some more conditional logic so that managers or administrators could still override grades but teachers could not, but that wasn't a requirement for us, so I didn't look into it.

We are hoping that this change will stop the flood of overridden grades, and if it doesn't, then at least we'll be able to rule out manual overrides by the teachers as the source.

Edit to add: we are using Moodle 2.4+ (Build: 20121230)

In reply to Erin Bard

Re: Lock Grader Report Category Total from being Overridden (Moodle 2.3.1)

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

This is way cool - please update if you run into any problems with it - thanks for sharing!

In reply to Erin Bard

Re: Lock Grader Report Category Total from being Overridden (Moodle 2.3.1)

by Juan F -

Erin, has this solved the problem?  Let us know!

In reply to Debbie Unterseher

Re: Lock Grader Report Category Total from being Overridden (Moodle 2.3.1)

by Debbie Unterseher -

Refer to this track number for why course totals are being overridden.  Two browser windows open with grade ready to be updated, and one browser updated and then the other updated, and course totals get overridden....

https://tracker.moodle.org/browse/MDL-38732