aboutsummaryrefslogtreecommitdiff
path: root/app/views/vips/exercises/ClozeTask/print.php
blob: fce4bc41c9ced934070a5a0c26cf47b84b40736f (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/**
 * @var ClozeTask $exercise
 * @var VipsSolution $solution
 * @var array $response
 * @var array $results
 * @var bool $print_correction
 * @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 && $response[$blank] !== ''): ?>
             --><span class="math-tex" style="text-decoration: underline;">&nbsp;&nbsp;<?= htmlReady($response[$blank]) ?>&nbsp;&nbsp;</span><!--
                <? if ($print_correction): ?>
                    <? if ($results[$blank]['points'] == 1): ?>
                     --><?= Icon::create('accept', Icon::ROLE_STATUS_GREEN)->asImg(['title' => _('richtig')]) ?><!--
                    <? elseif ($results[$blank]['points'] == 0.5): ?>
                     --><?= Icon::create('decline', Icon::ROLE_STATUS_YELLOW)->asImg(['title' => _('fast richtig')]) ?><!--
                    <? else: ?>
                     --><?= Icon::create('decline', Icon::ROLE_STATUS_RED)->asImg(['title' => _('falsch')]) ?><!--
                    <? endif ?>
                <? endif ?>
            <? elseif ($exercise->isSelect($blank)): ?>
                <? foreach ($exercise->task['answers'][$blank] as $index => $option) : ?>
                 --><?= $index ? ' | ' : '' ?><!--
                 --><?= Assets::img('choice_unchecked.svg', ['style' => 'vertical-align: text-bottom;']) ?> <!--
                 --><span class="math-tex" style="border-bottom: 1px dotted black;"><?= htmlReady($option['text']) ?></span><!--
                <? endforeach ?>
            <? else: ?>
             --><?= str_repeat('_', $exercise->getInputWidth($blank)) ?><!--
            <? 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>

<? if ($exercise->interactionType() === 'drag'): ?>
    <div class="label-text">
        <? if ($print_correction): ?>
            <?= _('Nicht zugeordnete Antworten:') ?>
        <? else: ?>
            <?= _('Antwortmöglichkeiten:') ?>
        <? endif ?>
    </div>

    <ol>
        <? foreach ($exercise->availableAnswers($solution) as $item): ?>
            <li>
                <span class="math-tex"><?= htmlReady($item) ?></span>
            </li>
        <? endforeach ?>
    </ol>
<? endif ?>

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