diff --git a/Modules/Test/classes/Screen/class.ilTestPlayerLayoutProvider.php b/Modules/Test/classes/Screen/class.ilTestPlayerLayoutProvider.php index 5fe0046113bb..ffcc3a1e516e 100644 --- a/Modules/Test/classes/Screen/class.ilTestPlayerLayoutProvider.php +++ b/Modules/Test/classes/Screen/class.ilTestPlayerLayoutProvider.php @@ -22,6 +22,7 @@ use ILIAS\GlobalScreen\Scope\Layout\Factory\LogoModification; use ILIAS\GlobalScreen\Scope\Layout\Factory\MainBarModification; use ILIAS\GlobalScreen\Scope\Layout\Factory\MetaBarModification; +use ILIAS\GlobalScreen\Scope\Layout\Factory\TitleModification; use ILIAS\GlobalScreen\Scope\Layout\Factory\ShortTitleModification; use ILIAS\GlobalScreen\Scope\Layout\Factory\ViewTitleModification; use ILIAS\GlobalScreen\Scope\Layout\Provider\AbstractModificationProvider; @@ -44,8 +45,10 @@ class ilTestPlayerLayoutProvider extends AbstractModificationProvider implements ModificationProvider { public const TEST_PLAYER_KIOSK_MODE_ENABLED = 'test_player_kiosk_mode_enabled'; - public const TEST_PLAYER_TITLE = 'test_player_kiosk_mode_title'; - public const TEST_PLAYER_SHORT_TITLE = 'test_player_kiosk_mode_instance_name'; + public const TEST_PLAYER_TITLE = 'test_player_title'; + public const TEST_PLAYER_VIEW_TITLE = 'test_player_view_title'; + public const TEST_PLAYER_SHORT_TITLE = 'test_player_instance_name'; + public const TEST_PLAYER_QUESTIONLIST = 'test_player_questionlist'; public function isInterestedInContexts(): ContextCollection @@ -53,49 +56,54 @@ public function isInterestedInContexts(): ContextCollection return $this->context_collection->repository(); } - public function getLogoModification(CalledContexts $called_contexts): ?LogoModification + public function getMainBarModification(CalledContexts $called_contexts): ?MainBarModification { - if ($this->isKioskModeEnabled($called_contexts)) { - $logo = $this->globalScreen()->layout()->factory()->logo(); - - $logo = $logo->withModification(function (?Image $current): ?Image { - return null; - }); + $mainbar = $this->globalScreen()->layout()->factory()->mainbar(); + $additionalData = $called_contexts->current()->getAdditionalData(); + $has_question_list = $additionalData->exists(self::TEST_PLAYER_QUESTIONLIST); + $is_kiosk_mode = $this->isKioskModeEnabled($called_contexts); - return $logo->withHighPriority(); + if (! $is_kiosk_mode && ! $has_question_list) { + return null; } - return null; - } + if ($is_kiosk_mode && ! $has_question_list) { + $mainbar_modification = static fn(?MainBar $mainbar): ?MainBar => null; + } - public function getResponsiveLogoModification(CalledContexts $called_contexts): ?LogoModification - { - if ($this->isKioskModeEnabled($called_contexts)) { - $logo = $this->globalScreen()->layout()->factory()->logo(); + if ($has_question_list) { + $f = $this->dic->ui()->factory(); + $r = $this->dic->ui()->renderer(); + $lng = $this->dic->language(); + $question_listing = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_QUESTIONLIST); - $logo = $logo->withModification(function (?Image $current): ?Image { - return null; - }); + $mainbar_modification = static function (?MainBar $mainbar) use ($f, $r, $lng, $question_listing, $is_kiosk_mode): ?MainBar { + if ($is_kiosk_mode) { + $mainbar = $mainbar->withClearedEntries(); + } - return $logo->withHighPriority(); - } + $icon = $f->symbol()->icon()->standard('tst', $lng->txt("more")); + $tools_button = $f->button()->bulky($icon, $lng->txt("tools"), "#") + ->withEngagedState(true); - return null; - } + $question_listing = $f->legacy($r->render($question_listing)); - public function getMainBarModification(CalledContexts $called_contexts): ?MainBarModification - { - if ($this->isKioskModeEnabled($called_contexts)) { - $mainBar = $this->globalScreen()->layout()->factory()->mainbar(); + $label = $lng->txt('mainbar_button_label_questionlist'); + $entry = $f->maincontrols()->slate()->legacy( + $label, + $f->symbol()->icon()->standard("tst", $label), + $question_listing + ); - $mainBar = $mainBar->withModification(function (?MainBar $current): ?MainBar { - return null; - }); - - return $mainBar->withHighPriority(); + return $mainbar + ->withToolsButton($tools_button) + ->withAdditionalToolEntry('questionlist', $entry); + }; } - return null; + return $mainbar + ->withModification($mainbar_modification) + ->withHighPriority(); } public function getMetaBarModification(CalledContexts $called_contexts): ?MetaBarModification @@ -157,6 +165,26 @@ function (?string $content) use ($title): ?string { public function getViewTitleModification(CalledContexts $called_contexts): ?ViewTitleModification { if ($this->isKioskModeEnabled($called_contexts)) { + $title = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_VIEW_TITLE); + if ($title == null) { + $title = ''; + } + return $this->globalScreen()->layout()->factory()->view_title() + ->withModification( + function (?string $content) use ($title): ?string { + return $title; + } + ) + ->withHighPriority(); + } + return null; + } + + public function getTitleModification(CalledContexts $called_contexts): ?TitleModification + { + $additionalData = $called_contexts->current()->getAdditionalData(); + $has_title = $additionalData->exists(self::TEST_PLAYER_TITLE); + if ($has_title) { $title = $called_contexts->current()->getAdditionalData()->get(self::TEST_PLAYER_TITLE); if ($title == null) { $title = ''; diff --git a/Modules/Test/classes/class.ilTestNavigationToolbarGUI.php b/Modules/Test/classes/class.ilTestNavigationToolbarGUI.php index 1dd9d0c9adfc..67f242408689 100644 --- a/Modules/Test/classes/class.ilTestNavigationToolbarGUI.php +++ b/Modules/Test/classes/class.ilTestNavigationToolbarGUI.php @@ -138,22 +138,6 @@ public function setQuestionListButtonEnabled($questionListButtonEnabled) $this->questionListButtonEnabled = $questionListButtonEnabled; } - /** - * @return boolean - */ - public function isQuestionTreeButtonEnabled(): bool - { - return $this->questionTreeButtonEnabled; - } - - /** - * @param boolean $questionTreeButtonEnabled - */ - public function setQuestionTreeButtonEnabled($questionTreeButtonEnabled) - { - $this->questionTreeButtonEnabled = $questionTreeButtonEnabled; - } - /** * @return boolean */ @@ -249,10 +233,6 @@ public function setDisabledStateEnabled($disabledStateEnabled) public function build() { - if ($this->isQuestionTreeButtonEnabled()) { - $this->addQuestionTreeButton(); - } - if ($this->isQuestionListButtonEnabled()) { $this->addQuestionListButton(); } @@ -320,24 +300,6 @@ private function addQuestionSelectionButton() $this->addButtonInstance($btn); } - private function addQuestionTreeButton() - { - $btn = ilTestPlayerNavButton::getInstance(); - $btn->setNextCommand(ilTestPlayerCommands::TOGGLE_SIDE_LIST); - $btn->setUrl($this->ctrl->getLinkTarget( - $this->playerGUI, - ilTestPlayerCommands::TOGGLE_SIDE_LIST - )); - if ($this->isQuestionTreeVisible()) { - $btn->setCaption('tst_hide_side_list'); - } else { - $btn->setCaption('tst_show_side_list'); - } - //$btn->setDisabled($this->isDisabledStateEnabled()); - $btn->addCSSClass('ilTstNavElem'); - $this->addButtonInstance($btn); - } - private function addFinishTestButton(): void { if ($this->userHasAttemptsLeft()) { diff --git a/Modules/Test/classes/class.ilTestOutputGUI.php b/Modules/Test/classes/class.ilTestOutputGUI.php index 2529c6edd813..4b4b80ca910c 100755 --- a/Modules/Test/classes/class.ilTestOutputGUI.php +++ b/Modules/Test/classes/class.ilTestOutputGUI.php @@ -55,23 +55,6 @@ public function executeCommand() $this->initAssessmentSettings(); - $this->global_screen->tool()->context()->current()->addAdditionalData( - ilTestPlayerLayoutProvider::TEST_PLAYER_KIOSK_MODE_ENABLED, - $this->object->getKioskMode() - ); - $this->global_screen->tool()->context()->current()->addAdditionalData( - ilTestPlayerLayoutProvider::TEST_PLAYER_TITLE, - $this->object->getTitle() - ); - $instance_name = $this->settings->get('short_inst_name') ?? ''; - if (trim($instance_name) === '') { - $instance_name = 'ILIAS'; - } - $this->global_screen->tool()->context()->current()->addAdditionalData( - ilTestPlayerLayoutProvider::TEST_PLAYER_SHORT_TITLE, - $instance_name - ); - $testSessionFactory = new ilTestSessionFactory($this->object, $this->db, $this->user); $this->test_session = $testSessionFactory->getSession($this->testrequest->int('active_id')); @@ -92,6 +75,29 @@ public function executeCommand() $this->handlePasswordProtectionRedirect(); + + $instance_name = $this->settings->get('short_inst_name') ?? ''; + if (trim($instance_name) === '') { + $instance_name = 'ILIAS'; + } + $this->global_screen->tool()->context()->current()->addAdditionalData( + ilTestPlayerLayoutProvider::TEST_PLAYER_SHORT_TITLE, + $instance_name + ); + $this->global_screen->tool()->context()->current()->addAdditionalData( + ilTestPlayerLayoutProvider::TEST_PLAYER_KIOSK_MODE_ENABLED, + $this->object->getKioskMode() + ); + $this->global_screen->tool()->context()->current()->addAdditionalData( + ilTestPlayerLayoutProvider::TEST_PLAYER_VIEW_TITLE, + $this->object->getTitle() + ); + $this->global_screen->tool()->context()->current()->addAdditionalData( + ilTestPlayerLayoutProvider::TEST_PLAYER_TITLE, + $this->getTestPlayerTitle() + ); + + $cmd = $this->getCommand($cmd); switch ($next_class) { @@ -967,4 +973,29 @@ protected function handlePrimaryButton(ilTestNavigationToolbarGUI $navigationToo return $isNextPrimary; } + + protected function getTestPlayerTitle(): string + { + $test_title = $this->object->getShowKioskModeTitle() ? $this->object->getTitle() : ''; + $user_name = $this->object->getShowKioskModeParticipant() ? $this->user->getFullname() : ''; + $exam_id = ''; + if ($this->object->isShowExamIdInTestPassEnabled()) { + $exam_id = $this->lng->txt("exam_id") + . ' ' + . ilObjTest::buildExamId( + $this->test_session->getActiveId(), + $this->test_session->getPass(), + $this->object->getId() + ); + } + + $layout = $this->ui_factory->layout()->alignment()->vertical( + $this->ui_factory->legacy($test_title), + $this->ui_factory->layout()->alignment()->horizontal()->dynamicallyDistributed( + $this->ui_factory->legacy($user_name), + $this->ui_factory->legacy($exam_id) + ) + ); + return $this->ui_renderer->render($layout); + } } diff --git a/Modules/Test/classes/class.ilTestPlayerAbstractGUI.php b/Modules/Test/classes/class.ilTestPlayerAbstractGUI.php index ebc5f5e70822..1a1d4dd0589f 100755 --- a/Modules/Test/classes/class.ilTestPlayerAbstractGUI.php +++ b/Modules/Test/classes/class.ilTestPlayerAbstractGUI.php @@ -608,13 +608,6 @@ protected function submitIntermediateSolutionCmd() $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION); } - public function toggleSideListCmd(): void - { - $show_side_list = $this->user->getPref('side_list_of_questions'); - $this->user->writePref('side_list_of_questions', (string) !$show_side_list); - $this->ctrl->redirect($this, ilTestPlayerCommands::SHOW_QUESTION); - } - protected function markQuestionAndSaveIntermediateCmd(): void { $this->handleIntermediateSubmit(); @@ -824,45 +817,6 @@ public function showFinalStatementCmd() $this->tpl->setVariable($this->getContentBlockName(), $template->get()); } - public function getKioskHead(): string - { - /** - * this is an abomination for release_8 + release_9! - * @todo Implement proper "kiosk-handling" for ILIAS 10. - */ - $this->tpl->addCSS('Modules/Test/templates/default/test_kiosk_header.css'); - //end of hack - - $template = new ilTemplate('tpl.il_as_tst_kiosk_head.html', true, true, 'Modules/Test'); - if ($this->object->getShowKioskModeTitle()) { - $template->setCurrentBlock("kiosk_show_title"); - $template->setVariable("TEST_TITLE", $this->object->getTitle()); - $template->parseCurrentBlock(); - } - if ($this->object->getShowKioskModeParticipant()) { - $template->setCurrentBlock("kiosk_show_participant"); - $template->setVariable("PARTICIPANT_NAME_TXT", $this->lng->txt("login_as")); - $template->setVariable("PARTICIPANT_NAME", $this->user->getFullname()); - $template->setVariable("PARTICIPANT_LOGIN", $this->user->getLogin()); - $template->setVariable("PARTICIPANT_MATRICULATION", $this->user->getMatriculation()); - $template->setVariable("PARTICIPANT_EMAIL", $this->user->getEmail()); - $template->parseCurrentBlock(); - } - if ($this->object->isShowExamIdInTestPassEnabled()) { - $exam_id = ilObjTest::buildExamId( - $this->test_session->getActiveId(), - $this->test_session->getPass(), - $this->object->getId() - ); - - $template->setCurrentBlock("kiosk_show_exam_id"); - $template->setVariable("EXAM_ID_TXT", $this->lng->txt("exam_id")); - $template->setVariable("EXAM_ID", $exam_id); - $template->parseCurrentBlock(); - } - return $template->get(); - } - protected function prepareTestPage($presentationMode, $sequenceElement, $questionId) { $this->navigation_history->addItem( @@ -891,12 +845,9 @@ protected function prepareTestPage($presentationMode, $sequenceElement, $questio return; } - if ($this->object->getKioskMode()) { - $this->populateKioskHead(); - } - $this->tpl->setVariable("TEST_ID", (string) $this->object->getTestId()); $this->tpl->setVariable("LOGIN", $this->user->getLogin()); + $this->tpl->setVariable("SEQ_ID", $sequenceElement); $this->tpl->setVariable("QUEST_ID", $questionId); @@ -981,7 +932,7 @@ protected function showQuestionEditable(assQuestionGUI $questionGui, $formAction $questionNavigationGUI->setDiscardSolutionButtonEnabled(true); // fau: testNav - set answere status in question header $questionGui->getQuestionHeaderBlockBuilder()->setQuestionAnswered(true); - // fau. + // fau. } elseif ($this->object->isPostponingEnabled()) { $questionNavigationGUI->setSkipQuestionLinkTarget( $this->ctrl->getLinkTarget($this, ilTestPlayerCommands::SKIP_QUESTION) @@ -1295,20 +1246,63 @@ 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; - $question_summary_data = $this->service->getQuestionSummaryData($this->testSequence, false); + if ($row['worked_through'] + || $row['isAnswered'] + //|| $row['sequence'] == $current_sequence_element - $question_side_list_gui = new ilTestQuestionSideListGUI($this->ctrl, $this->lng); - $question_side_list_gui->setTargetGUI($this); - $question_side_list_gui->setQuestionSummaryData($question_summary_data); - $question_side_list_gui->setCurrentSequenceElement($current_sequence_element); - $question_side_list_gui->setCurrentPresentationMode(ilTestPlayerAbstractGUI::PRESENTATION_MODE_VIEW); - $question_side_list_gui->setDisabled(false); - $this->tpl->setVariable('LIST_OF_QUESTIONS', $question_side_list_gui->getHTML()); + ) { + $status = ILIAS\UI\Component\Listing\Workflow\Step::IN_PROGRESS; + } + + + $questions[] = $f->listing()->workflow()->step($title, $description, $action) + ->withStatus($status); + $active = $row['sequence'] == $current_sequence_element ? $idx : $active; + } + + $question_listing = $f->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 + ); + } } abstract protected function isQuestionSummaryFinishTestButtonRequired(); @@ -1339,16 +1333,6 @@ public function outQuestionSummaryCmd( $this->tpl->setOnScreenMessage('failure', $this->lng->txt('not_all_obligations_answered')); } - if ($this->object->getKioskMode() && $fullpage) { - $head = $this->getKioskHead(); - if (strlen($head)) { - $this->tpl->setCurrentBlock("kiosk_options"); - $this->tpl->setVariable("KIOSK_HEAD", $head); - $this->tpl->parseCurrentBlock(); - } - } - - $active_id = $this->test_session->getActiveId(); $questionSummaryData = $this->service->getQuestionSummaryData($this->testSequence, $obligationsFilter); @@ -1595,10 +1579,6 @@ protected function prepareSummaryPage() 'tpl.il_as_tst_question_summary.html', 'Modules/Test' ); - - if ($this->object->getKioskMode()) { - $this->populateKioskHead(); - } } protected function initTestPageTemplate() @@ -1629,17 +1609,6 @@ protected function initTestPageTemplate() ); } - protected function populateKioskHead() - { - $head = $this->getKioskHead(); - - if (strlen($head)) { - $this->tpl->setCurrentBlock("kiosk_options"); - $this->tpl->setVariable("KIOSK_HEAD", $head); - $this->tpl->parseCurrentBlock(); - } - } - protected function handlePasswordProtectionRedirect() { /** @@ -1782,13 +1751,9 @@ protected function populateHelperGuiContent($helperGui) protected function getTestNavigationToolbarGUI(): ilTestNavigationToolbarGUI { $navigation_toolbar = new ilTestNavigationToolbarGUI($this->ctrl, $this->lng, $this); - $navigation_toolbar->setSuspendTestButtonEnabled($this->object->getShowCancel()); - $navigation_toolbar->setQuestionTreeButtonEnabled($this->object->getListOfQuestions()); - $navigation_toolbar->setQuestionTreeVisible((bool) $this->user->getPref('side_list_of_questions')); $navigation_toolbar->setQuestionListButtonEnabled($this->object->getListOfQuestions()); $navigation_toolbar->setFinishTestCommand($this->getFinishTestCommand()); - return $navigation_toolbar; } @@ -2242,7 +2207,6 @@ 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); $ass_settings = new ilSetting('assessment'); diff --git a/Modules/Test/classes/class.ilTestQuestionSideListGUI.php b/Modules/Test/classes/class.ilTestQuestionSideListGUI.php deleted file mode 100644 index 1a2c88927499..000000000000 --- a/Modules/Test/classes/class.ilTestQuestionSideListGUI.php +++ /dev/null @@ -1,271 +0,0 @@ - - * @version $Id$ - * - * @package Modules/Test - */ -class ilTestQuestionSideListGUI -{ - /** - * @var ilCtrl - */ - protected $ctrl; - - /** - * @var ilLanguage - */ - protected $lng; - - /** - * @var ilTestPlayerAbstractGUI - */ - private $targetGUI; - - /** - * @var array - */ - private $questionSummaryData; - - /** - * @var integer - */ - private $currentSequenceElement; - - /** - * @var string - */ - private $currentPresentationMode; - - /** - * @var bool - */ - private $disabled; - - /** - * @param ilCtrl $ctrl - * @param ilLanguage $lng - */ - public function __construct(ilCtrl $ctrl, ilLanguage $lng) - { - $this->ctrl = $ctrl; - $this->lng = $lng; - - $this->questionSummaryData = array(); - $this->currentSequenceElement = null; - $this->disabled = false; - } - - /** - * @return ilTestPlayerAbstractGUI - */ - public function getTargetGUI(): ilTestPlayerAbstractGUI - { - return $this->targetGUI; - } - - /** - * @param ilTestPlayerAbstractGUI $targetGUI - */ - public function setTargetGUI($targetGUI) - { - $this->targetGUI = $targetGUI; - } - - /** - * @return array - */ - public function getQuestionSummaryData(): array - { - return $this->questionSummaryData; - } - - /** - * @param array $questionSummaryData - */ - public function setQuestionSummaryData($questionSummaryData) - { - $this->questionSummaryData = $questionSummaryData; - } - - /** - * @return int - */ - public function getCurrentSequenceElement(): ?int - { - return $this->currentSequenceElement; - } - - /** - * @param int $currentSequenceElement - */ - public function setCurrentSequenceElement($currentSequenceElement) - { - $this->currentSequenceElement = $currentSequenceElement; - } - - /** - * @return string - */ - public function getCurrentPresentationMode(): string - { - return $this->currentPresentationMode; - } - - /** - * @param string $currentPresentationMode - */ - public function setCurrentPresentationMode($currentPresentationMode) - { - $this->currentPresentationMode = $currentPresentationMode; - } - - /** - * @return boolean - */ - public function isDisabled(): bool - { - return $this->disabled; - } - - /** - * @param boolean $disabled - */ - public function setDisabled($disabled) - { - $this->disabled = $disabled; - } - - /** - * @return ilPanelGUI - */ - private function buildPanel(): ilPanelGUI - { - $panel = ilPanelGUI::getInstance(); - $panel->setHeadingStyle(ilPanelGUI::HEADING_STYLE_SUBHEADING); - $panel->setPanelStyle(ilPanelGUI::PANEL_STYLE_SECONDARY); - $panel->setHeading($this->lng->txt('list_of_questions')); - return $panel; - } - - /** - * @return string - */ - private function renderList(): string - { - $tpl = new ilTemplate('tpl.il_as_tst_list_of_questions_short.html', true, true, 'Modules/Test'); - - foreach ($this->getQuestionSummaryData() as $row) { - $title = ilLegacyFormElementsUtil::prepareFormOutput($row['title']); - - if (strlen($row['description'])) { - $description = " title=\"" . htmlspecialchars($row['description']) . "\" "; - } else { - $description = ""; - } - - $active = ($row['sequence'] == $this->getCurrentSequenceElement()) ? ' active' : ''; - - $class = ( - $row['worked_through'] ? 'answered' . $active : 'unanswered' . $active - ); - - $headerclass = ($row['sequence'] == $this->getCurrentSequenceElement()) ? 'bold' : ''; - - if ($row['marked']) { - $tpl->setCurrentBlock("mark_icon"); - $tpl->setVariable("ICON_SRC", ilUtil::getImagePath('marked.svg')); - $tpl->setVariable("ICON_TEXT", $this->lng->txt('tst_question_marked')); - $tpl->setVariable("ICON_CLASS", 'ilTestMarkQuestionIcon'); - $tpl->parseCurrentBlock(); - } - - if ($this->isDisabled() || $row['disabled']) { - $tpl->setCurrentBlock('disabled_entry'); - $tpl->setVariable('CLASS', $class); - $tpl->setVariable('HEADERCLASS', $headerclass); - $tpl->setVariable('ITEM', $title); - $tpl->setVariable('DESCRIPTION', $description); - $tpl->parseCurrentBlock(); - } else { - // fau: testNav - show mark icon in side list - // fau. - $tpl->setCurrentBlock('linked_entry'); - $tpl->setVariable('HREF', $this->buildLink($row['sequence'])); - $tpl->setVariable('NEXTCMD', ilTestPlayerCommands::SHOW_QUESTION); - $tpl->setVariable('NEXTSEQ', $row['sequence']); - $tpl->setVariable('HEADERCLASS', $headerclass); - $tpl->setVariable('CLASS', $class); - $tpl->setVariable('ITEM', $title); - $tpl->setVariable("DESCRIPTION", $description); - $tpl->parseCurrentBlock(); - } - - $tpl->setCurrentBlock('item'); - } - - return $tpl->get(); - } - - /** - * @return string - */ - public function getHTML(): string - { - $panel = $this->buildPanel(); - $panel->setBody($this->renderList()); - return $panel->getHTML(); - } - - /** - * @param $row - * @return string - */ - private function buildLink($sequenceElement): string - { - $this->ctrl->setParameter( - $this->getTargetGUI(), - 'pmode', - '' - ); - - $this->ctrl->setParameter( - $this->getTargetGUI(), - 'sequence', - $sequenceElement - ); - - $href = $this->ctrl->getLinkTarget($this->getTargetGUI(), ilTestPlayerCommands::SHOW_QUESTION); - - $this->ctrl->setParameter( - $this->getTargetGUI(), - 'pmode', - $this->getCurrentPresentationMode() - ); - $this->ctrl->setParameter( - $this->getTargetGUI(), - 'sequence', - $this->getCurrentSequenceElement() - ); - return $href; - } -} diff --git a/Modules/Test/classes/class.ilTestServiceGUI.php b/Modules/Test/classes/class.ilTestServiceGUI.php index 0f2d48634ac2..45c884e93dca 100755 --- a/Modules/Test/classes/class.ilTestServiceGUI.php +++ b/Modules/Test/classes/class.ilTestServiceGUI.php @@ -68,6 +68,13 @@ 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; diff --git a/Modules/Test/templates/default/tpl.il_as_tst_kiosk_head.html b/Modules/Test/templates/default/tpl.il_as_tst_kiosk_head.html deleted file mode 100644 index 39abcfbf3b4e..000000000000 --- a/Modules/Test/templates/default/tpl.il_as_tst_kiosk_head.html +++ /dev/null @@ -1,16 +0,0 @@ -