Skip to content

Commit

Permalink
fix: only apply completiongradeitemnumber modification to elements co…
Browse files Browse the repository at this point in the history
…mpleted via a grade
  • Loading branch information
Glutamat42 committed Dec 3, 2024
1 parent 6d0255e commit feb95ba
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,12 @@ public function set_completion_to_auto(stdClass $cm_info, bool $view): void {
$this->moodle_core_repository->update_course_module_record($cm_info->id, [
'completion' => 2,
'completionpassgrade' => $view ? 0 : 1,
'completionview' => $view ? 1 : 0,
'completiongradeitemnumber' => 0
'completionview' => $view ? 1 : 0
]);
if (!$view) {
$this->moodle_core_repository->update_course_module_record($cm_info->id, [
'completiongradeitemnumber' => 0
]);
}
}
}

0 comments on commit feb95ba

Please sign in to comment.