ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 ?>