Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T&A: 43407: Fix missing StatusOfAttempt #8823

Open
wants to merge 2 commits into
base: release_10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

declare(strict_types=1);

use ILIAS\Test\Results\Data\StatusOfAttempt;
use ILIAS\Test\Scoring\Marks\MarkSchema;

/**
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -243,25 +242,11 @@ public function getStatusOfAttempt(): StatusOfAttempt
return $this->status_of_attempt;
}

if ($this->unfinished_attempt) {
return StatusOfAttempt::RUNNING;
}

return StatusOfAttempt::FINISHED_BY_UNKNOWN;
}

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;
}
}
Loading