ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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
4require_once 'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
5require_once 'Modules/Test/classes/class.ilTestPlayerNavButton.php';
6
14{
18 protected $ctrl;
19
23 protected $lng;
24
28 protected $playerGUI;
29
34
39
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
93 {
95 }
96
101 {
102 $this->suspendTestButtonEnabled = $suspendTestButtonEnabled;
103 }
104
109 {
111 }
112
117 {
118 $this->questionListButtonEnabled = $questionListButtonEnabled;
119 }
120
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
173 {
175 }
176
181 {
182 $this->finishTestButtonEnabled = $finishTestButtonEnabled;
183 }
184
188 public function getFinishTestCommand()
189 {
191 }
192
197 {
198 $this->finishTestCommand = $finishTestCommand;
199 }
200
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 {
237 $this->addQuestionTreeButton();
238 }
239
240 if( $this->isQuestionListButtonEnabled() )
241 {
242 $this->addQuestionListButton();
243 }
244
246 {
248 }
249
250 if( $this->isSuspendTestButtonEnabled() )
251 {
252 $this->addSuspendTestButton();
253 }
254
255 if( $this->isFinishTestButtonEnabled() )
256 {
257 $this->addFinishTestButton();
258 }
259 }
260
261 private function addSuspendTestButton()
262 {
264 $btn->setNextCommand(ilTestPlayerCommands::SUSPEND_TEST);
265 $btn->setUrl($this->ctrl->getLinkTarget(
266 $this->playerGUI, ilTestPlayerCommands::SUSPEND_TEST
267 ));
268 $btn->setCaption('cancel_test');
269 //$btn->setDisabled($this->isDisabledStateEnabled());
270 $btn->addCSSClass('ilTstNavElem');
271 $this->addButtonInstance($btn);
272 }
273
274 private function addQuestionListButton()
275 {
277 $btn->setNextCommand(ilTestPlayerCommands::QUESTION_SUMMARY);
278 $btn->setUrl($this->ctrl->getLinkTarget(
280 ));
281 $btn->setCaption('question_summary_btn');
282 //$btn->setDisabled($this->isDisabledStateEnabled());
283 $btn->addCSSClass('ilTstNavElem');
284 $this->addButtonInstance($btn);
285 }
286
287 private function addQuestionSelectionButton()
288 {
291 $btn->setUrl($this->ctrl->getLinkTarget(
293 ));
294 $btn->setCaption('tst_change_dyn_test_question_selection');
295 //$btn->setDisabled($this->isDisabledStateEnabled());
296 $btn->addCSSClass('ilTstNavElem');
297 $this->addButtonInstance($btn);
298 }
299
300 private function addQuestionTreeButton()
301 {
303 $btn->setNextCommand(ilTestPlayerCommands::TOGGLE_SIDE_LIST);
304 $btn->setUrl($this->ctrl->getLinkTarget(
306 ));
307 if( $this->isQuestionTreeVisible() )
308 {
309 $btn->setCaption('tst_hide_side_list');
310 }
311 else
312 {
313 $btn->setCaption('tst_show_side_list');
314 }
315 //$btn->setDisabled($this->isDisabledStateEnabled());
316 $btn->addCSSClass('ilTstNavElem');
317 $this->addButtonInstance($btn);
318 }
319
320 private function addFinishTestButton()
321 {
323 $btn->setNextCommand($this->getFinishTestCommand());
324 $btn->setUrl($this->ctrl->getLinkTarget(
325 $this->playerGUI, $this->getFinishTestCommand()
326 ));
327 $btn->setCaption('finish_test');
328 //$btn->setDisabled($this->isDisabledStateEnabled());
329 $btn->setPrimary($this->isFinishTestButtonPrimary());
330 $btn->addCSSClass('ilTstNavElem');
331 $this->addButtonInstance($btn);
332 }
333}
This class provides processing control methods.
language handling
__construct(ilCtrl $ctrl, ilLanguage $lng, ilTestPlayerAbstractGUI $playerGUI)
setQuestionSelectionButtonEnabled($questionSelectionButtonEnabled)
setQuestionListButtonEnabled($questionListButtonEnabled)
setFinishTestButtonEnabled($finishTestButtonEnabled)
setSuspendTestButtonEnabled($suspendTestButtonEnabled)
setQuestionTreeButtonEnabled($questionTreeButtonEnabled)
setFinishTestButtonPrimary($finishTestButtonPrimary)
Output class for assessment test execution.
addButtonInstance(ilButtonBase $a_button)
Add button instance.