ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestNavigationToolbarGUI Class Reference
+ Inheritance diagram for ilTestNavigationToolbarGUI:
+ Collaboration diagram for ilTestNavigationToolbarGUI:

Public Member Functions

 __construct (protected ilCtrl $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 $questionSelectionButtonEnabled = 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 ilCtrl  $ctrl,
protected ilTestPlayerAbstractGUI  $player_gui 
)

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

References ILIAS\MetaData\Repository\Validation\Data\__construct().

45  {
47  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ addPassOverviewButton()

ilTestNavigationToolbarGUI::addPassOverviewButton ( )
private

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

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

Referenced by build().

188  {
189  $button = $this->ui->factory()->button()->standard(
190  $this->lng->txt('question_summary_btn'),
191  ''
192  )->withUnavailableAction(true)->withAdditionalOnLoadCode(
194  $this->ctrl->getLinkTarget($this->player_gui, ilTestPlayerCommands::QUESTION_SUMMARY)
195  )
196  );
197 
198  $this->addComponent($button);
199  }
addComponent(\ILIAS\UI\Component\Component $a_comp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSuspendTestButton()

ilTestNavigationToolbarGUI::addSuspendTestButton ( )
private

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

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

Referenced by build().

174  {
175  $button = $this->ui->factory()->button()->standard(
176  $this->lng->txt('cancel_test'),
177  ''
178  )->withUnavailableAction(true)->withAdditionalOnLoadCode(
180  $this->ctrl->getLinkTarget($this->player_gui, ilTestPlayerCommands::SUSPEND_TEST)
181  )
182  );
183 
184  $this->addComponent($button);
185  }
addComponent(\ILIAS\UI\Component\Component $a_comp)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ build()

ilTestNavigationToolbarGUI::build ( )

Definition at line 158 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 224 of file class.ilTestNavigationToolbarGUI.php.

References ilToolbarGUI\$id.

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

224  : Closure
225  {
226  return static function (string $id) use ($target): string {
227  return "document.getElementById('{$id}').addEventListener('click', "
228  . '(e) => {'
229  . " il.TestPlayerQuestionEditControl.checkNavigation('{$target}', 'show', e);"
230  . '}); '
231  . "document.getElementById('{$id}').removeAttribute('disabled');";
232  };
233  }
+ Here is the caller graph for this function:

◆ getFinishTestCommand()

ilTestNavigationToolbarGUI::getFinishTestCommand ( )
Returns
string

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

References $finishTestCommand.

Referenced by retrieveFinishTestButton().

113  : string
114  {
116  }
+ Here is the caller graph for this function:

◆ getStandardOrPrimaryFinishButtonInstance()

ilTestNavigationToolbarGUI::getStandardOrPrimaryFinishButtonInstance ( )
private

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

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

Referenced by retrieveFinishTestButton().

215  : Button
216  {
217  if ($this->isFinishTestButtonPrimary()) {
218  return $this->ui->factory()->button()->primary($this->lng->txt('finish_test'), '');
219  }
220 
221  return $this->ui->factory()->button()->standard($this->lng->txt('finish_test'), '');
222  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDisabledStateEnabled()

ilTestNavigationToolbarGUI::isDisabledStateEnabled ( )
Returns
boolean

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

References $disabledStateEnabled.

145  : bool
146  {
148  }

◆ isFinishTestButtonEnabled()

ilTestNavigationToolbarGUI::isFinishTestButtonEnabled ( )
Returns
boolean

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

References $finishTestButtonEnabled.

Referenced by build().

97  : bool
98  {
100  }
+ Here is the caller graph for this function:

◆ isFinishTestButtonPrimary()

ilTestNavigationToolbarGUI::isFinishTestButtonPrimary ( )
Returns
boolean

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

References $finishTestButtonPrimary.

Referenced by getStandardOrPrimaryFinishButtonInstance().

129  : bool
130  {
132  }
+ Here is the caller graph for this function:

◆ isQuestionTreeVisible()

ilTestNavigationToolbarGUI::isQuestionTreeVisible ( )
Returns
boolean

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

References $questionTreeVisible.

84  : bool
85  {
87  }

◆ isSuspendTestButtonEnabled()

ilTestNavigationToolbarGUI::isSuspendTestButtonEnabled ( )
Returns
boolean

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

References $suspendTestButtonEnabled.

Referenced by build().

52  : bool
53  {
55  }
+ Here is the caller graph for this function:

◆ isUserPassOverviewEnabled()

ilTestNavigationToolbarGUI::isUserPassOverviewEnabled ( )
Returns
boolean

Definition at line 68 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 201 of file class.ilTestNavigationToolbarGUI.php.

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

Referenced by build().

201  : Button
202  {
203  $target = $this->ctrl->getLinkTarget($this->player_gui, $this->getFinishTestCommand());
204  if ($this->player_gui->getObject()->getMainSettings()->getFinishingSettings()->getShowAnswerOverview()
206  $target = $this->ctrl->getLinkTargetByClass('ilTestSubmissionReviewGUI', 'show');
207  }
208 
209  $button = $this->getStandardOrPrimaryFinishButtonInstance();
210  return $button->withUnavailableAction(true)->withAdditionalOnLoadCode(
211  $this->buildCheckNavigationClosure($target)
212  );
213  }
+ 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 153 of file class.ilTestNavigationToolbarGUI.php.

References $disabledStateEnabled.

154  {
155  $this->disabledStateEnabled = $disabledStateEnabled;
156  }

◆ setFinishTestButtonEnabled()

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

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

References $finishTestButtonEnabled.

106  {
107  $this->finishTestButtonEnabled = $finishTestButtonEnabled;
108  }

◆ setFinishTestButtonPrimary()

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

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

References $finishTestButtonPrimary.

Referenced by ilTestOutputGUI\handlePrimaryButton().

138  {
139  $this->finishTestButtonPrimary = $finishTestButtonPrimary;
140  }
+ Here is the caller graph for this function:

◆ setFinishTestCommand()

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

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

References $finishTestCommand.

122  {
123  $this->finishTestCommand = $finishTestCommand;
124  }

◆ setQuestionTreeVisible()

ilTestNavigationToolbarGUI::setQuestionTreeVisible ( bool  $questionTreeVisible)

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

References $questionTreeVisible.

89  : void
90  {
91  $this->questionTreeVisible = $questionTreeVisible;
92  }

◆ setSuspendTestButtonEnabled()

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

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

References $suspendTestButtonEnabled.

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

◆ setUserPassOverviewEnabled()

ilTestNavigationToolbarGUI::setUserPassOverviewEnabled ( bool  $user_pass_overview_button_enabled)
Parameters
boolean$questionListButtonEnabled

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

References $user_pass_overview_button_enabled.

77  {
78  $this->user_pass_overview_button_enabled = $user_pass_overview_button_enabled;
79  }

Field Documentation

◆ $disabledStateEnabled

bool ilTestNavigationToolbarGUI::$disabledStateEnabled = false
private

◆ $finish_test_modal

InterruptiveModal ilTestNavigationToolbarGUI::$finish_test_modal = null
protected

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

◆ $finishTestButtonEnabled

bool ilTestNavigationToolbarGUI::$finishTestButtonEnabled = false
private

◆ $finishTestButtonPrimary

bool ilTestNavigationToolbarGUI::$finishTestButtonPrimary = false
private

◆ $finishTestCommand

string ilTestNavigationToolbarGUI::$finishTestCommand = ''
private

◆ $questionSelectionButtonEnabled

bool ilTestNavigationToolbarGUI::$questionSelectionButtonEnabled = false
private

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

◆ $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: