aboutsummaryrefslogtreecommitdiff
path: root/app/views/course/evaluation/index.php
blob: 193ecf73548b5fbadae5817e37985f7186a6080a (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 Course_EvaluationController $controller
 */
?>

<?php foreach ($controller->evaluations as $key => $evaluation) : ?>
    <article class="studip toggle <?= $key == 0 ? 'open' : '' ?>">
        <header>
            <h1>
                <a href="#">
                    <?= htmlReady((Semester::find($evaluation->eval_assignment->semester_id))->name . ' - ' . $evaluation->title) ?>
                </a>
            </h1>
        </header>

        <?php if ($evaluation->isStopped()) : ?>
            <?= $this->render_partial('questionnaire/evaluate.php', ['questionnaire' => $evaluation, 'range_type' => 'course', 'range_id' => Context::getId()]) ?>
        <?php elseif ($evaluation->isAnswerable()) : ?>
            <?= $this->render_partial('questionnaire/answer.php', ['questionnaire' => $evaluation, 'range_type' => 'course', 'range_id' => Context::getId()]) ?>
        <?php else : ?>
            <p><?= _('Die Evaluation ist noch nicht abgeschlossen.') ?></p>
        <?php endif ?>
    </article>
<?php endforeach ?>

<?php
if (User::findCurrent()->hasPermissionLevel('tutor', Context::get())) {
    $actions = new ActionsWidget();
    $actions->addLink(
        _("QR-Code für Studierende anzeigen"),
        URLHelper::getURL('dispatch.php/course/evaluation'),
        Icon::create("code-qr", "clickable"),
        ['data-qr-code' => sprintf(_( 'Evaluation zur Veranstaltung %s'), Context::get()->getFullname('number-name'))]
    );
    Sidebar::Get()->addWidget($actions);
}