19 declare(strict_types=1);
38 private \ILIAS\DI\UIServices
$ui;
112 $this->anything_rendered =
true;
117 $this->show_discard_modal_signal = $signal;
130 if ($this->question_mark_link_target) {
135 'ilTestMarkQuestionIcon' 138 $actions[] = $this->ui_factory->button()->shy(
141 )->withAdditionalOnLoadCode(
142 static function (
string $id) use ($target):
string {
143 return "document.getElementById('$id').addEventListener('click', " 145 .
" il.TestPlayerQuestionEditControl.checkNavigation('{$target}', 'show', e);" 151 if ($this->skip_question_link_target) {
152 $actions[] = $this->ui_factory->button()->shy(
153 $this->
lng->txt(
'postpone_question'),
158 if ($actions !== []) {
159 $actions[] = $this->ui_factory->divider()->horizontal();
162 $actions[] = $this->ui_factory->button()->shy(
163 $this->
lng->txt(
'tst_revert_changes'),
165 )->withUnavailableAction(!$this->revert_changes_link_target);
167 if ($this->question_worked_through) {
168 $actions[] = $this->ui_factory->button()->shy(
169 $this->
lng->txt(
'discard_answer'),
171 )->withUnavailableAction(!$this->discard_solution_button_enabled)
175 $list = $this->ui_factory->dropdown()->standard($actions)->withLabel($this->
lng->txt(
'actions'));
176 $tpl->setVariable(
'ACTION_MENU', $this->ui_renderer->render($list));
184 if ($this->edit_solution_command) {
187 $this->edit_solution_command,
195 $this->instant_feedback_command,
197 $this->force_instant_response_enabled
201 if ($this->anything_rendered) {
210 if ($this->question_worked_through) {
211 return $this->
lng->txt(
'edit_answer');
214 return $this->
lng->txt(
'answer_question');
219 if ($this->answer_freezing_enabled) {
220 return $this->
lng->txt(
'submit_and_check');
223 return $this->
lng->txt(
'check');
228 if ($this->question_marked) {
229 return $this->
lng->txt(
'tst_remove_mark');
232 return $this->
lng->txt(
'tst_question_mark');
238 if ($this->question_marked) {
239 return $this->
lng->txt(
'tst_question_marked');
242 return$this->
lng->txt(
'tst_question_not_marked');
247 if ($this->question_marked) {
256 switch ($a_purpose) {
259 'tpl.tst_question_navigation.html',
262 'components/ILIAS/Test' 267 'tpl.tst_question_actions.html',
270 'components/ILIAS/Test' 290 $tpl->
setVariable(
'BUTTON_INSTANCE', $this->ui_renderer->render($button));
305 $this->ui_factory->button()->standard($label,
'')->withAdditionalOnLoadCode($on_load_code)
319 $this->ui_factory->button()->primary($label,
'')->withAdditionalOnLoadCode($on_load_code)
326 $this->ui_factory->button()->standard($label,
'')->withAdditionalOnLoadCode($on_load_code)
332 return static function (
$id) use ($command):
string {
333 return "document.getElementById('$id').addEventListener('click', " 335 .
" e.target.setAttribute('name', 'cmd[$command]');" 336 .
' e.target.form.requestSubmit(e.target);' parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
bool $force_instant_response_enabled
setRevertChangesLinkTarget(string $revert_changes_link_target)
setQuestionMarked(bool $question_marked)
getEditSolutionButtonLabel()
setSkipQuestionLinkTarget(string $skip_question_link_target)
setDiscardSolutionButtonEnabled(bool $discard_solution_button_enabled)
setEditSolutionCommand(string $edit_solution_command)
renderActionsIcon(ilTemplate $tpl, string $icon_src, string $label, string $css_class)
renderButtonInstance(ilTemplate $tpl, Button $button)
string $revert_changes_link_target
setShowDiscardModalSignal(Signal $signal)
const CSS_CLASS_SUBMIT_BUTTONS
parseButtonsBlock(ilTemplate $tpl)
setForceInstantResponseEnabled(bool $force_instant_response_enabled)
getOnLoadCode(string $command)
getQuestionMarkIconSource()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
string $question_mark_link_target
setAnswerFreezingEnabled(bool $answer_freezing_enabled)
setVariable($variable, $value='')
Sets a variable value.
renderSubmitButton(ilTemplate $tpl, string $command, string $label)
__construct(protected ilLanguage $lng, protected UIFactory $ui_factory, protected UIRenderer $ui_renderer)
getShowDiscardModalSignal()
const SHOW_DISABLED_COMMANDS
bool $discard_solution_button_enabled
Signal $show_discard_modal_signal
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
const SHOW_INSTANT_RESPONSE
string $skip_question_link_target
renderInstantFeedbackButton(ilTemplate $tpl, string $command, string $label, bool $is_primary)
string $edit_solution_command
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setInstantFeedbackCommand(string $instant_feedback_command)
setQuestionWorkedThrough(bool $question_worked_through)
bool $question_worked_through
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
bool $answer_freezing_enabled
getQuestionMarkIconLabel()
getTemplate($a_purpose='toolbar')
string $instant_feedback_command
setQuestionMarkLinkTarget(string $question_mark_link_target)
getQuestionMarkActionLabel()
parseNavigation(ilTemplate $tpl)