19declare(strict_types=1);
41 $single_answer = ($answers->getAnswerLimit() === 1);
44 if (!$single_answer && empty($last_vote)) {
45 $error = $this->
lng->txt(
"poll_vote_error_multi_no_answer");
46 } elseif (!$single_answer) {
48 $this->
lng->txt(
"poll_vote_error_multi"),
52 $error = $this->
lng->txt(
"poll_vote_error_single");
72 if (!$disable_input) {
95 if (!empty($last_vote) && is_array($last_vote) && in_array(
$id, $last_vote)) {
96 $status[] =
'checked="checked"';
99 $status[] =
'disabled';
102 $tpl->
setVariable(
"ANSWER_STATUS", implode(
' ', $status));
108 $this->
refinery->encode()->htmlSpecialCharsAsEntities()->transform(nl2br($answer))
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
setVariable($variable, $value='')
Sets a variable value.
popLastVoteFromSession()
TODO session handling should get its own class.
render(ilTemplate $tpl, ilPollAnswersHandler $answers, bool $disable_input)
__construct(ilLanguage $lng, Refinery $refinery)
renderAnswer(ilTemplate $tpl, int $id, string $answer, ?array $last_vote, bool $single_answer, bool $disable_input)
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
if(!file_exists('../ilias.ini.php'))