Skip to content

Commit

Permalink
Test: Fix Finishing Test Passes For Other Users
Browse files Browse the repository at this point in the history
  • Loading branch information
kergomard committed Nov 17, 2023
1 parent a7e78d2 commit 71f3518
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions components/ILIAS/Test/classes/class.ilTestEvaluationGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public function executeCommand()
default:
if (in_array($cmd, ['excel_scored_test_run', 'excel_all_test_runs', 'csv'])) {
$ret = $this->exportEvaluation($cmd);
} else if (in_array($cmd, ['excel_all_test_runs_a', 'csv_a'])) {
} elseif (in_array($cmd, ['excel_all_test_runs_a', 'csv_a'])) {
$ret = $this->exportAggregatedResults($cmd);
} else if ($cmd === 'certificate') {
} elseif ($cmd === 'certificate') {
$ret = $this->exportCertificate();
} else {
$ret = $this->$cmd();
Expand Down Expand Up @@ -303,7 +303,7 @@ public function outEvaluation()
$export_type = new ilSelectInputGUI($this->lng->txt('exp_eval_data'), 'export_type');
if ($this->getObject() && $this->getObject()->getQuestionSetType() !== ilObjTest::QUESTION_SET_TYPE_RANDOM) {
$options = array(
$this->ui_factory->button()->shy($this->lng->txt('exp_type_excel') . ' (' . $this->lng->txt('exp_scored_test_run') . ')', $this->ctrl->getLinkTarget($this,'excel_scored_test_run')),
$this->ui_factory->button()->shy($this->lng->txt('exp_type_excel') . ' (' . $this->lng->txt('exp_scored_test_run') . ')', $this->ctrl->getLinkTarget($this, 'excel_scored_test_run')),
$this->ui_factory->button()->shy($this->lng->txt('exp_type_excel') . ' (' . $this->lng->txt('exp_all_test_runs') . ')', $this->ctrl->getLinkTarget($this, 'excel_all_test_runs')),
$this->ui_factory->button()->shy($this->lng->txt('exp_type_spss'), $this->ctrl->getLinkTarget($this, 'csv'))
);
Expand Down Expand Up @@ -1872,11 +1872,11 @@ private function hasUsersWithWorkingTimeAvailable(): bool

public function confirmFinishTestPassForAllUser()
{
$accessFilter = $this->participant_access_filter->getManageParticipantsUserFilter($this->ref_id);
$access_filter = $this->participant_access_filter->getManageParticipantsUserFilter($this->ref_id);

$participant_list = new ilTestParticipantList($this->object, $this->user, $this->lng, $this->db);
$participant_list->initializeFromDbRows($this->object->getTestParticipants());
$filtered_participant_list = $participant_list->getAccessFilteredList($accessFilter);
$filtered_participant_list = $participant_list->getAccessFilteredList($access_filter);

foreach ($filtered_participant_list as $participant) {
if (!$participant->hasUnfinishedPasses()) {
Expand All @@ -1901,11 +1901,11 @@ public function confirmFinishTestPassForAllUser()
$this->redirectBackToParticipantsScreen();
}

protected function finishTestPass($active_id, $obj_id)
protected function finishTestPass(int $active_id, int $obj_id)
{
$process_locker = $this->processLockerFactory->withContextId((int) $active_id)->getLocker();
$process_locker = $this->processLockerFactory->withContextId($active_id)->getLocker();

$test_pass_finisher = new ilTestPassFinishTasks($this->testSessionFactory->getSession(), $obj_id);
$test_pass_finisher = new ilTestPassFinishTasks($this->testSessionFactory->getSession($active_id), $obj_id);
$test_pass_finisher->performFinishTasks($process_locker);
}

Expand Down

0 comments on commit 71f3518

Please sign in to comment.