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 $reachedLevels = array();
374 $reachedLevels[$reachedLevel[
'sklBaseId']] = array(
375 $reachedLevel[
'sklTrefId'] => $reachedLevel[
'sklLevelId']
379 return $reachedLevels;
384 $uniqueSkills = array();
386 foreach($this->skillQuestionAssignmentList->getUniqueAssignedSkills() as $skill)
388 $uniqueSkills[] = array(
389 'base_skill_id' => (
int)$skill[
'skill_base_id'],
390 'tref_id' => (
int)$skill[
'skill_tref_id']
394 return $uniqueSkills;
399 $this->skillQuestionAssignmentList->isAssignedSkill($skillBaseId, $skillTrefId);
404 $matchingSkillProfiles = array();
406 include_once(
"./Services/Skill/classes/class.ilSkillProfile.php");
409 foreach ($usersProfiles as $profileData)
412 $assignedSkillLevels = $profile->getSkillLevels();
414 foreach($assignedSkillLevels as $assignedSkillLevel)
416 $skillBaseId = $assignedSkillLevel[
'base_skill_id'];
417 $skillTrefId = $assignedSkillLevel[
'tref_id'];
419 if( $this->skillQuestionAssignmentList->isAssignedSkill($skillBaseId, $skillTrefId) )
421 $matchingSkillProfiles[$profileData[
'id']] = $profile->getTitle();
426 return $matchingSkillProfiles;
431 $noProfileMatchingSkills = $this->skillQuestionAssignmentList->getUniqueAssignedSkills();
433 foreach($availableSkillProfiles as $skillProfileId => $skillProfileTitle)
436 $assignedSkillLevels = $profile->getSkillLevels();
438 foreach($assignedSkillLevels as $assignedSkillLevel)
440 $skillBaseId = $assignedSkillLevel[
'base_skill_id'];
441 $skillTrefId = $assignedSkillLevel[
'tref_id'];
443 if( $this->skillQuestionAssignmentList->isAssignedSkill($skillBaseId, $skillTrefId) )
445 unset($noProfileMatchingSkills[
"{$skillBaseId}:{$skillTrefId}"]);
450 return count($noProfileMatchingSkills);
init(ilAssQuestionList $questionList)
setNumRequiredBookingsForSkillTriggering($numRequiredBookingsForSkillTriggering)
evaluateSkillPointAccounts()
invokeSkillLevelTrigger($skillLevelId, $skillTrefId)
calculateReachedSkillPointsFromTestPoints($skillPoints, $maxTestPoints, $reachedTestPoints)
Class CompositeEvaluator.
getUniqueAssignedSkillsForPersonalSkillGUI()
getAssignedSkillMatchingSkillProfiles()
isAnsweredQuestion($questionId)
$numRequiredBookingsForSkillTriggering
__construct(ilDB $db, $testId, $refId)
static getProfilesOfUser($a_user_id)
Get profiles of a user.
isAssignedSkill($skillBaseId, $skillTrefId)
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=0, $a_unique_identifier="")
Write skill level status.
$skillQuestionAssignmentList
noProfileMatchingAssignedSkillExists($availableSkillProfiles)
initTestResultData($testResults)
bookToSkillPointAccount($skillBaseId, $skillTrefId, $maxSkillPoints, $reachedSkillPoints)
drawUpSkillPointAccounts()
getNumRequiredBookingsForSkillTriggering()
Class ilParserQuestionProvider.
initTestQuestionData(ilAssQuestionList $questionList)
doesNumBookingsExceedRequiredBookingsBarrier(ilTestSkillPointAccount $skillPointAccount)
getReachedSkillLevelsForPersonalSkillGUI()
determineReachedSkillPointsWithSolutionCompare(ilAssQuestionSolutionComparisonExpressionList $expressionList)