4require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
 
    5require_once 
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/ilAssLacQuestionProvider.php';
 
    6require_once 
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/ilAssLacConditionParser.php';
 
    7require_once 
'Modules/TestQuestionPool/classes/questions/LogicalAnswerCompare/ilAssLacCompositeEvaluator.php';
 
    8require_once 
'Modules/Test/classes/class.ilTestSkillPointAccount.php';
 
    9require_once 
'Modules/Test/classes/class.ilTestSkillLevelThresholdList.php';
 
   10require_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();
 
  177            $this->questions[] = $questionData[
'question_id'];
 
  179            $this->maxPointsByQuestion[ $questionData[
'question_id'] ] = $questionData[
'points'];
 
  189            if (
$key === 
'pass' || 
$key === 
'test') { 
 
  193            if (!
$result[
'workedthrough']) {
 
  197            $this->reachedPointsByQuestion[ 
$result[
'qid'] ] = 
$result[
'reached'];
 
  203        foreach ($this->questions as $questionId) {
 
  208            $assignments = $this->skillQuestionAssignmentList->getAssignmentsByQuestionId($questionId);
 
  210            foreach ($assignments as $assignment) {
 
  211                if ($assignment->hasEvalModeBySolution()) {
 
  213                        $assignment->getSolutionComparisonExpressionList()
 
  216                    $maxTestPoints = $this->maxPointsByQuestion[$questionId];
 
  217                    $reachedTestPoints = $this->reachedPointsByQuestion[$questionId];
 
  220                        $assignment->getSkillPoints(),
 
  227                    $assignment->getSkillBaseId(),
 
  228                    $assignment->getSkillTrefId(),
 
  229                    $assignment->getMaxSkillPoints(),
 
  238        return isset($this->reachedPointsByQuestion[$questionId]);
 
  244        $questionProvider->setQuestionId($expressionList->
getQuestionId());
 
  246        foreach ($expressionList->
get() as $expression) {
 
  250            $conditionComposite = $conditionParser->parse($expression->getExpression());
 
  258            if ($compositeEvaluator->evaluate($conditionComposite)) {
 
  259                return $expression->getPoints();
 
  268        if ($reachedTestPoints < 0) {
 
  269            $reachedTestPoints = 0;
 
  274        if ($maxTestPoints > 0) {
 
  275            $factor = $reachedTestPoints / $maxTestPoints;
 
  278        return ($skillPoints * $factor);
 
  283        $skillKey = $skillBaseId . 
':' . $skillTrefId;
 
  285        if (!isset($this->skillPointAccounts[$skillKey])) {
 
  289        $this->skillPointAccounts[$skillKey]->addBooking($maxSkillPoints, $reachedSkillPoints);
 
  294        foreach ($this->skillPointAccounts as $skillKey => $skillPointAccount) {
 
  301            list($skillBaseId, $skillTrefId) = explode(
':', $skillKey);
 
  304            $levels = $skill->getLevelData();
 
  306            $reachedLevelId = 
null;
 
  308            foreach ($levels as $level) {
 
  309                $threshold = $this->skillLevelThresholdList->getThreshold($skillBaseId, $skillTrefId, $level[
'id']);
 
  315                $reachedLevelId = $level[
'id'];
 
  317                if ($skillPointAccount->getTotalReachedSkillPercent() <= $threshold->getThreshold()) {
 
  322            if ($reachedLevelId) {
 
  323                $this->reachedSkillLevels[] = array(
 
  324                    'sklBaseId' => $skillBaseId, 
'sklTrefId' => $skillTrefId, 
'sklLevelId' => $reachedLevelId
 
  357        $DIC->logger()->root()->info(
 
  358            "refId={$this->refId} / usrId={$this->getUserId()} / levelId={$skillLevelId} / trefId={$skillTrefId}" 
  366        $skillsMatchingNumAnswersBarrier = array();
 
  368        foreach ($this->skillPointAccounts as $skillKey => $skillPointAccount) {
 
  370                list($skillBaseId, $skillTrefId) = explode(
':', $skillKey);
 
  372                $skillsMatchingNumAnswersBarrier[$skillKey] = array(
 
  373                    'base_skill_id' => (
int) $skillBaseId,
 
  374                    'tref_id' => (
int) $skillTrefId
 
  379        return $skillsMatchingNumAnswersBarrier;
 
  384        $uniqueSkills = array();
 
  386        foreach ($this->skillQuestionAssignmentList->getUniqueAssignedSkills() as $skill) {
 
  387            $skillKey = $skill[
'skill_base_id'] . 
':' . $skill[
'skill_tref_id'];
 
  389            $uniqueSkills[$skillKey] = array(
 
  390                'base_skill_id' => (
int) $skill[
'skill_base_id'],
 
  391                'tref_id' => (
int) $skill[
'skill_tref_id']
 
  395        return $uniqueSkills;
 
  400        $this->skillQuestionAssignmentList->isAssignedSkill($skillBaseId, $skillTrefId);
 
  405        $matchingSkillProfiles = array();
 
  407        include_once(
"./Services/Skill/classes/class.ilSkillProfile.php");
 
  410        foreach ($usersProfiles as $profileData) {
 
  412            $assignedSkillLevels = $profile->getSkillLevels();
 
  414            foreach ($assignedSkillLevels as $assignedSkillLevel) {
 
  415                $skillBaseId = $assignedSkillLevel[
'base_skill_id'];
 
  416                $skillTrefId = $assignedSkillLevel[
'tref_id'];
 
  418                if ($this->skillQuestionAssignmentList->isAssignedSkill($skillBaseId, $skillTrefId)) {
 
  419                    $matchingSkillProfiles[$profileData[
'id']] = $profile->getTitle();
 
  424        return $matchingSkillProfiles;
 
  429        $noProfileMatchingSkills = $this->skillQuestionAssignmentList->getUniqueAssignedSkills();
 
  431        foreach ($availableSkillProfiles as $skillProfileId => $skillProfileTitle) {
 
  433            $assignedSkillLevels = $profile->getSkillLevels();
 
  435            foreach ($assignedSkillLevels as $assignedSkillLevel) {
 
  436                $skillBaseId = $assignedSkillLevel[
'base_skill_id'];
 
  437                $skillTrefId = $assignedSkillLevel[
'tref_id'];
 
  439                if ($this->skillQuestionAssignmentList->isAssignedSkill($skillBaseId, $skillTrefId)) {
 
  440                    unset($noProfileMatchingSkills[
"{$skillBaseId}:{$skillTrefId}"]);
 
  445        return count($noProfileMatchingSkills);
 
An exception for terminatinating execution or to throw for unit testing.
Class CompositeEvaluator.
Class ilParserQuestionProvider.
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.
static getProfilesOfUser($a_user_id)
Get profiles of a user.
drawUpSkillPointAccounts()
init(ilAssQuestionList $questionList)
initTestQuestionData(ilAssQuestionList $questionList)
calculateReachedSkillPointsFromTestPoints($skillPoints, $maxTestPoints, $reachedTestPoints)
getAssignedSkillMatchingSkillProfiles()
getNumRequiredBookingsForSkillTriggering()
initTestResultData($testResults)
determineReachedSkillPointsWithSolutionCompare(ilAssQuestionSolutionComparisonExpressionList $expressionList)
getSkillsInvolvedByAssignment()
evaluateSkillPointAccounts()
$skillQuestionAssignmentList
setNumRequiredBookingsForSkillTriggering($numRequiredBookingsForSkillTriggering)
noProfileMatchingAssignedSkillExists($availableSkillProfiles)
isAssignedSkill($skillBaseId, $skillTrefId)
bookToSkillPointAccount($skillBaseId, $skillTrefId, $maxSkillPoints, $reachedSkillPoints)
invokeSkillLevelTrigger($skillLevelId, $skillTrefId)
getSkillsMatchingNumAnswersBarrier()
isAnsweredQuestion($questionId)
doesNumBookingsExceedRequiredBookingsBarrier(ilTestSkillPointAccount $skillPointAccount)
$numRequiredBookingsForSkillTriggering
__construct(ilDBInterface $db, $testId, $refId)