ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTestSkillAdministrationGUI Class Reference
+ Collaboration diagram for ilTestSkillAdministrationGUI:

Public Member Functions

 __construct (ILIAS $ilias, ilCtrl $ctrl, ilAccessHandler $access, ilTabsGUI $tabs, ilTemplate $tpl, ilLanguage $lng, ilDBInterface $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,
ilDBInterface  $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 216 of file class.ilTestSkillAdministrationGUI.php.

Referenced by executeCommand().

217  {
218  $questionSetConfigFactory = new ilTestQuestionSetConfigFactory(
219  $this->tree,
220  $this->db,
221  $this->pluginAdmin,
222  $this->testOBJ
223  );
224 
225  $questionSetConfig = $questionSetConfigFactory->getQuestionSetConfig();
226 
227  if ($this->testOBJ->isRandomTest()) {
228  $testMode = $this->lng->txt('tst_question_set_type_random');
229  $poolLinks = $questionSetConfig->getCommaSeparatedSourceQuestionPoolLinks();
230 
231  return sprintf($this->lng->txt('tst_qst_skl_cfg_in_pool_hint_rndquestset'), $testMode, $poolLinks);
232  } elseif ($this->testOBJ->isDynamicTest()) {
233  $testMode = $this->lng->txt('tst_question_set_type_dynamic');
234  $poolLink = $questionSetConfig->getSourceQuestionPoolLink($questionSetConfig->getSourceQuestionPoolId());
235 
236  return sprintf($this->lng->txt('tst_qst_skl_cfg_in_pool_hint_dynquestset'), $testMode, $poolLink);
237  }
238 
239  return '';
240  }
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestSkillAdministrationGUI::executeCommand ( )

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

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

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

◆ getQuestionContainerId()

ilTestSkillAdministrationGUI::getQuestionContainerId ( )
private

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

Referenced by executeCommand().

186  {
187  if ($this->testOBJ->isDynamicTest()) {
188  $questionSetConfigFactory = new ilTestQuestionSetConfigFactory(
189  $this->tree,
190  $this->db,
191  $this->pluginAdmin,
192  $this->testOBJ
193  );
194 
195  $questionSetConfig = $questionSetConfigFactory->getQuestionSetConfig();
196 
197  return $questionSetConfig->getSourceQuestionPoolId();
198  }
199 
200  return $this->testOBJ->getId();
201  }
+ Here is the caller graph for this function:

◆ getRequiredQuestionInstanceTypeFilter()

ilTestSkillAdministrationGUI::getRequiredQuestionInstanceTypeFilter ( )
private

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

References ilAssQuestionList\QUESTION_INSTANCE_TYPE_DUPLICATES, and ilAssQuestionList\QUESTION_INSTANCE_TYPE_ORIGINALS.

Referenced by executeCommand().

204  {
205  if ($this->testOBJ->isDynamicTest()) {
207  }
208 
209  if ($this->testOBJ->isRandomTest()) {
211  }
212 
213  return null;
214  }
+ Here is the caller graph for this function:

◆ isAccessDenied()

ilTestSkillAdministrationGUI::isAccessDenied ( )
private

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

References ilObjTest\isSkillManagementGloballyActivated().

Referenced by executeCommand().

169  {
170  if (!$this->testOBJ->isSkillServiceEnabled()) {
171  return true;
172  }
173 
175  return true;
176  }
177 
178  if (!$this->access->checkAccess('write', '', $this->refId)) {
179  return true;
180  }
181 
182  return false;
183  }
static isSkillManagementGloballyActivated()
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAssignmentEditingRequired()

ilTestSkillAdministrationGUI::isAssignmentEditingRequired ( )
private

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

Referenced by executeCommand().

130  {
131  if (!$this->testOBJ->isFixedTest()) {
132  return false;
133  }
134 
135  if ($this->testOBJ->participantDataExist()) {
136  return false;
137  }
138 
139  return true;
140  }
+ Here is the caller graph for this function:

◆ manageTabs()

ilTestSkillAdministrationGUI::manageTabs (   $activeSubTabId)

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

References ilAssQuestionSkillAssignmentsGUI\CMD_SHOW_SKILL_QUEST_ASSIGNS, and ilTestSkillLevelThresholdsGUI\CMD_SHOW_SKILL_THRESHOLDS.

Referenced by executeCommand().

143  {
144  $link = $this->ctrl->getLinkTargetByClass(
145  'ilAssQuestionSkillAssignmentsGUI',
147  );
148  $this->tabs->addSubTab(
149  'ilassquestionskillassignmentsgui',
150  $this->lng->txt('qpl_skl_sub_tab_quest_assign'),
151  $link
152  );
153 
154  $link = $this->ctrl->getLinkTargetByClass(
155  'ilTestSkillLevelThresholdsGUI',
157  );
158  $this->tabs->addSubTab(
159  'iltestskilllevelthresholdsgui',
160  $this->lng->txt('tst_skl_sub_tab_thresholds'),
161  $link
162  );
163 
164  $this->tabs->activateTab('tst_tab_competences');
165  $this->tabs->activateSubTab($activeSubTabId);
166  }
+ 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: