ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSurveySkillThresholdsTableGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
5 include_once("./Services/Table/classes/class.ilTable2GUI.php");
6 
16 {
20  function __construct($a_parent_obj, $a_parent_cmd, $a_survey,
21  $a_base_skill_id, $a_tref_id)
22  {
23  global $ilCtrl, $lng, $ilAccess, $lng;
24 
25  $this->object = $a_survey;
26  $this->base_skill_id = $a_base_skill_id;
27  $this->tref_id = $a_tref_id;
28 
29 
31 
33  $lng->txt("survey_skill_nr_q").": ".count($this->question_ids).
34  ", ".$lng->txt("survey_skill_max_scale_points").": ".$this->scale_sum);
35 
36  include_once("./Modules/Survey/classes/class.ilSurveySkillThresholds.php");
37  $this->skill_thres = new ilSurveySkillThresholds($this->object);
38  $this->thresholds = $this->skill_thres->getThresholds();
39 
40  parent::__construct($a_parent_obj, $a_parent_cmd);
41 
42  include_once("./Modules/Survey/classes/class.ilSurveySkill.php");
43  $this->skill_survey = new ilSurveySkill($a_survey);
44  $this->setData($this->getLevels());
45  $this->setTitle(ilBasicSkill::_lookupTitle($this->base_skill_id, $this->tref_id));
46 
47  $this->addColumn($this->lng->txt("survey_skill_level"));
48  $this->addColumn($this->lng->txt("survey_up_to_x_points"));
49 
50  $this->setRowTemplate("tpl.svy_skill_threshold_row.html", "Modules/Survey");
51 
52 // $this->addMultiCommand("saveThresholds", $lng->txt("save"));
53  $this->addCommandButton("saveThresholds", $lng->txt("save"));
54  $this->setFormAction($ilCtrl->getFormAction($this->parent_obj));
55  }
56 
64  {
65  include_once("./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php");
66  include_once("./Modules/Survey/classes/class.ilSurveySkill.php");
67  $ssk = new ilSurveySkill($this->object);
68  $this->question_ids = $ssk->getQuestionsForSkill($this->base_skill_id,
69  $this->tref_id);
70  $this->scale_sum = $ssk->determineMaxScale($this->base_skill_id,
71  $this->tref_id);
72  }
73 
74 
81  function getLevels()
82  {
83  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
84  $bs = new ilBasicSkill($this->base_skill_id);
85  return $bs->getLevelData();
86  }
87 
88 
92  protected function fillRow($a_set)
93  {
94  global $lng, $ilCtrl;
95 
96  $this->tpl->setVariable("LEVEL", $a_set["title"]);
97  $this->tpl->setVariable("LEVEL_ID", $a_set["id"]);
98 
99  $tr = $this->thresholds[$a_set["id"]][$this->tref_id];
100  if ((int) $tr != 0)
101  {
102  $this->tpl->setVariable("THRESHOLD", (int) $tr);
103  }
104  else
105  {
106  $this->tpl->setVariable("THRESHOLD", "");
107  }
108  }
109 
110 }
111 ?>