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');
     }
 }
Ejemplo n.º 2
0
 private function areSkillLevelThresholdsMissing()
 {
     if ($this->object->isDynamicTest()) {
         $questionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
         $questionContainerId = $questionSetConfig->getSourceQuestionPoolId();
     } else {
         $questionContainerId = $this->object->getId();
     }
     global $ilDB;
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
     require_once 'Modules/Test/classes/class.ilTestSkillLevelThreshold.php';
     $assignmentList = new ilAssQuestionSkillAssignmentList($ilDB);
     $assignmentList->setParentObjId($questionContainerId);
     $assignmentList->loadFromDb();
     foreach ($assignmentList->getUniqueAssignedSkills() as $data) {
         foreach ($data['skill']->getLevelData() as $level) {
             $treshold = new ilTestSkillLevelThreshold($ilDB);
             $treshold->setTestId($this->object->getTestId());
             $treshold->setSkillBaseId($data['skill_base_id']);
             $treshold->setSkillTrefId($data['skill_tref_id']);
             $treshold->setSkillLevelId($level['id']);
             if (!$treshold->dbRecordExists()) {
                 return true;
             }
         }
     }
     return false;
 }
Ejemplo n.º 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);
 }
 private function buildSkillQuestionAssignmentList()
 {
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
     $assignmentList = new ilAssQuestionSkillAssignmentList($this->db);
     $assignmentList->setParentObjId($this->getQuestionContainerId());
     return $assignmentList;
 }
 private function getUniqueAssignedSkillsStats()
 {
     require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionSkillAssignmentList.php';
     $assignmentList = new ilAssQuestionSkillAssignmentList($this->myDb);
     $assignmentList->setParentObjId($this->poolId);
     $assignmentList->loadFromDb();
     $assignmentList->loadAdditionalSkillData();
     return $assignmentList->getUniqueAssignedSkills();
 }