ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilTestSkillEvaluationToolbarGUI.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 'Services/UIComponent/Button/classes/class.ilLinkButton.php';
6require_once 'Services/Form/classes/class.ilSelectInputGUI.php';
7
15{
16 const SKILL_PROFILE_PARAM = 'skill_profile';
17
21 private $ctrl;
22
23 private $parentGUI;
24 private $parentCMD;
25
27
29
31
32 private $testResultButtonEnabled = false;
33
35 {
36 $this->ctrl = $ctrl;
37
38 $this->parentGUI = $parentGUI;
39 $this->parentCMD = $parentCMD;
40
41 parent::__construct();
42 }
43
45 {
46 $this->availableSkillProfiles = $availableSkillProfiles;
47 }
48
49 public function getAvailableSkillProfiles()
50 {
52 }
53
55 {
56 $this->noSkillProfileOptionEnabled = $noSkillProfileOptionEnabled;
57 }
58
60 {
62 }
63
65 {
66 $this->selectedEvaluationMode = $selectedEvaluationMode;
67 }
68
69 public function getSelectedEvaluationMode()
70 {
72 }
73
74 public function isTestResultButtonEnabled()
75 {
77 }
78
80 {
81 $this->testResultButtonEnabled = $testResultButtonEnabled;
82 }
83
84 public function build()
85 {
86 if ($this->isTestResultButtonEnabled()) {
87 $link = ilLinkButton::getInstance(); // always returns a new instance
88 $link->setUrl($this->ctrl->getLinkTargetByClass('ilTestEvaluationGUI', 'outUserResultsOverview'));
89 $link->setCaption($this->lng->txt("tst_show_results"), false);
90 $this->addButtonInstance($link);
91
92 $this->addSeparator();
93 }
94
95 $this->setFormAction($this->ctrl->getFormAction($this->parentGUI));
96
97 $select = new ilSelectInputGUI($this->lng->txt("tst_analysis"), self::SKILL_PROFILE_PARAM);
98 $select->setOptions($this->buildEvaluationModeOptionsArray());
99 $select->setValue($this->getSelectedEvaluationMode());
100 $this->addInputItem($select, true);
101
102 $this->addFormButton($this->lng->txt("select"), $this->parentCMD);
103 }
104
106 {
107 $options = array();
108
109 if ($this->isNoSkillProfileOptionEnabled()) {
110 $options[0] = $this->lng->txt('tst_all_test_competences');
111 ;
112 }
113
114 foreach ($this->getAvailableSkillProfiles() as $skillProfileId => $skillProfileTitle) {
115 $options[$skillProfileId] = "{$this->lng->txt('tst_gap_analysis')}: {$skillProfileTitle}";
116 }
117
118 return $options;
119 }
120
121 public static function fetchSkillProfileParam($postData)
122 {
123 if (isset($postData[self::SKILL_PROFILE_PARAM])) {
125 }
126
127 return 0;
128 }
129}
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
An exception for terminatinating execution or to throw for unit testing.
This class provides processing control methods.
language handling
static getInstance()
Factory.
This class represents a selection list property in a property form.
__construct(ilCtrl $ctrl, ilLanguage $lng, $parentGUI, $parentCMD)
setNoSkillProfileOptionEnabled($noSkillProfileOptionEnabled)
addButtonInstance(ilButtonBase $a_button)
Add button instance.
setFormAction($a_val, $a_multipart=false, $a_target="")
Set form action (if form action is set, toolbar is wrapped into form tags)
addInputItem(ilToolbarItem $a_item, $a_output_label=false)
Add input item.
addFormButton($a_txt, $a_cmd, $a_acc_key="", $a_primary=false, $a_class=false)
Add form button to toolbar.
addSeparator()
Add separator.
if($session===NULL) $postData