3 declare(strict_types=1);
40 $this->
lng = $DIC->language();
49 $this->answers = $this->poll->getAnswers();
62 if (!count($this->answers)) {
85 if ($this->poll->hasUserVoted($a_user_id)) {
89 if ($this->poll->getVotingPeriod() &&
90 ($this->poll->getVotingPeriodBegin() > time() ||
91 $this->poll->getVotingPeriodEnd() < time())) {
106 $this->poll->getVotingPeriod() &&
107 $this->poll->getVotingPeriodEnd() > time()) {
115 if (!$this->active) {
119 switch ($this->poll->getViewResults()) {
131 if ($this->poll->hasUserVoted($a_user_id)) {
141 if (!count($this->answers)) {
142 return $this->
lng->txt(
"poll_block_message_no_answers");
145 if (!$this->active) {
146 if ($this->poll->getOfflineStatus()) {
147 return $this->
lng->txt(
"poll_block_message_offline");
149 if ($this->poll->getAccessBegin() > time()) {
151 return sprintf($this->
lng->txt(
"poll_block_message_inactive"), $date);
163 return $this->poll->getShowResultsAs();
171 return $this->poll->getShowComments();
maySeeQuestion($a_user_id)
const VIEW_RESULTS_AFTER_PERIOD
showComments()
Are comments enabled or disabled.
const VIEW_RESULTS_AFTER_VOTE
getMessage(int $a_user_id)
const VIEW_RESULTS_ALWAYS
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
maySeeResults(int $a_user_id)
static _isActivated(int $a_ref_id)
setRefId(int $a_id)
Set ref id (needed for poll access)
showResultsAs()
Show Results as (Barchart or Piechart)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
hasAnyContent(int $a_user_id, int $a_ref_id)
Check if user will see any content (vote/result)