57 $cmd = $this->ctrl->getCmd(self::CMD_SHOW_SKILL_QUEST_ASSIGNS) .
'Cmd';
64 $questionId = (int)
$_GET[
'question_id'];
66 $skillParameter = explode(
':',
$_GET[
'selected_skill']);
67 $skillBaseId = (int)$skillParameter[0];
68 $skillTrefId = (int)$skillParameter[1];
72 require_once
'Modules/Test/classes/class.ilTestSkillQuestionAssignment.php';
75 $assignment->setTestId($this->testOBJ->getTestId());
76 $assignment->setQuestionId($questionId);
77 $assignment->setSkillBaseId($skillBaseId);
78 $assignment->setSkillTrefId($skillTrefId);
80 if( !$assignment->dbRecordExists() )
84 $assignment->saveToDb();
88 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
93 $questionId = (int)
$_GET[
'question_id'];
94 $skillBaseId = (int)
$_GET[
'skill_base_id'];
95 $skillTrefId = (int)
$_GET[
'skill_tref_id'];
99 require_once
'Modules/Test/classes/class.ilTestSkillQuestionAssignment.php';
102 $assignment->setTestId($this->testOBJ->getTestId());
103 $assignment->setQuestionId($questionId);
104 $assignment->setSkillBaseId($skillBaseId);
105 $assignment->setSkillTrefId($skillTrefId);
107 if( $assignment->dbRecordExists() )
109 $assignment->deleteFromDb();
113 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
120 if( !$skillSelectorGUI->handleCommand() )
122 $this->ctrl->saveParameter($this,
'question_id');
124 $this->tpl->setContent($this->ctrl->getHTML($skillSelectorGUI));
130 if( is_array(
$_POST[
'quantifiers']) )
132 require_once
'Modules/Test/classes/class.ilTestSkillQuestionAssignment.php';
136 foreach(
$_POST[
'quantifiers'] as $assignmentKey => $quantifier)
138 $assignmentKey = explode(
':',$assignmentKey);
139 $skillBaseId = (int)$assignmentKey[0];
140 $skillTrefId = (int)$assignmentKey[1];
141 $questionId = (int)$assignmentKey[2];
147 $assignment->setTestId($this->testOBJ->getTestId());
148 $assignment->setQuestionId($questionId);
149 $assignment->setSkillBaseId($skillBaseId);
150 $assignment->setSkillTrefId($skillTrefId);
152 if( $assignment->dbRecordExists() )
154 $assignment->setSkillPoints((
int)$quantifier);
155 $assignment->saveToDb();
162 $this->ctrl->redirect($this, self::CMD_SHOW_SKILL_QUEST_ASSIGNS);
170 $assignmentList->loadFromDb();
171 $assignmentList->loadAdditionalSkillData();
172 $table->setSkillQuestionAssignmentList($assignmentList);
174 $table->setData($this->testOBJ->getTestQuestions());
176 $this->tpl->setContent($this->ctrl->getHTML($table));
181 require_once
'Modules/Test/classes/tables/class.ilTestSkillQuestionAssignmentsTableGUI.php';
189 require_once
'Modules/Test/classes/class.ilTestSkillQuestionAssignmentList.php';
191 $assignmentList->setTestId($this->testOBJ->getTestId());
193 return $assignmentList;
198 require_once
'Services/Skill/classes/class.ilSkillSelectorGUI.php';
201 $this, self::CMD_SHOW_SKILL_SELECT, $this, self::CMD_ADD_SKILL_QUEST_ASSIGN
204 return $skillSelectorGUI;
209 foreach($this->testOBJ->getTestQuestions() as $question)
211 if( $question[
'question_id'] == $questionId )