4 include_once(
"./Services/Block/classes/class.ilCustomBlock.php");
26 include_once
"Modules/Poll/classes/class.ilObjPoll.php";
28 $this->answers = $this->poll->getAnswers();
49 if(!
sizeof($this->answers))
54 include_once
"Modules/Poll/classes/class.ilObjPollAccess.php";
61 if(!$this->
mayVote($a_user_id) &&
77 if($a_user_id == ANONYMOUS_USER_ID)
82 if($this->poll->hasUserVoted($a_user_id))
87 if($this->poll->getVotingPeriod() &&
88 ($this->poll->getVotingPeriodBegin() >
time() ||
89 $this->poll->getVotingPeriodEnd() <
time()))
100 $this->poll->getVotingPeriod() &&
101 $this->poll->getVotingPeriodEnd() >
time())
115 switch($this->poll->getViewResults())
128 if($this->poll->hasUserVoted($a_user_id))
140 if(!
sizeof($this->answers))
142 return $lng->txt(
"poll_block_message_no_answers");
147 if(!$this->poll->isOnline())
149 return $lng->txt(
"poll_block_message_offline");
151 if($this->poll->getAccessBegin() >
time())
154 return sprintf($lng->txt(
"poll_block_message_inactive"), $date);
166 return $this->poll->getShowResultsAs();
175 return $this->poll->getShowComments();
const VIEW_RESULTS_AFTER_PERIOD
showComments()
Are Comments enabled or disabled.
const VIEW_RESULTS_AFTER_VOTE
const VIEW_RESULTS_ALWAYS
static _isActivated($a_ref_id)
Is activated?
getPoll()
Get poll object.
setRefId($a_id)
Set ref id (needed for poll access)
showResultsAs()
Show Results as (Barchart or Piechart)
static formatDate(ilDateTime $date)
Format a date public.
This is the super class of all custom blocks.
maySeeResults($a_user_id)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
hasAnyContent($a_user_id, $a_ref_id)
Check if user will see any content (vote/result)