MDL-83550 gradingform_rubric: fix submit no grade when remark disabled

This commit is contained in:
Andrew Gosali
2025-03-17 14:50:31 +07:00
parent cbd60e5a9b
commit 500a225afc
+10
View File
@@ -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);