diff --git a/grade/grading/form/rubric/renderer.php b/grade/grading/form/rubric/renderer.php index 6017a553ea6..9c12d593f77 100644 --- a/grade/grading/form/rubric/renderer.php +++ b/grade/grading/form/rubric/renderer.php @@ -115,6 +115,16 @@ class gradingform_rubric_renderer extends plugin_renderer_base { $descriptiontdparams['aria-label'] = get_string('criterion', 'gradingform_rubric', s($criterion['description'])); } + // Default value for criterion ids. + // Edge case: submitting empty grade when remark field is disabled. + // Reason: we need the criteria keys for the clear_attempt to clear the rubric fillings. + if ($mode == gradingform_rubric_controller::DISPLAY_EVAL) { + $criteriontemplate .= html_writer::empty_tag('input', [ + 'type' => 'hidden', + 'name' => '{NAME}[criteria][{CRITERION-id}][]', + ]); + } + // Description cell. $criteriontemplate .= html_writer::tag('td', $description, $descriptiontdparams);