aboutsummaryrefslogtreecommitdiff
path: root/app/views/vips/exercises/ClozeTask/correct.php
blob: 079158122efb53f6bdb3582e1d6a40b3f18b4e63 (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
33
34
35
36
37
38
39
40
41
42
<?php
/**
 * @var Exercise $exercise
 * @var VipsSolution $solution
 * @var array $results
 * @var array $response
 * @var bool $show_solution
 */
?>
<div class="description">
    <!--
    <? foreach (explode('[[]]', formatReady($exercise->task['text'])) as $blank => $text) : ?>
     --><?= $text ?><!--
        <? if (isset($exercise->task['answers'][$blank])) : ?>
            <? if ($solution->id): ?>
                <? if ($results[$blank]['points'] == 1): ?>
                 --><span class="correct_item math-tex"><?= htmlReady($response[$blank]) ?><!--
                     --><?= Icon::create('accept', Icon::ROLE_STATUS_GREEN)->asImg(['class' => 'correction_inline', 'title' => _('richtig')]) ?><!--
                 --></span><!--
                <? elseif ($results[$blank]['points'] == 0.5): ?>
                 --><span class="fuzzy_item math-tex"><?= htmlReady($response[$blank]) ?><!--
                     --><?= Icon::create('decline', Icon::ROLE_STATUS_YELLOW)->asImg(['class' => 'correction_inline', 'title' => _('fast richtig')]) ?><!--
                 --></span><!--
                <? elseif (empty($edit_solution) || $results[$blank]['safe']): ?>
                 --><span class="wrong_item math-tex"><?= htmlReady($response[$blank]) ?><!--
                     --><?= Icon::create('decline', Icon::ROLE_STATUS_RED)->asImg(['class' => 'correction_inline', 'title' => _('falsch')]) ?><!--
                 --></span><!--
                <? else: ?>
                 --><span class="wrong_item math-tex"><?= htmlReady($response[$blank]) ?><!--
                     --><?= Icon::create('question', Icon::ROLE_STATUS_RED)->asImg(['class' => 'correction_inline', 'title' => _('Unbekannte Antwort')]) ?><!--
                 --></span><!--
                <? endif ?>
            <? endif ?>
            <? if ($show_solution && (empty($results) || $results[$blank]['points'] < 1) && $exercise->correctAnswers($blank)): ?>
             --><span class="correct_item math-tex"><?= htmlReady(implode(' | ', $exercise->correctAnswers($blank))) ?></span><!--
            <? endif ?>
        <? endif ?>
    <? endforeach ?>
    -->
</div>

<?= $this->render_partial('exercises/evaluation_mode_info', ['evaluation_mode' => false]) ?>