compute answers in choices

This commit is contained in:
Tykayn 2021-04-27 11:17:41 +02:00 committed by tykayn
parent 665cf6d173
commit 8c2ad610a5
1 changed files with 6 additions and 2 deletions

View File

@ -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,
];
}