diff --git a/Modules/Test/classes/class.ilTestPlayerAbstractGUI.php b/Modules/Test/classes/class.ilTestPlayerAbstractGUI.php index d800b5cbc623..1ff9b1e7983d 100755 --- a/Modules/Test/classes/class.ilTestPlayerAbstractGUI.php +++ b/Modules/Test/classes/class.ilTestPlayerAbstractGUI.php @@ -1245,64 +1245,48 @@ public function checkWorkingTimeCmd(): void protected function showSideList($current_sequence_element): void { - $side_list_active = $this->user->getPref('side_list_of_questions'); - if (!$side_list_active) { - return; - } - if ($side_list_active) { - $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence, false); - - //TODO - global $DIC; - $f = $DIC['ui.factory']; - $lng = $DIC['lng']; - $ctrl = $DIC['ilCtrl']; - $questions = []; - - $active = 0; - foreach ($questionSummaryData as $idx => $row) { - $title = ilLegacyFormElementsUtil::prepareFormOutput($row['title']); - if (strlen($row['description'])) { - $description = " title=\"" . htmlspecialchars($row['description']) . "\" "; - } else { - $description = ""; - } - - if (!$row['disabled']) { - $ctrl->setParameter($this, 'pmode', ''); - $ctrl->setParameter($this, 'sequence', $row['sequence']); - $action = $ctrl->getLinkTarget($this, ilTestPlayerCommands::SHOW_QUESTION); - $ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW); - $ctrl->setParameter($this, 'sequence', $this->getCurrentSequenceElement($current_sequence_element)); - } - - $status = ILIAS\UI\Component\Listing\Workflow\Step::NOT_STARTED; - - if ($row['worked_through'] - || $row['isAnswered'] - //|| $row['sequence'] == $current_sequence_element + $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence, false); + $questions = []; + $active = 0; + + foreach ($questionSummaryData as $idx => $row) { + $title = ilLegacyFormElementsUtil::prepareFormOutput($row['title']); + if (strlen($row['description'])) { + $description = " title=\"" . htmlspecialchars($row['description']) . "\" "; + } else { + $description = ""; + } - ) { - $status = ILIAS\UI\Component\Listing\Workflow\Step::IN_PROGRESS; - } + if (!$row['disabled']) { + $this->ctrl->setParameter($this, 'pmode', ''); + $this->ctrl->setParameter($this, 'sequence', $row['sequence']); + $action = $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SHOW_QUESTION); + $this->ctrl->setParameter($this, 'pmode', ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW); + $this->ctrl->setParameter($this, 'sequence', $this->getCurrentSequenceElement($current_sequence_element)); + } + $status = ILIAS\UI\Component\Listing\Workflow\Step::NOT_STARTED; - $questions[] = $f->listing()->workflow()->step($title, $description, $action) - ->withStatus($status); - $active = $row['sequence'] == $current_sequence_element ? $idx : $active; + if ($row['worked_through'] || $row['isAnswered']) { + $status = ILIAS\UI\Component\Listing\Workflow\Step::IN_PROGRESS; } - $question_listing = $f->listing()->workflow()->linear( - $this->lng->txt('mainbar_button_label_questionlist'), - $questions - )->withActive($active); + $questions[] = $this->ui_factory->listing()->workflow() + ->step($title, $description, $action) + ->withStatus($status); + $active = $row['sequence'] == $current_sequence_element ? $idx : $active; + } + + $question_listing = $this->ui_factory->listing()->workflow()->linear( + $this->lng->txt('mainbar_button_label_questionlist'), + $questions + )->withActive($active); - $this->global_screen->tool()->context()->current()->addAdditionalData( - ilTestPlayerLayoutProvider::TEST_PLAYER_QUESTIONLIST, - $question_listing - ); - } + $this->global_screen->tool()->context()->current()->addAdditionalData( + ilTestPlayerLayoutProvider::TEST_PLAYER_QUESTIONLIST, + $question_listing + ); } abstract protected function isQuestionSummaryFinishTestButtonRequired(); @@ -2207,7 +2191,7 @@ protected function getQuestionInstance(int $question_id, bool $from_cache = true if ($from_cache && isset($this->cachedQuestionObjects[$question_id])) { return $this->cachedQuestionObjects[$question_id]; } - $question = assQuestion::_instantiateQuestion($question_id); + $question = assQuestion::instantiateQuestion($question_id); $ass_settings = new ilSetting('assessment'); diff --git a/Modules/Test/classes/class.ilTestServiceGUI.php b/Modules/Test/classes/class.ilTestServiceGUI.php index bb74fda99297..937878f373ef 100755 --- a/Modules/Test/classes/class.ilTestServiceGUI.php +++ b/Modules/Test/classes/class.ilTestServiceGUI.php @@ -68,13 +68,6 @@ class ilTestServiceGUI protected HTTPServices $http; protected ilCtrl $ctrl; protected ilToolbarGUI $toolbar; - -/* - public ilLanguage $lng; - public ilGlobalTemplateInterface|ilTemplate $tpl; - public ilCtrl $ctrl; -*/ - protected ilTabsGUI $tabs; protected ilObjectDataCache $obj_cache; protected ilComponentRepository $component_repository;