MDL-74300 core_grades: Fix errors in bulk to gradebook

This change prevents the printing of header when the
moodles page's state is STATE_IN_BODY. Due to the absence
of this check when user entered graded in bulk was causing
errors.
This commit is contained in:
Sujith Haridasan
2022-03-28 11:12:40 +05:30
parent efda17d3b0
commit f2c7f35f78
+4 -2
View File
@@ -386,8 +386,10 @@ function grade_regrade_final_grades_if_required($course, callable $callback = nu
}
if (grade_needs_regrade_progress_bar($course->id)) {
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
if ($PAGE->state !== moodle_page::STATE_IN_BODY) {
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
}
echo $OUTPUT->heading(get_string('recalculatinggrades', 'grades'));
$progress = new \core\progress\display(true);
$status = grade_regrade_final_grades($course->id, null, null, $progress);