Skip to content

Commit

Permalink
T&A 43837: allow multi select to finish pass only if processing time …
Browse files Browse the repository at this point in the history
…resett… (ILIAS-eLearning#8953)

* fix: allow multi select to finish pass only if processing time resetting is enabled (43837)

* refactor: remove commend and improve code structure
  • Loading branch information
lukas-heinrich authored and kergomard committed Feb 14, 2025
1 parent cecaf33 commit cd1a812
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,19 @@ public function onSubmit(
return null;
}

if (!$this->test_obj->getResetProcessingTime() && count($selected_participants) > 1) {
foreach ($selected_participants as $participant) {
if ($participant->hasUnfinishedAttempts()) {
$this->tpl->setOnScreenMessage(
\ilGlobalTemplateInterface::MESSAGE_TYPE_FAILURE,
$this->lng->txt('finish_test_more_than_one_selected'),
true
);
return null;
}
}
}

// This is required here because of late test object binding
$test_session_factory = new \ilTestSessionFactory(
$this->test_obj,
Expand Down
1 change: 1 addition & 0 deletions lang/ilias_de.lang
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ assessment#:#finish_pass_for_user_confirmation#:#Wollen Sie den Test Durchlauf f
assessment#:#finish_pass_for_user_in_processing_time#:#WARNUNG: die Bearbeitungszeit für diesen Benutzer ist noch nicht vorbei! Sie sollten den Testlauf nur bei zwingendem Grund (z.B. Ausschluss vom Test) beenden.
assessment#:#finish_test#:#Test beenden
assessment#:#finish_test_all#:#Sind Sie sicher, dass die den Testdurchlauf für alle Teilnehmer beenden möchten?
assessment#:#finish_test_more_than_one_selected#:#Wenn der Test nur einen Durchgang zulässt, darf nur ein einziger Teilnehmer ausgewählt werden, um den Durchgang zu beenden.
assessment#:#finish_test_multiple#:#Sind Sie sicher, dass Sie den Testdurchlauf für folgende Teilnehmer beenden möchten?
assessment#:#finish_test_no_valid_participants_selected#:#Für die gewählten Teilnehmer gibt es keine aktiven Testdurchläufe und können daher nicht beendet werden.
assessment#:#finish_test_single#:#Sind Sie sicher, dass Sie den Testdurchlauf für den Teilnehmer "%s" beenden möchten?
Expand Down
1 change: 1 addition & 0 deletions lang/ilias_en.lang
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ assessment#:#finish_pass_for_user_confirmation#:#Are you sure you want to finish
assessment#:#finish_pass_for_user_in_processing_time#:#WARNING: the processing time for this user is not over yet! You should only end the test run if there is a compelling reason (e.g. exclusion from the test).
assessment#:#finish_test#:#Finish Test
assessment#:#finish_test_all#:#Are you sure you want to finish the test attempts for all users?
assessment#:#finish_test_more_than_one_selected#:#Only a single participant may be selected to finish the pass if the test allows only one pass.
assessment#:#finish_test_multiple#:#Are you sure you want to finish the test attempts for the following participants?
assessment#:#finish_test_no_valid_participants_selected#:#There are no active test runs for the selected participants, so they cannot be completed.
assessment#:#finish_test_single#:#Are you sure you want to finish the test attempt for the participant "%s"?
Expand Down

0 comments on commit cd1a812

Please sign in to comment.