4 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
5 require_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/ilAssLacQuestionProvider.php';
6 require_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/ilAssLacConditionParser.php';
7 require_once
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/ilAssLacCompositeEvaluator.php';
8 require_once
'Modules/Test/classes/class.ilTestSkillPointAccount.php';
9 require_once
'Modules/Test/classes/class.ilTestSkillLevelThresholdList.php';
10 require_once
'Services/Skill/classes/class.ilBasicSkill.php';
93 $this->skillLevelThresholdList->setTestId($testId);
95 $this->questions =
array();
96 $this->maxPointsByQuestion =
array();
141 $this->skillQuestionAssignmentList->setParentObjId($questionList->
getParentObjId());
142 $this->skillQuestionAssignmentList->loadFromDb();
144 $this->skillLevelThresholdList->loadFromDb();
169 $this->reachedPointsByQuestion =
array();
170 $this->skillPointAccounts =
array();
171 $this->reachedSkillLevels =
array();
178 $this->questions[] = $questionData[
'question_id'];
180 $this->maxPointsByQuestion[ $questionData[
'question_id'] ] = $questionData[
'points'];
189 foreach($testResults as $key =>
$result)
191 if($key ===
'pass' || $key ===
'test')
196 if( !
$result[
'workedthrough'] )
201 $this->reachedPointsByQuestion[
$result[
'qid'] ] = $result[
'reached'];
207 foreach($this->questions as $questionId)
214 $assignments = $this->skillQuestionAssignmentList->getAssignmentsByQuestionId($questionId);
216 foreach($assignments as $assignment)
218 if( $assignment->hasEvalModeBySolution() )
221 $assignment->getSolutionComparisonExpressionList()
226 $maxTestPoints = $this->maxPointsByQuestion[$questionId];
227 $reachedTestPoints = $this->reachedPointsByQuestion[$questionId];
230 $assignment->getSkillPoints(), $maxTestPoints, $reachedTestPoints
235 $assignment->getSkillBaseId(), $assignment->getSkillTrefId(),
236 $assignment->getMaxSkillPoints(), $reachedSkillPoints
244 return isset($this->reachedPointsByQuestion[$questionId]);
250 $questionProvider->setQuestionId($expressionList->
getQuestionId());
252 foreach($expressionList->
get() as $expression)
257 $conditionComposite = $conditionParser->parse($expression->getExpression());
263 if( $compositeEvaluator->evaluate($conditionComposite) )
265 return $expression->getPoints();
274 if( $reachedTestPoints < 0 )
276 $reachedTestPoints = 0;
281 if( $maxTestPoints > 0 )
283 $factor = $reachedTestPoints / $maxTestPoints;
286 return ($skillPoints * $factor);
291 $skillKey = $skillBaseId.
':'.$skillTrefId;
293 if( !isset($this->skillPointAccounts[$skillKey]) )
298 $this->skillPointAccounts[$skillKey]->addBooking($maxSkillPoints, $reachedSkillPoints);
303 foreach($this->skillPointAccounts as $skillKey => $skillPointAccount)
312 list($skillBaseId, $skillTrefId) = explode(
':', $skillKey);
315 $levels = $skill->getLevelData();
317 $reachedLevelId = null;
319 foreach($levels as $level)
321 $threshold = $this->skillLevelThresholdList->getThreshold($skillBaseId, $skillTrefId, $level[
'id']);
328 $reachedLevelId = $level[
'id'];
330 if( $skillPointAccount->getTotalReachedSkillPercent() <= $threshold->getThreshold() )
336 if( $reachedLevelId )
338 $this->reachedSkillLevels[] =
array(
339 'sklBaseId' => $skillBaseId,
'sklTrefId' => $skillTrefId,
'sklLevelId' => $reachedLevelId
361 $skillLevelId, $this->
getUserId(), $this->refId,
370 $skillsMatchingNumAnswersBarrier =
array();
372 foreach($this->skillPointAccounts as $skillKey => $skillPointAccount)
376 list($skillBaseId, $skillTrefId) = explode(
':', $skillKey);
378 $skillsMatchingNumAnswersBarrier[$skillKey] =
array(
379 'base_skill_id' => (
int)$skillBaseId,
380 'tref_id' => (
int)$skillTrefId
385 return $skillsMatchingNumAnswersBarrier;
390 $uniqueSkills =
array();
392 foreach($this->skillQuestionAssignmentList->getUniqueAssignedSkills() as $skill)
394 $skillKey = $skill[
'skill_base_id'].
':'.$skill[
'skill_tref_id'];
396 $uniqueSkills[$skillKey] =
array(
397 'base_skill_id' => (
int)$skill[
'skill_base_id'],
398 'tref_id' => (
int)$skill[
'skill_tref_id']
402 return $uniqueSkills;
407 $this->skillQuestionAssignmentList->isAssignedSkill($skillBaseId, $skillTrefId);
412 $matchingSkillProfiles =
array();
414 include_once(
"./Services/Skill/classes/class.ilSkillProfile.php");
417 foreach ($usersProfiles as $profileData)
420 $assignedSkillLevels = $profile->getSkillLevels();
422 foreach($assignedSkillLevels as $assignedSkillLevel)
424 $skillBaseId = $assignedSkillLevel[
'base_skill_id'];
425 $skillTrefId = $assignedSkillLevel[
'tref_id'];
427 if( $this->skillQuestionAssignmentList->isAssignedSkill($skillBaseId, $skillTrefId) )
429 $matchingSkillProfiles[$profileData[
'id']] = $profile->getTitle();
434 return $matchingSkillProfiles;
439 $noProfileMatchingSkills = $this->skillQuestionAssignmentList->getUniqueAssignedSkills();
441 foreach($availableSkillProfiles as $skillProfileId => $skillProfileTitle)
444 $assignedSkillLevels = $profile->getSkillLevels();
446 foreach($assignedSkillLevels as $assignedSkillLevel)
448 $skillBaseId = $assignedSkillLevel[
'base_skill_id'];
449 $skillTrefId = $assignedSkillLevel[
'tref_id'];
451 if( $this->skillQuestionAssignmentList->isAssignedSkill($skillBaseId, $skillTrefId) )
453 unset($noProfileMatchingSkills[
"{$skillBaseId}:{$skillTrefId}"]);
458 return count($noProfileMatchingSkills);
init(ilAssQuestionList $questionList)
setNumRequiredBookingsForSkillTriggering($numRequiredBookingsForSkillTriggering)
evaluateSkillPointAccounts()
invokeSkillLevelTrigger($skillLevelId, $skillTrefId)
calculateReachedSkillPointsFromTestPoints($skillPoints, $maxTestPoints, $reachedTestPoints)
Class CompositeEvaluator.
getAssignedSkillMatchingSkillProfiles()
isAnsweredQuestion($questionId)
$numRequiredBookingsForSkillTriggering
__construct(ilDBInterface $db, $testId, $refId)
static getProfilesOfUser($a_user_id)
Get profiles of a user.
isAssignedSkill($skillBaseId, $skillTrefId)
$skillQuestionAssignmentList
noProfileMatchingAssignedSkillExists($availableSkillProfiles)
initTestResultData($testResults)
bookToSkillPointAccount($skillBaseId, $skillTrefId, $maxSkillPoints, $reachedSkillPoints)
static writeUserSkillLevelStatus($a_level_id, $a_user_id, $a_trigger_ref_id, $a_tref_id=0, $a_status=ilBasicSkill::ACHIEVED, $a_force=false, $a_self_eval=false, $a_unique_identifier="")
Write skill level status.
drawUpSkillPointAccounts()
Create styles array
The data for the language used.
getNumRequiredBookingsForSkillTriggering()
getSkillsInvolvedByAssignment()
Class ilParserQuestionProvider.
initTestQuestionData(ilAssQuestionList $questionList)
doesNumBookingsExceedRequiredBookingsBarrier(ilTestSkillPointAccount $skillPointAccount)
determineReachedSkillPointsWithSolutionCompare(ilAssQuestionSolutionComparisonExpressionList $expressionList)
getSkillsMatchingNumAnswersBarrier()