ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilTestSkillAdministrationGUI Class Reference
+ Collaboration diagram for ilTestSkillAdministrationGUI:

Public Member Functions

 __construct (private ilCtrl $ctrl, private ilAccessHandler $access, private ilTabsGUI $tabs, private ilGlobalTemplateInterface $tpl, private ilLanguage $lng, private Refinery $refinery, private ilDBInterface $db, private ilLogger $log, private ilTree $tree, private ilComponentRepository $component_repository, private ilObjTest $test_obj, private QuestionInfoService $questioninfo, private int $ref_id)
 
 executeCommand ()
 
 manageTabs ($activeSubTabId)
 

Private Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestSkillAdministrationGUI::__construct ( private ilCtrl  $ctrl,
private ilAccessHandler  $access,
private ilTabsGUI  $tabs,
private ilGlobalTemplateInterface  $tpl,
private ilLanguage  $lng,
private Refinery  $refinery,
private ilDBInterface  $db,
private ilLogger  $log,
private ilTree  $tree,
private ilComponentRepository  $component_repository,
private ilObjTest  $test_obj,
private QuestionInfoService  $questioninfo,
private int  $ref_id 
)

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

50  {
51  }

Member Function Documentation

◆ buildAssignmentConfigurationInPoolHintMessage()

ilTestSkillAdministrationGUI::buildAssignmentConfigurationInPoolHintMessage ( )
private

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

References ILIAS\Repository\lng().

Referenced by executeCommand().

165  : string
166  {
167  $question_set_config_factory = new ilTestQuestionSetConfigFactory(
168  $this->tree,
169  $this->db,
170  $this->lng,
171  $this->log,
172  $this->component_repository,
173  $this->test_obj,
174  $this->questioninfo
175  );
176 
177  $question_set_config = $question_set_config_factory->getQuestionSetConfig();
178 
179  if ($this->test_obj->isRandomTest()) {
180  $testMode = $this->lng->txt('tst_question_set_type_random');
181  $poolLinks = $question_set_config->getCommaSeparatedSourceQuestionPoolLinks();
182 
183  return sprintf($this->lng->txt('tst_qst_skl_cfg_in_pool_hint_rndquestset'), $testMode, $poolLinks);
184  }
185 
186  return '';
187  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestSkillAdministrationGUI::executeCommand ( )

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

References ILIAS\Repository\access(), buildAssignmentConfigurationInPoolHintMessage(), ILIAS\Repository\ctrl(), getRequiredQuestionInstanceTypeFilter(), isAccessDenied(), isAssignmentEditingRequired(), ILIAS\Repository\lng(), manageTabs(), ILIAS\Repository\refinery(), and ilTestSkillLevelThresholdsGUI\setQuestionAssignmentColumnsEnabled().

54  {
55  if ($this->isAccessDenied()) {
56  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
57  $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $this->ref_id);
58  $this->ctrl->redirectByClass(ilObjTestGUI::class);
59  }
60 
61  $nextClass = $this->ctrl->getNextClass();
62 
63  $this->manageTabs($nextClass);
64 
65  switch ($nextClass) {
66  case 'ilassquestionskillassignmentsgui':
67 
68  $questionContainerId = $this->test_obj->getId();
69 
70  $questionList = new ilAssQuestionList($this->db, $this->lng, $this->refinery, $this->component_repository);
71  $questionList->setParentObjId($questionContainerId);
72  $questionList->setQuestionInstanceTypeFilter($this->getRequiredQuestionInstanceTypeFilter());
73  $questionList->load();
74 
75  $gui = new ilAssQuestionSkillAssignmentsGUI($this->ctrl, $this->access, $this->tpl, $this->lng, $this->db);
76  $gui->setAssignmentEditingEnabled($this->isAssignmentEditingRequired());
77  $gui->setQuestionContainerId($questionContainerId);
78  $gui->setQuestionList($questionList);
79 
80  if ($this->test_obj->isFixedTest()) {
81  $gui->setQuestionOrderSequence($this->test_obj->getQuestions());
82  } else {
83  $gui->setAssignmentConfigurationHintMessage($this->buildAssignmentConfigurationInPoolHintMessage());
84  }
85 
86  $this->ctrl->forwardCommand($gui);
87 
88  break;
89 
90  case 'iltestskilllevelthresholdsgui':
91 
92  $gui = new ilTestSkillLevelThresholdsGUI($this->ctrl, $this->tpl, $this->lng, $this->db, $this->test_obj->getTestId());
93  $gui->setQuestionAssignmentColumnsEnabled(!$this->test_obj->isRandomTest());
94  $gui->setQuestionContainerId($this->test_obj->getId());
95  $this->ctrl->forwardCommand($gui);
96  break;
97  }
98  }
setQuestionAssignmentColumnsEnabled($questionAssignmentColumnsEnabled)
+ Here is the call graph for this function:

◆ getRequiredQuestionInstanceTypeFilter()

ilTestSkillAdministrationGUI::getRequiredQuestionInstanceTypeFilter ( )
private

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

References ilAssQuestionList\QUESTION_INSTANCE_TYPE_DUPLICATES.

Referenced by executeCommand().

156  : ?string
157  {
158  if ($this->test_obj->isRandomTest()) {
160  }
161 
162  return null;
163  }
+ Here is the caller graph for this function:

◆ isAccessDenied()

ilTestSkillAdministrationGUI::isAccessDenied ( )
private

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

References ILIAS\Repository\access(), and ilObjTest\isSkillManagementGloballyActivated().

Referenced by executeCommand().

139  : bool
140  {
141  if (!$this->test_obj->isSkillServiceEnabled()) {
142  return true;
143  }
144 
146  return true;
147  }
148 
149  if (!$this->access->checkAccess('write', '', $this->ref_id)) {
150  return true;
151  }
152 
153  return false;
154  }
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 100 of file class.ilTestSkillAdministrationGUI.php.

Referenced by executeCommand().

100  : bool
101  {
102  if (!$this->test_obj->isFixedTest()) {
103  return false;
104  }
105 
106  if ($this->test_obj->participantDataExist()) {
107  return false;
108  }
109 
110  return true;
111  }
+ Here is the caller graph for this function:

◆ manageTabs()

ilTestSkillAdministrationGUI::manageTabs (   $activeSubTabId)

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

References ilAssQuestionSkillAssignmentsGUI\CMD_SHOW_SKILL_QUEST_ASSIGNS, ilTestSkillLevelThresholdsGUI\CMD_SHOW_SKILL_THRESHOLDS, ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\tabs().

Referenced by executeCommand().

114  {
115  $link = $this->ctrl->getLinkTargetByClass(
116  'ilAssQuestionSkillAssignmentsGUI',
118  );
119  $this->tabs->addSubTab(
120  'ilassquestionskillassignmentsgui',
121  $this->lng->txt('qpl_skl_sub_tab_quest_assign'),
122  $link
123  );
124 
125  $link = $this->ctrl->getLinkTargetByClass(
126  'ilTestSkillLevelThresholdsGUI',
128  );
129  $this->tabs->addSubTab(
130  'iltestskilllevelthresholdsgui',
131  $this->lng->txt('tst_skl_sub_tab_thresholds'),
132  $link
133  );
134 
135  $this->tabs->activateTab('tst_tab_competences');
136  $this->tabs->activateSubTab($activeSubTabId);
137  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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