ILIAS  release_7 Revision v7.30-3-g800a261c036
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
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 $this->addQuestionTreeButton();
237 }
238
239 if ($this->isQuestionListButtonEnabled()) {
240 $this->addQuestionListButton();
241 }
242
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 {
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}
An exception for terminatinating execution or to throw for unit testing.
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.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc