diff options
| author | Finn Schneider <schneider@data-quest.de> | 2026-03-19 14:03:21 +0100 |
|---|---|---|
| committer | Finn Schneider <schneider@data-quest.de> | 2026-03-19 14:03:21 +0100 |
| commit | 96e5a86a214bad7cf50f2e5a987b5d852341af5f (patch) | |
| tree | 3b31651f4d3e2cbd0b12968c233bbfccba257a32 | |
| parent | 5893a1183af02564a31de80a051e218f30a04090 (diff) | |
fix eval_assign remove start/stopdate
| -rw-r--r-- | app/controllers/course/evaluation.php | 2 | ||||
| -rw-r--r-- | app/views/course/evaluation/index.php | 7 | ||||
| -rw-r--r-- | lib/models/Questionnaire.php | 12 |
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() |
