From 5cbadc9dacda461897183527fae78ac2a0c7587f Mon Sep 17 00:00:00 2001 From: Nicolas Alexandropoulos Date: Wed, 13 Nov 2024 13:48:58 +0100 Subject: [PATCH] Fix code checker issues --- db/upgrade.php | 1 - lang/en/choicegroup.php | 2 +- mod_form.php | 13 +++++++++---- renderer.php | 4 ++-- settings.php | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/db/upgrade.php b/db/upgrade.php index c98473a..d111cb8 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -116,6 +116,5 @@ function xmldb_choicegroup_upgrade($oldversion) { upgrade_mod_savepoint(true, 2024092600, 'choicegroup'); } - return true; } diff --git a/lang/en/choicegroup.php b/lang/en/choicegroup.php index 8f922c0..8fccf20 100644 --- a/lang/en/choicegroup.php +++ b/lang/en/choicegroup.php @@ -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"; diff --git a/mod_form.php b/mod_form.php index e265dea..9d4c7c1 100644 --- a/mod_form.php +++ b/mod_form.php @@ -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. // -------------------------. // ------------------------------------------------------------------------------- diff --git a/renderer.php b/renderer.php index fddf25e..32e0a25 100644 --- a/renderer.php +++ b/renderer.php @@ -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']); diff --git a/settings.php b/settings.php index 11ccd92..ae75014 100644 --- a/settings.php +++ b/settings.php @@ -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'), ] )); }