mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
Merge branch 'MDL-52578-master' of git://github.com/junpataleta/moodle
This commit is contained in:
commit
a5a8ca5e62
1 changed files with 15 additions and 1 deletions
|
@ -277,6 +277,13 @@ function edit_module_post_actions($moduleinfo, $course) {
|
|||
if ($update) {
|
||||
$item->update();
|
||||
}
|
||||
|
||||
if (!empty($moduleinfo->add)) {
|
||||
$gradecategory = $item->get_parent_category();
|
||||
if ($item->set_aggregation_fields_for_aggregation(0, $gradecategory->aggregation)) {
|
||||
$item->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -298,8 +305,8 @@ function edit_module_post_actions($moduleinfo, $course) {
|
|||
|
||||
if (property_exists($moduleinfo, $elname) and $moduleinfo->$elname) {
|
||||
// Check if this is a new outcome grade item.
|
||||
$outcomeexists = false;
|
||||
if ($items) {
|
||||
$outcomeexists = false;
|
||||
foreach($items as $item) {
|
||||
if ($item->outcomeid == $outcome->id) {
|
||||
$outcomeexists = true;
|
||||
|
@ -333,6 +340,13 @@ function edit_module_post_actions($moduleinfo, $course) {
|
|||
} else if (isset($moduleinfo->gradecat)) {
|
||||
$outcomeitem->set_parent($moduleinfo->gradecat);
|
||||
}
|
||||
|
||||
if (!$outcomeexists) {
|
||||
$gradecategory = $outcomeitem->get_parent_category();
|
||||
if ($outcomeitem->set_aggregation_fields_for_aggregation(0, $gradecategory->aggregation)) {
|
||||
$outcomeitem->update();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue