mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-59055 grades: fix bug displaying item id instead of grade
Thanks to Marcelo Santos for initial patch
This commit is contained in:
parent
8146b1f06d
commit
be85f0cf88
@ -996,7 +996,7 @@ class grade_report_grader extends grade_report {
|
||||
// Get the decimal points preference for this item
|
||||
$decimalpoints = $item->get_decimals();
|
||||
|
||||
if (in_array($itemid, $unknown)) {
|
||||
if (array_key_exists($itemid, $unknown)) {
|
||||
$gradeval = null;
|
||||
} else if (array_key_exists($itemid, $altered)) {
|
||||
$gradeval = $altered[$itemid];
|
||||
|
@ -525,7 +525,7 @@ abstract class grade_report {
|
||||
$aggregationweight = null;
|
||||
}
|
||||
}
|
||||
} else if (!empty($hiding_affected['unknown'][$course_item->id])) {
|
||||
} else if (array_key_exists($course_item->id, $hiding_affected['unknown'])) {
|
||||
//not sure whether or not this item depends on a hidden item
|
||||
if (!$this->showtotalsifcontainhidden[$courseid]) {
|
||||
//hide the grade
|
||||
|
@ -795,10 +795,10 @@ class grade_grade extends grade_object {
|
||||
for($i=0; $i<$max; $i++) {
|
||||
$found = false;
|
||||
foreach($todo as $key=>$do) {
|
||||
$hidden_precursors = array_intersect($dependson[$do], $unknown);
|
||||
$hidden_precursors = array_intersect($dependson[$do], array_keys($unknown));
|
||||
if ($hidden_precursors) {
|
||||
// this item depends on hidden grade indirectly
|
||||
$unknown[$do] = $do;
|
||||
$unknown[$do] = $grade_grades[$do]->finalgrade;
|
||||
unset($todo[$key]);
|
||||
$found = true;
|
||||
continue;
|
||||
@ -828,7 +828,7 @@ class grade_grade extends grade_object {
|
||||
) {
|
||||
// This is a grade item that is not a category or course and has been affected by grade hiding.
|
||||
// I guess this means it is a calculation that needs to be recalculated.
|
||||
$unknown[$do] = $do;
|
||||
$unknown[$do] = $grade_grades[$do]->finalgrade;
|
||||
unset($todo[$key]);
|
||||
$found = true;
|
||||
continue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user