MDL-78889 gradereport_user: Fix pass/fail icon for totals

When the category has a 'grade to pass' set, the pass/fail icon
was displayed even when the category total grade values was hidden.
This commit is contained in:
Ilya Tregubov 2024-04-26 10:54:05 +08:00
parent 7b9a4eeca5
commit 7721ddb679

View File

@ -713,7 +713,7 @@ class user extends grade_report {
$gradestatusclass = '';
$gradepassicon = '';
$ispassinggrade = $gradegrade->is_passed($gradegrade->grade_item);
if (!is_null($ispassinggrade)) {
if (!is_null($gradeval) && !is_null($ispassinggrade)) {
$gradestatusclass = $ispassinggrade ? 'gradepass' : 'gradefail';
if ($ispassinggrade) {
$gradepassicon = $OUTPUT->pix_icon(