Skip to content

Commit

Permalink
Merge pull request #10 from andreasschenkel/develop
Browse files Browse the repository at this point in the history
v2.0.3
  • Loading branch information
andreasschenkel authored Jan 1, 2022
2 parents dc9e2fc + a7b5243 commit 5a67ece
Show file tree
Hide file tree
Showing 14 changed files with 98 additions and 12 deletions.
69 changes: 62 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,67 @@
# 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)




### D: Changelog ###

[[v2.0.3]]

- setting to allow generator on frontpage with courseid=1. Use URL moodleurl/local/feedbackchoicegenerator/index.php?id=1'

## Changelog ##

[[v2.0.2]]

Expand Down Expand Up @@ -50,19 +105,19 @@ 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_.
2. Upload the ZIP file with the plugin code. You should only be prompted to add
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

Expand All @@ -77,7 +132,7 @@ Alternatively, you can run

to complete the installation from the command line.

## License ##
### License ###



Expand Down
1 change: 1 addition & 0 deletions classes/Database/DataFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions classes/Database/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions classes/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
defined('MOODLE_INTERNAL') || die();

/**
* @package local_feedbackchoicegenerator
* Class manager
*/
class Manager
Expand Down
1 change: 1 addition & 0 deletions classes/Security/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use stdClass;

/**
* @package local_feedbackchoicegenerator
* Class Security
*/
class Security
Expand Down
1 change: 1 addition & 0 deletions classes/View/FeedbackChoiceGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use local_feedbackchoicegenerator\Manager;

/**
* @package local_feedbackchoicegenerator
* Class FeedbackChoiceGenerator
*/
class FeedbackChoiceGenerator
Expand Down
1 change: 0 additions & 1 deletion classes/privacy/provider.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php
// …

namespace local_feedbackchoicegenerator\privacy;

Expand Down
13 changes: 12 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
require_once(__DIR__ . '/../../config.php');
require_login();

use local_feedbackchoicegenerator\View\FeedbackChoiceGenerator;

// Assign global variables to local (parameter) variables.
Expand All @@ -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";
}
4 changes: 4 additions & 0 deletions lang/de/local_feedbackchoicegenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';

Expand Down
4 changes: 4 additions & 0 deletions lang/en/local_feedbackchoicegenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.';

Expand Down
1 change: 1 addition & 0 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
/**
* This function extends the navigation with the report items
*
* @package local_feedbackchoicegenerator
* @param navigation_node $navigation The navigation node to extend
* @param stdClass $course The course to object for the generator
* @param stdClass $context The context of the course
Expand Down
7 changes: 7 additions & 0 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
}

#feedbackchoicegenerator .row {
margin-left: 0px;
margin-left: 0;
}
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

0 comments on commit 5a67ece

Please sign in to comment.