This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
|
| __construct (ilObjSurvey $a_survey) |
|
| read () |
|
| getSkillForQuestion (int $a_question_id) |
| Get skill for question. More...
|
|
| getQuestionsForSkill (int $a_base_skill_id, int $a_tref_id) |
| Get questions for skill. More...
|
|
| addQuestionSkillAssignment (int $a_question_id, int $a_base_skill_id, int $a_tref_id) |
| Add survey question to skill assignment. More...
|
|
| removeQuestionSkillAssignment (int $a_question_id) |
|
| removeUsagesOfSkills (array $a_skills) |
| Remove usages of skills This function checks, if the skills are really not in use anymore. More...
|
|
| isSkillAssignedToQuestion (int $a_skill_id, int $a_tref_id) |
|
| getAllAssignedSkillsAsOptions () |
|
| determineSkillLevelsForAppraisee (int $a_appraisee_id, bool $a_self_eval=false, int $finished_id=0) |
| Determine skill levels for appraisee. More...
|
|
| determineMaxScale (int $a_base_skill, int $a_tref_id=0) |
|
| writeAndAddAppraiseeSkills (int $user_id) |
| Write appraisee skills and add them to user's competence records. More...
|
|
| writeAndAddIndFeedbackSkills (int $finished_id, int $appr_id, string $rater_id) |
|
| writeAndAddSelfEvalSkills (int $user_id) |
| Write skills on self evaluation and add them to user's competence records. More...
|
|
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Skill/Competence handling in surveys
- Author
- Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Definition at line 23 of file class.ilSurveySkill.php.
◆ __construct()
Definition at line 37 of file class.ilSurveySkill.php.
References $DIC, ilLoggerFactory\getLogger(), and read().
41 $this->db = $DIC->database();
42 $this->survey = $a_survey;
45 $this->skill_profile_service = $DIC->skills()->profile();
46 $this->skill_personal_service = $DIC->skills()->personal();
47 $this->skill_usage_service = $DIC->skills()->usage();
static getLogger(string $a_component_id)
Get component logger.
◆ addQuestionSkillAssignment()
ilSurveySkill::addQuestionSkillAssignment |
( |
int |
$a_question_id, |
|
|
int |
$a_base_skill_id, |
|
|
int |
$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 106 of file class.ilSurveySkill.php.
References $db, and $ilDB.
115 array(
"q_id" => array(
"integer", $a_question_id)),
117 "survey_id" => array(
"integer", $this->survey->getId()),
118 "base_skill_id" => array(
"integer", $a_base_skill_id),
119 "tref_id" => array(
"integer", $a_tref_id)
122 $this->q_skill[$a_question_id] = array(
123 "q_id" => $a_question_id,
124 "base_skill_id" => $a_base_skill_id,
125 "tref_id" => $a_tref_id
129 $this->skill_usage_service->addUsage($this->survey->getId(), $a_base_skill_id, $a_tref_id);
◆ determineMaxScale()
ilSurveySkill::determineMaxScale |
( |
int |
$a_base_skill, |
|
|
int |
$a_tref_id = 0 |
|
) |
| |
Definition at line 340 of file class.ilSurveySkill.php.
References $c, $q, and SurveyQuestion\_instanciateQuestion().
345 $question_ids = $ssk->getQuestionsForSkill($a_base_skill, $a_tref_id);
347 foreach ($question_ids as $q_id) {
349 if (!is_object(
$q)) {
352 $cats =
$q->getCategories();
354 for ($i = 0; $i < $cats->getCategoryCount(); $i++) {
355 $c = $cats->getCategory($i);
359 if (
$c->scale > $max_scale) {
360 $max_scale =
$c->scale;
364 $scale_sum += $max_scale;
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _instanciateQuestion(int $question_id)
Get question object.
◆ determineSkillLevelsForAppraisee()
ilSurveySkill::determineSkillLevelsForAppraisee |
( |
int |
$a_appraisee_id, |
|
|
bool |
$a_self_eval = false , |
|
|
int |
$finished_id = 0 |
|
) |
| |
Determine skill levels for appraisee.
- Returns
- array array with lots of information
- Todo:
- introduce dto
Definition at line 242 of file class.ilSurveySkill.php.
References $results, getAllAssignedSkillsAsOptions(), getQuestionsForSkill(), and null.
Referenced by writeAndAddAppraiseeSkills(), writeAndAddIndFeedbackSkills(), and writeAndAddSelfEvalSkills().
251 foreach ($opts as $k => $title) {
252 $k = explode(
":", $k);
255 $ld = $bs->getLevelData();
258 "base_skill_id" => (
int) $k[0],
259 "tref_id" => (
int) $k[1],
260 "skill_title" => $title,
267 if ($finished_id > 0) {
268 $finished_ids = array($finished_id);
270 $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) {
275 $finished_ids = array($finished_id);
284 $results = $this->survey->getUserSpecificResults($finished_ids);
285 $this->log->debug(
"Finished IDS: " . print_r($finished_ids,
true));
286 foreach ($skills as $k => $s) {
288 $this->log->debug(
"Skill: " . $s[
"base_skill_id"] .
":" . $s[
"tref_id"] .
", Questions: " . implode(
",", $q_ids));
290 foreach ($q_ids as $q_id) {
295 foreach (
$results[$q_id] as $uid => $answer) {
300 $scale_values = array_keys($answer);
301 $this->log->debug(
"User answer (scale values): " . print_r($scale_values,
true));
302 $sum += array_sum($scale_values);
303 $cnt += count($scale_values);
306 $qmean = $sum / $cnt;
308 $this->log->debug(
"MEAN: " . $qmean);
311 $this->log->debug(
"MEAN SUM: " . $mean_sum);
313 $skills[$k][
"mean_sum"] = $mean_sum;
316 $thresholds = $skthr->getThresholds();
319 foreach ($skills[$k][
"level_data"] as $l) {
320 $t = $thresholds[$l[
"id"]][$s[
"tref_id"]] ?? 0;
321 if ($t > 0 && $mean_sum >= $t) {
322 $skills[$k][
"new_level"] = $l[
"title"];
323 $skills[$k][
"new_level_id"] = $l[
"id"];
324 $skills[$k][
"next_level_perc"] = 0;
325 } elseif ($t > 0 && $mean_sum < $t) {
327 if ($previous == ($skills[$k][
"new_level_id"] ??
null) && !isset($skills[$k][
"next_level_perc"])) {
328 $skills[$k][
"next_level_perc"] = 1 / ($t - $previous_t) * ($mean_sum - $previous_t);
332 $previous = $l[
"id"];
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getQuestionsForSkill(int $a_base_skill_id, int $a_tref_id)
Get questions for skill.
getAllAssignedSkillsAsOptions()
◆ getAllAssignedSkillsAsOptions()
ilSurveySkill::getAllAssignedSkillsAsOptions |
( |
| ) |
|
◆ getQuestionsForSkill()
ilSurveySkill::getQuestionsForSkill |
( |
int |
$a_base_skill_id, |
|
|
int |
$a_tref_id |
|
) |
| |
◆ getSkillForQuestion()
ilSurveySkill::getSkillForQuestion |
( |
int |
$a_question_id | ) |
|
Get skill for question.
- Parameters
-
int | $a_question_id | question id |
- Returns
- ?array{q_id: int, base_skill_id: int, tref_id: int} skill array
Definition at line 75 of file class.ilSurveySkill.php.
References null.
78 return $this->q_skill[$a_question_id] ??
null;
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
◆ handleQuestionDeletion()
static ilSurveySkill::handleQuestionDeletion |
( |
int |
$a_question_id, |
|
|
int |
$a_obj_id |
|
) |
| |
|
static |
Remove question skill assignment.
Definition at line 163 of file class.ilSurveySkill.php.
References ilObject\_exists(), ilObject\_lookupType(), and ilLoggerFactory\getLogger().
Referenced by SurveyQuestion\delete().
169 $svy_log->debug(
"delete skill assignment, obj id " . $a_obj_id .
174 $svy_log->debug(
"call removeQuestionSkillAssignment.");
178 $svy_skill->removeQuestionSkillAssignment($a_question_id);
static getLogger(string $a_component_id)
Get component logger.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _lookupType(int $id, bool $reference=false)
◆ isSkillAssignedToQuestion()
ilSurveySkill::isSkillAssignedToQuestion |
( |
int |
$a_skill_id, |
|
|
int |
$a_tref_id |
|
) |
| |
Definition at line 206 of file class.ilSurveySkill.php.
References $db, and $ilDB.
Referenced by removeUsagesOfSkills().
213 "SELECT * FROM svy_quest_skill " .
214 " WHERE base_skill_id = " .
$ilDB->quote($a_skill_id,
"integer") .
215 " AND tref_id = " .
$ilDB->quote($a_tref_id,
"integer") .
216 " AND survey_id = " .
$ilDB->quote($this->survey->getId(),
"integer")
218 if ($rec =
$ilDB->fetchAssoc($set)) {
◆ read()
◆ removeQuestionSkillAssignment()
ilSurveySkill::removeQuestionSkillAssignment |
( |
int |
$a_question_id | ) |
|
Definition at line 132 of file class.ilSurveySkill.php.
References $db, $ilDB, and removeUsagesOfSkills().
139 "SELECT * FROM svy_quest_skill " .
140 " WHERE q_id = " .
$ilDB->quote($a_question_id,
"integer")
143 while ($rec =
$ilDB->fetchAssoc($set)) {
145 "skill_id" => $rec[
"base_skill_id"],
146 "tref_id" => $rec[
"tref_id"]
152 "DELETE FROM svy_quest_skill WHERE " .
153 " q_id = " .
$ilDB->quote($a_question_id,
"integer")
155 unset($this->q_skill[$a_question_id]);
removeUsagesOfSkills(array $a_skills)
Remove usages of skills This function checks, if the skills are really not in use anymore...
◆ removeUsagesOfSkills()
ilSurveySkill::removeUsagesOfSkills |
( |
array |
$a_skills | ) |
|
Remove usages of skills This function checks, if the skills are really not in use anymore.
- Parameters
-
array | $a_skills | array of arrays with keys "skill_id" and "tref_id" |
Definition at line 187 of file class.ilSurveySkill.php.
References isSkillAssignedToQuestion().
Referenced by removeQuestionSkillAssignment().
190 $used_skills = array();
191 foreach ($a_skills as $skill) {
193 $used_skills[] = $skill[
"skill_id"] .
":" . $skill[
"tref_id"];
199 foreach ($a_skills as $skill) {
200 if (!in_array($skill[
"skill_id"] .
":" . $skill[
"tref_id"], $used_skills,
true)) {
201 $this->skill_usage_service->removeUsage($this->survey->getId(), $skill[
"skill_id"], $skill[
"tref_id"]);
isSkillAssignedToQuestion(int $a_skill_id, int $a_tref_id)
◆ writeAndAddAppraiseeSkills()
ilSurveySkill::writeAndAddAppraiseeSkills |
( |
int |
$user_id | ) |
|
Write appraisee skills and add them to user's competence records.
Definition at line 373 of file class.ilSurveySkill.php.
References ilBasicSkill\ACHIEVED, determineSkillLevelsForAppraisee(), ILIAS\Repository\int(), writeAndAddSelfEvalSkills(), and ilBasicSkill\writeUserSkillLevelStatus().
378 foreach ($new_levels as $nl) {
379 if (($nl[
"new_level_id"] ?? 0) > 0) {
381 (
int) $nl[
"new_level_id"],
383 $this->survey->getRefId(),
384 (
int) $nl[
"tref_id"],
389 $nl[
"next_level_perc"]
392 if (($nl[
"tref_id"] ?? 0) > 0) {
393 $this->skill_personal_service->addPersonalSkill(
$user_id, (
int) $nl[
"tref_id"]);
395 $this->skill_personal_service->addPersonalSkill(
$user_id, (
int) $nl[
"base_skill_id"]);
401 $this->skill_profile_service->writeCompletionEntryForAllProfiles(
$user_id);
determineSkillLevelsForAppraisee(int $a_appraisee_id, bool $a_self_eval=false, int $finished_id=0)
Determine skill levels for appraisee.
writeAndAddSelfEvalSkills(int $user_id)
Write skills on self evaluation and add them to user's competence records.
static writeUserSkillLevelStatus(int $a_level_id, int $a_user_id, int $a_trigger_ref_id, int $a_tref_id=0, int $a_status=ilBasicSkill::ACHIEVED, bool $a_force=false, bool $a_self_eval=false, string $a_unique_identifier="", float $a_next_level_fulfilment=0.0, string $trigger_user_id="")
◆ writeAndAddIndFeedbackSkills()
ilSurveySkill::writeAndAddIndFeedbackSkills |
( |
int |
$finished_id, |
|
|
int |
$appr_id, |
|
|
string |
$rater_id |
|
) |
| |
Definition at line 407 of file class.ilSurveySkill.php.
References ilBasicSkill\ACHIEVED, determineSkillLevelsForAppraisee(), ILIAS\Repository\int(), and ilBasicSkill\writeUserSkillLevelStatus().
413 foreach ($new_levels as $nl) {
414 if (($nl[
"new_level_id"] ?? 0) > 0) {
416 (
int) $nl[
"new_level_id"],
418 $this->survey->getRefId(),
419 (
int) $nl[
"tref_id"],
424 $nl[
"next_level_perc"],
428 if (($nl[
"tref_id"] ?? 0) > 0) {
429 $this->skill_personal_service->addPersonalSkill($appr_id, (
int) $nl[
"tref_id"]);
431 $this->skill_personal_service->addPersonalSkill($appr_id, (
int) $nl[
"base_skill_id"]);
determineSkillLevelsForAppraisee(int $a_appraisee_id, bool $a_self_eval=false, int $finished_id=0)
Determine skill levels for appraisee.
static writeUserSkillLevelStatus(int $a_level_id, int $a_user_id, int $a_trigger_ref_id, int $a_tref_id=0, int $a_status=ilBasicSkill::ACHIEVED, bool $a_force=false, bool $a_self_eval=false, string $a_unique_identifier="", float $a_next_level_fulfilment=0.0, string $trigger_user_id="")
◆ writeAndAddSelfEvalSkills()
ilSurveySkill::writeAndAddSelfEvalSkills |
( |
int |
$user_id | ) |
|
Write skills on self evaluation and add them to user's competence records.
Definition at line 440 of file class.ilSurveySkill.php.
References ilBasicSkill\ACHIEVED, determineSkillLevelsForAppraisee(), ILIAS\Repository\int(), ilObjSurvey\MODE_360, ilObjSurvey\MODE_SELF_EVAL, and ilBasicSkill\writeUserSkillLevelStatus().
Referenced by writeAndAddAppraiseeSkills().
445 foreach ($new_levels as $nl) {
446 if (($nl[
"new_level_id"] ?? 0) > 0) {
448 (
int) $nl[
"new_level_id"],
450 $this->survey->getRefId(),
451 (
int) $nl[
"tref_id"],
456 $nl[
"next_level_perc"]
459 if (($nl[
"tref_id"] ?? 0) > 0) {
460 $this->skill_personal_service->addPersonalSkill(
$user_id, (
int) $nl[
"tref_id"]);
462 $this->skill_personal_service->addPersonalSkill(
$user_id, (
int) $nl[
"base_skill_id"]);
determineSkillLevelsForAppraisee(int $a_appraisee_id, bool $a_self_eval=false, int $finished_id=0)
Determine skill levels for appraisee.
static writeUserSkillLevelStatus(int $a_level_id, int $a_user_id, int $a_trigger_ref_id, int $a_tref_id=0, int $a_status=ilBasicSkill::ACHIEVED, bool $a_force=false, bool $a_self_eval=false, string $a_unique_identifier="", float $a_next_level_fulfilment=0.0, string $trigger_user_id="")
◆ $db
◆ $log
◆ $q_skill
array ilSurveySkill::$q_skill = array() |
|
protected |
◆ $skill_personal_service
ILIAS Skill Service SkillPersonalService ilSurveySkill::$skill_personal_service |
|
protected |
◆ $skill_profile_service
ILIAS Skill Service SkillProfileService ilSurveySkill::$skill_profile_service |
|
protected |
◆ $skill_usage_service
ILIAS Skill Service SkillUsageService ilSurveySkill::$skill_usage_service |
|
protected |
◆ $survey
The documentation for this class was generated from the following file: