aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/course/evaluation.php2
-rw-r--r--app/views/course/evaluation/index.php7
-rw-r--r--lib/models/Questionnaire.php12
3 files changed, 7 insertions, 14 deletions
diff --git a/app/controllers/course/evaluation.php b/app/controllers/course/evaluation.php
index dd3043f..7f7d301 100644
--- a/app/controllers/course/evaluation.php
+++ b/app/controllers/course/evaluation.php
@@ -7,7 +7,7 @@ class Course_EvaluationController extends AuthenticatedController
$this->evaluations = Questionnaire::findBySQL(
"INNER JOIN `questionnaire_eval_assignments` USING(`questionnaire_id`)
WHERE `course_id` = ? AND `applied` = 1
- ORDER BY `questionnaire_eval_assignments`.`startdate` DESC",
+ ORDER BY `questionnaires`.`startdate` DESC",
[Context::getId()]);
$this->render_template('course/evaluation/index', $this->layout);
}
diff --git a/app/views/course/evaluation/index.php b/app/views/course/evaluation/index.php
index 05f677d..ddbbb3a 100644
--- a/app/views/course/evaluation/index.php
+++ b/app/views/course/evaluation/index.php
@@ -16,18 +16,19 @@
</header>
<?php if (EvaluationHelper::isPermittedEvaluationAccess()) : ?>
- <?= $this->render_partial('questionnaire/evaluate.php', ['questionnaire' => $evaluation, 'range_type' => 'course', 'range_id' => Context::getId()]) ?>
+ <?= $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 -->
<table class="row-headers">
<tbody>
<tr>
<th scope="row"><?= _('Evaluationsbeginn') ?></th>
- <td><?= date('d.m.Y H:i', $evaluation->eval_assignment->startdate) ?></td>
+ <td><?= date('d.m.Y H:i', $evaluation->startdate) ?></td>
</tr>
<tr>
<th scope="row"><?= _('Evaluationsende') ?></th>
- <td><?= date('d.m.Y H:i', $evaluation->eval_assignment->stopdate) ?></td>
+ <td><?= date('d.m.Y H:i', $evaluation->stopdate) ?></td>
</tr>
<tr>
<th scope="row"><?= _('Anonyme Teilnahme') ?></th>
diff --git a/lib/models/Questionnaire.php b/lib/models/Questionnaire.php
index 62b358d..d6260f0 100644
--- a/lib/models/Questionnaire.php
+++ b/lib/models/Questionnaire.php
@@ -241,20 +241,12 @@ class Questionnaire extends SimpleORMap implements PrivacyObject
public function isStarted()
{
- if ($this->eval_assignment) {
- return $this->eval_assignment->startdate && $this->eval_assignment->startdate <= time();
- } else {
- return $this['startdate'] && ($this['startdate'] <= time());
- }
+ return $this['startdate'] && ($this['startdate'] <= time());
}
public function isStopped()
{
- if ($this->eval_assignment) {
- return $this->eval_assignment->stopdate && $this->eval_assignment->stopdate <= time();
- } else {
- return $this['stopdate'] && ($this['stopdate'] <= time());
- }
+ return $this['stopdate'] && ($this['stopdate'] <= time());
}
public function isRunning()