ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

References ILIAS\GlobalScreen\Provider\__construct().

44  {
46  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ addPassOverviewButton()

ilTestNavigationToolbarGUI::addPassOverviewButton ( )
private

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

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

Referenced by build().

174  {
175  $button = $this->ui->factory()->button()->standard(
176  $this->lng->txt('question_summary_btn'),
177  ''
180  $this->ctrl->getLinkTarget($this->player_gui, ilTestPlayerCommands::QUESTION_SUMMARY)
181  )
182  );
183  $this->addComponent($button);
184  }
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 160 of file class.ilTestNavigationToolbarGUI.php.

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

Referenced by build().

161  {
162  $button = $this->ui->factory()->button()->standard(
163  $this->lng->txt('cancel_test'),
164  ''
167  $this->ctrl->getLinkTarget($this->player_gui, ilTestPlayerCommands::SUSPEND_TEST)
168  )
169  );
170  $this->addComponent($button);
171  }
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 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.

References ilToolbarGUI\$id.

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

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  };
217  }
+ Here is the caller graph for this function:

◆ getFinishTestCommand()

ilTestNavigationToolbarGUI::getFinishTestCommand ( )
Returns
string

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

References $finishTestCommand.

Referenced by retrieveFinishTestButton().

100  : string
101  {
103  }
+ Here is the caller graph for this function:

◆ getStandardOrPrimaryFinishButtonInstance()

ilTestNavigationToolbarGUI::getStandardOrPrimaryFinishButtonInstance ( )
private

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

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

Referenced by retrieveFinishTestButton().

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  }
+ 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.

References $disabledStateEnabled.

132  : bool
133  {
135  }

◆ isFinishTestButtonEnabled()

ilTestNavigationToolbarGUI::isFinishTestButtonEnabled ( )

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

References $finishTestButtonEnabled.

Referenced by build().

84  : bool
85  {
87  }
+ 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().

116  : bool
117  {
119  }
+ Here is the caller graph for this function:

◆ isQuestionTreeVisible()

ilTestNavigationToolbarGUI::isQuestionTreeVisible ( )

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

References $questionTreeVisible.

74  : bool
75  {
77  }

◆ isSuspendTestButtonEnabled()

ilTestNavigationToolbarGUI::isSuspendTestButtonEnabled ( )
Returns
boolean

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

References $suspendTestButtonEnabled.

Referenced by build().

51  : bool
52  {
54  }
+ 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.

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

Referenced by build().

186  : Button
187  {
188  $target = $this->ctrl->getLinkTarget($this->player_gui, $this->getFinishTestCommand());
189  if ($this->player_gui->getObject()->getMainSettings()->getFinishingSettings()->getShowAnswerOverview()
191  $target = $this->ctrl->getLinkTargetByClass('ilTestSubmissionReviewGUI', 'show');
192  }
193 
194  $button = $this->getStandardOrPrimaryFinishButtonInstance();
195  return $button->withAdditionalOnLoadCode(
196  $this->buildCheckNavigationClosure($target)
197  );
198  }
+ 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.

References $disabledStateEnabled.

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

◆ setFinishTestButtonEnabled()

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

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

References $finishTestButtonEnabled.

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

◆ setFinishTestButtonPrimary()

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

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

References $finishTestButtonPrimary.

Referenced by ilTestPlayerAbstractGUI\handlePrimaryButton().

125  {
126  $this->finishTestButtonPrimary = $finishTestButtonPrimary;
127  }
+ Here is the caller graph for this function:

◆ setFinishTestCommand()

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

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

References $finishTestCommand.

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

◆ setQuestionTreeVisible()

ilTestNavigationToolbarGUI::setQuestionTreeVisible ( bool  $questionTreeVisible)

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

References $questionTreeVisible.

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

◆ setSuspendTestButtonEnabled()

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

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

References $suspendTestButtonEnabled.

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

◆ setUserPassOverviewEnabled()

ilTestNavigationToolbarGUI::setUserPassOverviewEnabled ( bool  $user_pass_overview_button_enabled)

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

References $user_pass_overview_button_enabled.

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

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: