ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
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 177 of file class.ilTestSkillAdministrationGUI.php.

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

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 );
104 $gui->setAssignmentEditingEnabled($this->isAssignmentEditingRequired());
105 $gui->setQuestionContainerId($questionContainerId);
106 $gui->setQuestionList($questionList);
107
108 if ($this->test_obj->isFixedTest()) {
109 $gui->setQuestionOrderSequence($this->test_obj->getQuestions());
110 } else {
111 $gui->setAssignmentConfigurationHintMessage($this->buildAssignmentConfigurationInPoolHintMessage());
112 }
113
114 $this->ctrl->forwardCommand($gui);
115
116 break;
117
118 case 'iltestskilllevelthresholdsgui':
119 $this->tabs_manager->getSettingsSubTabs();
120 $this->tabs_manager->activateTab(TabsManager::TAB_ID_SETTINGS);
121 $this->tabs_manager->activateSubTab(TabsManager::SETTINGS_SUBTAB_ID_ASSIGN_SKILL_TRESHOLDS);
122
124 $this->ctrl,
125 $this->tpl,
126 $this->lng,
127 $this->db,
128 $this->request_data_collector,
129 $this->test_obj->getTestId()
130 );
131 $gui->setQuestionAssignmentColumnsEnabled(!$this->test_obj->isRandomTest());
132 $gui->setQuestionContainerId($this->test_obj->getId());
133 $this->ctrl->forwardCommand($gui);
134 break;
135 }
136 }
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 168 of file class.ilTestSkillAdministrationGUI.php.

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

References ilAssQuestionList\QUESTION_INSTANCE_TYPE_DUPLICATES.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ isAccessDenied()

ilTestSkillAdministrationGUI::isAccessDenied ( )
private

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

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

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

Referenced by executeCommand().

+ Here is the caller graph for this function:

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