Permalink
Browse files

course completion: MDL-2631 Only update passing grade if grade criter…

…ia enabled
  • Loading branch information...
1 parent 0b66f4e commit 70f25ccee41202cfe972209ebab71561ec9ccf4e Aaron Barnes committed Aug 26, 2010
Showing with 7 additions and 5 deletions.
  1. +7 −5 course/completion.php
View
@@ -143,11 +143,13 @@
$aggregation->insert();
// Update course total passing grade
- if ($grade_item = grade_category::fetch_course_category($course->id)->grade_item) {
- $grade_item->gradepass = $data->criteria_grade_value;
- if (method_exists($grade_item, 'update')) {
- $grade_item->update('course/completion.php');
- }
+ if (!empty($data->criteria_grade)) {
+ if ($grade_item = grade_category::fetch_course_category($course->id)->grade_item) {
+ $grade_item->gradepass = $data->criteria_grade_value;
+ if (method_exists($grade_item, 'update')) {
+ $grade_item->update('course/completion.php');
+ }
+ }
}
redirect($CFG->wwwroot."/course/view.php?id=$course->id", get_string('changessaved'));

0 comments on commit 70f25cc

Please sign in to comment.