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

Public Member Functions

 __construct (private ilObjTest $test_obj, private ilCtrl $ctrl, private ilGlobalTemplateInterface $tpl, private ilLanguage $lng, private ilDBInterface $db, private LoggingServices $logging_services, private SkillService $skills_service, private InternalRequestService $testrequest)
 
 getQuestionList ()
 
 setQuestionList ($questionList)
 
 getObjectiveOrientedContainer ()
 
 setObjectiveOrientedContainer ($objectiveOrientedContainer)
 
 executeCommand ()
 
 setTestSession (ilTestSession $testSession)
 
 getTestSession ()
 
 isNoSkillProfileOptionEnabled ()
 
 setNoSkillProfileOptionEnabled (bool $noSkillProfileOptionEnabled)
 
 getAvailableSkillProfiles ()
 
 setAvailableSkillProfiles (array $availableSkillProfiles)
 
 getAvailableSkills ()
 
 setAvailableSkills (array $availableSkills)
 

Data Fields

const INVOLVE_SKILLS_BELOW_NUM_ANSWERS_BARRIER_FOR_GAP_ANALASYS = false
 
const SKILL_PROFILE_PARAM = 'skill_profile'
 
const CMD_SHOW = 'show'
 

Protected Member Functions

 init (bool $skill_profile_enabled)
 

Protected Attributes

bool $noSkillProfileOptionEnabled = false
 
array $availableSkillProfiles = []
 
array $availableSkills = []
 
ilTestPassesSelector $testPassesSelector = null
 

Private Member Functions

 isAccessDenied ()
 
 showCmd ()
 
 buildEvaluationToolbarGUI (int $selectedSkillProfileId)
 
 buildPersonalSkillsGUI (int $usrId, ?int $selectedSkillProfileId, array $availableSkills)
 

Private Attributes

ilTestSession $testSession
 
ilTestObjectiveOrientedContainer $objectiveOrientedContainer
 
ilAssQuestionList $questionList
 

Detailed Description

Definition at line 37 of file class.ilTestSkillEvaluationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestSkillEvaluationGUI::__construct ( private ilObjTest  $test_obj,
private ilCtrl  $ctrl,
private ilGlobalTemplateInterface  $tpl,
private ilLanguage  $lng,
private ilDBInterface  $db,
private LoggingServices  $logging_services,
private SkillService  $skills_service,
private InternalRequestService  $testrequest 
)

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

62  {
63  }

Member Function Documentation

◆ buildEvaluationToolbarGUI()

ilTestSkillEvaluationGUI::buildEvaluationToolbarGUI ( int  $selectedSkillProfileId)
private

Definition at line 183 of file class.ilTestSkillEvaluationGUI.php.

References ILIAS\Repository\ctrl(), getAvailableSkillProfiles(), isNoSkillProfileOptionEnabled(), and ILIAS\Repository\lng().

Referenced by showCmd().

184  {
185  if (!$this->isNoSkillProfileOptionEnabled() && !$selectedSkillProfileId) {
186  $selectedSkillProfileId = key($this->getAvailableSkillProfiles()) ?? 0;
187  }
188 
189  $gui = new ilTestSkillEvaluationToolbarGUI($this->ctrl, $this->lng);
190 
191  $gui->setAvailableSkillProfiles($this->getAvailableSkillProfiles());
192  $gui->setNoSkillProfileOptionEnabled($this->isNoSkillProfileOptionEnabled());
193  $gui->setSelectedEvaluationMode($selectedSkillProfileId);
194 
195  $gui->build();
196 
197  return $gui;
198  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buildPersonalSkillsGUI()

ilTestSkillEvaluationGUI::buildPersonalSkillsGUI ( int  $usrId,
?int  $selectedSkillProfileId,
array  $availableSkills 
)
private

Definition at line 200 of file class.ilTestSkillEvaluationGUI.php.

References ILIAS\Repository\lng(), and ilTestPersonalSkillsGUI\setAvailableSkills().

Referenced by showCmd().

205  $gui = new ilTestPersonalSkillsGUI($this->lng, $this->test_obj->getId());
206 
208  $gui->setSelectedSkillProfile($selectedSkillProfileId);
209  $gui->setUsrId($usrId);
210 
211  return $gui;
212  }
setAvailableSkills(array $availableSkills)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilTestSkillEvaluationGUI::executeCommand ( )

Definition at line 97 of file class.ilTestSkillEvaluationGUI.php.

References ILIAS\Repository\ctrl().

98  {
99  $cmd = $this->ctrl->getCmd(self::CMD_SHOW) . 'Cmd';
100  $this->$cmd();
101  }
+ Here is the call graph for this function:

◆ getAvailableSkillProfiles()

ilTestSkillEvaluationGUI::getAvailableSkillProfiles ( )

Definition at line 234 of file class.ilTestSkillEvaluationGUI.php.

References $availableSkillProfiles.

Referenced by buildEvaluationToolbarGUI().

234  : array
235  {
237  }
+ Here is the caller graph for this function:

◆ getAvailableSkills()

ilTestSkillEvaluationGUI::getAvailableSkills ( )

Definition at line 244 of file class.ilTestSkillEvaluationGUI.php.

References $availableSkills.

Referenced by showCmd().

244  : array
245  {
246  return $this->availableSkills;
247  }
+ Here is the caller graph for this function:

◆ getObjectiveOrientedContainer()

ilTestSkillEvaluationGUI::getObjectiveOrientedContainer ( )

◆ getQuestionList()

ilTestSkillEvaluationGUI::getQuestionList ( )
Returns
ilAssQuestionList

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

References $questionList.

Referenced by init().

+ Here is the caller graph for this function:

◆ getTestSession()

ilTestSkillEvaluationGUI::getTestSession ( )

Definition at line 219 of file class.ilTestSkillEvaluationGUI.php.

References $testSession.

Referenced by init(), and showCmd().

219  : ilTestSession
220  {
221  return $this->testSession;
222  }
+ Here is the caller graph for this function:

◆ init()

ilTestSkillEvaluationGUI::init ( bool  $skill_profile_enabled)
protected

Definition at line 108 of file class.ilTestSkillEvaluationGUI.php.

References ilObjAssessmentFolder\DEFAULT_SKL_TRIG_NUM_ANSWERS_BARRIER, getQuestionList(), getTestSession(), setAvailableSkillProfiles(), setAvailableSkills(), setNoSkillProfileOptionEnabled(), and ilTestSkillEvaluation\setUserId().

Referenced by showCmd().

108  : void
109  {
110  $this->testPassesSelector = new ilTestPassesSelector($this->db, $this->test_obj);
111  $this->testPassesSelector->setActiveId($this->testSession->getActiveId());
112  $this->testPassesSelector->setLastFinishedPass($this->testSession->getLastFinishedPass());
113 
114  $assSettings = new ilSetting('assessment');
115  $skillEvaluation = new ilTestSkillEvaluation(
116  $this->db,
117  $this->logging_services,
118  $this->test_obj->getTestId(),
119  $this->test_obj->getRefId(),
120  $this->skills_service->profile(),
121  $this->skills_service->personal()
122  );
123 
124  $skillEvaluation->setUserId($this->getTestSession()->getUserId());
125  $skillEvaluation->setActiveId($this->getTestSession()->getActiveId());
126 
127  $skillEvaluation->setNumRequiredBookingsForSkillTriggering((int) $assSettings->get(
128  'ass_skl_trig_num_answ_barrier',
130  ));
131 
132  $skillEvaluation->init($this->getQuestionList());
133 
134  $availableSkillProfiles = $skillEvaluation->getAssignedSkillMatchingSkillProfiles();
136  $skillEvaluation->noProfileMatchingAssignedSkillExists($availableSkillProfiles)
137  );
139 
140  // should be reportedPasses - yes - indeed, skill level status will not respect - avoid confuse here
141  $evaluationPasses = $this->testPassesSelector->getExistingPasses();
142 
143  $availableSkills = [];
144 
145  foreach ($evaluationPasses as $evalPass) {
146  $testResults = $this->test_obj->getTestResult($this->getTestSession()->getActiveId(), $evalPass, true);
147 
148  $skillEvaluation->setPass($evalPass);
149  $skillEvaluation->evaluate($testResults);
150 
151  if ($skill_profile_enabled && self::INVOLVE_SKILLS_BELOW_NUM_ANSWERS_BARRIER_FOR_GAP_ANALASYS) {
152  $skills = $skillEvaluation->getSkillsInvolvedByAssignment();
153  } else {
154  $skills = $skillEvaluation->getSkillsMatchingNumAnswersBarrier();
155  }
156 
157  $availableSkills = array_merge($availableSkills, $skills);
158  }
159 
160  $this->setAvailableSkills(array_values($availableSkills));
161  }
setAvailableSkillProfiles(array $availableSkillProfiles)
setAvailableSkills(array $availableSkills)
setNoSkillProfileOptionEnabled(bool $noSkillProfileOptionEnabled)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isAccessDenied()

ilTestSkillEvaluationGUI::isAccessDenied ( )
private

Definition at line 103 of file class.ilTestSkillEvaluationGUI.php.

103  : bool
104  {
105  return false;
106  }

◆ isNoSkillProfileOptionEnabled()

ilTestSkillEvaluationGUI::isNoSkillProfileOptionEnabled ( )

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

References $noSkillProfileOptionEnabled.

Referenced by buildEvaluationToolbarGUI().

224  : bool
225  {
227  }
+ Here is the caller graph for this function:

◆ setAvailableSkillProfiles()

ilTestSkillEvaluationGUI::setAvailableSkillProfiles ( array  $availableSkillProfiles)

Definition at line 239 of file class.ilTestSkillEvaluationGUI.php.

References $availableSkillProfiles.

Referenced by init().

239  : void
240  {
241  $this->availableSkillProfiles = $availableSkillProfiles;
242  }
+ Here is the caller graph for this function:

◆ setAvailableSkills()

ilTestSkillEvaluationGUI::setAvailableSkills ( array  $availableSkills)

Definition at line 249 of file class.ilTestSkillEvaluationGUI.php.

References $availableSkills.

Referenced by init().

249  : void
250  {
251  $this->availableSkills = $availableSkills;
252  }
+ Here is the caller graph for this function:

◆ setNoSkillProfileOptionEnabled()

ilTestSkillEvaluationGUI::setNoSkillProfileOptionEnabled ( bool  $noSkillProfileOptionEnabled)

Definition at line 229 of file class.ilTestSkillEvaluationGUI.php.

References $noSkillProfileOptionEnabled.

Referenced by init().

229  : void
230  {
231  $this->noSkillProfileOptionEnabled = $noSkillProfileOptionEnabled;
232  }
+ Here is the caller graph for this function:

◆ setObjectiveOrientedContainer()

ilTestSkillEvaluationGUI::setObjectiveOrientedContainer (   $objectiveOrientedContainer)
Parameters
ilTestObjectiveOrientedContainer$objectiveOrientedContainer

Definition at line 92 of file class.ilTestSkillEvaluationGUI.php.

References $objectiveOrientedContainer.

93  {
94  $this->objectiveOrientedContainer = $objectiveOrientedContainer;
95  }
ilTestObjectiveOrientedContainer $objectiveOrientedContainer

◆ setQuestionList()

ilTestSkillEvaluationGUI::setQuestionList (   $questionList)
Parameters
ilAssQuestionList$questionList

Definition at line 76 of file class.ilTestSkillEvaluationGUI.php.

References $questionList.

77  {
78  $this->questionList = $questionList;
79  }

◆ setTestSession()

ilTestSkillEvaluationGUI::setTestSession ( ilTestSession  $testSession)

Definition at line 214 of file class.ilTestSkillEvaluationGUI.php.

References $testSession.

214  : void
215  {
216  $this->testSession = $testSession;
217  }

◆ showCmd()

ilTestSkillEvaluationGUI::showCmd ( )
private

Definition at line 163 of file class.ilTestSkillEvaluationGUI.php.

References buildEvaluationToolbarGUI(), buildPersonalSkillsGUI(), ILIAS\Repository\ctrl(), getAvailableSkills(), getTestSession(), and init().

164  {
165  $selected_skill_profile = $this->testrequest->int(self::SKILL_PROFILE_PARAM);
166  $skill_profile_enabled = $this->testrequest->isset(self::SKILL_PROFILE_PARAM);
167 
168  $this->init($skill_profile_enabled);
169 
170  $evaluation_toolbar_gui = $this->buildEvaluationToolbarGUI($selected_skill_profile);
171 
172  $personal_skills_gui = $this->buildPersonalSkillsGUI(
173  $this->getTestSession()->getUserId(),
174  $evaluation_toolbar_gui->getSelectedEvaluationMode(),
175  $this->getAvailableSkills()
176  );
177 
178  $this->tpl->setContent(
179  $this->ctrl->getHTML($evaluation_toolbar_gui) . $this->ctrl->getHTML($personal_skills_gui)
180  );
181  }
buildEvaluationToolbarGUI(int $selectedSkillProfileId)
init(bool $skill_profile_enabled)
buildPersonalSkillsGUI(int $usrId, ?int $selectedSkillProfileId, array $availableSkills)
+ Here is the call graph for this function:

Field Documentation

◆ $availableSkillProfiles

array ilTestSkillEvaluationGUI::$availableSkillProfiles = []
protected

◆ $availableSkills

array ilTestSkillEvaluationGUI::$availableSkills = []
protected

Definition at line 50 of file class.ilTestSkillEvaluationGUI.php.

Referenced by getAvailableSkills(), and setAvailableSkills().

◆ $noSkillProfileOptionEnabled

bool ilTestSkillEvaluationGUI::$noSkillProfileOptionEnabled = false
protected

◆ $objectiveOrientedContainer

ilTestObjectiveOrientedContainer ilTestSkillEvaluationGUI::$objectiveOrientedContainer
private

◆ $questionList

ilAssQuestionList ilTestSkillEvaluationGUI::$questionList
private

Definition at line 46 of file class.ilTestSkillEvaluationGUI.php.

Referenced by getQuestionList(), and setQuestionList().

◆ $testPassesSelector

ilTestPassesSelector ilTestSkillEvaluationGUI::$testPassesSelector = null
protected

Definition at line 51 of file class.ilTestSkillEvaluationGUI.php.

◆ $testSession

ilTestSession ilTestSkillEvaluationGUI::$testSession
private

Definition at line 44 of file class.ilTestSkillEvaluationGUI.php.

Referenced by getTestSession(), and setTestSession().

◆ CMD_SHOW

const ilTestSkillEvaluationGUI::CMD_SHOW = 'show'

◆ INVOLVE_SKILLS_BELOW_NUM_ANSWERS_BARRIER_FOR_GAP_ANALASYS

const ilTestSkillEvaluationGUI::INVOLVE_SKILLS_BELOW_NUM_ANSWERS_BARRIER_FOR_GAP_ANALASYS = false

Definition at line 39 of file class.ilTestSkillEvaluationGUI.php.

◆ SKILL_PROFILE_PARAM

const ilTestSkillEvaluationGUI::SKILL_PROFILE_PARAM = 'skill_profile'

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