mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 01:46:45 +02:00
Merge branch 'MDL-52078-master' of git://github.com/cameron1729/moodle
This commit is contained in:
commit
8b198577e2
2 changed files with 79 additions and 2 deletions
|
@ -805,8 +805,18 @@ class grade_grade extends grade_object {
|
|||
|
||||
} else if (!array_intersect($dependson[$do], $todo)) {
|
||||
$hidden_precursors = array_intersect($dependson[$do], array_keys($altered));
|
||||
if (!$hidden_precursors) {
|
||||
// hiding does not affect this grade
|
||||
// If the dependency is a sum aggregation, we need to process it as if it had hidden items.
|
||||
// The reason for this, is that the code will recalculate the maxgrade by removing ungraded
|
||||
// items and accounting for 'drop x grades' and then stored back in our virtual grade_items.
|
||||
// This recalculation is necessary because there will be a call to:
|
||||
// $grade_category->aggregate_values_and_adjust_bounds
|
||||
// for the top level grade that will depend on knowing what that caclulated grademax is
|
||||
// and it finds that value by checking the virtual grade_items.
|
||||
$issumaggregate = false;
|
||||
if ($grade_items[$do]->itemtype == 'category') {
|
||||
$issumaggregate = $grade_items[$do]->load_item_category()->aggregation == GRADE_AGGREGATE_SUM;
|
||||
}
|
||||
if (!$hidden_precursors && !$issumaggregate) {
|
||||
unset($todo[$key]);
|
||||
$found = true;
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue