Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down