Skip to content

Commit

Permalink
Fixed "Free Input" voting type inputs. Fixed freezing of the results …
Browse files Browse the repository at this point in the history
…view in the "Free Input" type.
  • Loading branch information
ZallaxDev committed Oct 18, 2023
1 parent 5cfa45f commit f150127
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions classes/QuestionTypes/FreeInput/class.xlvoFreeInputGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,24 +184,21 @@ protected function getMultiForm()
//$form->addCommandButton(self::CMD_CLEAR, $this->txt('delete_all'));
}

$mli = new ilTextInputGUI($this->txt('answers'), self::F_VOTE_MULTI_LINE_INPUT);
$mli->setMulti(true,false,true);
/*
$mli = new MultiLineNewInputGUI($this->txt('answers'), self::F_VOTE_MULTI_LINE_INPUT);
$te = $this->getTextInputGUI($this->txt('text'), self::F_FREE_INPUT);

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

$form->addItem($mli);
$array = array();
foreach ($xlvoVotes as $xlvoVote) {
$array[] = array(
self::F_FREE_INPUT => $xlvoVote->getFreeInput(),
self::F_VOTE_ID => $xlvoVote->getId(),
);
}
$mli->setMultiValues($array);
$form->addItem($mli);

$form->setValuesByArray(array(self::F_VOTE_MULTI_LINE_INPUT => $array));
$form->addCommandButton(self::CMD_SUBMIT, $this->txt('send'));
Expand Down
1 change: 1 addition & 0 deletions src/Voting/xlvoVoting.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ public function setVotingOptions($voting_options)
*/
public function getFirstVotingOption()
{
$this->afterObjectLoad();
return $this->first_voting_option;
}

Expand Down

0 comments on commit f150127

Please sign in to comment.