mirror of
https://framagit.org/tykayn/date-poll-api
synced 2023-08-25 08:23:11 +02:00
compute answers in choices
This commit is contained in:
parent
665cf6d173
commit
8c2ad610a5
@ -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,
|
||||
];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user