From 5657d4dfd7ae1eb0162a14776ed463a60e838953 Mon Sep 17 00:00:00 2001 From: Matthias Opitz Date: Fri, 24 Nov 2023 17:18:18 +0000 Subject: [PATCH] Replaced deprecated core completion strings with local ones --- lang/en/hsuforum.php | 6 ++++++ mod_form.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lang/en/hsuforum.php b/lang/en/hsuforum.php index eba01dd3..31543041 100644 --- a/lang/en/hsuforum.php +++ b/lang/en/hsuforum.php @@ -755,3 +755,9 @@ $string['forumsubjectdeleted'] = 'This forum post has been removed'; $string['forumbodydeleted'] = 'The content of this forum post has been removed and can no longer be accessed.'; $string['gradeitem:posts'] = 'Posts'; + +// Replacements for deprecated core completion strings of Moodle 4.3+. +$string['completionview'] = 'Require view'; +$string['completionusegrade'] = 'Require grade'; +$string['completionusegrade_desc'] = 'Receive a grade'; +$string['completionusegrade_help'] = 'If enabled, the activity is considered complete when a student receives a grade. If a pass grade for the activity is set, then pass and fail icons are displayed in the activity completion report.'; diff --git a/mod_form.php b/mod_form.php index bcef8ac6..6142235d 100644 --- a/mod_form.php +++ b/mod_form.php @@ -414,7 +414,7 @@ protected function standard_hsuforum_coursemodule_elements() { // Automatic completion once you view it $gotcompletionoptions = false; if (plugin_supports('mod', $this->_modname, FEATURE_COMPLETION_TRACKS_VIEWS, false)) { - $mform->addElement('checkbox', 'completionview', get_string('completionview', 'completion'), + $mform->addElement('checkbox', 'completionview', get_string('completionview', 'mod_hsuforum'), get_string('completionview_desc', 'completion')); $mform->hideIf('completionview', 'completion', 'ne', COMPLETION_TRACKING_AUTOMATIC); // Check by default if automatic completion tracking is set. @@ -441,7 +441,7 @@ protected function standard_hsuforum_coursemodule_elements() { get_string('completionusegrade_desc', 'completion') ); $mform->hideIf('completionusegrade', 'completion', 'ne', COMPLETION_TRACKING_AUTOMATIC); - $mform->addHelpButton('completionusegrade', 'completionusegrade', 'completion'); + $mform->addHelpButton('completionusegrade', 'completionusegrade', 'mod_hsuforum'); // The disabledIf logic differs between ratings and other grade items due to different field types. if ($this->_features->rating) {