ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
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 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 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.

63 {
64 }

Member Function Documentation

◆ buildAssignmentConfigurationInPoolHintMessage()

ilTestSkillAdministrationGUI::buildAssignmentConfigurationInPoolHintMessage ( )
private

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

178 : string
179 {
180 $question_set_config_factory = new ilTestQuestionSetConfigFactory(
181 $this->tree,
182 $this->db,
183 $this->lng,
184 $this->logger,
185 $this->component_repository,
186 $this->test_obj,
187 $this->questionrepository
188 );
189
190 $question_set_config = $question_set_config_factory->getQuestionSetConfig();
191
192 if ($this->test_obj->isRandomTest()) {
193 $testMode = $this->lng->txt('tst_question_set_type_random');
194 $poolLinks = $question_set_config->getCommaSeparatedSourceQuestionPoolLinks();
195
196 return sprintf($this->lng->txt('tst_qst_skl_cfg_in_pool_hint_rndquestset'), $testMode, $poolLinks);
197 }
198
199 return '';
200 }

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

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

169 : ?string
170 {
171 if ($this->test_obj->isRandomTest()) {
173 }
174
175 return null;
176 }

References ilAssQuestionList\QUESTION_INSTANCE_TYPE_DUPLICATES.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ isAccessDenied()

ilTestSkillAdministrationGUI::isAccessDenied ( )
private

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

152 : bool
153 {
154 if (!$this->test_obj->isSkillServiceEnabled()) {
155 return true;
156 }
157
159 return true;
160 }
161
162 if (!$this->access->checkAccess('write', '', $this->ref_id)) {
163 return true;
164 }
165
166 return false;
167 }
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 139 of file class.ilTestSkillAdministrationGUI.php.

139 : bool
140 {
141 if (!$this->test_obj->isFixedTest()) {
142 return false;
143 }
144
145 if ($this->test_obj->participantDataExist()) {
146 return false;
147 }
148
149 return true;
150 }

Referenced by executeCommand().

+ Here is the caller graph for this function:

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