diff --git a/src/Entity/Poll.php b/src/Entity/Poll.php index 2383a38..98612c5 100755 --- a/src/Entity/Poll.php +++ b/src/Entity/Poll.php @@ -263,7 +263,7 @@ class Poll { , 'password_protected' => $this->getPassword() ? 'yes' : 'no', 'max_score' => $computedAnswers[ 'max_score' ], - 'choices' => $displayedChoices, + 'choices' => $computedAnswers[ 'answers' ], 'stacks' => $displayedStackOfVotes, 'comments' => $displayedComments, ]; @@ -321,9 +321,13 @@ class Poll { } } } + $answersWithStats = []; + foreach ( $computedArray as $choice_stat ) { + $answersWithStats[] = $choice_stat; + } return [ - 'answers' => $computedArray, + 'answers' => $answersWithStats, 'max_score' => $maxScore, ]; }