25 $this->survey = $a_survey;
39 $set = $ilDB->query(
"SELECT * FROM svy_quest_skill ".
40 " WHERE survey_id = ".$ilDB->quote($this->survey->getId(),
"integer")
43 include_once(
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php");
45 while ($rec = $ilDB->fetchAssoc($set))
49 $this->q_skill[$rec[
"q_id"]] = array(
"q_id" => $rec[
"q_id"],
50 "base_skill_id" => $rec[
"base_skill_id"],
51 "tref_id" => $rec[
"tref_id"]);
64 if (isset($this->q_skill[$a_question_id]))
66 return $this->q_skill[$a_question_id];
80 foreach ($this->q_skill as $q_id => $s)
82 if ($s[
"base_skill_id"] == $a_base_skill_id &&
83 $s[
"tref_id"] == $a_tref_id)
103 $ilDB->replace(
"svy_quest_skill",
104 array(
"q_id" => array(
"integer", $a_question_id)),
106 "survey_id" => array(
"integer", $this->survey->getId()),
107 "base_skill_id" => array(
"integer", $a_base_skill_id),
108 "tref_id" => array(
"integer", $a_tref_id)
111 $this->q_skill[$a_question_id] = array(
"q_id" => $a_question_id,
112 "base_skill_id" => $a_base_skill_id,
113 "tref_id" => $a_tref_id);
116 include_once(
"./Services/Skill/classes/class.ilSkillUsage.php");
131 $set = $ilDB->query(
"SELECT * FROM svy_quest_skill ".
132 " WHERE q_id = ".$ilDB->quote($a_question_id,
"integer")
135 while ($rec = $ilDB->fetchAssoc($set))
137 $skills[] = array(
"skill_id" => $rec[
"base_skill_id"],
138 "tref_id" => $rec[
"tref_id"]);
142 $ilDB->manipulate(
"DELETE FROM svy_quest_skill WHERE ".
143 " q_id = ".$ilDB->quote($a_question_id,
"integer")
145 unset($this->q_skill[$a_question_id]);
161 include_once
'./Modules/Survey/classes/class.ilObjSurvey.php';
164 $svy_skill->removeQuestionSkillAssignment($a_question_id);
176 $used_skills = array();
177 foreach ($a_skills as $skill)
181 $used_skills[] = $skill[
"skill_id"].
":".$skill[
"tref_id"];
187 include_once(
"./Services/Skill/classes/class.ilSkillUsage.php");
190 foreach ($a_skills as $skill)
192 if (!in_array($skill[
"skill_id"].
":".$skill[
"tref_id"], $used_skills))
209 $set = $ilDB->query(
"SELECT * FROM svy_quest_skill ".
210 " WHERE base_skill_id = ".$ilDB->quote($a_skill_id,
"integer").
211 " AND tref_id = ".$ilDB->quote($a_tref_id,
"integer").
212 " AND survey_id = ".$ilDB->quote($this->survey->getId(),
"integer")
214 if ($rec = $ilDB->fetchAssoc($set))
231 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
232 foreach ($this->q_skill as $sk)
234 $skills[$sk[
"base_skill_id"].
":".$sk[
"tref_id"]] =
252 foreach ($opts as $k => $title)
254 $k = explode(
":", $k);
257 $ld = $bs->getLevelData();
260 "base_skill_id" => (
int) $k[0],
261 "tref_id" => (
int) $k[1],
262 "skill_title" => $title,
269 $finished_ids = $this->survey->getFinishedIdsForAppraiseeId($a_appraisee_id,
true);
273 $finished_id = $this->survey->getFinishedIdForAppraiseeIdAndRaterId($a_appraisee_id, $a_appraisee_id);
274 if ($finished_id > 0)
276 $finished_ids = array($finished_id);
280 if(!
sizeof($finished_ids))
282 $finished_ids = array(-1);
285 $results = $this->survey->getUserSpecificResults($finished_ids);
286 foreach ($skills as $k => $s)
290 foreach ($q_ids as $q_id)
301 $r = explode(
" - ", $r);
312 $skills[$k][
"mean_sum"] = $mean_sum;
314 include_once(
"./Modules/Survey/classes/class.ilSurveySkillThresholds.php");
316 $thresholds = $skthr->getThresholds();
317 foreach ($skills[$k][
"level_data"] as $l)
319 $t = $thresholds[$l[
"id"]][$s[
"tref_id"]];
320 if (
$t > 0 && $mean_sum >=
$t)
322 $skills[$k][
"new_level"] = $l[
"title"];
323 $skills[$k][
"new_level_id"] = $l[
"id"];
340 include_once(
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php");
341 include_once(
"./Modules/Survey/classes/class.ilSurveySkill.php");
343 $question_ids = $ssk->getQuestionsForSkill($a_base_skill, $a_tref_id);
345 foreach ($question_ids as $q_id)
352 $cats = $q->getCategories();
354 for($i = 0; $i<= $cats->getCategoryCount(); $i++)
356 $c = $cats->getCategory($i);
361 if ($c->scale > $max_scale)
363 $max_scale = $c->scale;
367 $scale_sum+= $max_scale;
383 foreach ($new_levels as $nl)
385 if ($nl[
"new_level_id"] > 0)