diff --git a/components/ILIAS/Test/classes/class.ilTestPlayerAbstractGUI.php b/components/ILIAS/Test/classes/class.ilTestPlayerAbstractGUI.php index 5510825da065..0f49bbbf17de 100755 --- a/components/ILIAS/Test/classes/class.ilTestPlayerAbstractGUI.php +++ b/components/ILIAS/Test/classes/class.ilTestPlayerAbstractGUI.php @@ -2364,6 +2364,10 @@ protected function buildReadOnlyStateQuestionNavigationGUI($question_id): ilTest $this->ui_renderer ); + $navigationGUI->setFeedbackButtonEnabled( + $this->object->getMainSettings()->getQuestionBehaviourSettings()->isAnyInstantFeedbackOptionEnabled() + ); + if (!$this->isParticipantsAnswerFixed($question_id)) { $navigationGUI->setEditSolutionCommand(ilTestPlayerCommands::EDIT_SOLUTION); } @@ -2398,6 +2402,10 @@ protected function buildEditableStateQuestionNavigationGUI($question_id): ilTest $this->ui_renderer ); + $navigation_gui->setFeedbackButtonEnabled( + $this->object->getMainSettings()->getQuestionBehaviourSettings()->isAnyInstantFeedbackOptionEnabled() + ); + // fau: testNav - add a 'revert changes' link for editable question $navigation_gui->setRevertChangesLinkTarget($this->ctrl->getLinkTarget($this, ilTestPlayerCommands::REVERT_CHANGES)); diff --git a/components/ILIAS/Test/classes/class.ilTestQuestionNavigationGUI.php b/components/ILIAS/Test/classes/class.ilTestQuestionNavigationGUI.php index a23f7f7a5503..b44216d9f602 100755 --- a/components/ILIAS/Test/classes/class.ilTestQuestionNavigationGUI.php +++ b/components/ILIAS/Test/classes/class.ilTestQuestionNavigationGUI.php @@ -49,6 +49,7 @@ class ilTestQuestionNavigationGUI private bool $question_marked = false; private bool $anything_rendered = false; private ?Signal $show_discard_modal_signal = null; + private bool $feedback_button_enabled = false; public function __construct( protected ilLanguage $lng, @@ -122,6 +123,16 @@ private function getShowDiscardModalSignal(): Signal return $this->show_discard_modal_signal ?? new SignalImplementation(''); } + public function setFeedbackButtonEnabled(bool $feedback_button_enabled): void + { + $this->feedback_button_enabled = $feedback_button_enabled; + } + + public function isFeedbackButtonEnabled(): bool + { + return $this->feedback_button_enabled; + } + public function getActionsHTML(): string { $tpl = $this->getTemplate('actions'); @@ -189,7 +200,7 @@ public function getHTML(): string ); } - if ($this->instant_feedback_command === ilTestPlayerCommands::SHOW_INSTANT_RESPONSE) { + if ($this->isFeedbackButtonEnabled()) { $this->renderInstantFeedbackButton( $tpl, $this->instant_feedback_command, diff --git a/components/ILIAS/Test/src/Settings/MainSettings/SettingsQuestionBehaviour.php b/components/ILIAS/Test/src/Settings/MainSettings/SettingsQuestionBehaviour.php index cffe0b59e240..c41738429be6 100755 --- a/components/ILIAS/Test/src/Settings/MainSettings/SettingsQuestionBehaviour.php +++ b/components/ILIAS/Test/src/Settings/MainSettings/SettingsQuestionBehaviour.php @@ -489,7 +489,7 @@ public function withInstantFeedbackSolutionEnabled(bool $instant_feedback_soluti return $clone; } - private function isAnyInstantFeedbackOptionEnabled(): bool + public function isAnyInstantFeedbackOptionEnabled(): bool { return $this->getInstantFeedbackPointsEnabled() || $this->getInstantFeedbackGenericEnabled()