Skip to content

Commit

Permalink
MBS-9793: Set backlink as default when using format_learningmap
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-csg authored and Paola Maneggia committed Feb 5, 2025
1 parent 2a8e4d1 commit 82e98e1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ public function definition(): void {
)
);

$learningmapformat = $this->_course->format === 'learningmap';

// If using learningmap course format, the map is never shown on the course page.
if ($this->_course->format === 'learningmap') {
if ($learningmapformat) {
$mform->addElement('hidden', 'showmaponcoursepage', 0);
} else {
$mform->addElement('advcheckbox', 'showmaponcoursepage', get_string('showmaponcoursepage', 'learningmap'));
Expand All @@ -122,6 +124,7 @@ public function definition(): void {
$mform->addElement('advcheckbox', 'backlink', get_string('showbacklink', 'learningmap'));
$mform->setType('backlink', PARAM_INT);
$mform->addHelpButton('backlink', 'showbacklink', 'learningmap');
$mform->setDefault('backlink', $learningmapformat);
} else {
$mform->addElement('hidden', 'backlink', 0);
}
Expand Down

0 comments on commit 82e98e1

Please sign in to comment.