From db3ce254374925e83b4bc0dc3b5c0af96f627f25 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Fri, 31 Dec 2021 17:45:15 +0100 Subject: [PATCH 1/7] some css improvements --- styles.css | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/styles.css b/styles.css index b469f9b..0ba1c7d 100644 --- a/styles.css +++ b/styles.css @@ -1,3 +1,14 @@ -.feedbackchoicegenerator h3 { +#feedbackchoicegenerator { + background-color: rgb(223, 242, 247); padding: 10px; -} \ No newline at end of file +} + +#feedbackchoicegenerator h3 { + padding: 10px; + background-color: rgb(35, 65, 163); + color: #fff; +} + +#feedbackchoicegenerator .row { + margin-left: 0px; +} From 30f5e91e982b072e7816d71bf31dc7e51b71d055 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Fri, 31 Dec 2021 17:46:01 +0100 Subject: [PATCH 2/7] new languagestrings --- lang/de/local_feedbackchoicegenerator.php | 10 ++++++---- lang/en/local_feedbackchoicegenerator.php | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lang/de/local_feedbackchoicegenerator.php b/lang/de/local_feedbackchoicegenerator.php index 414eba4..8dce2bd 100644 --- a/lang/de/local_feedbackchoicegenerator.php +++ b/lang/de/local_feedbackchoicegenerator.php @@ -45,15 +45,17 @@ $string['summary'] = 'Ein Generator für die Aktivität Feedback, um eine 1. und 2. Wahl umzusetzen.'; $string['courseidlabel'] = 'Kursid'; +$string['backtocourselabel'] = 'zurück zum Kurs'; $string['sizelabel'] = 'Anzahl der Optionen'; -$string['optionsheader'] = 'Eingabebereich der Optionen:'; +$string['optionslengthinfo'] = 'max. Zeichenanzahl je Option:'; -$string['description'] = 'Den hier erzeugten xml-Code mit Hilfe des Download-Buttons herunterladen (rechte Maustaste nutzen und Speichern unter wählen). +$string['description'] = 'Den hier erzeugten xml-Code mit Hilfe des Download-Links herunterladen (rechte Maustaste "Ziel speichern unter..." nutzen). Alternativ den xml-Code in einer Textdatei kopieren und mit der Endung .xml speichern.'; -$string['buttonlabel'] = 'XML erzeugen oder aktualisieren'; -$string['downloadbuttonlabel'] = 'Download (rechte Maustaste speichern und unter)'; +$string['buttonlabel'] = 'XML erzeugen'; +$string['updatebuttonlabel'] = 'aktualisieren'; +$string['downloadbuttonlabel'] = 'XML-Download (rechte Maustaste "Ziel speichern unter...")'; $string['resetbuttonlabel'] = 'Eingaben zurücksetzen'; $string['selectlabel'] = 'auswählen'; diff --git a/lang/en/local_feedbackchoicegenerator.php b/lang/en/local_feedbackchoicegenerator.php index 7209204..ebff10d 100644 --- a/lang/en/local_feedbackchoicegenerator.php +++ b/lang/en/local_feedbackchoicegenerator.php @@ -45,14 +45,16 @@ $string['summary'] = 'Generating import-file for activity feedback'; $string['courseidlabel'] = 'course id'; +$string['backtocourselabel'] = 'Back to the course'; $string['sizelabel'] = 'How many options'; -$string['optionsheader'] = 'Enter options'; +$string['optionslengthinfo'] = 'Max. inputlength for each option:'; -$string['description'] = 'Download the generated code or put the generated xml-Code in to a textfile with the extension .xml.'; +$string['description'] = 'Download the generated code "Save link as ..." or put the generated xml-Code in to a textfile with the extension .xml.'; -$string['buttonlabel'] = 'generate XML or update'; -$string['downloadbuttonlabel'] = 'download with right click and save'; +$string['buttonlabel'] = 'generate XML'; +$string['updatebuttonlabel'] = 'update'; +$string['downloadbuttonlabel'] = 'download with right click and "save link as..."'; $string['resetbuttonlabel'] = 'reset'; $string['selectlabel'] = 'select'; From 539bf74148f7b4d80058e2109453e5a850cbe705 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Fri, 31 Dec 2021 17:46:29 +0100 Subject: [PATCH 3/7] css and layout improvement --- templates/mainpage.mustache | 84 +++++++++++++++++++++---------------- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/templates/mainpage.mustache b/templates/mainpage.mustache index e6fd00b..7794039 100644 --- a/templates/mainpage.mustache +++ b/templates/mainpage.mustache @@ -3,40 +3,54 @@ }} +{{backtocourselabel}} +
+

{{header3}}

+
+ {{summary}} +
+
+ {{optionslengthinfo}} {{maxoptionslength}} +
+ + + + +
+ + +
+
+ {{sizelabel}} (max. {{maxlength}}):  + + +
+
+ +
+
+ {{#options}} + {{{optionlabel}}}: 
+ {{/options}} +
+
+
+
+ + + {{resetbuttonlabel}}
+ {{downloadbuttonlabel}} +
+
+ +
+ +
+ {{description}} +
+ + -

{{header3}}

-
- {{summary}} -
- -
- - -
- {{optionsheader}} (maxoptionslength {{maxoptionslength}})
-
- -
- {{sizelabel}}:  (max. {{maxlength}}) -
- - {{#options}} - {{{optionlabel}}}: 
- {{/options}} - -
- - -
- -
- {{description}}
- - From 4e78edbcbd00d661608e08808d9b028e3a060753 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Fri, 31 Dec 2021 17:48:08 +0100 Subject: [PATCH 4/7] support configuration to set generator active or inactive --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 00212e7..7cdc377 100644 --- a/index.php +++ b/index.php @@ -27,8 +27,8 @@ $feedbackchoicegeneratorinstance = new FeedbackChoiceGenerator($db, $courseid, $page, $output); global $CFG; -$isactive = true; -// $isactive = $CFG->local_feedbackchoicegenerator_isactive; + +$isactive = $CFG->local_feedbackchoicegenerator_isactive; if ($isactive) { $feedbackchoicegeneratorinstance->init(); } else { From 9c3a51c8781966312433ab174202cfda52382465 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Fri, 31 Dec 2021 17:49:11 +0100 Subject: [PATCH 5/7] only show node if generator is active --- lib.php | 48 ++++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/lib.php b/lib.php index 4e0ce48..bf91803 100755 --- a/lib.php +++ b/lib.php @@ -25,32 +25,36 @@ */ function local_feedbackchoicegenerator_extend_navigation_course($navigation, $course, $context) { global $CFG; - $page = $GLOBALS['PAGE']; - $url = new moodle_url('/local/feedbackchoicegenerator/index.php', array('id' => $course->id)); + $isactive = false; + $isactive = $CFG->local_feedbackchoicegenerator_isactive; + if ($isactive) { + $page = $GLOBALS['PAGE']; + $url = new moodle_url('/local/feedbackchoicegenerator/index.php', array('id' => $course->id)); - $feedbackchoicegeneratornode = $page->navigation->find($course->id, navigation_node::TYPE_COURSE); + $feedbackchoicegeneratornode = $page->navigation->find($course->id, navigation_node::TYPE_COURSE); - $collection = $feedbackchoicegeneratornode->children; + $collection = $feedbackchoicegeneratornode->children; - foreach ($collection->getIterator() as $child) { - $key = $child->key; - // position of node before this note - if ($key === 'participants') { - break; + foreach ($collection->getIterator() as $child) { + $key = $child->key; + // position of node before this note + if ($key === 'participants') { + break; + } } - } - $node = $feedbackchoicegeneratornode->create(get_string('pluginname', 'local_feedbackchoicegenerator'), - $url, navigation_node::NODETYPE_LEAF, null, 'feedbackchoicegenerator', new pix_icon('i/report', 'grades')); - $feedbackchoicegeneratornode->add_node($node, $key); - - $navigation->add( - get_string('pluginname', 'local_feedbackchoicegenerator'), - $url, - navigation_node::TYPE_SETTING, - null, - null, - new pix_icon('i/report', '') - ); + $node = $feedbackchoicegeneratornode->create(get_string('pluginname', 'local_feedbackchoicegenerator'), + $url, navigation_node::NODETYPE_LEAF, null, 'feedbackchoicegenerator', new pix_icon('i/report', 'grades')); + $feedbackchoicegeneratornode->add_node($node, $key); + + $navigation->add( + get_string('pluginname', 'local_feedbackchoicegenerator'), + $url, + navigation_node::TYPE_SETTING, + null, + null, + new pix_icon('i/report', '') + ); + } } From 49ba16c17052c5f701aea007d87fcde2752749a0 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Fri, 31 Dec 2021 17:49:51 +0100 Subject: [PATCH 6/7] css and layout impovements --- classes/View/FeedbackChoiceGenerator.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/View/FeedbackChoiceGenerator.php b/classes/View/FeedbackChoiceGenerator.php index 4541f30..4b7a990 100644 --- a/classes/View/FeedbackChoiceGenerator.php +++ b/classes/View/FeedbackChoiceGenerator.php @@ -89,8 +89,6 @@ public function init() { $size = 3; } - - if ($size > $maxlength) { $size = $maxlength; } @@ -125,6 +123,8 @@ public function init() { 'local_feedbackchoicegenerator/mainpage', [ 'courseid' => $this->courseid, + 'backtocourselabel' => get_string('backtocourselabel', 'local_feedbackchoicegenerator'), + 'title' => $this->get_page()->get_title(), 'header3' => get_string('header3', 'local_feedbackchoicegenerator'), 'summary' => get_string('summary', 'local_feedbackchoicegenerator'), @@ -133,7 +133,7 @@ public function init() { 'sizelabel' => get_string('sizelabel', 'local_feedbackchoicegenerator'), 'maxlength' => $maxlength, - 'optionsheader' => get_string('optionsheader', 'local_feedbackchoicegenerator'), + 'optionslengthinfo' => get_string('optionslengthinfo', 'local_feedbackchoicegenerator'), 'description' => get_string('description', 'local_feedbackchoicegenerator'), 'size' => $size, @@ -143,6 +143,7 @@ public function init() { 'textareacontent' => $textareacontent, 'buttonlabel' => get_string('buttonlabel', 'local_feedbackchoicegenerator'), 'downloadbuttonlabel' => get_string('downloadbuttonlabel', 'local_feedbackchoicegenerator'), + 'updatebuttonlabel' => get_string('updatebuttonlabel', 'local_feedbackchoicegenerator'), 'resetbuttonlabel' => get_string('resetbuttonlabel', 'local_feedbackchoicegenerator'), 'dataurl' => $dataurl ] From 202aff7f006a91d3abb1a34692c6035c7dc6f8ce Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Fri, 31 Dec 2021 17:53:30 +0100 Subject: [PATCH 7/7] new release v2.0.1 --- README.md | 4 ++++ version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7cdc277..76812dc 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ Plugin that helps to generate an xml-file to import into activity feedback to su ## Changelog ## +[[v2.0.1]] + +- 31.12.2021 css and layout improvements, add link back to the course, bug with activating generator in settings-page of the plugin + [[v2.0.0]] - 12.12.2021 to support moodle styleguide use code checker to find codebeautyfing issues diff --git a/version.php b/version.php index 83d7044..53e54b1 100644 --- a/version.php +++ b/version.php @@ -28,4 +28,4 @@ $plugin->version = 2021121301; $plugin->component = 'local_feedbackchoicegenerator'; $plugin->requires = 2017111300; -$plugin->release = 'v0.0.1'; +$plugin->release = 'v2.0.1';