[Poll] Store poll response to DB

This commit is contained in:
Daniel
2020-11-04 19:43:36 +00:00
committed by Hugo Sales
parent 4fcde940ff
commit 8bbeb79233
3 changed files with 39 additions and 27 deletions

View File

@@ -33,8 +33,8 @@ class PollResponseForm extends Form
{
$formOptions = [];
$options = [];
for ($i = 0; $i < count($opts); ++$i) {
$options[$opts[$i]] = $i;
for ($i = 1; $i <= count($opts); ++$i) {
$options[$opts[$i - 1]] = $i;
}
array_push($formOptions, ['Question', ChoiceType::class, [
'choices' => $options,