| @@ 240-244 (lines=5) @@ | ||
| 237 | if (isset($_POST['buttons']) && isset($_POST['buttons']['remove_answer'])) { |
|
| 238 | $counter--; |
|
| 239 | Session::write('answer_count', $counter); |
|
| 240 | foreach ($formData['answers'] as $index => &$data) { |
|
| 241 | if ($index > $counter) { |
|
| 242 | unset($formData['answers'][$index]); |
|
| 243 | } |
|
| 244 | } |
|
| 245 | } |
|
| 246 | ||
| 247 | if (!isset($_POST['delete_answer'])) { |
|
| @@ 249-253 (lines=5) @@ | ||
| 246 | ||
| 247 | if (!isset($_POST['delete_answer'])) { |
|
| 248 | if (isset($formData['answers'])) { |
|
| 249 | foreach ($formData['answers'] as $index => $data) { |
|
| 250 | if ($index > $counter) { |
|
| 251 | unset($formData['answers'][$index]); |
|
| 252 | } |
|
| 253 | } |
|
| 254 | ||
| 255 | for ($i = 0; $i <= $counter; $i++) { |
|
| 256 | if (!isset($formData['answers'][$i])) { |
|