diff --git a/grade/lib.php b/grade/lib.php index 8c4d100084c..f3b637d71fa 100644 --- a/grade/lib.php +++ b/grade/lib.php @@ -2379,7 +2379,10 @@ class grade_structure { ['id' => $this->courseid, 'sesskey' => sesskey(), 'eid' => $element['eid']]); $url = $gpr->add_url_params($url); - if (($element['type'] == 'grade') && ($element['object']->grade_item->is_locked())) { + if ($element['type'] == 'category') { + // Grade categories themselves cannot be locked. + return null; + } else if (($element['type'] == 'grade') && ($element['object']->grade_item->is_locked())) { // Don't allow an unlocking action for a grade whose grade item is locked: just print a state icon. $strparamobj = new stdClass(); $strparamobj->itemname = $element['object']->grade_item->get_name(true, true); @@ -2520,6 +2523,7 @@ class grade_structure { if (isset($element['type']) && ($element['type'] == 'category')) { $context['classes'] = 'category_grade_icons'; + $context['locked'] = false; } return $OUTPUT->render_from_template('core_grades/status_icons', $context); @@ -2651,7 +2655,6 @@ class grade_structure { } $context->editurl = $this->get_edit_link($element, $gpr); $context->hideurl = $this->get_hiding_link($element, $gpr); - $context->lockurl = $this->get_locking_link($element, $gpr); } }