Permalink
Browse files

MDL-38559 Fix the ability to disable the grade condition in the cours…

…e completion settings form
  • Loading branch information...
1 parent 6e5a473 commit 870a4f81192292c115b3bb9d7b9a00fb9499ff4a @mudrd8mz mudrd8mz committed May 9, 2013
Showing with 8 additions and 6 deletions.
  1. +8 −6 completion/criteria/completion_criteria_grade.php
@@ -80,12 +80,14 @@ public function config_form_display(&$mform, $data = null) {
*/
public function update_config(&$data) {
- $formatedgrade = unformat_float($data->criteria_grade_value);
- // TODO validation
- if (!empty($formatedgrade) && is_numeric($formatedgrade)) {
- $this->course = $data->id;
- $this->gradepass = $formatedgrade;
- $this->insert();
+ if (!empty($data->criteria_grade)) {
+ $formatedgrade = unformat_float($data->criteria_grade_value);
+ // TODO validation
+ if (!empty($formatedgrade) && is_numeric($formatedgrade)) {
+ $this->course = $data->id;
+ $this->gradepass = $formatedgrade;
+ $this->insert();
+ }
}
}

0 comments on commit 870a4f8

Please sign in to comment.