public function fillRow($question)
 {
     $assignments = $this->skillQuestionAssignmentList->getAssignmentsByQuestionId($question['question_id']);
     $this->ctrl->setParameter($this->parent_obj, 'question_id', $question['question_id']);
     $this->tpl->setCurrentBlock('question_title');
     $this->tpl->setVariable('ROWSPAN', $this->getRowspan($assignments));
     $this->tpl->setVariable('QUESTION_TITLE', $question['title']);
     $this->tpl->setVariable('QUESTION_DESCRIPTION', $question['description']);
     $this->tpl->parseCurrentBlock();
     $this->tpl->setCurrentBlock('tbl_content');
     for ($i = 0, $numAssigns = count($assignments); $i < $numAssigns; $i++) {
         /* @var ilAssQuestionSkillAssignment $assignment */
         $assignment = $assignments[$i];
         $this->tpl->setCurrentBlock('actions_col');
         $this->tpl->setVariable('ACTION', $this->getCompetenceAssignPropertiesFormLink($assignment));
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock('tbl_content');
         $this->tpl->setVariable('COMPETENCE', $assignment->getSkillTitle());
         $this->tpl->setVariable('COMPETENCE_PATH', $assignment->getSkillPath());
         $this->tpl->setVariable('EVAL_MODE', $this->getEvalModeLabel($assignment));
         if ($this->isSkillPointInputRequired($assignment)) {
             $this->tpl->setVariable('SKILL_POINTS', $this->buildSkillPointsInput($assignment));
         } else {
             $this->tpl->setVariable('SKILL_POINTS', $assignment->getMaxSkillPoints());
         }
         if ($this->areManipulationsEnabled() || $i + 1 < $numAssigns) {
             $this->tpl->parseCurrentBlock();
             $this->tpl->setCurrentBlock('tbl_content');
             $this->tpl->setVariable("CSS_ROW", $this->css_row);
         }
     }
     if ($this->areManipulationsEnabled()) {
         $this->tpl->setCurrentBlock('actions_col');
         $this->tpl->setVariable('ACTION', $this->getManageCompetenceAssignsActionLink());
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock('tbl_content');
     } elseif (!$numAssigns) {
         $this->tpl->setCurrentBlock('actions_col');
         $this->tpl->setVariable('ACTION', '&nbsp;');
         $this->tpl->parseCurrentBlock();
         $this->tpl->setCurrentBlock('tbl_content');
     }
 }
 private function showSkillSelectionCmd()
 {
     $this->ctrl->saveParameter($this, 'question_id');
     $questionId = (int) $_GET['question_id'];
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
     $assignmentList = new ilAssQuestionSkillAssignmentList($this->db);
     $assignmentList->setParentObjId($this->getQuestionContainerId());
     $assignmentList->loadFromDb();
     $skillSelectorExplorerGUI = $this->buildSkillSelectorExplorerGUI($assignmentList->getAssignmentsByQuestionId($questionId));
     if (!$skillSelectorExplorerGUI->handleCommand()) {
         $tpl = new ilTemplate('tpl.qpl_qst_skl_assign_selection.html', false, false, 'Modules/TestQuestionPool');
         $tpl->setVariable('SKILL_SELECTOR_HEADER', $this->getSkillSelectorHeader($questionId));
         $skillSelectorToolbarGUI = $this->buildSkillSelectorToolbarGUI();
         $skillSelectorToolbarGUI->setOpenFormTag(true);
         $skillSelectorToolbarGUI->setCloseFormTag(false);
         $skillSelectorToolbarGUI->setLeadingImage(ilUtil::getImagePath("arrow_upright.png"), " ");
         $tpl->setVariable('SKILL_SELECTOR_TOOLBAR_TOP', $this->ctrl->getHTML($skillSelectorToolbarGUI));
         $tpl->setVariable('SKILL_SELECTOR_EXPLORER', $this->ctrl->getHTML($skillSelectorExplorerGUI));
         $skillSelectorToolbarGUI->setOpenFormTag(false);
         $skillSelectorToolbarGUI->setCloseFormTag(true);
         $skillSelectorToolbarGUI->setLeadingImage(ilUtil::getImagePath("arrow_downright.png"), " ");
         $tpl->setVariable('SKILL_SELECTOR_TOOLBAR_BOTTOM', $this->ctrl->getHTML($skillSelectorToolbarGUI));
         $this->tpl->setContent($tpl->get());
     }
 }
Exemple #3
0
 public function syncSkillAssignments($srcParentId, $srcQuestionId, $trgParentId, $trgQuestionId)
 {
     global $ilDB;
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
     $assignmentList = new ilAssQuestionSkillAssignmentList($ilDB);
     $assignmentList->setParentObjId($trgParentId);
     $assignmentList->setQuestionIdFilter($trgQuestionId);
     $assignmentList->loadFromDb();
     foreach ($assignmentList->getAssignmentsByQuestionId($trgQuestionId) as $assignment) {
         /* @var ilAssQuestionSkillAssignment $assignment */
         $assignment->deleteFromDb();
     }
     $this->duplicateSkillAssignments($srcParentId, $srcQuestionId, $trgParentId, $trgQuestionId);
 }