5 include_once(
"./Services/Table/classes/class.ilTable2GUI.php");
25 public function __construct($a_parent_obj, $a_parent_cmd, $a_survey)
29 $this->ctrl = $DIC->ctrl();
30 $this->lng = $DIC->language();
31 $this->access = $DIC->access();
33 $lng = $DIC->language();
34 $ilAccess = $DIC->access();
35 $lng = $DIC->language();
37 $this->
object = $a_survey;
38 include_once(
"./Modules/Survey/classes/class.ilSurveySkill.php");
41 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
44 parent::__construct($a_parent_obj, $a_parent_cmd);
48 $this->
addColumn($this->lng->txt(
"question"));
49 $this->
addColumn($this->lng->txt(
"survey_skill"));
50 $this->
addColumn($this->lng->txt(
"actions"));
53 $this->
setRowTemplate(
"tpl.svy_skill_ass_row.html",
"Modules/Survey");
70 $survey_questions = $this->
object->getSurveyQuestions();
72 if (count($survey_questions) > 0) {
73 $table_data =
array();
74 $last_questionblock_id = $position = $block_position = 0;
75 foreach ($survey_questions as $question_id =>
$data) {
79 if (in_array(
$data[
"questiontype_fi"],
array(2))) {
87 "supported" => $supported,
88 "heading" =>
$data[
"heading"],
89 "title" =>
$data[
"title"],
90 "description" =>
$data[
"description"],
91 "author" =>
$data[
"author"],
92 "obligatory" => (
bool)
$data[
"obligatory"]);
107 $ilCtrl->setParameter($this->parent_obj,
"q_id", $a_set[
"id"]);
109 if ($a_set[
"supported"]) {
110 $this->tpl->setCurrentBlock(
"cmd");
111 $this->tpl->setVariable(
115 "assignSkillToQuestion" 118 $this->tpl->setVariable(
"TXT_CMD",
$lng->txt(
"survey_assign_competence"));
119 $this->tpl->parseCurrentBlock();
121 if (
$s = $this->skill_survey->getSkillForQuestion($a_set[
"id"])) {
122 $this->tpl->setCurrentBlock(
"cmd");
123 $this->tpl->setVariable(
127 "removeSkillFromQuestion" 130 $this->tpl->setVariable(
"TXT_CMD",
$lng->txt(
"survey_remove_competence"));
131 $this->tpl->parseCurrentBlock();
133 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
134 $this->tpl->setVariable(
140 $path = $this->skill_tree->getSkillTreePath(
$s[
"base_skill_id"],
$s[
"tref_id"]);
141 $path_nodes =
array();
142 foreach (
$path as $p) {
143 if ($p[
"child"] > 1 && $p[
"skill_id"] !=
$s[
"base_skill_id"]) {
147 $this->tpl->setVariable(
"PATH", implode($path_nodes,
" > "));
148 $this->tpl->setVariable(
"COMP_ID",
"comp_" . $a_set[
"id"]);
155 $this->tpl->setVariable(
"NOT_SUPPORTED",
$lng->txt(
"svy_skl_comp_assignm_not_supported"));
158 $this->tpl->setVariable(
"QUESTION_TITLE", $a_set[
"title"]);
160 $ilCtrl->setParameter($this->parent_obj,
"q_id",
"");
getQuestions()
Get questions.
if(!array_key_exists('StateId', $_REQUEST)) $id
Skill/Competence handling in surveys.
TableGUI class for survey questions to skill assignment.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
__construct($a_parent_obj, $a_parent_cmd, $a_survey)
Constructor.
fillRow($a_set)
Fill table row.
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.