ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilTestSkillAdministrationGUI Class Reference
+ Collaboration diagram for ilTestSkillAdministrationGUI:

Public Member Functions

 __construct (private ilCtrlInterface $ctrl, private ilAccessHandler $access, private TabsManager $tabs_manager, private ilGlobalTemplateInterface $tpl, private ilLanguage $lng, private Refinery $refinery, private ilDBInterface $db, private TestLogger $logger, private ilTree $tree, private ilComponentRepository $component_repository, private ilComponentFactory $component_factory, private ilObjTest $test_obj, private GeneralQuestionPropertiesRepository $questionrepository, private RequestDataCollector $request_data_collector, private readonly HTTP $http, private readonly ilToolbarGUI $toolbar, private readonly SkillUsageService $skill_usage_service, private readonly Factory $ui_factory, private readonly Renderer $ui_renderer, private readonly ilTabsGUI $tabs, private int $ref_id)
 
 executeCommand ()
 

Private Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilTestSkillAdministrationGUI::__construct ( private ilCtrlInterface  $ctrl,
private ilAccessHandler  $access,
private TabsManager  $tabs_manager,
private ilGlobalTemplateInterface  $tpl,
private ilLanguage  $lng,
private Refinery  $refinery,
private ilDBInterface  $db,
private TestLogger  $logger,
private ilTree  $tree,
private ilComponentRepository  $component_repository,
private ilComponentFactory  $component_factory,
private ilObjTest  $test_obj,
private GeneralQuestionPropertiesRepository  $questionrepository,
private RequestDataCollector  $request_data_collector,
private readonly HTTP  $http,
private readonly ilToolbarGUI  $toolbar,
private readonly SkillUsageService  $skill_usage_service,
private readonly Factory  $ui_factory,
private readonly Renderer  $ui_renderer,
private readonly ilTabsGUI  $tabs,
private int  $ref_id 
)

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

64 {
65 }

Member Function Documentation

◆ buildAssignmentConfigurationInPoolHintMessage()

ilTestSkillAdministrationGUI::buildAssignmentConfigurationInPoolHintMessage ( )
private

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

185 : string
186 {
187 $question_set_config_factory = new ilTestQuestionSetConfigFactory(
188 $this->tree,
189 $this->db,
190 $this->lng,
191 $this->logger,
192 $this->component_repository,
193 $this->test_obj,
194 $this->questionrepository
195 );
196
197 $question_set_config = $question_set_config_factory->getQuestionSetConfig();
198
199 if ($this->test_obj->isRandomTest()) {
200 $testMode = $this->lng->txt('tst_question_set_type_random');
201 $poolLinks = $question_set_config->getCommaSeparatedSourceQuestionPoolLinks();
202
203 return sprintf($this->lng->txt('tst_qst_skl_cfg_in_pool_hint_rndquestset'), $testMode, $poolLinks);
204 }
205
206 return '';
207 }

References ILIAS\Repository\lng(), and ILIAS\Repository\logger().

Referenced by executeCommand().

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

◆ executeCommand()

ilTestSkillAdministrationGUI::executeCommand ( )

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

68 {
69 if ($this->isAccessDenied()) {
70 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_permission"), true);
71 $this->ctrl->setParameterByClass(ilObjTestGUI::class, 'ref_id', $this->ref_id);
72 $this->ctrl->redirectByClass(ilObjTestGUI::class);
73 }
74
75 $nextClass = $this->ctrl->getNextClass();
76
77 switch ($nextClass) {
78 case 'ilassquestionskillassignmentsgui':
79 $this->tabs_manager->getQuestionsSubTabs();
80 $this->tabs_manager->activateTab(TabsManager::TAB_ID_QUESTIONS);
81 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_ASSIGN_SKILLS_TO_QUESTIONS);
82
83 $questionContainerId = $this->test_obj->getId();
84
85 $questionList = new ilAssQuestionList(
86 $this->db,
87 $this->lng,
88 $this->refinery,
89 $this->component_repository,
90 $this->component_factory
91 );
92 $questionList->setParentObjId($questionContainerId);
93 $questionList->setQuestionInstanceTypeFilter($this->getRequiredQuestionInstanceTypeFilter());
94 $questionList->load();
95
97 $this->ctrl,
98 $this->access,
99 $this->tpl,
100 $this->lng,
101 $this->db,
102 $this->request_data_collector,
103 $this->skill_usage_service,
104 $this->ui_factory,
105 $this->ui_renderer,
106 $this->refinery,
107 $this->http,
108 $this->toolbar,
109 $this->tabs,
110 $this->test_obj
111 );
112 $gui->setAssignmentEditingEnabled($this->isAssignmentEditingRequired());
113 $gui->setQuestionContainerId($questionContainerId);
114 $gui->setQuestionList($questionList);
115
116 if ($this->test_obj->isFixedTest()) {
117 $gui->setQuestionOrderSequence($this->test_obj->getQuestions());
118 } else {
119 $gui->setAssignmentConfigurationHintMessage($this->buildAssignmentConfigurationInPoolHintMessage());
120 }
121
122 $this->ctrl->forwardCommand($gui);
123
124 break;
125
126 case 'iltestskilllevelthresholdsgui':
127 $this->tabs_manager->getSettingsSubTabs();
128 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
129 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_ASSIGN_SKILL_TRESHOLDS);
130
132 $this->ctrl,
133 $this->tpl,
134 $this->lng,
135 $this->db,
136 $this->request_data_collector,
137 $this->test_obj->getTestId()
138 );
139 $gui->setQuestionAssignmentColumnsEnabled(!$this->test_obj->isRandomTest());
140 $gui->setQuestionContainerId($this->test_obj->getId());
141 $this->ctrl->forwardCommand($gui);
142 break;
143 }
144 }
static http()
Fetches the global http state from ILIAS.

References ILIAS\Repository\access(), buildAssignmentConfigurationInPoolHintMessage(), ILIAS\Repository\ctrl(), getRequiredQuestionInstanceTypeFilter(), ILIAS\FileDelivery\http(), isAccessDenied(), isAssignmentEditingRequired(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\tabs(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ getRequiredQuestionInstanceTypeFilter()

ilTestSkillAdministrationGUI::getRequiredQuestionInstanceTypeFilter ( )
private

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

176 : ?string
177 {
178 if ($this->test_obj->isRandomTest()) {
180 }
181
182 return null;
183 }

References ilAssQuestionList\QUESTION_INSTANCE_TYPE_DUPLICATES.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ isAccessDenied()

ilTestSkillAdministrationGUI::isAccessDenied ( )
private

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

159 : bool
160 {
161 if (!$this->test_obj->isSkillServiceEnabled()) {
162 return true;
163 }
164
166 return true;
167 }
168
169 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
170 return true;
171 }
172
173 return false;
174 }
static isSkillManagementGloballyActivated()

References ILIAS\Repository\access(), and 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 146 of file class.ilTestSkillAdministrationGUI.php.

146 : bool
147 {
148 if (!$this->test_obj->isFixedTest()) {
149 return false;
150 }
151
152 if ($this->test_obj->participantDataExist()) {
153 return false;
154 }
155
156 return true;
157 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

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