diff --git a/components/ILIAS/Test/classes/class.ilObjTestGUI.php b/components/ILIAS/Test/classes/class.ilObjTestGUI.php index f61b911503e8..23272beb809a 100755 --- a/components/ILIAS/Test/classes/class.ilObjTestGUI.php +++ b/components/ILIAS/Test/classes/class.ilObjTestGUI.php @@ -326,7 +326,8 @@ public function executeCommand(): void $this->ctrl, $this->tabs_gui, $this->toolbar, - $this->test_question_set_config_factory->getQuestionSetConfig() + $this->test_question_set_config_factory->getQuestionSetConfig(), + $this->testrequest ); $gui->setTestAccess($this->getTestAccess()); diff --git a/components/ILIAS/Test/classes/class.ilTestDashboardGUI.php b/components/ILIAS/Test/classes/class.ilTestDashboardGUI.php index e81300bef858..d6faa8bd18c6 100755 --- a/components/ILIAS/Test/classes/class.ilTestDashboardGUI.php +++ b/components/ILIAS/Test/classes/class.ilTestDashboardGUI.php @@ -21,6 +21,8 @@ use ILIAS\UI\Factory as UIFactory; use ILiAS\UI\Renderer as UIRenderer; +use ILIAS\Test\InternalRequestService; + /** * Class ilTestDashboardGUI * @@ -50,7 +52,8 @@ public function __construct( protected ilCtrl $ctrl, protected ilTabsGUI $tabs, protected ilToolbarGUI $toolbar, - protected ilTestQuestionSetConfig $question_set_config + protected ilTestQuestionSetConfig $question_set_config, + protected InternalRequestService $testrequest ) { } @@ -128,7 +131,8 @@ public function executeCommand(): void $this->ctrl, $this->db, $this->tabs, - $this->toolbar + $this->toolbar, + $this->testrequest ); $gui->setTestAccess($this->getTestAccess()); $gui->setObjectiveParent($this->getObjectiveParent()); diff --git a/components/ILIAS/Test/classes/class.ilTestParticipantsGUI.php b/components/ILIAS/Test/classes/class.ilTestParticipantsGUI.php index eaea2da0201a..eff53c4cb092 100755 --- a/components/ILIAS/Test/classes/class.ilTestParticipantsGUI.php +++ b/components/ILIAS/Test/classes/class.ilTestParticipantsGUI.php @@ -21,6 +21,8 @@ use ILIAS\UI\Factory as UIFactory; use ILiAS\UI\Renderer as UIRenderer; +use ILIAS\Test\InternalRequestService; + /** * Class ilTestParticipantsGUI * @@ -58,7 +60,8 @@ public function __construct( protected ilCtrl $ctrl, protected ilDBInterface $db, protected ilTabsGUI $tabs, - protected ilToolbarGUI $toolbar + protected ilToolbarGUI $toolbar, + protected InternalRequestService $testrequest ) { $this->participant_access_filter = new ilTestParticipantAccessFilterFactory($access); } @@ -328,15 +331,16 @@ protected function addFinishAllPassesButton(ilToolbarGUI $toolbar): void protected function saveClientIpCmd(): void { $filter_closure = $this->participant_access_filter->getManageParticipantsUserFilter($this->getTestObj()->getRefId()); - $a_user_ids = $filter_closure((array) $_POST["chbUser"]); + $selected_users = $filter_closure($this->testrequest->raw('chbUser') ?? []); - if (is_array($a_user_ids)) { - foreach ($a_user_ids as $user_id) { - $this->getTestObj()->setClientIP($user_id, $_POST["clientip_" . $user_id]); - } - } else { + if ($selected_users === []) { $this->main_tpl->setOnScreenMessage('info', $this->lng->txt("select_one_user"), true); } + + foreach ($selected_users as $user_id) { + $this->getTestObj()->setClientIP($user_id, $_POST["clientip_" . $user_id]); + } + $this->ctrl->redirect($this, self::CMD_SHOW); } diff --git a/components/ILIAS/Test/tests/ilTestDashboardGUITest.php b/components/ILIAS/Test/tests/ilTestDashboardGUITest.php index 9b4e8ed25c1d..d185b04312c1 100755 --- a/components/ILIAS/Test/tests/ilTestDashboardGUITest.php +++ b/components/ILIAS/Test/tests/ilTestDashboardGUITest.php @@ -54,7 +54,8 @@ protected function setUp(): void $DIC['ilCtrl'], $DIC['ilTabs'], $DIC['ilToolbar'], - $this->createMock(ilTestQuestionSetConfig::class) + $this->createMock(ilTestQuestionSetConfig::class), + $this->createMock(\ILIAS\Test\InternalRequestService::class) ); } diff --git a/components/ILIAS/Test/tests/ilTestParticipantsGUITest.php b/components/ILIAS/Test/tests/ilTestParticipantsGUITest.php index e40d7c8291c3..03fbae78625f 100755 --- a/components/ILIAS/Test/tests/ilTestParticipantsGUITest.php +++ b/components/ILIAS/Test/tests/ilTestParticipantsGUITest.php @@ -54,7 +54,8 @@ protected function setUp(): void $DIC['ilCtrl'], $DIC['ilDB'], $DIC['ilTabs'], - $DIC['ilToolbar'] + $DIC['ilToolbar'], + $this->createMock(\ILIAS\Test\InternalRequestService::class) ); }