ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestNavigationToolbarGUI Class Reference
+ Inheritance diagram for ilTestNavigationToolbarGUI:
+ Collaboration diagram for ilTestNavigationToolbarGUI:

Public Member Functions

 __construct (protected ilCtrlInterface $ctrl, protected ilTestPlayerAbstractGUI $player_gui)
 
 isSuspendTestButtonEnabled ()
 
 setSuspendTestButtonEnabled ($suspendTestButtonEnabled)
 
 isUserPassOverviewEnabled ()
 
 setUserPassOverviewEnabled (bool $user_pass_overview_button_enabled)
 
 isQuestionTreeVisible ()
 
 setQuestionTreeVisible (bool $questionTreeVisible)
 
 isFinishTestButtonEnabled ()
 
 setFinishTestButtonEnabled ($finishTestButtonEnabled)
 
 getFinishTestCommand ()
 
 setFinishTestCommand ($finishTestCommand)
 
 isFinishTestButtonPrimary ()
 
 setFinishTestButtonPrimary ($finishTestButtonPrimary)
 
 isDisabledStateEnabled ()
 
 setDisabledStateEnabled ($disabledStateEnabled)
 
 build ()
 
- Public Member Functions inherited from ilToolbarGUI
 setFormAction (string $a_val, bool $a_multipart=false, string $a_target="")
 Set form action (if form action is set, toolbar is wrapped into form tags) More...
 
 getFormAction ()
 
 setLeadingImage (string $a_img, string $a_alt)
 
 setHidden (bool $a_val)
 
 getHidden ()
 
 setId (string $a_val)
 
 getId ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 addButton (string $a_txt, string $a_cmd, string $a_target="", ?int $a_acc_key=null, string $a_additional_attrs='', string $a_id="", string $a_class='submit')
 
 addFormButton (string $a_txt, string $a_cmd, ?int $a_acc_key=null, bool $a_primary=false, ?string $a_class=null)
 
 addInputItem (ilToolbarItem $a_item, bool $a_output_label=false)
 
 addStickyItem ( $a_item, bool $a_output_label=false)
 Add a sticky item. More...
 
 addButtonInstance (ilButtonBase $a_button)
 Add button instance. More...
 
 addDropDown (string $a_txt, string $a_dd_html)
 
 addAdvancedSelectionList (ilAdvancedSelectionListGUI $adv)
 
 addSeparator ()
 
 addText (string $a_text)
 
 addSpacer (?string $a_width=null)
 
 addComponent (\ILIAS\UI\Component\Component $a_comp)
 
 addLink (string $a_caption, string $a_url, bool $a_disabled=false)
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 setFormName (string $a_val)
 
 getFormName ()
 
 getGroupedItems ()
 Get all groups (items separated by a separator) More...
 
 getItems ()
 
 setItems (array $items)
 

Protected Attributes

InterruptiveModal $finish_test_modal = null
 
bool $user_pass_overview_button_enabled = false
 
- Protected Attributes inherited from ilToolbarGUI
ilLanguage $lng
 
string $id = ''
 
string $form_action = ''
 
bool $hidden = false
 
array $lead_img
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
string $form_target = ""
 
string $form_name = ""
 
bool $prevent_double_submission = false
 
array $sticky_items = array()
 
bool $has_separator = false
 
ILIAS DI UIServices $ui
 
bool $multipart = false
 

Private Member Functions

 addSuspendTestButton ()
 
 addPassOverviewButton ()
 
 retrieveFinishTestButton ()
 
 getStandardOrPrimaryFinishButtonInstance ()
 
 buildCheckNavigationClosure (string $target)
 

Private Attributes

bool $suspendTestButtonEnabled = false
 
bool $questionTreeVisible = false
 
bool $finishTestButtonEnabled = false
 
string $finishTestCommand = ''
 
bool $finishTestButtonPrimary = false
 
bool $disabledStateEnabled = false
 

Additional Inherited Members

- Data Fields inherited from ilToolbarGUI
array $items = array()
 
- Protected Member Functions inherited from ilToolbarGUI
 applyAutoStickyToSingleElement ()
 If the toolbar consists of only one button, make it sticky Note: Atm this is only possible for buttons. More...
 
- Static Protected Attributes inherited from ilToolbarGUI
static int $instances = 0
 

Detailed Description

Definition at line 30 of file class.ilTestNavigationToolbarGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestNavigationToolbarGUI::__construct ( protected ilCtrlInterface  $ctrl,
protected ilTestPlayerAbstractGUI  $player_gui 
)

Definition at line 41 of file class.ilTestNavigationToolbarGUI.php.

44 {
46 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ addPassOverviewButton()

ilTestNavigationToolbarGUI::addPassOverviewButton ( )
private

Definition at line 173 of file class.ilTestNavigationToolbarGUI.php.

174 {
175 $button = $this->ui->factory()->button()->standard(
176 $this->lng->txt('question_summary_btn'),
177 ''
178 )->withUnavailableAction(true)->withAdditionalOnLoadCode(
180 $this->ctrl->getLinkTarget($this->player_gui, ilTestPlayerCommands::QUESTION_SUMMARY)
181 )
182 );
183 $this->addComponent($button);
184 }
addComponent(\ILIAS\UI\Component\Component $a_comp)

References ilToolbarGUI\addComponent(), buildCheckNavigationClosure(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilTestPlayerCommands\QUESTION_SUMMARY, and ILIAS\Repository\ui().

Referenced by build().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSuspendTestButton()

ilTestNavigationToolbarGUI::addSuspendTestButton ( )
private

Definition at line 160 of file class.ilTestNavigationToolbarGUI.php.

161 {
162 $button = $this->ui->factory()->button()->standard(
163 $this->lng->txt('cancel_test'),
164 ''
165 )->withUnavailableAction(true)->withAdditionalOnLoadCode(
167 $this->ctrl->getLinkTarget($this->player_gui, ilTestPlayerCommands::SUSPEND_TEST)
168 )
169 );
170 $this->addComponent($button);
171 }

References ilToolbarGUI\addComponent(), buildCheckNavigationClosure(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilTestPlayerCommands\SUSPEND_TEST, and ILIAS\Repository\ui().

Referenced by build().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ build()

ilTestNavigationToolbarGUI::build ( )

Definition at line 145 of file class.ilTestNavigationToolbarGUI.php.

References addPassOverviewButton(), ilToolbarGUI\addStickyItem(), addSuspendTestButton(), isFinishTestButtonEnabled(), isSuspendTestButtonEnabled(), isUserPassOverviewEnabled(), and retrieveFinishTestButton().

+ Here is the call graph for this function:

◆ buildCheckNavigationClosure()

ilTestNavigationToolbarGUI::buildCheckNavigationClosure ( string  $target)
private

Definition at line 209 of file class.ilTestNavigationToolbarGUI.php.

209 : Closure
210 {
211 return static function (string $id) use ($target): string {
212 return "document.getElementById('{$id}').addEventListener('click', "
213 . '(e) => {'
214 . " il.TestPlayerQuestionEditControl.checkNavigation('{$target}', 'show', e);"
215 . '}); '
216 . "document.getElementById('{$id}').removeAttribute('disabled');";
217 };
218 }

References ilToolbarGUI\$id.

Referenced by addPassOverviewButton(), addSuspendTestButton(), and retrieveFinishTestButton().

+ Here is the caller graph for this function:

◆ getFinishTestCommand()

ilTestNavigationToolbarGUI::getFinishTestCommand ( )
Returns
string

Definition at line 100 of file class.ilTestNavigationToolbarGUI.php.

100 : string
101 {
103 }

References $finishTestCommand.

Referenced by retrieveFinishTestButton().

+ Here is the caller graph for this function:

◆ getStandardOrPrimaryFinishButtonInstance()

ilTestNavigationToolbarGUI::getStandardOrPrimaryFinishButtonInstance ( )
private

Definition at line 200 of file class.ilTestNavigationToolbarGUI.php.

200 : Button
201 {
202 if ($this->isFinishTestButtonPrimary()) {
203 return $this->ui->factory()->button()->primary($this->lng->txt('finish_test'), '');
204 }
205
206 return $this->ui->factory()->button()->standard($this->lng->txt('finish_test'), '');
207 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Bulky.php:21

References isFinishTestButtonPrimary(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

Referenced by retrieveFinishTestButton().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDisabledStateEnabled()

ilTestNavigationToolbarGUI::isDisabledStateEnabled ( )
Returns
boolean

Definition at line 132 of file class.ilTestNavigationToolbarGUI.php.

132 : bool
133 {
135 }

References $disabledStateEnabled.

◆ isFinishTestButtonEnabled()

ilTestNavigationToolbarGUI::isFinishTestButtonEnabled ( )

Definition at line 84 of file class.ilTestNavigationToolbarGUI.php.

References $finishTestButtonEnabled.

Referenced by build().

+ Here is the caller graph for this function:

◆ isFinishTestButtonPrimary()

ilTestNavigationToolbarGUI::isFinishTestButtonPrimary ( )
Returns
boolean

Definition at line 116 of file class.ilTestNavigationToolbarGUI.php.

References $finishTestButtonPrimary.

Referenced by getStandardOrPrimaryFinishButtonInstance().

+ Here is the caller graph for this function:

◆ isQuestionTreeVisible()

ilTestNavigationToolbarGUI::isQuestionTreeVisible ( )

Definition at line 74 of file class.ilTestNavigationToolbarGUI.php.

References $questionTreeVisible.

◆ isSuspendTestButtonEnabled()

ilTestNavigationToolbarGUI::isSuspendTestButtonEnabled ( )
Returns
boolean

Definition at line 51 of file class.ilTestNavigationToolbarGUI.php.

References $suspendTestButtonEnabled.

Referenced by build().

+ Here is the caller graph for this function:

◆ isUserPassOverviewEnabled()

ilTestNavigationToolbarGUI::isUserPassOverviewEnabled ( )

Definition at line 64 of file class.ilTestNavigationToolbarGUI.php.

References $user_pass_overview_button_enabled.

Referenced by build().

+ Here is the caller graph for this function:

◆ retrieveFinishTestButton()

ilTestNavigationToolbarGUI::retrieveFinishTestButton ( )
private

Definition at line 186 of file class.ilTestNavigationToolbarGUI.php.

186 : Button
187 {
188 $target = $this->ctrl->getLinkTarget($this->player_gui, $this->getFinishTestCommand());
189 if ($this->player_gui->getObject()->getMainSettings()->getFinishingSettings()->getShowAnswerOverview()
190 && $this->getFinishTestCommand() !== ilTestPlayerCommands::QUESTION_SUMMARY) {
191 $target = $this->ctrl->getLinkTargetByClass('ilTestSubmissionReviewGUI', 'show');
192 }
193
195 return $button->withUnavailableAction(true)->withAdditionalOnLoadCode(
196 $this->buildCheckNavigationClosure($target)
197 );
198 }

References buildCheckNavigationClosure(), ILIAS\Repository\ctrl(), getFinishTestCommand(), getStandardOrPrimaryFinishButtonInstance(), and ilTestPlayerCommands\QUESTION_SUMMARY.

Referenced by build().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDisabledStateEnabled()

ilTestNavigationToolbarGUI::setDisabledStateEnabled (   $disabledStateEnabled)
Parameters
boolean$disabledStateEnabled

Definition at line 140 of file class.ilTestNavigationToolbarGUI.php.

141 {
142 $this->disabledStateEnabled = $disabledStateEnabled;
143 }

References $disabledStateEnabled.

◆ setFinishTestButtonEnabled()

ilTestNavigationToolbarGUI::setFinishTestButtonEnabled (   $finishTestButtonEnabled)
Parameters
boolean$finishTestButtonEnabled

Definition at line 92 of file class.ilTestNavigationToolbarGUI.php.

93 {
94 $this->finishTestButtonEnabled = $finishTestButtonEnabled;
95 }

References $finishTestButtonEnabled.

◆ setFinishTestButtonPrimary()

ilTestNavigationToolbarGUI::setFinishTestButtonPrimary (   $finishTestButtonPrimary)
Parameters
boolean$finishTestButtonPrimary

Definition at line 124 of file class.ilTestNavigationToolbarGUI.php.

125 {
126 $this->finishTestButtonPrimary = $finishTestButtonPrimary;
127 }

References $finishTestButtonPrimary.

Referenced by ilTestPlayerAbstractGUI\handlePrimaryButton().

+ Here is the caller graph for this function:

◆ setFinishTestCommand()

ilTestNavigationToolbarGUI::setFinishTestCommand (   $finishTestCommand)
Parameters
string$finishTestCommand

Definition at line 108 of file class.ilTestNavigationToolbarGUI.php.

109 {
110 $this->finishTestCommand = $finishTestCommand;
111 }

References $finishTestCommand.

◆ setQuestionTreeVisible()

ilTestNavigationToolbarGUI::setQuestionTreeVisible ( bool  $questionTreeVisible)

Definition at line 79 of file class.ilTestNavigationToolbarGUI.php.

79 : void
80 {
81 $this->questionTreeVisible = $questionTreeVisible;
82 }

References $questionTreeVisible.

◆ setSuspendTestButtonEnabled()

ilTestNavigationToolbarGUI::setSuspendTestButtonEnabled (   $suspendTestButtonEnabled)
Parameters
boolean$suspendTestButtonEnabled

Definition at line 59 of file class.ilTestNavigationToolbarGUI.php.

60 {
61 $this->suspendTestButtonEnabled = $suspendTestButtonEnabled;
62 }

References $suspendTestButtonEnabled.

◆ setUserPassOverviewEnabled()

ilTestNavigationToolbarGUI::setUserPassOverviewEnabled ( bool  $user_pass_overview_button_enabled)

Definition at line 69 of file class.ilTestNavigationToolbarGUI.php.

69 : void
70 {
71 $this->user_pass_overview_button_enabled = $user_pass_overview_button_enabled;
72 }

References $user_pass_overview_button_enabled.

Field Documentation

◆ $disabledStateEnabled

bool ilTestNavigationToolbarGUI::$disabledStateEnabled = false
private

◆ $finish_test_modal

InterruptiveModal ilTestNavigationToolbarGUI::$finish_test_modal = null
protected

Definition at line 38 of file class.ilTestNavigationToolbarGUI.php.

◆ $finishTestButtonEnabled

bool ilTestNavigationToolbarGUI::$finishTestButtonEnabled = false
private

◆ $finishTestButtonPrimary

bool ilTestNavigationToolbarGUI::$finishTestButtonPrimary = false
private

◆ $finishTestCommand

string ilTestNavigationToolbarGUI::$finishTestCommand = ''
private

◆ $questionTreeVisible

bool ilTestNavigationToolbarGUI::$questionTreeVisible = false
private

◆ $suspendTestButtonEnabled

bool ilTestNavigationToolbarGUI::$suspendTestButtonEnabled = false
private

◆ $user_pass_overview_button_enabled

bool ilTestNavigationToolbarGUI::$user_pass_overview_button_enabled = false
protected

The documentation for this class was generated from the following file: