From 06ac7bf301675246ae32d26eac6f813eef123c99 Mon Sep 17 00:00:00 2001 From: Lukas Eichenauer Date: Fri, 3 Jan 2025 10:31:59 +0100 Subject: [PATCH 1/2] fix: 0043407 by adding missing setter in factory --- .../classes/Evaluation/class.ilTestEvaluationFactory.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/ILIAS/Test/classes/Evaluation/class.ilTestEvaluationFactory.php b/components/ILIAS/Test/classes/Evaluation/class.ilTestEvaluationFactory.php index 84932bce1c95..f89084ee4fd5 100644 --- a/components/ILIAS/Test/classes/Evaluation/class.ilTestEvaluationFactory.php +++ b/components/ILIAS/Test/classes/Evaluation/class.ilTestEvaluationFactory.php @@ -18,6 +18,7 @@ declare(strict_types=1); +use ILIAS\Test\Results\Data\StatusOfAttempt; use ILIAS\Test\Scoring\Marks\MarkSchema; /** @@ -150,6 +151,12 @@ public function getEvaluationData(): ilTestEvaluationData $attempt->setExamId((string) $row['exam_id']); $attempt->setRequestedHintsCount($row['hint_count']); $attempt->setDeductedHintPoints($row['hint_points']); + + $attempt->setStatusOfAttempt( + !isset($row['finalized_by']) || $row['finalized_by'] === null + ? StatusOfAttempt::RUNNING + : StatusOfAttempt::from($row['finalized_by']) + ); } if ($row['question_fi'] !== null) { From 64d6a3920bee0893a3a2d31a9fba4ea46202f9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Jou=C3=9Fen?= Date: Fri, 10 Jan 2025 13:21:29 +0100 Subject: [PATCH 2/2] Remove unused variable unfinished attempt --- .../Evaluation/class.ilTestEvaluationPassData.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/components/ILIAS/Test/classes/Evaluation/class.ilTestEvaluationPassData.php b/components/ILIAS/Test/classes/Evaluation/class.ilTestEvaluationPassData.php index 2d0e6dd4843a..06b4dd24c4ab 100644 --- a/components/ILIAS/Test/classes/Evaluation/class.ilTestEvaluationPassData.php +++ b/components/ILIAS/Test/classes/Evaluation/class.ilTestEvaluationPassData.php @@ -43,7 +43,6 @@ class ilTestEvaluationPassData private ?float $deductedHintPoints = null; private string $exam_id = ''; private ?StatusOfAttempt $status_of_attempt = null; - private bool $unfinished_attempt = false; public function __sleep() { @@ -243,10 +242,6 @@ public function getStatusOfAttempt(): StatusOfAttempt return $this->status_of_attempt; } - if ($this->unfinished_attempt) { - return StatusOfAttempt::RUNNING; - } - return StatusOfAttempt::FINISHED_BY_UNKNOWN; } @@ -254,14 +249,4 @@ public function setStatusOfAttempt(?StatusOfAttempt $status_of_attempt): void { $this->status_of_attempt = $status_of_attempt; } - - public function isUnfinishedAttempt(): bool - { - return $this->unfinished_attempt; - } - - public function setUnfinishedAttempt(bool $unfinished_attempt): void - { - $this->unfinished_attempt = $unfinished_attempt; - } }