aboutsummaryrefslogtreecommitdiff
path: root/app/views/vips/solutions/view_solution.php
blob: f0e0e1a74aea22ce96cb0823107b2d0f4ad6436b (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
63
64
65
66
67
68
69
70
71
72
73
<?php
/**
 * @var Vips_SolutionsController $controller
 * @var VipsAssignment $assignment
 * @var Exercise $exercise
 * @var VipsSolution $solution
 * @var float $max_points
 */
?>
<div class="breadcrumb width-1200">
    <div style="display: inline-block; width: 20%;">
        <? if (isset($prev_exercise_id)) : ?>
            <a href="<?= $controller->view_solution(['assignment_id' => $assignment->id, 'exercise_id' => $prev_exercise_id]) ?>">
                <?= Icon::create('arr_1left') ?>
                <?= _('Vorige Aufgabe') ?>
            </a>
        <? endif ?>
    </div><!--
 --><div style="display: inline-block; text-align: center; width: 60%;">
        <a href="<?= $controller->student_assignment_solutions(['assignment_id' => $assignment->id]) ?>">
            &bull; <?= htmlReady($assignment->test->title) ?> &bull;
        </a>
    </div><!--
 --><div style="display: inline-block; text-align: right; width: 20%;">
        <? if (isset($next_exercise_id)) : ?>
            <a href="<?= $controller->view_solution(['assignment_id' => $assignment->id, 'exercise_id' => $next_exercise_id]) ?>">
                <?= _('Nächste Aufgabe') ?>
                <?= Icon::create('arr_1right') ?>
            </a>
        <? endif ?>
    </div>
</div>

<form class="default width-1200">
    <?= $this->render_partial('vips/exercises/correct_exercise') ?>

    <fieldset>
        <legend>
            <?= sprintf(_('Bewertung der Aufgabe &bdquo;%s&ldquo;'), htmlReady($exercise->title)) ?>
            <div style="float: right;">
                <? if ($solution->state): ?>
                    <?= _('Korrigiert') ?>
                <? elseif ($solution->id): ?>
                    <?= _('Unkorrigiert') ?>
                <? else: ?>
                    <?= _('Nicht abgegeben') ?>
                <? endif ?>
            </div>
        </legend>

        <? if ($solution->feedback != '') : ?>
            <div class="label-text">
                <?= _('Anmerkung des Korrektors') ?>

                <? if (isset($solution->grader_id) && $assignment->type === 'practice') : ?>
                    <? $corrector_full_name = get_fullname($solution->grader_id); ?>
                    (<a href="<?= URLHelper::getLink('dispatch.php/messages/write', ['rec_uname' => get_username($solution->grader_id)]) ?>"
                        title="<?= htmlReady(sprintf(_('Nachricht an „%s“ schreiben'), $corrector_full_name)) ?>" data-dialog><?= htmlReady($corrector_full_name) ?></a>)
                <? endif ?>
            </div>

            <div class="vips_output">
                <?= formatReady($solution->feedback) ?>
            </div>
        <? endif ?>

        <?= $this->render_partial('vips/solutions/feedback_files_table') ?>

        <div class="description">
            <?= sprintf(_('Erreichte Punkte: %g von %g'), $solution->points, $max_points) ?>
        </div>
    </fieldset>
</form>