From 81b3573530ce0f20c330634ad2c7e73fc9351429 Mon Sep 17 00:00:00 2001 From: mstuder Date: Fri, 4 Oct 2019 18:13:31 +0200 Subject: [PATCH] New Live Voting Version 4.3.3 - Changes see Changelog --- CHANGELOG.md | 9 +++++++++ .../NumberRange/class.xlvoNumberRangeGUI.php | 5 +---- classes/Voting/class.xlvoVotingGUI.php | 2 +- plugin.php | 2 +- sql/dbupdate.php | 2 +- .../Initialisation/Version/v53/xlvoStyleDefinition.php | 8 ++++++++ src/QuestionTypes/FreeOrder/xlvoFreeOrderSubFormGUI.php | 2 +- .../NumberRange/xlvoNumberRangeSubFormGUI.php | 4 ++-- .../SingleVote/xlvoSingleVoteSubFormGUI.php | 3 ++- src/Voting/xlvoVoting.php | 4 ++-- src/Voting/xlvoVotingManager2.php | 6 +++--- templates/default/Display/Bar/tpl.bar_collection.html | 2 +- 12 files changed, 32 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84c67c62..5f640b86 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ # Change Log +## [4.3.3] +- Fixed Bug PLLV-345 - do not present results in more than one column +- Fixed issue with other plugins calling ilUtil::getImagePath - thx to mjansen / https://github.com/studer-raimann/LiveVoting/pull/24 +- Fixed Avoid errors with devision by 0 - thx to swiniker / https://github.com/studer-raimann/LiveVoting/pull/23/ +- Fix typo in function name - thx to Rillke / https://github.com/studer-raimann/LiveVoting/pull/22 +- Unbreak delete-an-option thx to Rillke / +https://github.com/studer-raimann/LiveVoting/pull/21 +- Fixed Bug Uncommented method to possibly fix a bug with number range inputs - thx to rsheer / https://github.com/studer-raimann/LiveVoting/pull/18 ## [4.3.2] - Fixed BUG SUPPORT-2161 Use of undefined constant IL_COOKIE_PATH (PHP7.2)" @@ -73,6 +81,7 @@ - Screen-Id-Component - PHP version checker - Improved PIN validation in pin.php +- **Updates to RewriteRules might be required** - Improved FreeInput config validation ## [4.0.2] - 2018-07-11 diff --git a/classes/QuestionTypes/NumberRange/class.xlvoNumberRangeGUI.php b/classes/QuestionTypes/NumberRange/class.xlvoNumberRangeGUI.php index 06fcb5d3..d7f4fead 100755 --- a/classes/QuestionTypes/NumberRange/class.xlvoNumberRangeGUI.php +++ b/classes/QuestionTypes/NumberRange/class.xlvoNumberRangeGUI.php @@ -49,13 +49,10 @@ public function initJS($current = false) { } - /* * - * - * / protected function clear() { $this->manager->unvoteAll(); $this->afterSubmit(); - }*/ + } /** * diff --git a/classes/Voting/class.xlvoVotingGUI.php b/classes/Voting/class.xlvoVotingGUI.php index 525b75cb..3a4b68ce 100755 --- a/classes/Voting/class.xlvoVotingGUI.php +++ b/classes/Voting/class.xlvoVotingGUI.php @@ -754,7 +754,7 @@ protected function import() { $xlvoOptions[] = $xlvoOption; } $xlvoVoting->setVotingOptions($xlvoOptions); - $xlvoVoting->renegerateOptionSorting(); + $xlvoVoting->regenerateOptionSorting(); } $this->cancel(); } diff --git a/plugin.php b/plugin.php index 69ae4217..6771db05 100755 --- a/plugin.php +++ b/plugin.php @@ -3,7 +3,7 @@ require_once __DIR__ . "/vendor/srag/dic/src/PHPVersionChecker.php"; $id = 'xlvo'; -$version = '4.3.2'; +$version = '4.3.3'; $ilias_min_version = '5.3.0'; $ilias_max_version = '5.4.999'; $responsible = 'studer + raimann ag - Team Custom 1'; diff --git a/sql/dbupdate.php b/sql/dbupdate.php index a074f267..6aee4a43 100755 --- a/sql/dbupdate.php +++ b/sql/dbupdate.php @@ -342,7 +342,7 @@ * @var $xlvoVoting \LiveVoting\Voting\xlvoVoting */ foreach (\LiveVoting\Voting\xlvoVoting::get() as $xlvoVoting) { - $xlvoVoting->renegerateOptionSorting(); + $xlvoVoting->regenerateOptionSorting(); } ?> diff --git a/src/Context/Initialisation/Version/v53/xlvoStyleDefinition.php b/src/Context/Initialisation/Version/v53/xlvoStyleDefinition.php index 420e28d9..863f1f24 100755 --- a/src/Context/Initialisation/Version/v53/xlvoStyleDefinition.php +++ b/src/Context/Initialisation/Version/v53/xlvoStyleDefinition.php @@ -37,6 +37,14 @@ public function __construct() { public function getSkin() { return $this->skin; } + + /** + * @return string + */ + public function getImageDirectory($style_id) + { + return ''; + } } /** diff --git a/src/QuestionTypes/FreeOrder/xlvoFreeOrderSubFormGUI.php b/src/QuestionTypes/FreeOrder/xlvoFreeOrderSubFormGUI.php index 42ecfddd..b9580d29 100755 --- a/src/QuestionTypes/FreeOrder/xlvoFreeOrderSubFormGUI.php +++ b/src/QuestionTypes/FreeOrder/xlvoFreeOrderSubFormGUI.php @@ -129,7 +129,7 @@ protected function handleOptions() { } } $this->getXlvoVoting()->setMultiFreeInput(true); - //$this->getXlvoVoting()->renegerateOptionSorting(); + //$this->getXlvoVoting()->regenerateOptionSorting(); $this->getXlvoVoting()->store(); } } diff --git a/src/QuestionTypes/NumberRange/xlvoNumberRangeSubFormGUI.php b/src/QuestionTypes/NumberRange/xlvoNumberRangeSubFormGUI.php index 991bd067..88f56b13 100755 --- a/src/QuestionTypes/NumberRange/xlvoNumberRangeSubFormGUI.php +++ b/src/QuestionTypes/NumberRange/xlvoNumberRangeSubFormGUI.php @@ -40,7 +40,7 @@ class xlvoNumberRangeSubFormGUI extends xlvoSubFormGUI { const START_RANGE_MAX = 1000000; const END_RANGE_MIN = - 1000000; const END_RANGE_MAX = 1000000; - //const STEP_RANGE_MIN = 0; + const STEP_RANGE_MIN = 1; //const STEP_RANGE_MAX = 1000000; const STEP_RANGE_DEFAULT_VALUE = 1; const STEP_RANGE_INVALID_INFO = 'qtype_6_invalid_step_range'; @@ -89,7 +89,7 @@ protected function initFormElements() { //create end range number input $stepRange = new ilNumberInputGUI($this->txt(self::OPTION_RANGE_STEP), self::OPTION_RANGE_STEP); $stepRange->setInfo($this->txt(self::OPTION_RANGE_STEP_INFO)); - //$stepRange->setMinValue(self::STEP_RANGE_MIN); + $stepRange->setMinValue(self::STEP_RANGE_MIN); //$stepRange->setMaxValue(self::STEP_RANGE_MAX); $stepRange->setValue($this->getXlvoVoting()->getStepRange()); diff --git a/src/QuestionTypes/SingleVote/xlvoSingleVoteSubFormGUI.php b/src/QuestionTypes/SingleVote/xlvoSingleVoteSubFormGUI.php index f007b6e4..416f04ed 100755 --- a/src/QuestionTypes/SingleVote/xlvoSingleVoteSubFormGUI.php +++ b/src/QuestionTypes/SingleVote/xlvoSingleVoteSubFormGUI.php @@ -148,6 +148,7 @@ protected function handleOptions() { $xlvoOption->delete(); } } - $this->getXlvoVoting()->renegerateOptionSorting(); + $this->getXlvoVoting()->setVotingOptions($this->options); + $this->getXlvoVoting()->regenerateOptionSorting(); } } diff --git a/src/Voting/xlvoVoting.php b/src/Voting/xlvoVoting.php index 234b55f0..bf841199 100755 --- a/src/Voting/xlvoVoting.php +++ b/src/Voting/xlvoVoting.php @@ -244,7 +244,7 @@ public function getComputedColums() { /** * */ - public function renegerateOptionSorting() { + public function regenerateOptionSorting() { $i = 1; foreach ($this->getVotingOptions() as $votingOption) { $votingOption->setPosition($i); @@ -284,7 +284,7 @@ public function fullClone($change_name = true, $clone_options = true) { $votingOptionNew->setVotingId($newObj->getId()); $votingOptionNew->store(); } - $newObj->renegerateOptionSorting(); + $newObj->regenerateOptionSorting(); } return $newObj; diff --git a/src/Voting/xlvoVotingManager2.php b/src/Voting/xlvoVotingManager2.php index 836ff008..1c1627aa 100755 --- a/src/Voting/xlvoVotingManager2.php +++ b/src/Voting/xlvoVotingManager2.php @@ -141,7 +141,7 @@ public function vote($option = NULL) { * */ public function prepare() { - $this->getVoting()->renegerateOptionSorting(); + $this->getVoting()->regenerateOptionSorting(); $this->getPlayer()->setStatus(xlvoPlayer::STAT_RUNNING); $this->getPlayer()->freeze(); } @@ -366,7 +366,7 @@ public function previous() { $this->player->setActiveVoting($prev_id); $this->player->store(); - $this->getVoting()->renegerateOptionSorting(); + $this->getVoting()->regenerateOptionSorting(); } @@ -382,7 +382,7 @@ public function next() { $this->handleQuestionSwitching(); $this->player->setActiveVoting($next_id); $this->player->store(); - $this->getVoting()->renegerateOptionSorting(); + $this->getVoting()->regenerateOptionSorting(); } diff --git a/templates/default/Display/Bar/tpl.bar_collection.html b/templates/default/Display/Bar/tpl.bar_collection.html index 3c980c71..42623780 100755 --- a/templates/default/Display/Bar/tpl.bar_collection.html +++ b/templates/default/Display/Bar/tpl.bar_collection.html @@ -1,7 +1,7 @@
-
+
{BAR}