Skip to content

Commit

Permalink
MDL-19407 Defaulting all grade items to non-extra-credit when moving …
Browse files Browse the repository at this point in the history
…to a SWM category, except if they originally come from a SWM category and were set as extra credit there.
  • Loading branch information
nicolasconnault committed Sep 17, 2009
1 parent 1d919f4 commit 1119cfa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/grade/grade_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -1208,6 +1208,13 @@ function set_parent($parentid) {
return false;
}

// MDL-19407 If moving from a non-SWM category to a SWM category, convert aggregationcoef to 0
$currentparent = $this->load_parent_category();

if ($currentparent->aggregation != GRADE_AGGREGATE_WEIGHTED_MEAN2 && $parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN2) {
$this->aggregationcoef = 0;
}

$this->force_regrading();

// set new parent
Expand Down

0 comments on commit 1119cfa

Please sign in to comment.