mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
MDL-38559 Fix the ability to disable the grade condition in the course completion settings form
This commit is contained in:
parent
6e5a473c47
commit
870a4f8119
@ -80,12 +80,14 @@ class completion_criteria_grade extends completion_criteria {
|
||||
*/
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user