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

This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.
Lock Grader Report Category Total from being Overridden (Moodle 2.3.1)

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!

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

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.

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

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!

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') )
{
}

if(strpos($element['type'], 'category') !== FALSE || strpos($element['type'], 'course') !== FALSE)
{
}

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)

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

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

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

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

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

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