Skip to content

Commit b361e85

Browse files
opitzMatthias Opitz
andauthored
Added suffix for completion rules for Moodle 4.3+ (#533)
Co-authored-by: Matthias Opitz <[email protected]>
1 parent e4ce349 commit b361e85

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

mod_form.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,19 @@ public function validation($data, $files) {
199199
* @return string[]
200200
*/
201201
public function add_completion_rules() {
202+
global $CFG;
203+
204+
// Changes for Moodle 4.3 - MDL-78516.
205+
if ($CFG->branch < 403) {
206+
$suffix = '';
207+
} else {
208+
$suffix = $this->get_suffix();
209+
}
210+
202211
$mform =& $this->_form;
203-
$mform->addElement('checkbox', 'completionsubmit', '', get_string('completionsubmit', 'questionnaire'));
204-
return array('completionsubmit');
212+
$mform->addElement('checkbox', 'completionsubmit' . $suffix, '',
213+
get_string('completionsubmit', 'questionnaire'));
214+
return ['completionsubmit' . $suffix];
205215
}
206216

207217
/**

0 commit comments

Comments
 (0)