ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilSurveySkillThresholds Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilSurveySkillThresholds:

Public Member Functions

 __construct (ilObjSurvey $a_survey)
 
 read ()
 
 getThresholds ()
 
 writeThreshold (int $a_base_skill_id, int $a_tref_id, int $a_level_id, int $a_threshold)
 
 cloneTo (ilObjSurvey $target_survey, array $mapping)
 

Protected Attributes

ilObjSurvey $survey
 
ilDBInterface $db
 
array $threshold = []
 

Detailed Description

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 tresholds for 360 surveys

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 23 of file class.ilSurveySkillThresholds.php.

Constructor & Destructor Documentation

◆ __construct()

ilSurveySkillThresholds::__construct ( ilObjSurvey  $a_survey)

Definition at line 30 of file class.ilSurveySkillThresholds.php.

31 {
32 global $DIC;
33
34 $this->db = $DIC->database();
35 $this->survey = $a_survey;
36 $this->read();
37 }
global $DIC
Definition: shib_login.php:26

References $DIC, and read().

+ Here is the call graph for this function:

Member Function Documentation

◆ cloneTo()

ilSurveySkillThresholds::cloneTo ( ilObjSurvey  $target_survey,
array  $mapping 
)

Definition at line 79 of file class.ilSurveySkillThresholds.php.

79 : void
80 {
81 $target_thresholds = new self($target_survey);
82 $set = $this->db->queryF(
83 "SELECT * FROM svy_skill_threshold " .
84 " WHERE survey_id = %s ",
85 ["integer"],
86 [$this->survey->getId()]
87 );
88 while ($rec = $this->db->fetchAssoc($set)) {
89 $target_thresholds->writeThreshold(
90 (int) $rec["base_skill_id"],
91 (int) $rec["tref_id"],
92 (int) $rec["level_id"],
93 (int) $rec["threshold"]
94 );
95 }
96 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getThresholds()

ilSurveySkillThresholds::getThresholds ( )
Returns
array<int, array<int, int>>

Definition at line 55 of file class.ilSurveySkillThresholds.php.

55 : array
56 {
57 return $this->threshold;
58 }

References $threshold.

◆ read()

ilSurveySkillThresholds::read ( )

Definition at line 39 of file class.ilSurveySkillThresholds.php.

39 : void
40 {
42
43 $set = $ilDB->query(
44 "SELECT * FROM svy_skill_threshold " .
45 " WHERE survey_id = " . $ilDB->quote($this->survey->getId(), "integer")
46 );
47 while ($rec = $ilDB->fetchAssoc($set)) {
48 $this->threshold[(int) $rec['level_id']][(int) $rec['tref_id']] = (int) $rec['threshold'];
49 }
50 }

References $db, $ilDB, and ILIAS\Repository\int().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeThreshold()

ilSurveySkillThresholds::writeThreshold ( int  $a_base_skill_id,
int  $a_tref_id,
int  $a_level_id,
int  $a_threshold 
)

Definition at line 60 of file class.ilSurveySkillThresholds.php.

65 : void {
67
68 $ilDB->replace(
69 "svy_skill_threshold",
70 array("survey_id" => array("integer", $this->survey->getId()),
71 "base_skill_id" => array("integer", $a_base_skill_id),
72 "tref_id" => array("integer", $a_tref_id),
73 "level_id" => array("integer", $a_level_id)
74 ),
75 array("threshold" => array("integer", $a_threshold))
76 );
77 }

Field Documentation

◆ $db

ilDBInterface ilSurveySkillThresholds::$db
protected

Definition at line 26 of file class.ilSurveySkillThresholds.php.

Referenced by read().

◆ $survey

ilObjSurvey ilSurveySkillThresholds::$survey
protected

Definition at line 25 of file class.ilSurveySkillThresholds.php.

◆ $threshold

array ilSurveySkillThresholds::$threshold = []
protected

Definition at line 28 of file class.ilSurveySkillThresholds.php.

Referenced by getThresholds().


The documentation for this class was generated from the following file: