4 require_once
'Services/Table/classes/class.ilTable2GUI.php';
21 $this->skillQuestionAssignmentList = $assignmentList;
31 $this->
setId(
'assQstSkl');
34 $this->
setStyle(
'table',
'fullwidth');
36 $this->
setRowTemplate(
"tpl.tst_skl_qst_assignment_row.html",
"Modules/Test");
53 $this->
addColumn($this->lng->txt(
'tst_question'),
'question',
'25%');
54 $this->
addColumn($this->lng->txt(
'tst_competence'),
'competence',
'55%');
55 $this->
addColumn($this->lng->txt(
'tst_comp_points'),
'points',
'');
56 $this->
addColumn($this->lng->txt(
'actions') ,
'actions',
'');
61 $assignments = $this->skillQuestionAssignmentList->getAssignmentsByQuestionId($question[
'question_id']);
63 $this->ctrl->setParameter($this->parent_obj,
'question_id', $question[
'question_id']);
65 $this->tpl->setCurrentBlock(
'question_title');
66 $this->tpl->setVariable(
'ROWSPAN', $this->
getRowspan($assignments));
67 $this->tpl->setVariable(
'QUESTION', $question[
'title']);
68 $this->tpl->parseCurrentBlock();
70 $this->tpl->setCurrentBlock(
'tbl_content');
72 for($i = 0, $max = count($assignments); $i < $max; $i++)
74 $assignment = $assignments[$i];
76 $this->tpl->setVariable(
'COMPETENCE', $assignment->getSkillTitle());
77 $this->tpl->setVariable(
'COMPETENCE_PATH', $assignment->getSkillPath());
81 $this->tpl->parseCurrentBlock();
82 $this->tpl->setVariable(
"CSS_ROW", $this->css_row);
83 $this->tpl->setVariable(
"CSS_NO_BORDER",
'ilBorderlessRow');
91 $cnt = count($assignments);
103 $assignmentKey = implode(
':', array(
107 return "<input type\"text\" size=\"2\" name=\"quantifiers[{$assignmentKey}]\" value=\"{$assignment->getSkillPoints()}\" />";
112 $href = $this->ctrl->getLinkTarget(
116 $label = $this->lng->txt(
'tst_assign_competence');
123 $this->ctrl->setParameter($this->parent_obj,
'skill_base_id', $assignment->
getSkillBaseId());
124 $this->ctrl->setParameter($this->parent_obj,
'skill_tref_id', $assignment->
getSkillTrefId());
126 $href = $this->ctrl->getLinkTarget(
130 $label = $this->lng->txt(
'tst_remove_competence');
132 $this->ctrl->setParameter($this->parent_obj,
'skill_base_id', null);
133 $this->ctrl->setParameter($this->parent_obj,
'skill_tref_id', null);
140 return "<a href=\"{$href}\" title=\"{$label}\">{$label}</a>";
147 foreach($assignments as $assignment)
149 $this->ctrl->setParameter($this->parent_obj,
'skill_base_id', $assignment->getSkillBaseId());
150 $this->ctrl->setParameter($this->parent_obj,
'skill_tref_id', $assignment->getSkillTrefId());
152 $href = $this->ctrl->getLinkTarget(
156 $label = $this->lng->txt(
'tst_remove_competence');
161 $href = $this->ctrl->getLinkTarget(
165 $label = $this->lng->txt(
'tst_assign_competence');
168 return implode(
'<br />', $actions);