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',
|
'password_protected' => $this->getPassword() ? 'yes' : 'no',
|
||||||
'max_score' => $computedAnswers[ 'max_score' ],
|
'max_score' => $computedAnswers[ 'max_score' ],
|
||||||
'choices' => $displayedChoices,
|
'choices' => $computedAnswers[ 'answers' ],
|
||||||
'stacks' => $displayedStackOfVotes,
|
'stacks' => $displayedStackOfVotes,
|
||||||
'comments' => $displayedComments,
|
'comments' => $displayedComments,
|
||||||
];
|
];
|
||||||
|
@ -321,9 +321,13 @@ class Poll {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$answersWithStats = [];
|
||||||
|
foreach ( $computedArray as $choice_stat ) {
|
||||||
|
$answersWithStats[] = $choice_stat;
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'answers' => $computedArray,
|
'answers' => $answersWithStats,
|
||||||
'max_score' => $maxScore,
|
'max_score' => $maxScore,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue