Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodor Truffer committed Sep 2, 2021
2 parents ea74d31 + 0a4e319 commit 998626b
Show file tree
Hide file tree
Showing 288 changed files with 4,805 additions and 22,548 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## [5.2.0]
- Change: ILIAS 7 compatibility
- Change: dropped ILIAS 5.4 compatibility
- Fix: number range slider can not be saved with certain configs (start not divisible by step)

## [5.1.5]
- Fix: some language variables fixed/added

Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,13 @@ Config Rewrite Rule in .htaccess or Apache-Config:
</IfModule>
```

### Some screenshots
TODO

## PowerPoint export
For display the exported PowerPoint files you need to install the WebViewer-AddIn in PowerPoint:
https://appsource.microsoft.com/en-us/product/office/WA104295828?tab=Overview
You need also to configure your website as HTTPS and allow that your website can be displayed in frames.

### Requirements
* ILIAS 5.4 or ILIAS 6
* PHP >=5.5
* ILIAS 6.x / 7.x

### Adjustment suggestions
* Adjustment suggestions by pull requests
Expand Down
4 changes: 2 additions & 2 deletions classes/Conf/class.xlvoConfGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function index()

$xlvoConfFormGUI = new xlvoConfFormGUI($this);
$xlvoConfFormGUI->fillForm();
self::dic()->mainTemplate()->setContent($xlvoConfFormGUI->getHTML());
self::dic()->ui()->mainTemplate()->setContent($xlvoConfFormGUI->getHTML());
}


Expand All @@ -73,7 +73,7 @@ protected function update()
ilUtil::sendSuccess($this->txt('msg_success'), true);
self::dic()->ctrl()->redirect($this, self::CMD_STANDARD);
}
self::dic()->mainTemplate()->setContent($xlvoConfFormGUI->getHTML());
self::dic()->ui()->mainTemplate()->setContent($xlvoConfFormGUI->getHTML());
}


Expand Down
23 changes: 11 additions & 12 deletions classes/Player/class.xlvoPlayerGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use LiveVoting\Player\xlvoDisplayPlayerGUI;
use LiveVoting\Player\xlvoPlayer;
use LiveVoting\QuestionTypes\CorrectOrder\xlvoCorrectOrderResultsGUI;
use LiveVoting\QuestionTypes\FreeInput\xlvoFreeInputCategorizeGUI;
use LiveVoting\QuestionTypes\FreeInput\xlvoFreeInputCategory;
use LiveVoting\QuestionTypes\FreeInput\xlvoFreeInputResultsGUI;
use LiveVoting\QuestionTypes\FreeOrder\xlvoFreeOrderResultsGUI;
Expand All @@ -29,7 +28,7 @@
use LiveVoting\Voting\xlvoVoting;
use LiveVoting\Voting\xlvoVotingConfig;
use LiveVoting\Voting\xlvoVotingManager2;
use srag\CustomInputGUIs\LiveVoting\GlyphGUI\GlyphGUI;
use LiveVoting\UIComponent\GlyphGUI;

/**
* Class xlvoPlayerGUI
Expand Down Expand Up @@ -72,7 +71,7 @@ public function __construct()

$this->manager = xlvoVotingManager2::getInstanceFromObjId(ilObject2::_lookupObjId($param_manager->getRefId()));

self::dic()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/default.css');
self::dic()->ui()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/default.css');
}


Expand Down Expand Up @@ -141,7 +140,7 @@ protected function index()
}
$js->call('handleStartButton');

self::dic()->mainTemplate()->setContent($template->get());
self::dic()->ui()->mainTemplate()->setContent($template->get());
}


Expand Down Expand Up @@ -634,8 +633,8 @@ protected function initJsAndCss()

iljQueryUtil::initjQuery();

//self::dic()->mainTemplate()->addJavaScript("https://appsforoffice.microsoft.com/lib/1/hosted/Office.js");
//self::dic()->mainTemplate()->addJavaScript(self::plugin()->directory() . '/js/PPT/xlvoPPT.min.js');
//self::dic()->ui()->mainTemplate()->addJavaScript("https://appsforoffice.microsoft.com/lib/1/hosted/Office.js");
//self::dic()->ui()->mainTemplate()->addJavaScript(self::plugin()->directory() . '/js/PPT/xlvoPPT.min.js');

xlvoJs::getInstance()->addLibToHeader('screenfull.min.js');
xlvoJs::getInstance()->ilias($this)->addSettings($settings)->name('Player')->addTranslations(array(
Expand All @@ -644,8 +643,8 @@ protected function initJsAndCss()

//xlvoJs::getInstance()->ilias($this)->name('PPT')->init()->setRunCode();

self::dic()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/Player/player.css');
self::dic()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/Display/Bar/bar.css');
self::dic()->ui()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/Player/player.css');
self::dic()->ui()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/Display/Bar/bar.css');

xlvoFreeInputResultsGUI::addJsAndCss();
xlvoCorrectOrderResultsGUI::addJsAndCss();
Expand All @@ -666,7 +665,7 @@ protected function handlePreview()
$param_manager = ParamManager::getInstance();

$preview->setVariable('URL', $this->manager->getVotingConfig()->getShortLinkURL(false, $param_manager->getRefId()));
self::dic()->mainTemplate()->setRightContent($preview->get());
self::dic()->ui()->mainTemplate()->setRightContent($preview->get());
}
}

Expand All @@ -675,10 +674,10 @@ protected function handlePreview()
* @param string $content
*/
protected function setContent(string $content)/* : void*/ {
if (self::dic()->mainTemplate()->blockExists("xlvo_player_content")) {
self::dic()->mainTemplate()->setVariable('PLAYER_CONTENT', $content);
if (self::dic()->ui()->mainTemplate()->blockExists("xlvo_player_content")) {
self::dic()->ui()->mainTemplate()->setVariable('PLAYER_CONTENT', self::dic()->toolbar()->getHTML() . $content);
} else {
self::dic()->mainTemplate()->setContent($content);
self::dic()->ui()->mainTemplate()->setContent($content);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use LiveVoting\QuestionTypes\xlvoQuestionTypes;
use LiveVoting\QuestionTypes\xlvoQuestionTypesGUI;
use LiveVoting\Vote\xlvoVote;
use srag\CustomInputGUIs\LiveVoting\GlyphGUI\GlyphGUI;
use LiveVoting\UIComponent\GlyphGUI;

/**
* Class xlvoCorrectOrderGUI
Expand Down Expand Up @@ -76,7 +76,8 @@ protected function getFormContent()
$tpl->setVariable('BTN_RESET', self::plugin()->translate('qtype_4_clear'));
$tpl->setVariable('BTN_SAVE', self::plugin()->translate('qtype_4_save'));

$vote = array_shift(array_values($this->manager->getVotesOfUser()));
$votes = array_values($this->manager->getVotesOfUser());
$vote = array_shift($votes);
$order = array();
$vote_id = null;
if ($vote instanceof xlvoVote) {
Expand All @@ -87,8 +88,6 @@ protected function getFormContent()
$tpl->setVariable('BTN_RESET_DISABLED', 'disabled="disabled"');
}

$options = null;

$options = $this->manager->getVoting()->getVotingOptions();
if ($this->isRandomizeOptions()) {
//randomize the options for the voters
Expand Down
19 changes: 9 additions & 10 deletions classes/QuestionTypes/FreeInput/class.xlvoFreeInputGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
use LiveVoting\QuestionTypes\xlvoQuestionTypes;
use LiveVoting\QuestionTypes\xlvoQuestionTypesGUI;
use LiveVoting\Vote\xlvoVote;
use srag\CustomInputGUIs\LiveVoting\GlyphGUI\GlyphGUI;
use srag\CustomInputGUIs\LiveVoting\MultiLineInputGUI\MultiLineInputGUI;
use LiveVoting\UIComponent\GlyphGUI;
use srag\CustomInputGUIs\LiveVoting\MultiLineNewInputGUI\MultiLineNewInputGUI;
use srag\CustomInputGUIs\LiveVoting\TextAreaInputGUI\TextAreaInputGUI;
use srag\CustomInputGUIs\LiveVoting\TextInputGUI\TextInputGUI;
use srag\CustomInputGUIs\LiveVoting\HiddenInputGUI\HiddenInputGUI;

/**
* Class xlvoFreeInputGUI
Expand All @@ -28,7 +29,6 @@ class xlvoFreeInputGUI extends xlvoQuestionTypesGUI
const F_VOTE_MULTI_LINE_INPUT = 'vote_multi_line_input';
const F_FREE_INPUT = 'free_input';
const F_VOTE_ID = 'vote_id';
//const CMD_CLEAR = 'clear';

const BUTTON_CATEGORIZE = 'btn_categorize';
/**
Expand All @@ -42,8 +42,7 @@ class xlvoFreeInputGUI extends xlvoQuestionTypesGUI
*/
public function initJS($current = false)
{
$xlvoMultiLineInputGUI = new MultiLineInputGUI();
$xlvoMultiLineInputGUI->initCSSandJS();
MultiLineNewInputGUI::init();
xlvoJs::getInstance()->api($this)->name(xlvoQuestionTypes::FREE_INPUT)->category('QuestionTypes')->init();
}

Expand Down Expand Up @@ -147,11 +146,11 @@ protected function getSingleForm()
$form->setFormAction(self::dic()->ctrl()->getFormAction($this));
$form->setId('xlvo_free_input');

$votes = $this->manager->getVotesOfUser(true);
$vote = array_shift(array_values($votes));
$votes = array_values($this->manager->getVotesOfUser(true));
$vote = array_shift($votes);

$an = $this->getTextInputGUI($this->txt('input'), self::F_FREE_INPUT);
$hi2 = new ilHiddenInputGUI(self::F_VOTE_ID);
$hi2 = new HiddenInputGUI(self::F_VOTE_ID);

if ($vote instanceof xlvoVote) {
if ($vote->isActive()) {
Expand Down Expand Up @@ -185,10 +184,10 @@ protected function getMultiForm()
//$form->addCommandButton(self::CMD_CLEAR, $this->txt('delete_all'));
}

$mli = new MultiLineInputGUI($this->txt('answers'), self::F_VOTE_MULTI_LINE_INPUT);
$mli = new MultiLineNewInputGUI($this->txt('answers'), self::F_VOTE_MULTI_LINE_INPUT);
$te = $this->getTextInputGUI($this->txt('text'), self::F_FREE_INPUT);

$hi2 = new ilHiddenInputGUI(self::F_VOTE_ID);
$hi2 = new HiddenInputGUI(self::F_VOTE_ID);
$mli->addInput($te);
$mli->addInput($hi2);

Expand Down
2 changes: 1 addition & 1 deletion classes/QuestionTypes/FreeOrder/class.xlvoFreeOrderGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use LiveVoting\Js\xlvoJs;
use LiveVoting\QuestionTypes\xlvoQuestionTypes;
use srag\CustomInputGUIs\LiveVoting\GlyphGUI\GlyphGUI;
use LiveVoting\UIComponent\GlyphGUI;

/**
* Class xlvoFreeOrderGUI
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,6 @@ private function getStep()
*/
private function snapToStep($value)
{
return intval(ceil($value / $this->getStep()) * $this->getStep());
return intval(ceil(($value - $this->getStart()) / $this->getStep()) * $this->getStep()) + $this->getStart();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use LiveVoting\Js\xlvoJs;
use LiveVoting\QuestionTypes\xlvoQuestionTypes;
use LiveVoting\QuestionTypes\xlvoQuestionTypesGUI;
use srag\CustomInputGUIs\LiveVoting\GlyphGUI\GlyphGUI;
use LiveVoting\UIComponent\GlyphGUI;

/**
* Class xlvoSingleVoteGUI
Expand Down
6 changes: 3 additions & 3 deletions classes/Results/class.xlvoResultsGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private function showResults()
$this->buildFilters($table);
$table->initFilter();
$table->buildData($this->obj_id, $this->round->getId());
self::dic()->mainTemplate()->setContent($table->getHTML());
self::dic()->ui()->mainTemplate()->setContent($table->getHTML());
}


Expand Down Expand Up @@ -211,7 +211,7 @@ private function showHistory()

$table = new xlvoVoteHistoryTableGUI($this, self::CMD_SHOW_HISTORY);
$table->parseData($_GET['user_id'], $_GET['user_identifier'], $_GET['voting_id'], $this->round->getId());
self::dic()->mainTemplate()->setContent($form->getHTML() . $table->getHTML());
self::dic()->ui()->mainTemplate()->setContent($form->getHTML() . $table->getHTML());
}


Expand Down Expand Up @@ -260,7 +260,7 @@ public function confirmNewRound()
$conf->setHeaderText(self::plugin()->translate('common_confirm_new_round'));
$conf->setConfirm(self::plugin()->translate("common_new_round"), self::CMD_NEW_ROUND);
$conf->setCancel(self::plugin()->translate('common_cancel'), self::CMD_SHOW);
self::dic()->mainTemplate()->setContent($conf->getHTML());
self::dic()->ui()->mainTemplate()->setContent($conf->getHTML());
}


Expand Down
20 changes: 10 additions & 10 deletions classes/Voter/class.xlvoVoter2GUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use LiveVoting\Voter\xlvoVoter;
use LiveVoting\Voting\xlvoVotingConfig;
use LiveVoting\Voting\xlvoVotingManager2;
use srag\CustomInputGUIs\LiveVoting\GlyphGUI\GlyphGUI;
use LiveVoting\UIComponent\GlyphGUI;
use srag\CustomInputGUIs\LiveVoting\TextInputGUI\TextInputGUI;

/**
Expand Down Expand Up @@ -108,7 +108,7 @@ protected function index()
}

$tpl = self::plugin()->template('default/Voter/tpl.pin.html', true, false);
self::dic()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/Voter/pin.css');
self::dic()->ui()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/Voter/pin.css');
$pin_form = new ilPropertyFormGUI();
$pin_form->setFormAction(self::dic()->ctrl()->getLinkTarget($this, self::CMD_CHECK_PIN));
$pin_form->addCommandButton(self::CMD_CHECK_PIN, $this->txt('send'));
Expand All @@ -123,9 +123,9 @@ protected function index()
$tpl->setVariable('FORM', $pin_form->getHTML());

if (self::version()->is6()) {
self::dic()->mainTemplate()->setVariable('PLAYER_CONTENT', $tpl->get());
self::dic()->ui()->mainTemplate()->setVariable('PLAYER_CONTENT', $tpl->get());
} else {
self::dic()->mainTemplate()->setContent($tpl->get());
self::dic()->ui()->mainTemplate()->setContent($tpl->get());
}
}

Expand Down Expand Up @@ -167,12 +167,12 @@ protected function startVoterPlayer()
}

$this->initJsAndCss();
self::dic()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/default.css');
self::dic()->ui()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/default.css');
$tpl = self::plugin()->template('default/Voter/tpl.voter_player.html', true, false);
if (self::version()->is6()) {
self::dic()->mainTemplate()->setVariable('PLAYER_CONTENT', $tpl->get());
self::dic()->ui()->mainTemplate()->setVariable('PLAYER_CONTENT', $tpl->get());
} else {
self::dic()->mainTemplate()->setContent($tpl->get());
self::dic()->ui()->mainTemplate()->setContent($tpl->get());
}
}

Expand All @@ -199,9 +199,9 @@ protected function getVotingData()
*/
protected function initJsAndCss()
{
self::dic()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/Voter/voter.css');
self::dic()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/libs/bootstrap-slider.min.css');
self::dic()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/QuestionTypes/NumberRange/number_range.css');
self::dic()->ui()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/Voter/voter.css');
self::dic()->ui()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/libs/bootstrap-slider.min.css');
self::dic()->ui()->mainTemplate()->addCss(self::plugin()->directory() . '/templates/default/QuestionTypes/NumberRange/number_range.css');
iljQueryUtil::initjQueryUI();

$t = array('player_seconds');
Expand Down
Loading

0 comments on commit 998626b

Please sign in to comment.