19declare(strict_types=1);
28 $before_start =
false;
34 return $offline || $before_start || $after_end;
52 if (!$poll->getVotingPeriod()) {
55 if ($poll->getVotingPeriodBegin() > time()) {
68 if (!$poll->getVotingPeriod()) {
71 if ($poll->getVotingPeriodEnd() < time()) {
79 if (!array_key_exists(
$user_id, $this->cached_user_status)) {
82 return $this->cached_user_status[
$user_id];
87 return !$this->isUserAnonymous(
$user_id);
105 return $this->hasVotingPeriodEnded($poll,
true);
108 if ($this->hasUserAlreadyVoted(
$user_id, $poll)) {
120 $this->hasVotingPeriodEnded($poll,
false)
const int VIEW_RESULTS_AFTER_VOTE
const int VIEW_RESULTS_ALWAYS
hasUserVoted(int $a_user_id)
const int VIEW_RESULTS_NEVER
const int VIEW_RESULTS_AFTER_PERIOD
array $cached_user_status
areResultsVisible(int $user_id, ilObjPoll $poll)
isOfflineOrUnavailable(ilObjPoll $poll)
hasVotingPeriodNotStarted(ilObjPoll $poll, bool $default)
returns default if no voting period is set
mayUserVote(int $user_id)
hasQuestion(ilObjPoll $poll)
willResultsBeShown(ilObjPoll $poll)
hasUserAlreadyVoted(int $user_id, ilObjPoll $poll)
hasVotingPeriodEnded(ilObjPoll $poll, bool $default)
returns default if no voting period is set
isUserAnonymous(int $user_id)
if(!file_exists('../ilias.ini.php'))