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()])) {
100 $this->assignments[$assignment->
getQuestionId()][] = $assignment;
107 if (!isset($this->numAssignsBySkill[
$key])) {
108 $this->numAssignsBySkill[
$key] = 0;
111 $this->numAssignsBySkill[
$key]++;
118 if (!isset($this->maxPointsBySkill[
$key])) {
119 $this->maxPointsBySkill[
$key] = 0;
129 $res = $this->db->query(
" 130 SELECT obj_fi, question_fi, skill_base_fi, skill_tref_fi, skill_points, eval_mode 131 FROM qpl_qst_skl_assigns 132 WHERE {$this->getWhereConditions()} 135 while (
$row = $this->db->fetchAssoc(
$res)) {
138 if ($assignment->hasEvalModeBySolution()) {
139 $assignment->loadComparisonExpressions();
151 'obj_fi = ' . $this->db->quote($this->getParentObjId(),
'integer')
155 $conditions[] =
'question_fi = ' . $this->db->quote($this->
getQuestionIdFilter(),
'integer');
158 return implode(
' AND ', $conditions);
169 $assignment->setParentObjId(
$data[
'obj_fi']);
170 $assignment->setQuestionId(
$data[
'question_fi']);
171 $assignment->setSkillBaseId(
$data[
'skill_base_fi']);
172 $assignment->setSkillTrefId(
$data[
'skill_tref_fi']);
173 $assignment->setSkillPoints(
$data[
'skill_points']);
174 $assignment->setEvalMode(
$data[
'eval_mode']);
181 return $skillBaseId .
':' . $skillTrefId;
186 foreach ($this->assignments as $assignmentsByQuestion) {
187 foreach ($assignmentsByQuestion as $assignment) {
188 $assignment->loadAdditionalSkillData();
195 if (!isset($this->assignments[$questionId])) {
199 return $this->assignments[$questionId];
204 if (!isset($this->assignments[$questionId])) {
208 foreach ($this->assignments[$questionId] as $assignment) {
209 if ($assignment->getSkillBaseId() != $skillBaseId) {
213 if ($assignment->getSkillTrefId() != $skillTrefId) {
225 require_once
'Services/Skill/classes/class.ilBasicSkill.php';
229 foreach ($this->assignments as $assignmentsByQuestion) {
230 foreach ($assignmentsByQuestion as $assignment) {
233 $key = $this->
buildSkillKey($assignment->getSkillBaseId(), $assignment->getSkillTrefId());
235 if (!isset($skills[
$key])) {
237 'skill' =>
new ilBasicSkill($assignment->getSkillBaseId()),
238 'skill_base_id' => $assignment->getSkillBaseId(),
239 'skill_tref_id' => $assignment->getSkillTrefId(),
240 'skill_title' => $assignment->getSkillTitle(),
241 'skill_path' => $assignment->getSkillPath(),
243 $assignment->getSkillBaseId(),
244 $assignment->getSkillTrefId()
247 $assignment->getSkillBaseId(),
248 $assignment->getSkillTrefId()
261 if ($assignedSkill[
'skill_base_id'] != $skillBaseId) {
265 if ($assignedSkill[
'skill_tref_id'] == $skillTrefId) {
275 return $this->numAssignsBySkill[$this->
buildSkillKey($skillBaseId, $skillTrefId)];
280 return $this->maxPointsBySkill[$this->
buildSkillKey($skillBaseId, $skillTrefId)];
285 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
289 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)
foreach($_POST as $key=> $value) $res
buildSkillQuestionAssignmentByArray($data)
isAssignedSkill($skillBaseId, $skillTrefId)
getUniqueAssignedSkills()
Create styles array
The data for the language used.
static getSkillTriggerAnswerNumberBarrier()
isAssignedToQuestionId($skillBaseId, $skillTrefId, $questionId)
incrementNumAssignsBySkill(ilAssQuestionSkillAssignment $assignment)