19 declare(strict_types=1);
33 private readonly TestResultRepository $test_pass_result_repository
40 $pass = $this->test_session->getPass();
42 if (!$this->test_session->isSubmitted()) {
43 $this->test_session->setSubmitted();
44 $this->test_session->setSubmittedTimestamp();
45 $this->test_session->saveToDb();
48 $last_started_pass = (
49 $this->test_session->getLastStartedPass() ===
null ? -1 : $this->test_session->getLastStartedPass()
52 $last_finished_pass = (
53 $this->test_session->getLastFinishedPass() ===
null ? -1 : $this->test_session->getLastFinishedPass()
56 if ($last_started_pass > -1 && $last_finished_pass < $last_started_pass) {
57 $this->test_session->setLastFinishedPass($this->test_session->getPass());
58 $this->test_session->increaseTestPass();
61 $this->test_pass_result_repository->finalizeTestPassResult(
62 $this->test_session->getActiveId(),
68 $this->obj_test->updateTestResultCache($this->test_session->getActiveId(),
null);
76 $this->obj_test->getId(),
__construct(private readonly ilTestSession $test_session, private readonly ilObjTest $obj_test, private readonly TestResultRepository $test_pass_result_repository)
Class ilTestPassFinishTasks.
static _getParticipantId($active_id)
Get user id for active id.
updateLearningProgressAfterPassFinishedIsWritten()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
performFinishTasks(ilTestProcessLocker $process_locker, StatusOfAttempt $status_of_attempt)
executeTestFinishOperation(callable $operation)
static _updateStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null, bool $a_percentage=false, bool $a_force_raise=false)