From ccffc6f13a5b90c14bf923c1d971d389e3ad8f1b Mon Sep 17 00:00:00 2001 From: andreasschenkel <31856043+andreasschenkel@users.noreply.github.com> Date: Fri, 31 Dec 2021 22:44:27 +0100 Subject: [PATCH 1/4] improvement of documentation --- README.md | 64 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a3dc38f..15cd3f7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,62 @@ -# Local # +# 1. and 2. choice in feedback-generator # + +A: How to use + +B: Settings + +C: Capabilitys + +D: Changelog + +E: hint to evaluate the choices with calc-program + +F: Installing via uploaded ZIP file + +G: Installing manually + + +### A: How to use ### Plugin that helps to generate an xml-file to import into activity feedback to support first and second choise feedback. +See this animated gif to find out, how to use this localplugin as an generator and how to use the generated code as questions in feedback activity in moodle. + ![erstzweitwahl](https://user-images.githubusercontent.com/31856043/144657346-a58d6fd1-b3cf-4499-9a60-bf1080575483.gif) -![image](https://user-images.githubusercontent.com/31856043/144513664-fed4377f-1517-44a4-a020-16094002a874.png) +![image](https://user-images.githubusercontent.com/31856043/147839212-c09e9810-af3f-4931-a7a8-be0a683321e2.png) + +You can enter options and then click generate a xml-code that hast do be saved as xml-file. +There ar two ways to save this file. +1. You can copy the generated xml-code into an texteditor ans save the file. + +or + +2. The xml-file can be saved with rightclick and choosing "save file as" + +This saved file then can be used for import in moodle-feedback activity. + + + +### B: Settings ### + +- You can activate the generator in the settings of the local plugin (default is no for inactiv generator). +- You can set the maximum number of options (default is 40). +- You can set the length of each option '(default is 30) + +![image](https://user-images.githubusercontent.com/31856043/147839230-3c9248d2-97ab-4544-8a1d-13343d93089f.png) + + + +### C: Capabilitys ### + +By default only editing teacher can use this generator. If other roles should be able to use the generator the capabilitys have to be set. + +![image](https://user-images.githubusercontent.com/31856043/147839457-719c90cb-3b93-4c4b-9d14-0893228bf3d8.png) + + + -## Changelog ## +### D: Changelog ### [[v2.0.2]] @@ -50,11 +100,11 @@ unknown [[v1.0.0]] initial -## hint to evaluate the choices with calc-program ## +### E: hint to evaluate the choices with calc-program ### =WENN(D2<>"";D2;WENN(E2<>"";E2;WENN(F2<>"";F2;WENN(G2<>"";G2;"2.Wahl ist leer")))) -## Installing via uploaded ZIP file ## +### F: Installing via uploaded ZIP file ### 1. Log in to your Moodle site as an admin and go to _Site administration > Plugins > Install plugins_. @@ -62,7 +112,7 @@ unknown extra details if your plugin type is not automatically detected. 3. Check the plugin validation report and finish the installation. -## Installing manually ## +### G: Installing manually ### The plugin can be also installed by putting the contents of this directory to @@ -77,7 +127,7 @@ Alternatively, you can run to complete the installation from the command line. -## License ## +### License ### From b61452fe6fdd92241bdfbd4280116e50f954eee8 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Sat, 1 Jan 2022 19:13:53 +0100 Subject: [PATCH 2/4] support config of using generator on frontpage (not so nice code but it works) --- index.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 7cdc377..b2f5729 100644 --- a/index.php +++ b/index.php @@ -15,6 +15,7 @@ // along with Moodle. If not, see . require_once(__DIR__ . '/../../config.php'); require_login(); + use local_feedbackchoicegenerator\View\FeedbackChoiceGenerator; // Assign global variables to local (parameter) variables. @@ -28,9 +29,19 @@ global $CFG; +$isallowedonfrontpage = $CFG->local_feedbackchoicegenerator_isallowedonfrontpage; $isactive = $CFG->local_feedbackchoicegenerator_isactive; + if ($isactive) { - $feedbackchoicegeneratorinstance->init(); + if ($courseid === (int)'1') { + if ($isallowedonfrontpage) { + $feedbackchoicegeneratorinstance->init(); + } else { + echo "not supported on frontpage"; + } + } else { + $feedbackchoicegeneratorinstance->init(); + } } else { echo "is not activ"; } From 555753a65a414131507db7c60363527227485fd1 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Sat, 1 Jan 2022 19:16:44 +0100 Subject: [PATCH 3/4] setting to allow generator on frontpage with for version v2.0.3 --- README.md | 5 +++++ lang/de/local_feedbackchoicegenerator.php | 4 ++++ lang/en/local_feedbackchoicegenerator.php | 4 ++++ settings.php | 7 +++++++ version.php | 4 ++-- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15cd3f7..eb756a4 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,11 @@ By default only editing teacher can use this generator. If other roles should be ### D: Changelog ### +[[v2.0.3]] + +- setting to allow generator on frontpage with courseid=1. Use URL moodleurl/local/feedbackchoicegenerator/index.php?id=1' + + [[v2.0.2]] - 31.12.2021 css and layout improvements, add link back to the course, bug with activating generator in settings-page of the plugin diff --git a/lang/de/local_feedbackchoicegenerator.php b/lang/de/local_feedbackchoicegenerator.php index 8dce2bd..1765f7e 100644 --- a/lang/de/local_feedbackchoicegenerator.php +++ b/lang/de/local_feedbackchoicegenerator.php @@ -32,6 +32,10 @@ $string['isactive'] = 'Generator aktivieren'; $string['configisactive'] = 'Wenn aktiviert kann der Generator bei vorhandenen Berechtigungen im der Kursnavigation aufgerufen werden.'; +$string['isallowedonfrontpage'] = 'Generator auf Startseite mit Kursid=1 erlauben'; +$string['configisallowedonfrontpage'] = 'Wenn aktiviert kann der Generator auf der Startseite aufgerufen werden. + Link wird allerdings nicht angezeigt. URL ist: moodleurl/local/feedbackchoicegenerator/index.php?id=1'; + $string['maxoptionslength'] = 'Max. Länge der Optionen'; $string['configmaxoptionslength'] = 'Bis zu dieser Länge kann der Text einer Option eingegeben werden.'; diff --git a/lang/en/local_feedbackchoicegenerator.php b/lang/en/local_feedbackchoicegenerator.php index ebff10d..34ea05d 100644 --- a/lang/en/local_feedbackchoicegenerator.php +++ b/lang/en/local_feedbackchoicegenerator.php @@ -32,6 +32,10 @@ $string['isactive'] = 'Activate generator'; $string['configisactive'] = 'When activate the generator can be started in the coursenavigation.'; +$string['isallowedonfrontpage'] = 'Allow generator on frontpage with coursid=1'; +$string['configisallowedonfrontpage'] = 'When activate the generator can be used on frontpage with courseid=1. + URL ist: moodleurl/local/feedbackchoicegenerator/index.php?id=1'; + $string['maxoptionslength'] = 'maximum text length of an option'; $string['configmaxoptionslength'] = 'Up to this length a user can enter text as an option.'; diff --git a/settings.php b/settings.php index b92e805..1909dd1 100644 --- a/settings.php +++ b/settings.php @@ -37,6 +37,13 @@ 0 )); + $settings->add(new admin_setting_configcheckbox( + 'local_feedbackchoicegenerator_isallowedonfrontpage', + get_string('isallowedonfrontpage', 'local_feedbackchoicegenerator'), + get_string('configisallowedonfrontpage', 'local_feedbackchoicegenerator'), + 0 + )); + $options = array(5 => '5', 10 => '10', 20 => '20', 30 => '30', 40 => '40', 50 => '50', 100 => '100', 200 => '200'); $settings->add(new admin_setting_configselect( diff --git a/version.php b/version.php index b626a0f..a96cabc 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die; $plugin->maturity = MATURITY_BETA; -$plugin->version = 2021123100; +$plugin->version = 2022010100; $plugin->component = 'local_feedbackchoicegenerator'; $plugin->requires = 2017111300; -$plugin->release = 'v2.0.2'; +$plugin->release = 'v2.0.3'; From a7b524396fccd4b310d1af0e3971fab7f8501846 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Sat, 1 Jan 2022 19:28:07 +0100 Subject: [PATCH 4/4] some coding styles --- classes/Database/DataFiles.php | 1 + classes/Database/Factory.php | 1 + classes/Manager.php | 1 + classes/Security/Security.php | 1 + classes/View/FeedbackChoiceGenerator.php | 1 + classes/privacy/provider.php | 1 - lib.php | 1 + styles.css | 2 +- 8 files changed, 7 insertions(+), 2 deletions(-) diff --git a/classes/Database/DataFiles.php b/classes/Database/DataFiles.php index 8079d61..34c91f1 100644 --- a/classes/Database/DataFiles.php +++ b/classes/Database/DataFiles.php @@ -19,6 +19,7 @@ use moodle_database; /** + * @package local_feedbackchoicegenerator * This class provides high-level functionality for the module. Concepts like * enumerating files belonging to a specific component are mapped to the * relevant SQL queries, therefore encapsulating low-level database access inside diff --git a/classes/Database/Factory.php b/classes/Database/Factory.php index a760aaf..397cf7d 100644 --- a/classes/Database/Factory.php +++ b/classes/Database/Factory.php @@ -19,6 +19,7 @@ use moodle_database; /** + * @package local_feedbackchoicegenerator * This is a straightfoward implementation of the Factory Pattern. The * class provides access to objects that are necessary for interaction * with the Moodle database via a DataFiles abstraction. diff --git a/classes/Manager.php b/classes/Manager.php index b198203..ef5d962 100644 --- a/classes/Manager.php +++ b/classes/Manager.php @@ -23,6 +23,7 @@ defined('MOODLE_INTERNAL') || die(); /** + * @package local_feedbackchoicegenerator * Class manager */ class Manager diff --git a/classes/Security/Security.php b/classes/Security/Security.php index 04c75d7..68afd56 100644 --- a/classes/Security/Security.php +++ b/classes/Security/Security.php @@ -24,6 +24,7 @@ use stdClass; /** + * @package local_feedbackchoicegenerator * Class Security */ class Security diff --git a/classes/View/FeedbackChoiceGenerator.php b/classes/View/FeedbackChoiceGenerator.php index 4b7a990..1167560 100644 --- a/classes/View/FeedbackChoiceGenerator.php +++ b/classes/View/FeedbackChoiceGenerator.php @@ -23,6 +23,7 @@ use local_feedbackchoicegenerator\Manager; /** + * @package local_feedbackchoicegenerator * Class FeedbackChoiceGenerator */ class FeedbackChoiceGenerator diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index e88765b..8b4b4dd 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -1,5 +1,4 @@