From 7486acac28ad924dd2294910a5731c1f671c7e96 Mon Sep 17 00:00:00 2001 From: Stephan Kergomard Date: Wed, 11 Dec 2024 15:45:53 +0100 Subject: [PATCH] Test: Fix Formating of Feedback See: https://mantis.ilias.de/view.php?id=42908 --- .../class.ilAssQuestionFeedbackEditingGUI.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php b/Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php index 812742101fbb..5a43543b50b6 100644 --- a/Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php +++ b/Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php @@ -16,6 +16,8 @@ * *********************************************************************/ +use ILIAS\Style\Content\Service as ContentStyle; + /** * GUI class for feedback editing of assessment questions * @@ -102,6 +104,8 @@ class ilAssQuestionFeedbackEditingGUI */ protected $lng = null; + protected ContentStyle $content_style; + /** * Constructor * @@ -118,6 +122,7 @@ public function __construct(assQuestionGUI $questionGUI, ilCtrl $ctrl, ilAccessH $this->questionGUI = $questionGUI; $this->questionOBJ = $questionGUI->object; $this->feedbackOBJ = $questionGUI->object->feedbackOBJ; + /** @var ILIAS\DI\Container $DIC */ global $DIC; $this->request = $DIC->testQuestionPool()->internal()->request(); $this->ctrl = $ctrl; @@ -126,6 +131,7 @@ public function __construct(assQuestionGUI $questionGUI, ilCtrl $ctrl, ilAccessH $this->tabs = $tabs; $this->lng = $lng; $this->questioninfo = $DIC->testQuestionPool()->questionInfo(); + $this->content_style = $DIC->contentStyle(); } /** @@ -154,7 +160,11 @@ public function executeCommand(): void break; default: - $this->tabs->setTabActive('feedback'); + if ($this->questionOBJ->selfassessmenteditingmode) { + $this->tabs->setTabActive('feedback'); + } else { + $this->tabs->setTabActive('tst_feedback'); + } $cmd .= 'Cmd'; $this->$cmd(); break; @@ -166,7 +176,7 @@ public function executeCommand(): void */ protected function setContentStyle(): void { - $this->tpl->addCss(ilObjStyleSheet::getContentStylePath(0)); + $this->content_style->gui()->addCss($this->tpl, $this->request->getRefId()); } /** @@ -176,10 +186,6 @@ protected function setContentStyle(): void */ private function showFeedbackFormCmd(): void { - $this->tpl->setCurrentBlock("ContentStyle"); - $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0)); - $this->tpl->parseCurrentBlock(); - $form = $this->buildForm(); $this->feedbackOBJ->initGenericFormProperties($form);