diff --git a/classes/completion/custom_completion.php b/classes/completion/custom_completion.php index 9e2a35d2..25a129a4 100644 --- a/classes/completion/custom_completion.php +++ b/classes/completion/custom_completion.php @@ -73,7 +73,7 @@ public function get_state(string $rule): int { public static function get_defined_custom_rules(): array { return [ 'completionvote', - 'completionallocation' + 'completionallocation', ]; } @@ -85,7 +85,7 @@ public static function get_defined_custom_rules(): array { public function get_custom_rule_descriptions(): array { return [ 'completionvote' => get_string('completionvote_desc', RATINGALLOCATE_MOD_NAME), - 'completionallocation' => get_string('completionallocation_desc', RATINGALLOCATE_MOD_NAME) + 'completionallocation' => get_string('completionallocation_desc', RATINGALLOCATE_MOD_NAME), ]; } @@ -98,7 +98,7 @@ public function get_sort_order(): array { return [ 'completionview', 'completionvote', - 'completionallocation' + 'completionallocation', ]; } } diff --git a/lib.php b/lib.php index 226f1a5f..dbdcac74 100644 --- a/lib.php +++ b/lib.php @@ -764,6 +764,7 @@ function ratingallocate_reset_course_form_defaults($course) { * @param stdClass $coursemodule The coursemodule object (record). * @return cached_cm_info An object on information that the courses * will know about (most noticeably, an icon). + * @throws dml_exception */ function ratingallocate_get_coursemodule_info($coursemodule) { global $DB; diff --git a/locallib.php b/locallib.php index da5a4942..a7078428 100644 --- a/locallib.php +++ b/locallib.php @@ -187,7 +187,7 @@ class ratingallocate { /** * Returns all users enrolled in the course the ratingallocate is in, who were able to access the activity - * @returns Array of user records + * @return Array of user records * @throws moodle_exception */ public function get_raters_in_course(): array { diff --git a/mod_form.php b/mod_form.php index 3d0e06b7..6c854906 100644 --- a/mod_form.php +++ b/mod_form.php @@ -351,6 +351,12 @@ public function add_completion_rules() { return [$this->get_suffixed_name('vote'), $this->get_suffixed_name('allocation')]; } + /** + * Returns the suffixed name for custom completion elements. + * + * @param string $fieldname + * @return string + */ protected function get_suffixed_name(string $fieldname): string { // Replace _ratingallocate with $this->get_suffix() for Moodle 4.3 or later. return 'completion' . $fieldname . '_ratingallocate';