Browse files

Merge branch 'MDL-36761_loop_23' of git://github.com/andyjdavis/moodl…

…e into MOODLE_23_STABLE
  • Loading branch information...
2 parents b88caf8 + b10a467 commit 5b2b3bdaf8973db40d6134cc559da39245618560 Sam Hemelryk committed Dec 9, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/grade/grade_category.php
View
6 lib/grade/grade_category.php
@@ -886,7 +886,9 @@ public function apply_limit_rules(&$grade_values, $items) {
$droppedsomething = false;
$grade_keys = array_keys($grade_values);
- if (count($grade_keys) === 0) {
+ $gradekeycount = count($grade_keys);
+
+ if ($gradekeycount === 0) {
//We've dropped all grade items
break;
}
@@ -910,7 +912,7 @@ public function apply_limit_rules(&$grade_values, $items) {
}
$i = 1;
- while ($originalindex+$i < count($grade_keys)) {
+ while ($originalindex + $i < $gradekeycount) {
$possibleitemid = $grade_keys[$originalindex+$i];
$i++;

0 comments on commit 5b2b3bd

Please sign in to comment.