ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestSkillAdministrationGUI Class Reference
+ Collaboration diagram for ilTestSkillAdministrationGUI:

Public Member Functions

 __construct (ILIAS $ilias, ilCtrl $ctrl, ilAccessHandler $access, ilTabsGUI $tabs, ilGlobalTemplateInterface $tpl, ilLanguage $lng, \ILIAS\Refinery\Factory $refinery, ilDBInterface $db, ilTree $tree, ilPluginAdmin $pluginAdmin, ilObjTest $testOBJ, $refId)
 
 executeCommand ()
 
 manageTabs ($activeSubTabId)
 

Protected Attributes

 $refinery
 

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 18 of file class.ilTestSkillAdministrationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestSkillAdministrationGUI::__construct ( ILIAS  $ilias,
ilCtrl  $ctrl,
ilAccessHandler  $access,
ilTabsGUI  $tabs,
ilGlobalTemplateInterface  $tpl,
ilLanguage  $lng,
\ILIAS\Refinery\Factory  $refinery,
ilDBInterface  $db,
ilTree  $tree,
ilPluginAdmin  $pluginAdmin,
ilObjTest  $testOBJ,
  $refId 
)

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

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

76  {
77  $this->ilias = $ilias;
78  $this->ctrl = $ctrl;
79  $this->access = $access;
80  $this->tabs = $tabs;
81  $this->tpl = $tpl;
82  $this->lng = $lng;
83  $this->refinery = $refinery;
84  $this->db = $db;
85  $this->tree = $tree;
86  $this->pluginAdmin = $pluginAdmin;
87  $this->testOBJ = $testOBJ;
88  $this->refId = $refId;
89  }
$refId
Definition: xapitoken.php:40
redirection script todo: (a better solution should control the processing via a xml file) ...

Member Function Documentation

◆ buildAssignmentConfigurationInPoolHintMessage()

ilTestSkillAdministrationGUI::buildAssignmentConfigurationInPoolHintMessage ( )
private

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

Referenced by executeCommand().

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

◆ executeCommand()

ilTestSkillAdministrationGUI::executeCommand ( )

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

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

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

Referenced by executeCommand().

194  {
195  if ($this->testOBJ->isDynamicTest()) {
196  $questionSetConfigFactory = new ilTestQuestionSetConfigFactory(
197  $this->tree,
198  $this->db,
199  $this->pluginAdmin,
200  $this->testOBJ
201  );
202 
203  $questionSetConfig = $questionSetConfigFactory->getQuestionSetConfig();
204 
205  return $questionSetConfig->getSourceQuestionPoolId();
206  }
207 
208  return $this->testOBJ->getId();
209  }
+ Here is the caller graph for this function:

◆ getRequiredQuestionInstanceTypeFilter()

ilTestSkillAdministrationGUI::getRequiredQuestionInstanceTypeFilter ( )
private

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

References ilAssQuestionList\QUESTION_INSTANCE_TYPE_DUPLICATES, and ilAssQuestionList\QUESTION_INSTANCE_TYPE_ORIGINALS.

Referenced by executeCommand().

212  {
213  if ($this->testOBJ->isDynamicTest()) {
215  }
216 
217  if ($this->testOBJ->isRandomTest()) {
219  }
220 
221  return null;
222  }
+ Here is the caller graph for this function:

◆ isAccessDenied()

ilTestSkillAdministrationGUI::isAccessDenied ( )
private

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

References ilObjTest\isSkillManagementGloballyActivated().

Referenced by executeCommand().

177  {
178  if (!$this->testOBJ->isSkillServiceEnabled()) {
179  return true;
180  }
181 
183  return true;
184  }
185 
186  if (!$this->access->checkAccess('write', '', $this->refId)) {
187  return true;
188  }
189 
190  return false;
191  }
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 137 of file class.ilTestSkillAdministrationGUI.php.

Referenced by executeCommand().

138  {
139  if (!$this->testOBJ->isFixedTest()) {
140  return false;
141  }
142 
143  if ($this->testOBJ->participantDataExist()) {
144  return false;
145  }
146 
147  return true;
148  }
+ Here is the caller graph for this function:

◆ manageTabs()

ilTestSkillAdministrationGUI::manageTabs (   $activeSubTabId)

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

References ilAssQuestionSkillAssignmentsGUI\CMD_SHOW_SKILL_QUEST_ASSIGNS, and ilTestSkillLevelThresholdsGUI\CMD_SHOW_SKILL_THRESHOLDS.

Referenced by executeCommand().

151  {
152  $link = $this->ctrl->getLinkTargetByClass(
153  'ilAssQuestionSkillAssignmentsGUI',
155  );
156  $this->tabs->addSubTab(
157  'ilassquestionskillassignmentsgui',
158  $this->lng->txt('qpl_skl_sub_tab_quest_assign'),
159  $link
160  );
161 
162  $link = $this->ctrl->getLinkTargetByClass(
163  'ilTestSkillLevelThresholdsGUI',
165  );
166  $this->tabs->addSubTab(
167  'iltestskilllevelthresholdsgui',
168  $this->lng->txt('tst_skl_sub_tab_thresholds'),
169  $link
170  );
171 
172  $this->tabs->activateTab('tst_tab_competences');
173  $this->tabs->activateSubTab($activeSubTabId);
174  }
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilTestSkillAdministrationGUI::$access
private

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

Referenced by __construct().

◆ $ctrl

ilTestSkillAdministrationGUI::$ctrl
private

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

Referenced by __construct().

◆ $db

ilTestSkillAdministrationGUI::$db
private

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

Referenced by __construct().

◆ $ilias

ilTestSkillAdministrationGUI::$ilias
private

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

Referenced by __construct().

◆ $lng

ilTestSkillAdministrationGUI::$lng
private

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

Referenced by __construct().

◆ $pluginAdmin

ilTestSkillAdministrationGUI::$pluginAdmin
private

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

Referenced by __construct().

◆ $refinery

ilTestSkillAdministrationGUI::$refinery
protected

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

Referenced by __construct().

◆ $tabs

ilTestSkillAdministrationGUI::$tabs
private

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

Referenced by __construct().

◆ $testOBJ

ilTestSkillAdministrationGUI::$testOBJ
private

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

Referenced by __construct().

◆ $tpl

ilTestSkillAdministrationGUI::$tpl
private

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

Referenced by __construct().

◆ $tree

ilTestSkillAdministrationGUI::$tree
private

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

Referenced by __construct().


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