Skip to content
Snippets Groups Projects
Commit 704e76a2 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

use correct index in answer array, fixes #165

parent 49a6a977
No related branches found
No related tags found
No related merge requests found
......@@ -28,13 +28,14 @@
</a>
</td>
<td class="dynamic_list">
<? foreach ($exercise->task['answers'] as $j => $answer): ?>
<? $j = 0 ?>
<? foreach ($exercise->task['answers'] as $answer): ?>
<? if ($answer['group'] == $i): ?>
<? $size = substr_count($answer['text'], "\n") == 0 ? 'small' : 'large' ?>
<div class="dynamic_row size_toggle size_<?= $size ?>">
<?= $this->render_partial('exercises/flexible_input', ['name' => "answer[$i][$j]", 'value' => $answer['text'], 'size' => $size]) ?>
<input type="hidden" name="id[<?= $i ?>][<?= $j ?>]" value="<?= $answer['id'] ?>">
<input type="hidden" name="id[<?= $i ?>][<?= $j++ ?>]" value="<?= $answer['id'] ?>">
<a href="#" class="delete_dynamic_row">
<?= Icon::create('trash', 'clickable', ['title' => _vips('Antwort Löschen')]) ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment