4 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignment.php';
48 $this->parentObjId = null;
49 $this->assignments =
array();
50 $this->numAssignsBySkill =
array();
51 $this->maxPointsBySkill =
array();
52 $this->questionIdFilter = null;
89 $this->assignments =
array();
90 $this->numAssignsBySkill =
array();
91 $this->maxPointsBySkill =
array();
96 if( !isset($this->assignments[$assignment->
getQuestionId()]) )
101 $this->assignments[$assignment->
getQuestionId()][] = $assignment;
108 if( !isset($this->numAssignsBySkill[$key]) )
110 $this->numAssignsBySkill[$key] = 0;
113 $this->numAssignsBySkill[$key]++;
120 if( !isset($this->maxPointsBySkill[$key]) )
122 $this->maxPointsBySkill[$key] = 0;
132 $res = $this->db->query(
" 133 SELECT obj_fi, question_fi, skill_base_fi, skill_tref_fi, skill_points, eval_mode 134 FROM qpl_qst_skl_assigns 135 WHERE {$this->getWhereConditions()} 138 while(
$row = $this->db->fetchAssoc(
$res) )
142 if( $assignment->hasEvalModeBySolution() )
144 $assignment->loadComparisonExpressions();
156 'obj_fi = '.$this->db->quote($this->getParentObjId(),
'integer')
161 $conditions[] =
'question_fi = '.$this->db->quote($this->
getQuestionIdFilter(),
'integer');
164 return implode(
' AND ', $conditions);
175 $assignment->setParentObjId(
$data[
'obj_fi']);
176 $assignment->setQuestionId(
$data[
'question_fi']);
177 $assignment->setSkillBaseId(
$data[
'skill_base_fi']);
178 $assignment->setSkillTrefId(
$data[
'skill_tref_fi']);
179 $assignment->setSkillPoints(
$data[
'skill_points']);
180 $assignment->setEvalMode(
$data[
'eval_mode']);
187 return $skillBaseId.
':'.$skillTrefId;
192 foreach($this->assignments as $assignmentsByQuestion)
194 foreach($assignmentsByQuestion as $assignment)
196 $assignment->loadAdditionalSkillData();
203 if( !isset($this->assignments[$questionId]) )
208 return $this->assignments[$questionId];
213 if( !isset($this->assignments[$questionId]) )
218 foreach($this->assignments[$questionId] as $assignment)
220 if( $assignment->getSkillBaseId() != $skillBaseId )
225 if( $assignment->getSkillTrefId() != $skillTrefId )
238 require_once
'Services/Skill/classes/class.ilBasicSkill.php';
242 foreach($this->assignments as $assignmentsByQuestion)
244 foreach($assignmentsByQuestion as $assignment)
248 $key = $this->
buildSkillKey($assignment->getSkillBaseId(), $assignment->getSkillTrefId());
250 if( !isset($skills[$key]) )
252 $skills[$key] =
array(
253 'skill' =>
new ilBasicSkill($assignment->getSkillBaseId()),
254 'skill_base_id' => $assignment->getSkillBaseId(),
255 'skill_tref_id' => $assignment->getSkillTrefId(),
256 'skill_title' => $assignment->getSkillTitle(),
257 'skill_path' => $assignment->getSkillPath(),
259 $assignment->getSkillBaseId(), $assignment->getSkillTrefId()
262 $assignment->getSkillBaseId(), $assignment->getSkillTrefId()
276 if( $assignedSkill[
'skill_base_id'] != $skillBaseId )
281 if( $assignedSkill[
'skill_tref_id'] == $skillTrefId )
292 return $this->numAssignsBySkill[$this->
buildSkillKey($skillBaseId, $skillTrefId)];
297 return $this->maxPointsBySkill[$this->
buildSkillKey($skillBaseId, $skillTrefId)];
302 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
307 if( $skillData[
'num_assigns'] < $globalBarrier )
incrementMaxPointsBySkill(ilAssQuestionSkillAssignment $assignment)
__construct(ilDBInterface $db)
getNumAssignsBySkill($skillBaseId, $skillTrefId)
loadAdditionalSkillData()
hasSkillsAssignedLowerThanBarrier()
getAssignmentsByQuestionId($questionId)
buildSkillKey($skillBaseId, $skillTrefId)
setQuestionIdFilter($questionIdFilter)
setParentObjId($parentObjId)
getMaxPointsBySkill($skillBaseId, $skillTrefId)
addAssignment(ilAssQuestionSkillAssignment $assignment)
buildSkillQuestionAssignmentByArray($data)
isAssignedSkill($skillBaseId, $skillTrefId)
getUniqueAssignedSkills()
Create styles array
The data for the language used.
static getSkillTriggerAnswerNumberBarrier()
isAssignedToQuestionId($skillBaseId, $skillTrefId, $questionId)
incrementNumAssignsBySkill(ilAssQuestionSkillAssignment $assignment)