ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilTestNavigationToolbarGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
5 require_once 'Modules/Test/classes/class.ilTestPlayerNavButton.php';
6 
14 {
18  protected $ctrl;
19 
23  protected $lng;
24 
28  protected $playerGUI;
29 
33  private $suspendTestButtonEnabled = false;
34 
38  private $questionListButtonEnabled = false;
39 
43  private $questionTreeButtonEnabled = false;
44 
48  private $questionTreeVisible = false;
49 
54 
58  private $finishTestButtonEnabled = false;
59 
63  private $finishTestCommand = '';
64 
68  private $finishTestButtonPrimary = false;
69 
73  private $disabledStateEnabled = false;
74 
81  {
82  $this->ctrl = $ctrl;
83  $this->lng = $lng;
84  $this->playerGUI = $playerGUI;
85 
86  parent::__construct();
87  }
88 
92  public function isSuspendTestButtonEnabled()
93  {
95  }
96 
101  {
102  $this->suspendTestButtonEnabled = $suspendTestButtonEnabled;
103  }
104 
108  public function isQuestionListButtonEnabled()
109  {
111  }
112 
117  {
118  $this->questionListButtonEnabled = $questionListButtonEnabled;
119  }
120 
124  public function isQuestionTreeButtonEnabled()
125  {
127  }
128 
133  {
134  $this->questionTreeButtonEnabled = $questionTreeButtonEnabled;
135  }
136 
140  public function isQuestionTreeVisible()
141  {
143  }
144 
149  {
150  $this->questionTreeVisible = $questionTreeVisible;
151  }
152 
157  {
159  }
160 
165  {
166  $this->questionSelectionButtonEnabled = $questionSelectionButtonEnabled;
167  }
168 
172  public function isFinishTestButtonEnabled()
173  {
175  }
176 
181  {
182  $this->finishTestButtonEnabled = $finishTestButtonEnabled;
183  }
184 
188  public function getFinishTestCommand()
189  {
191  }
192 
197  {
198  $this->finishTestCommand = $finishTestCommand;
199  }
200 
204  public function isFinishTestButtonPrimary()
205  {
207  }
208 
213  {
214  $this->finishTestButtonPrimary = $finishTestButtonPrimary;
215  }
216 
220  public function isDisabledStateEnabled()
221  {
223  }
224 
229  {
230  $this->disabledStateEnabled = $disabledStateEnabled;
231  }
232 
233  public function build()
234  {
235  if ($this->isQuestionTreeButtonEnabled()) {
236  $this->addQuestionTreeButton();
237  }
238 
239  if ($this->isQuestionListButtonEnabled()) {
240  $this->addQuestionListButton();
241  }
242 
243  if ($this->isQuestionSelectionButtonEnabled()) {
245  }
246 
247  if ($this->isSuspendTestButtonEnabled()) {
248  $this->addSuspendTestButton();
249  }
250 
251  if ($this->isFinishTestButtonEnabled()) {
252  $this->addFinishTestButton();
253  }
254  }
255 
256  private function addSuspendTestButton()
257  {
259  $btn->setNextCommand(ilTestPlayerCommands::SUSPEND_TEST);
260  $btn->setUrl($this->ctrl->getLinkTarget(
261  $this->playerGUI,
263  ));
264  $btn->setCaption('cancel_test');
265  //$btn->setDisabled($this->isDisabledStateEnabled());
266  $btn->addCSSClass('ilTstNavElem');
267  $this->addButtonInstance($btn);
268  }
269 
270  private function addQuestionListButton()
271  {
273  $btn->setNextCommand(ilTestPlayerCommands::QUESTION_SUMMARY);
274  $btn->setUrl($this->ctrl->getLinkTarget(
275  $this->playerGUI,
277  ));
278  $btn->setCaption('question_summary_btn');
279  //$btn->setDisabled($this->isDisabledStateEnabled());
280  $btn->addCSSClass('ilTstNavElem');
281  $this->addButtonInstance($btn);
282  }
283 
284  private function addQuestionSelectionButton()
285  {
287  $btn->setNextCommand(ilTestPlayerCommands::SHOW_QUESTION_SELECTION);
288  $btn->setUrl($this->ctrl->getLinkTarget(
289  $this->playerGUI,
291  ));
292  $btn->setCaption('tst_change_dyn_test_question_selection');
293  //$btn->setDisabled($this->isDisabledStateEnabled());
294  $btn->addCSSClass('ilTstNavElem');
295  $this->addButtonInstance($btn);
296  }
297 
298  private function addQuestionTreeButton()
299  {
301  $btn->setNextCommand(ilTestPlayerCommands::TOGGLE_SIDE_LIST);
302  $btn->setUrl($this->ctrl->getLinkTarget(
303  $this->playerGUI,
305  ));
306  if ($this->isQuestionTreeVisible()) {
307  $btn->setCaption('tst_hide_side_list');
308  } else {
309  $btn->setCaption('tst_show_side_list');
310  }
311  //$btn->setDisabled($this->isDisabledStateEnabled());
312  $btn->addCSSClass('ilTstNavElem');
313  $this->addButtonInstance($btn);
314  }
315 
316  private function addFinishTestButton()
317  {
319  $btn->setNextCommand($this->getFinishTestCommand());
320  $btn->setUrl($this->ctrl->getLinkTarget(
321  $this->playerGUI,
322  $this->getFinishTestCommand()
323  ));
324  $btn->setCaption('finish_test');
325  //$btn->setDisabled($this->isDisabledStateEnabled());
326  $btn->setPrimary($this->isFinishTestButtonPrimary());
327  $btn->addCSSClass('ilTstNavElem');
328  $this->addButtonInstance($btn);
329  }
330 }
This class provides processing control methods.
setFinishTestButtonEnabled($finishTestButtonEnabled)
setQuestionTreeButtonEnabled($questionTreeButtonEnabled)
setSuspendTestButtonEnabled($suspendTestButtonEnabled)
addButtonInstance(ilButtonBase $a_button)
Add button instance.
setQuestionSelectionButtonEnabled($questionSelectionButtonEnabled)
__construct(ilCtrl $ctrl, ilLanguage $lng, ilTestPlayerAbstractGUI $playerGUI)
setFinishTestButtonPrimary($finishTestButtonPrimary)
language handling
setQuestionListButtonEnabled($questionListButtonEnabled)
Output class for assessment test execution.