ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilTestSkillAdministrationGUI Class Reference
+ Collaboration diagram for ilTestSkillAdministrationGUI:

Public Member Functions

 __construct (ILIAS $ilias, ilCtrl $ctrl, ilAccessHandler $access, ilTabsGUI $tabs, ilTemplate $tpl, ilLanguage $lng, ilDB $db, ilTree $tree, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ, $refId)
 
 executeCommand ()
 
 manageTabs ($activeSubTabId)
 

Private Member Functions

 isAssignmentEditingRequired ()
 
 isAccessDenied ()
 
 getQuestionContainerId ()
 
 getRequiredQuestionInstanceTypeFilter ()
 
 buildAssignmentConfigurationInPoolHintMessage ()
 

Private Attributes

 $ilias
 
 $ctrl
 
 $access
 
 $tabs
 
 $tpl
 
 $lng
 
 $db
 
 $tree
 
 $pluginAdmin
 
 $testOBJ
 

Detailed Description

Definition at line 16 of file class.ilTestSkillAdministrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestSkillAdministrationGUI::__construct ( ILIAS  $ilias,
ilCtrl  $ctrl,
ilAccessHandler  $access,
ilTabsGUI  $tabs,
ilTemplate  $tpl,
ilLanguage  $lng,
ilDB  $db,
ilTree  $tree,
ilPluginAdmin  $pluginAdmin,
ilObjTest  $testOBJ,
  $refId 
)

Definition at line 68 of file class.ilTestSkillAdministrationGUI.php.

References $access, $ctrl, $db, $ilias, $lng, $pluginAdmin, $tabs, $testOBJ, $tpl, and $tree.

Member Function Documentation

◆ buildAssignmentConfigurationInPoolHintMessage()

ilTestSkillAdministrationGUI::buildAssignmentConfigurationInPoolHintMessage ( )
private

Definition at line 221 of file class.ilTestSkillAdministrationGUI.php.

222 {
223 $questionSetConfigFactory = new ilTestQuestionSetConfigFactory(
224 $this->tree, $this->db, $this->pluginAdmin, $this->testOBJ
225 );
226
227 $questionSetConfig = $questionSetConfigFactory->getQuestionSetConfig();
228
229 if( $this->testOBJ->isRandomTest() )
230 {
231 $testMode = $this->lng->txt('tst_question_set_type_random');
232 $poolLinks = $questionSetConfig->getCommaSeparatedSourceQuestionPoolLinks();
233
234 return sprintf($this->lng->txt('tst_qst_skl_cfg_in_pool_hint_rndquestset'), $testMode, $poolLinks);
235 }
236 elseif( $this->testOBJ->isDynamicTest() )
237 {
238 $testMode = $this->lng->txt('tst_question_set_type_dynamic');
239 $poolLink = $questionSetConfig->getSourceQuestionPoolLink($questionSetConfig->getSourceQuestionPoolId());
240
241 return sprintf($this->lng->txt('tst_qst_skl_cfg_in_pool_hint_dynquestset'), $testMode, $poolLink);
242 }
243
244 return '';
245 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ executeCommand()

ilTestSkillAdministrationGUI::executeCommand ( )

Definition at line 83 of file class.ilTestSkillAdministrationGUI.php.

84 {
85 if( $this->isAccessDenied() )
86 {
87 $this->ilias->raiseError($this->lng->txt("permission_denied"), $this->ilias->error_obj->MESSAGE);
88 }
89
90 $nextClass = $this->ctrl->getNextClass();
91
92 $this->manageTabs($nextClass);
93
94 switch($nextClass)
95 {
96 case 'ilassquestionskillassignmentsgui':
97
98 $questionContainerId = $this->getQuestionContainerId();
99
100 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
101 $questionList = new ilAssQuestionList($this->db, $this->lng, $this->pluginAdmin);
102 $questionList->setParentObjId($questionContainerId);
103 $questionList->setQuestionInstanceTypeFilter($this->getRequiredQuestionInstanceTypeFilter());
104 $questionList->load();
105
106 $gui = new ilAssQuestionSkillAssignmentsGUI($this->ctrl, $this->access, $this->tpl, $this->lng, $this->db);
107 $gui->setAssignmentEditingEnabled($this->isAssignmentEditingRequired());
108 $gui->setQuestionContainerId($questionContainerId);
109 $gui->setQuestionList($questionList);
110
111 if( $this->testOBJ->isFixedTest() )
112 {
113 $gui->setQuestionOrderSequence($this->testOBJ->getQuestions());
114 }
115 else
116 {
117 $gui->setAssignmentConfigurationHintMessage($this->buildAssignmentConfigurationInPoolHintMessage());
118 }
119
120 $this->ctrl->forwardCommand($gui);
121
122 break;
123
124 case 'iltestskilllevelthresholdsgui':
125
126 $gui = new ilTestSkillLevelThresholdsGUI($this->ctrl, $this->tpl, $this->lng, $this->db, $this->testOBJ->getTestId());
127 $gui->setQuestionAssignmentColumnsEnabled(!$this->testOBJ->isRandomTest());
128 $gui->setQuestionContainerId($this->getQuestionContainerId());
129 $this->ctrl->forwardCommand($gui);
130 break;
131 }
132 }

References buildAssignmentConfigurationInPoolHintMessage(), getQuestionContainerId(), getRequiredQuestionInstanceTypeFilter(), isAccessDenied(), isAssignmentEditingRequired(), and manageTabs().

+ Here is the call graph for this function:

◆ getQuestionContainerId()

ilTestSkillAdministrationGUI::getQuestionContainerId ( )
private

Definition at line 190 of file class.ilTestSkillAdministrationGUI.php.

191 {
192 if( $this->testOBJ->isDynamicTest() )
193 {
194 $questionSetConfigFactory = new ilTestQuestionSetConfigFactory(
195 $this->tree, $this->db, $this->pluginAdmin, $this->testOBJ
196 );
197
198 $questionSetConfig = $questionSetConfigFactory->getQuestionSetConfig();
199
200 return $questionSetConfig->getSourceQuestionPoolId();
201 }
202
203 return $this->testOBJ->getId();
204 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getRequiredQuestionInstanceTypeFilter()

ilTestSkillAdministrationGUI::getRequiredQuestionInstanceTypeFilter ( )
private

Definition at line 206 of file class.ilTestSkillAdministrationGUI.php.

207 {
208 if( $this->testOBJ->isDynamicTest() )
209 {
211 }
212
213 if( $this->testOBJ->isRandomTest() )
214 {
216 }
217
218 return null;
219 }

References ilAssQuestionList\QUESTION_INSTANCE_TYPE_DUPLICATES, and ilAssQuestionList\QUESTION_INSTANCE_TYPE_ORIGINALS.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ isAccessDenied()

ilTestSkillAdministrationGUI::isAccessDenied ( )
private

Definition at line 170 of file class.ilTestSkillAdministrationGUI.php.

171 {
172 if( !$this->testOBJ->isSkillServiceEnabled() )
173 {
174 return true;
175 }
176
178 {
179 return true;
180 }
181
182 if( ! $this->access->checkAccess('write', '', $this->refId) )
183 {
184 return true;
185 }
186
187 return false;
188 }
static isSkillManagementGloballyActivated()

References ilObjTest\isSkillManagementGloballyActivated().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAssignmentEditingRequired()

ilTestSkillAdministrationGUI::isAssignmentEditingRequired ( )
private

Definition at line 134 of file class.ilTestSkillAdministrationGUI.php.

135 {
136 if( !$this->testOBJ->isFixedTest() )
137 {
138 return false;
139 }
140
141 if( $this->testOBJ->participantDataExist() )
142 {
143 return false;
144 }
145
146 return true;
147 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ manageTabs()

ilTestSkillAdministrationGUI::manageTabs (   $activeSubTabId)

Definition at line 149 of file class.ilTestSkillAdministrationGUI.php.

150 {
151 $link = $this->ctrl->getLinkTargetByClass(
153 );
154 $this->tabs->addSubTab(
155 'ilassquestionskillassignmentsgui', $this->lng->txt('qpl_skl_sub_tab_quest_assign'), $link
156
157 );
158
159 $link = $this->ctrl->getLinkTargetByClass(
160 'ilTestSkillLevelThresholdsGUI', ilTestSkillLevelThresholdsGUI::CMD_SHOW_SKILL_THRESHOLDS
161 );
162 $this->tabs->addSubTab(
163 'iltestskilllevelthresholdsgui', $this->lng->txt('tst_skl_sub_tab_thresholds'), $link
164 );
165
166 $this->tabs->activateTab('tst_tab_competences');
167 $this->tabs->activateSubTab($activeSubTabId);
168 }

References ilAssQuestionSkillAssignmentsGUI\CMD_SHOW_SKILL_QUEST_ASSIGNS, and ilTestSkillLevelThresholdsGUI\CMD_SHOW_SKILL_THRESHOLDS.

Referenced by executeCommand().

+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilTestSkillAdministrationGUI::$access
private

Definition at line 31 of file class.ilTestSkillAdministrationGUI.php.

Referenced by __construct().

◆ $ctrl

ilTestSkillAdministrationGUI::$ctrl
private

Definition at line 26 of file class.ilTestSkillAdministrationGUI.php.

Referenced by __construct().

◆ $db

ilTestSkillAdministrationGUI::$db
private

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

Referenced by __construct().

◆ $ilias

ilTestSkillAdministrationGUI::$ilias
private

Definition at line 21 of file class.ilTestSkillAdministrationGUI.php.

Referenced by __construct().

◆ $lng

ilTestSkillAdministrationGUI::$lng
private

Definition at line 46 of file class.ilTestSkillAdministrationGUI.php.

Referenced by __construct().

◆ $pluginAdmin

ilTestSkillAdministrationGUI::$pluginAdmin
private

Definition at line 61 of file class.ilTestSkillAdministrationGUI.php.

Referenced by __construct().

◆ $tabs

ilTestSkillAdministrationGUI::$tabs
private

Definition at line 36 of file class.ilTestSkillAdministrationGUI.php.

Referenced by __construct().

◆ $testOBJ

ilTestSkillAdministrationGUI::$testOBJ
private

Definition at line 66 of file class.ilTestSkillAdministrationGUI.php.

Referenced by __construct().

◆ $tpl

ilTestSkillAdministrationGUI::$tpl
private

Definition at line 41 of file class.ilTestSkillAdministrationGUI.php.

Referenced by __construct().

◆ $tree

ilTestSkillAdministrationGUI::$tree
private

Definition at line 56 of file class.ilTestSkillAdministrationGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: