ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilSurveySkillThresholds.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
14
21 function __construct(ilObjSurvey $a_survey)
22 {
23 $this->survey = $a_survey;
24 $this->read();
25 }
26
33 function read()
34 {
35 global $ilDB;
36
37 $set = $ilDB->query("SELECT * FROM svy_skill_threshold ".
38 " WHERE survey_id = ".$ilDB->quote($this->survey->getId(), "integer")
39 );
40 while ($rec = $ilDB->fetchAssoc($set))
41 {
42 $this->threshold[$rec['level_id']][$rec['tref_id']] =
43 $rec['threshold'];
44 }
45 }
46
53 function getThresholds()
54 {
55 return $this->threshold;
56 }
57
64 function writeThreshold($a_base_skill_id, $a_tref_id, $a_level_id, $a_threshold)
65 {
66 global $ilDB;
67
68 $ilDB->replace("svy_skill_threshold",
69 array("survey_id" => array("integer", $this->survey->getId()),
70 "base_skill_id" => array("integer", (int) $a_base_skill_id),
71 "tref_id" => array("integer", (int) $a_tref_id),
72 "level_id" => array("integer", (int) $a_level_id)
73 ),
74 array("threshold" => array("integer", (int) $a_threshold))
75 );
76 }
77
78}
79
80?>
Skill tresholds for 360 surveys.
writeThreshold($a_base_skill_id, $a_tref_id, $a_level_id, $a_threshold)
Write threshold.
__construct(ilObjSurvey $a_survey)
Constructor.
global $ilDB