Skip to content

Commit

Permalink
codestyle fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
irinahpe committed Jul 30, 2024
1 parent 8a1cea8 commit 48e2bf4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions classes/completion/custom_completion.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function get_state(string $rule): int {
public static function get_defined_custom_rules(): array {
return [
'completionvote',
'completionallocation'
'completionallocation',
];
}

Expand All @@ -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),
];
}

Expand All @@ -98,7 +98,7 @@ public function get_sort_order(): array {
return [
'completionview',
'completionvote',
'completionallocation'
'completionallocation',
];
}
}
Expand Down
1 change: 1 addition & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 6 additions & 0 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 48e2bf4

Please sign in to comment.