moodleou / moodle-mod_oublog

Alternative blog module for Moodle 2 (including course blogs)
31 stars 29 forks source link

Activity completion badges lack proper descriptions in Moodle 3.11 #125

Open ebithell opened 2 years ago

ebithell commented 2 years ago

Affected branch: MOODLE_311_STABLE at commit #b723f216, installed in Moodle 3.11.7.

Moodle 3.11 adds activity completion status lozenges below each activity link on a main course page, if activity completion is enabled. The automatic completion badges for the OU Blog activity lack proper descriptions, for example (compared with a standard Forum activity):

Moodle311_OUBlogcompletion

This is because get_custom_rule_descriptions() in mod/oublog/classes/completion/custom_completion.php returns an empty array:

public function get_custom_rule_descriptions(): array {
    return [];
}

whereas it would be expected to contain logic and language strings similar to mod/forum/classes/completion/custom_completion.php:

public function get_custom_rule_descriptions(): array {
    $completiondiscussions = $this->cm->customdata['customcompletionrules']['completiondiscussions'] ?? 0;
    $completionreplies = $this->cm->customdata['customcompletionrules']['completionreplies'] ?? 0;
    $completionposts = $this->cm->customdata['customcompletionrules']['completionposts'] ?? 0;

    return [
        'completiondiscussions' => get_string('completiondetail:discussions', 'forum', $completiondiscussions),
        'completionreplies' => get_string('completiondetail:replies', 'forum', $completionreplies),
        'completionposts' => get_string('completiondetail:posts', 'forum', $completionposts),
    ];
}

Thank you in advance to the OU development team for anything that you can do to fix this issue!

jason-platts commented 2 years ago

Thanks for spotting this - I've added to our development backlog.