aboutsummaryrefslogtreecommitdiff
path: root/app/views/vips/exercises/TextLineTask/correct.php
blob: c87d531d021888621f8bd5d3ca353175256cd27f (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
<?php
/**
 * @var Exercise $exercise
 * @var VipsSolution $solution
 * @var array $results
 * @var array $response
 * @var bool $show_solution
 * @var bool $edit_solution
 */
?>
<? if ($solution->id): ?>
    <div class="label-text">
        <?= _('Antwort') ?>
    </div>

    <?= htmlReady($response[0]) ?>

    <? if ($results[0]['points'] == 1): ?>
        <?= Icon::create('accept', Icon::ROLE_STATUS_GREEN)->asImg(['title' => _('richtig')]) ?>
    <? elseif ($results[0]['points'] == 0.5): ?>
        <?= Icon::create('decline', Icon::ROLE_STATUS_YELLOW)->asImg(['title' => _('fast richtig')]) ?>
    <? elseif (!$edit_solution || $results[0]['safe']): ?>
        <?= Icon::create('decline', Icon::ROLE_STATUS_RED)->asImg(['title' => _('falsch')]) ?>
    <? else: ?>
        <?= Icon::create('question', Icon::ROLE_STATUS_RED)->asImg(['title' => _('Unbekannte Antwort')]) ?>
    <? endif ?>
<? endif ?>

<? if ($show_solution && $exercise->correctAnswers()): ?>
    <div class="label-text">
        <?= _('Richtige Antworten') ?>:

        <span class="correct_item">
            <?= htmlReady(implode(' | ', $exercise->correctAnswers())) ?>
        </span>
    </div>
<? endif ?>