Skill/Competence handling in surveys.
More...
Skill/Competence handling in surveys.
- Author
- Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
- Version
- $Id$
Definition at line 12 of file class.ilSurveySkill.php.
◆ __construct()
◆ addQuestionSkillAssignment()
ilSurveySkill::addQuestionSkillAssignment |
( |
|
$a_question_id, |
|
|
|
$a_base_skill_id, |
|
|
|
$a_tref_id |
|
) |
| |
Add survey question to skill assignment.
- Parameters
-
int | $a_question_id | question id |
int | $a_base_skill_id | base skill id |
int | $a_tref_id | skill template reference id (0, if no template involved) |
Definition at line 104 of file class.ilSurveySkill.php.
References $ilDB, array, and ilSkillUsage\setUsage().
108 $ilDB->replace(
"svy_quest_skill",
109 array(
"q_id" =>
array(
"integer", $a_question_id)),
111 "survey_id" =>
array(
"integer", $this->survey->getId()),
112 "base_skill_id" =>
array(
"integer", $a_base_skill_id),
113 "tref_id" =>
array(
"integer", $a_tref_id)
116 $this->q_skill[$a_question_id] =
array(
"q_id" => $a_question_id,
117 "base_skill_id" => $a_base_skill_id,
118 "tref_id" => $a_tref_id);
121 include_once(
"./Services/Skill/classes/class.ilSkillUsage.php");
static setUsage($a_obj_id, $a_skill_id, $a_tref_id, $a_use=true)
Set usage.
Create styles array
The data for the language used.
◆ determineMaxScale()
ilSurveySkill::determineMaxScale |
( |
|
$a_base_skill, |
|
|
|
$a_tref_id = 0 |
|
) |
| |
Determine max scales and questions.
- Parameters
-
Definition at line 349 of file class.ilSurveySkill.php.
References $n, and SurveyQuestion\_instanciateQuestion().
351 include_once(
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php");
352 include_once(
"./Modules/Survey/classes/class.ilSurveySkill.php");
354 $question_ids = $ssk->getQuestionsForSkill($a_base_skill, $a_tref_id);
356 foreach ($question_ids as $q_id)
363 $cats = $q->getCategories();
365 for($i = 0; $i<= $cats->getCategoryCount(); $i++)
367 $c = $cats->getCategory($i);
372 if ($c->scale > $max_scale)
374 $max_scale = $c->scale;
378 $scale_sum+= $max_scale;
Skill/Competence handling in surveys.
static _instanciateQuestion($question_id)
Creates an instance of a question with a given question id.
◆ determineSkillLevelsForAppraisee()
ilSurveySkill::determineSkillLevelsForAppraisee |
( |
|
$a_appraisee_id, |
|
|
|
$a_self_eval = false |
|
) |
| |
Determine skill levels for appraisee.
- Parameters
-
$a_appraisee_id | int user id of appraisee |
- Returns
- array array with lots of information
Definition at line 251 of file class.ilSurveySkill.php.
References $l, $ld, $results, $t, $title, array, getAllAssignedSkillsAsOptions(), and getQuestionsForSkill().
Referenced by writeAppraiseeSkills().
257 foreach ($opts as $k =>
$title)
259 $k = explode(
":", $k);
262 $ld = $bs->getLevelData();
265 "base_skill_id" => (
int) $k[0],
266 "tref_id" => (
int) $k[1],
274 $finished_ids = $this->survey->getFinishedIdsForAppraiseeId($a_appraisee_id,
true);
278 $finished_id = $this->survey->getFinishedIdForAppraiseeIdAndRaterId($a_appraisee_id, $a_appraisee_id);
279 if ($finished_id > 0)
281 $finished_ids =
array($finished_id);
285 if(!
sizeof($finished_ids))
287 $finished_ids =
array(-1);
290 $results = $this->survey->getUserSpecificResults($finished_ids);
291 $this->log->debug(
"Finished IDS: ".print_r($finished_ids,
true));
292 foreach ($skills as $k => $s)
295 $this->log->debug(
"Skill: ".$s[
"base_skill_id"].
":".$s[
"tref_id"].
", Questions: ".implode(
",",$q_ids));
297 foreach ($q_ids as $q_id)
304 foreach (
$results[$q_id] as $uid => $answer)
310 $scale_values = array_keys($answer);
311 $this->log->debug(
"User answer (scale values): ".print_r($scale_values,
true));
312 $sum += array_sum($scale_values);
313 $cnt +=
sizeof($scale_values);
319 $this->log->debug(
"MEAN: ".$qmean);
322 $this->log->debug(
"MEAN SUM: ".$mean_sum);
324 $skills[$k][
"mean_sum"] = $mean_sum;
326 include_once(
"./Modules/Survey/classes/class.ilSurveySkillThresholds.php");
328 $thresholds = $skthr->getThresholds();
329 foreach ($skills[$k][
"level_data"] as
$l)
331 $t = $thresholds[$l[
"id"]][$s[
"tref_id"]];
332 if (
$t > 0 && $mean_sum >=
$t)
334 $skills[$k][
"new_level"] = $l[
"title"];
335 $skills[$k][
"new_level_id"] = $l[
"id"];
Skill tresholds for 360 surveys.
Create styles array
The data for the language used.
getAllAssignedSkillsAsOptions()
Get skill for question.
getQuestionsForSkill($a_base_skill_id, $a_tref_id)
Get questions for skill.
◆ getAllAssignedSkillsAsOptions()
ilSurveySkill::getAllAssignedSkillsAsOptions |
( |
| ) |
|
Get skill for question.
- Parameters
-
int | $a_question_id | question id |
- Returns
- array skill array
Definition at line 233 of file class.ilSurveySkill.php.
References ilSkillTreeNode\_lookupTitle(), and array.
Referenced by determineSkillLevelsForAppraisee().
236 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
237 foreach ($this->q_skill as $sk)
239 $skills[$sk[
"base_skill_id"].
":".$sk[
"tref_id"]] =
Create styles array
The data for the language used.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
◆ getQuestionsForSkill()
ilSurveySkill::getQuestionsForSkill |
( |
|
$a_base_skill_id, |
|
|
|
$a_tref_id |
|
) |
| |
Get questions for skill.
- Parameters
-
Definition at line 82 of file class.ilSurveySkill.php.
References array.
Referenced by determineSkillLevelsForAppraisee().
85 foreach ($this->q_skill as $q_id => $s)
87 if ($s[
"base_skill_id"] == $a_base_skill_id &&
88 $s[
"tref_id"] == $a_tref_id)
Create styles array
The data for the language used.
◆ getSkillForQuestion()
ilSurveySkill::getSkillForQuestion |
( |
|
$a_question_id | ) |
|
Get skill for question.
- Parameters
-
int | $a_question_id | question id |
- Returns
- array skill array
Definition at line 67 of file class.ilSurveySkill.php.
69 if (isset($this->q_skill[$a_question_id]))
71 return $this->q_skill[$a_question_id];
◆ handleQuestionDeletion()
static ilSurveySkill::handleQuestionDeletion |
( |
|
$a_question_id, |
|
|
|
$a_obj_id |
|
) |
| |
|
static |
Remove question skill assignment.
- Parameters
-
int | $a_question_id | question id |
Definition at line 160 of file class.ilSurveySkill.php.
References $ilDB, and ilObject\_lookupType().
Referenced by SurveyQuestion\delete().
166 include_once
'./Modules/Survey/classes/class.ilObjSurvey.php';
169 $svy_skill->removeQuestionSkillAssignment($a_question_id);
Skill/Competence handling in surveys.
static _lookupType($a_id, $a_reference=false)
lookup object type
◆ isSkillAssignedToQuestion()
ilSurveySkill::isSkillAssignedToQuestion |
( |
|
$a_skill_id, |
|
|
|
$a_tref_id |
|
) |
| |
Is skill assigned to any question?
- Parameters
-
Definition at line 210 of file class.ilSurveySkill.php.
References $ilDB.
Referenced by removeUsagesOfSkills().
214 $set = $ilDB->query(
"SELECT * FROM svy_quest_skill ".
215 " WHERE base_skill_id = ".$ilDB->quote($a_skill_id,
"integer").
216 " AND tref_id = ".$ilDB->quote($a_tref_id,
"integer").
217 " AND survey_id = ".$ilDB->quote($this->survey->getId(),
"integer")
219 if ($rec = $ilDB->fetchAssoc($set))
◆ read()
Read.
- Parameters
-
Definition at line 40 of file class.ilSurveySkill.php.
References $ilDB, SurveyQuestion\_questionExists(), and array.
Referenced by __construct().
44 $set = $ilDB->query(
"SELECT * FROM svy_quest_skill ".
45 " WHERE survey_id = ".$ilDB->quote($this->survey->getId(),
"integer")
48 include_once(
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php");
50 while ($rec = $ilDB->fetchAssoc($set))
54 $this->q_skill[$rec[
"q_id"]] =
array(
"q_id" => $rec[
"q_id"],
55 "base_skill_id" => $rec[
"base_skill_id"],
56 "tref_id" => $rec[
"tref_id"]);
static _questionExists($question_id)
Returns true if the question already exists in the database.
Create styles array
The data for the language used.
◆ removeQuestionSkillAssignment()
ilSurveySkill::removeQuestionSkillAssignment |
( |
|
$a_question_id | ) |
|
Remove question skill assignment.
- Parameters
-
int | $a_question_id | question id |
Definition at line 131 of file class.ilSurveySkill.php.
References $ilDB, array, and removeUsagesOfSkills().
136 $set = $ilDB->query(
"SELECT * FROM svy_quest_skill ".
137 " WHERE q_id = ".$ilDB->quote($a_question_id,
"integer")
140 while ($rec = $ilDB->fetchAssoc($set))
142 $skills[] =
array(
"skill_id" => $rec[
"base_skill_id"],
143 "tref_id" => $rec[
"tref_id"]);
147 $ilDB->manipulate(
"DELETE FROM svy_quest_skill WHERE ".
148 " q_id = ".$ilDB->quote($a_question_id,
"integer")
150 unset($this->q_skill[$a_question_id]);
removeUsagesOfSkills($a_skills)
Remove usages of skills.
Create styles array
The data for the language used.
◆ removeUsagesOfSkills()
ilSurveySkill::removeUsagesOfSkills |
( |
|
$a_skills | ) |
|
Remove usages of skills.
This function checks, if the skills are really not in use anymore
- Parameters
-
array | array of arrays with keys "skill_id" and "tref_id" |
Definition at line 179 of file class.ilSurveySkill.php.
References array, isSkillAssignedToQuestion(), and ilSkillUsage\setUsage().
Referenced by removeQuestionSkillAssignment().
181 $used_skills =
array();
182 foreach ($a_skills as $skill)
186 $used_skills[] = $skill[
"skill_id"].
":".$skill[
"tref_id"];
192 include_once(
"./Services/Skill/classes/class.ilSkillUsage.php");
195 foreach ($a_skills as $skill)
197 if (!in_array($skill[
"skill_id"].
":".$skill[
"tref_id"], $used_skills))
static setUsage($a_obj_id, $a_skill_id, $a_tref_id, $a_use=true)
Set usage.
isSkillAssignedToQuestion($a_skill_id, $a_tref_id)
Is skill assigned to any question?
Create styles array
The data for the language used.
◆ writeAppraiseeSkills()
ilSurveySkill::writeAppraiseeSkills |
( |
|
$a_app_id | ) |
|
Write appraisee skills.
- Parameters
-
Definition at line 390 of file class.ilSurveySkill.php.
References ilBasicSkill\ACHIEVED, determineSkillLevelsForAppraisee(), and ilBasicSkill\writeUserSkillLevelStatus().
394 foreach ($new_levels as $nl)
396 if ($nl[
"new_level_id"] > 0)
405 foreach ($new_levels as $nl)
407 if ($nl[
"new_level_id"] > 0)
determineSkillLevelsForAppraisee($a_appraisee_id, $a_self_eval=false)
Determine skill levels for appraisee.
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.
◆ $log
◆ $q_skill
ilSurveySkill::$q_skill = array() |
|
protected |
The documentation for this class was generated from the following file: