ILIAS  release_7 Revision v7.30-3-g800a261c036
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
11{
15 public function __construct(
16 $a_parent_obj,
17 $a_parent_cmd,
18 $a_survey,
19 $a_base_skill_id,
20 $a_tref_id
21 ) {
22 global $DIC;
23
24 $this->ctrl = $DIC->ctrl();
25 $this->lng = $DIC->language();
26 $ilCtrl = $DIC->ctrl();
27 $lng = $DIC->language();
28
29 $this->object = $a_survey;
30 $this->base_skill_id = $a_base_skill_id;
31 $this->tref_id = $a_tref_id;
32
33
35
37 $lng->txt("survey_skill_nr_q") . ": " . count($this->question_ids) .
38 ", " . $lng->txt("survey_skill_max_scale_points") . ": " . $this->scale_sum
39 );
40
41 $this->skill_thres = new ilSurveySkillThresholds($this->object);
42 $this->thresholds = $this->skill_thres->getThresholds();
43
44 parent::__construct($a_parent_obj, $a_parent_cmd);
45
46 $this->skill_survey = new ilSurveySkill($a_survey);
47 $this->setData($this->getLevels());
48 $this->setTitle(ilBasicSkill::_lookupTitle($this->base_skill_id, $this->tref_id));
49
50 $this->addColumn($this->lng->txt("survey_skill_level"));
51 $this->addColumn($this->lng->txt("survey_up_to_x_points"));
52
53 $this->setRowTemplate("tpl.svy_skill_threshold_row.html", "Modules/Survey");
54
55 // $this->addMultiCommand("saveThresholds", $lng->txt("save"));
56 $this->addCommandButton("saveThresholds", $lng->txt("save"));
57 $this->setFormAction($ilCtrl->getFormAction($this->parent_obj));
58 }
59
67 {
68 $ssk = new ilSurveySkill($this->object);
69 $this->question_ids = $ssk->getQuestionsForSkill(
70 $this->base_skill_id,
71 $this->tref_id
72 );
73 $this->scale_sum = $ssk->determineMaxScale(
74 $this->base_skill_id,
75 $this->tref_id
76 );
77 }
78
79
86 public function getLevels()
87 {
88 $bs = new ilBasicSkill($this->base_skill_id);
89 return $bs->getLevelData();
90 }
91
92
96 protected function fillRow($a_set)
97 {
99 $ilCtrl = $this->ctrl;
100
101 $this->tpl->setVariable("LEVEL", $a_set["title"]);
102 $this->tpl->setVariable("LEVEL_ID", $a_set["id"]);
103
104 $tr = $this->thresholds[$a_set["id"]][$this->tref_id];
105 if ((int) $tr != 0) {
106 $this->tpl->setVariable("THRESHOLD", (int) $tr);
107 } else {
108 $this->tpl->setVariable("THRESHOLD", "");
109 }
110 }
111}
An exception for terminatinating execution or to throw for unit testing.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
TableGUI class for competence thresholds.
__construct( $a_parent_obj, $a_parent_cmd, $a_survey, $a_base_skill_id, $a_tref_id)
Constructor.
determineMaxScalesAndQuestions()
Determine max scales and questions.
Skill tresholds for 360 surveys.
Skill/Competence handling in surveys.
Class ilTable2GUI.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc