Skip to content

Commit

Permalink
Merge pull request #4 from andreasschenkel/develop
Browse files Browse the repository at this point in the history
v1.0.4
  • Loading branch information
andreasschenkel authored Dec 3, 2021
2 parents 407d539 + 069b0ae commit b4f254d
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 129 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

Plugin that helps to generate an xml-file to import into activity feedback to support first and second choise feedback.

![image](https://user-images.githubusercontent.com/31856043/144513664-fed4377f-1517-44a4-a020-16094002a874.png)
![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)

## Changelog ##
[[v1.0.4]]

03.12.2021

- codebeautyfing

[[v1.0.3]]

03.12.2021
Expand Down
1 change: 0 additions & 1 deletion classes/Database/DataFiles.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace report_feedbackchoicegenerator\Database;

use moodle_database;
Expand Down
86 changes: 0 additions & 86 deletions classes/HTML.php

This file was deleted.

10 changes: 7 additions & 3 deletions classes/Helper.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace report_feedbackchoicegenerator;

use html_writer;
Expand All @@ -8,13 +7,12 @@ class Helper
{

/**
* generates the options seperated by |
* @return string with all options without the $selectedoption
* if $selectedoption is "" for first choice with ALL Options
*/
static function generateOptionsList($options, $selectedoption)
{
$htmloutput = '';
// $last = count($options) - 1;
$counter = 0;
foreach ($options as $option) {
if ($option != $selectedoption) {
Expand All @@ -29,6 +27,7 @@ static function generateOptionsList($options, $selectedoption)
}

/**
* generates nessesary lines at the beginning of the file
* @return string
*/
static function generateDocumentHeaderOpeninglines()
Expand All @@ -40,6 +39,7 @@ static function generateDocumentHeaderOpeninglines()
}

/**
* generates nessesary lines at the end of the file to close the opened tags
* @return string
*/
static function generateDocumentLastlines()
Expand All @@ -51,6 +51,7 @@ static function generateDocumentLastlines()
}

/**
* generates the header that can be found in all xml-files for feedback
* @param int $itemnumber The number of the actual xml-component to be generated
* @return string
*/
Expand All @@ -70,6 +71,7 @@ static function generateDocumentHeader($itemnumber)
}

/**
* generates the pagebrakes to seperate the different options
* @param int $itemnumber The number of the actual xml-component to be generated
*/
static function generatePagebreak($itemnumber)
Expand All @@ -88,6 +90,7 @@ static function generatePagebreak($itemnumber)
}

/**
* generates the list of options for first or second choice
* @param integer $level indicates if first choice oder second choise
* @param int $itemnumber The number of the actual xml-component to be generated
* @param int $firstchoicereferencenumber Number for to reference to in the second second choice
Expand Down Expand Up @@ -116,6 +119,7 @@ static function generateSelectionOverview($level, $itemnumber, $firstchoicerefer
}

/**
* generates the xml-code for the label
* @param $xmlWriterPlus
* @param int $itemnumber The number of the actual xml-component to be generated
* @param int $firstchoicereferencenumber Number for to reference to in the second second choice
Expand Down
16 changes: 0 additions & 16 deletions classes/Manager.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
<?php

namespace report_feedbackchoicegenerator;

use moodle_database;

use report_feedbackchoicegenerator\Database\Factory as DatabaseFactory;
use report_feedbackchoicegenerator\Parser\Parser;
use report_feedbackchoicegenerator\Files\Files;
use report_feedbackchoicegenerator\Security\Security;
use report_feedbackchoicegenerator\Handler\Factory as HandlerFactory;

defined('MOODLE_INTERNAL') || die();

Expand Down Expand Up @@ -39,14 +35,6 @@ public function database(): DatabaseFactory
return new DatabaseFactory($this->dbM);
}

/**
* @return Parser
*/
public function parser(): Parser
{
return new Parser();
}

/**
* @return Security
*/
Expand All @@ -55,8 +43,4 @@ public function security(): Security
return new Security($this->dbM);
}

public function handler(): HandlerFactory
{
return new HandlerFactory($this);
}
}
7 changes: 6 additions & 1 deletion classes/View/FeedbackChoiceGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
*/
class FeedbackChoiceGenerator
{

/**
* @var moodle_page
*/
private $page;

/**
Expand Down Expand Up @@ -51,6 +55,7 @@ public function __construct($db, int $courseId, $page, $output, $user)
}

/**
* getter for Page
* @return Page
*/
public function getPage(): Page
Expand Down Expand Up @@ -129,8 +134,8 @@ public function init()
}

/**
* generates the xml-content and returns the content as string
* @param array $optionsArray Array contains all options
*
* @return string xml-code to add into textarea in htmlpage
*/
public function textareagenerator($optionsArray): string
Expand Down
4 changes: 1 addition & 3 deletions classes/View/Page.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?php

namespace report_feedbackchoicegenerator\View;

use moodle_url;
Expand All @@ -11,7 +10,6 @@ class Page
private $title;
private $course;


/**
* @param moodle_page $page
* @param $course
Expand Down Expand Up @@ -56,7 +54,7 @@ protected function getPage()
return $this->page;
}

public function getIconURL($instance)
public function getIconURLlöschen($instance)
{
return $this->getPage()->theme->image_url('icon', $instance->modname)->out();
}
Expand Down
11 changes: 0 additions & 11 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Public API of the competency report.
*
* Defines the APIs used by competency reports
*
* @package report_competency
* @copyright 2015 Damyon Wiese
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

defined('MOODLE_INTERNAL') || die;


/**
* This function extends the navigation with the report items
*
Expand Down
4 changes: 1 addition & 3 deletions settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Course list block settings
*
* @package report_feedbackchoicegenerator
* @copyright
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand All @@ -39,7 +37,7 @@
'report_feedbackchoicegenerator_maxlength',
get_string('maxlength', 'report_feedbackchoicegenerator'),
get_string('configmaxlength', 'report_feedbackchoicegenerator'),
'30',
'40',
$options
));

Expand Down
4 changes: 2 additions & 2 deletions styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.feedbackchoicegenerator h3{
padding:10px;
.feedbackchoicegenerator h3 {
padding: 10px;
}
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'report_feedbackchoicegenerator';
$plugin->release = '1.0.3';
$plugin->version = 2021120301;
$plugin->release = '1.0.4';
$plugin->version = 2021120302;
$plugin->requires = 2020061500;
$plugin->maturity = MATURITY_RC;

0 comments on commit b4f254d

Please sign in to comment.