Skip to content

Commit

Permalink
Replaced deprecated core completion strings with local ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Opitz committed Nov 24, 2023
1 parent ea98304 commit 5657d4d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lang/en/hsuforum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
4 changes: 2 additions & 2 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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) {
Expand Down

0 comments on commit 5657d4d

Please sign in to comment.