Skip to content

Commit

Permalink
Fix code checker issues
Browse files Browse the repository at this point in the history
  • Loading branch information
NicoAlexH committed Nov 13, 2024
1 parent 009125f commit 5cbadc9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,5 @@ function xmldb_choicegroup_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2024092600, 'choicegroup');
}


return true;
}
2 changes: 1 addition & 1 deletion lang/en/choicegroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
$string['completiondetail:submit'] = 'Choose a group';
$string['completionsubmit'] = 'Show as complete when user makes a choice';
$string['createdate'] = 'Group creation date';
$string['defaultsettings'] = 'Default settings';
$string['defaultgroupdescriptionstate'] = 'Default group description display';
$string['defaultgroupdescriptionstate_desc'] = 'Should the group description be displayed by default or not.';
$string['defaultsettings'] = 'Default settings';
$string['del'] = "Remove";
$string['del_group'] = "Remove Group";
$string['del_groups'] = "Remove Groups";
Expand Down
13 changes: 9 additions & 4 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,21 @@ public function definition() {
$mform->addElement('select', 'sortgroupsby', get_string('sortgroupsby', 'choicegroup'), $options);
$mform->setDefault('sortgroupsby', CHOICEGROUP_SORTGROUPS_SYSTEMDEFAULT);

// Default Group Description Display
// Default Group Description Display.
$descriptionoptions = [
CHOICEGROUP_GROUPDESCRIPTIONSTATE_VISIBLE => get_string('showdescription', 'choicegroup'),
CHOICEGROUP_GROUPDESCRIPTIONSTATE_HIDDEN => get_string('hidedescription', 'choicegroup')
CHOICEGROUP_GROUPDESCRIPTIONSTATE_HIDDEN => get_string('hidedescription', 'choicegroup'),
];
$groupdescriptionstate = get_config('choicegroup', 'defaultgroupdescriptionstate');
$mform->addElement('select', 'defaultgroupdescriptionstate', get_string('defaultgroupdescriptionstate', 'choicegroup'), $descriptionoptions);
$mform->addElement(
'select',
'defaultgroupdescriptionstate',
get_string('defaultgroupdescriptionstate', 'choicegroup'),
$descriptionoptions
);
$mform->setDefault('defaultgroupdescriptionstate', $groupdescriptionstate);
// -------------------------
// Go on the with the remainder of the form
// Go on the with the remainder of the form.
// -------------------------.

// -------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ public function display_options($options, $coursemoduleid, $vertical = true, $pu
if ($groupdescriptionstate == CHOICEGROUP_GROUPDESCRIPTIONSTATE_HIDDEN) {
$group .= html_writer::tag('a', get_string('showdescription', 'choicegroup'),
['role' => 'button', 'class' => 'choicegroup-descriptiondisplay choicegroup-descriptionshow btn btn-secondary ml-1',
'href' => '#',]);
'href' => '#']);
} else {
$group .= html_writer::tag('a', get_string('hidedescription', 'choicegroup'),
['role' => 'button', 'class' => 'choicegroup-descriptiondisplay choicegroup-descriptionshow btn btn-secondary ml-1',
'href' => '#',]);
'href' => '#']);
}
$html .= html_writer::tag('th', $group, ['class' => 'width40']);

Expand Down
2 changes: 1 addition & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
CHOICEGROUP_GROUPDESCRIPTIONSTATE_HIDDEN,
[
CHOICEGROUP_GROUPDESCRIPTIONSTATE_VISIBLE => get_string('showdescription', 'choicegroup'),
CHOICEGROUP_GROUPDESCRIPTIONSTATE_HIDDEN => get_string('hidedescription', 'choicegroup')
CHOICEGROUP_GROUPDESCRIPTIONSTATE_HIDDEN => get_string('hidedescription', 'choicegroup'),
]
));
}

0 comments on commit 5cbadc9

Please sign in to comment.