aboutsummaryrefslogtreecommitdiff
path: root/app/views/vips/exercises/MultipleChoiceTask/correct.php
blob: 2f2a6dc80a55d4171fb03922e09c569f929fed24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
/**
 * @var Exercise $exercise
 * @var VipsSolution $solution
 * @var array $results
 * @var array $response
 * @var bool $show_solution
 */
?>
<div class="mc_list inline-content">
    <? foreach ($exercise->task['answers'] as $key => $entry): ?>
        <div class="mc_flex <?= $show_solution && $entry['score'] ? 'correct_item' : 'mc_item' ?>">
            <? if (isset($response[$key]) && $response[$key]): ?>
                <?= Assets::img('choice_checked.svg') ?>
            <? else: ?>
                <?= Assets::img('choice_unchecked.svg') ?>
            <? endif ?>

            <?= formatReady($entry['text']) ?>

            <? if (isset($response[$key])): ?>
                <? if ((int) $response[$key] == $entry['score']): ?>
                    <?= Icon::create('accept', Icon::ROLE_STATUS_GREEN)->asImg(['class' => 'correction_marker', 'title' => _('richtig')]) ?>
                <? else: ?>
                    <?= Icon::create('decline', Icon::ROLE_STATUS_RED)->asImg(['class' => 'correction_marker', 'title' => _('falsch')]) ?>
                <? endif ?>
            <? endif ?>
        </div>
    <? endforeach ?>
</div>

<?= $this->render_partial('exercises/evaluation_mode_info') ?>