aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFinn Schneider <schneider@data-quest.de>2026-03-19 16:45:16 +0100
committerFinn Schneider <schneider@data-quest.de>2026-03-19 16:45:16 +0100
commitf897832eb2c8750fa51f37a5f673639362815494 (patch)
treef6b4f607394645533a1b3f6c9cdd0d8bf02913d0
parent063dafb012c6bdeedd5257bf8117b5949c915763 (diff)
course views
-rw-r--r--app/views/course/evaluation/index.php17
-rw-r--r--lib/models/Questionnaire.php11
2 files changed, 14 insertions, 14 deletions
diff --git a/app/views/course/evaluation/index.php b/app/views/course/evaluation/index.php
index ddbbb3a..3adbb94 100644
--- a/app/views/course/evaluation/index.php
+++ b/app/views/course/evaluation/index.php
@@ -4,7 +4,6 @@
*/
?>
-<!-- TODO min responses -->
<?php foreach ($controller->evaluations as $key => $evaluation) : ?>
<article class="studip toggle <?= $key == 0 ? 'open' : '' ?>">
<header>
@@ -15,11 +14,13 @@
</h1>
</header>
- <?php if (EvaluationHelper::isPermittedEvaluationAccess()) : ?>
+ <?php if ($evaluation->resultsVisible()) : ?>
<?= $this->render_partial('questionnaire/evaluate.php',
['questionnaire' => $evaluation, 'range_type' => 'course', 'range_id' => Context::getId()]) ?>
- <?php elseif (User::findCurrent()->hasPermissionLevel('tutor', Context::get())) : ?>
- <!-- TODO other views -->
+ <?php elseif ($evaluation->isAnswerable()) : ?>
+ <?= $this->render_partial('questionnaire/answer.php',
+ ['questionnaire' => $evaluation, 'range_type' => 'course', 'range_id' => Context::getId()]) ?>
+ <?php else : ?>
<table class="row-headers">
<tbody>
<tr>
@@ -58,14 +59,6 @@
</tr>
</tbody>
</table>
- <?php else : ?>
- <?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 ?>
<?php endif ?>
</article>
<?php endforeach ?>
diff --git a/lib/models/Questionnaire.php b/lib/models/Questionnaire.php
index 52fc7f2..17a399e 100644
--- a/lib/models/Questionnaire.php
+++ b/lib/models/Questionnaire.php
@@ -155,6 +155,11 @@ class Questionnaire extends SimpleORMap implements PrivacyObject
public function isAnswerable()
{
+ if ($this->template_id && Context::isCourse()
+ && User::findCurrent()->hasPermissionLevel('tutor', Context::get())) {
+ return false;
+ }
+
if (!$this->isViewable() || !$this->isRunning()) {
return false;
}
@@ -273,8 +278,10 @@ class Questionnaire extends SimpleORMap implements PrivacyObject
&& $this->countAnswers() >= $this->minimum_responses;
return $eval_visible
- && ($this->resultvisibility === 'afterending' && $this->isStopped()
- || $this->resultvisibility === 'afterparticipation' && $this->isAnswered());
+ && (($this->resultvisibility === 'afterending' && $this->isStopped())
+ || ($this->resultvisibility === 'afterparticipation' && $this->isAnswered())
+ || ($this->resultvisibility === 'afterparticipation'
+ && $user->hasPermissionLevel('tutor', Context::get())));
}
return $this['resultvisibility'] === 'always'