findById($threadId); if (is_null($poll)) { Error404::error("No reference to that poll found"); } if ($poll->isClosed()) { Error403::error("Sorry, the poll is closed"); } $answerList = $poll->answerList(); $vote = $poll->vote(); if (!isset($_POST['vote']) || !is_number($_POST['vote'])) { ?> Please select an option.
$answer) { ?>



addVote($Viewer, $response)) { Error400::error('Cannot add your vote to the poll'); } $vote = $poll->vote(); // need to refresh the results to take the vote into account ?>
Voted: of total. (You may click on a choice to change your vote).
+ $answer) { $choice = $vote[$i]; ?>
  • (%)

  • ➔ (Abstain)

  • Votes: total()) ?>