예제 #1
0
 /**
  * Check if questions are assigned
  * @param type $a_test_ref_id
  */
 protected function lookupQuestionsAssigned($a_test_ref_id)
 {
     include_once './Modules/Course/classes/Objectives/class.ilLOUtils.php';
     if (ilLOUtils::lookupRandomTest(ilObject::_lookupObjId($a_test_ref_id))) {
         foreach ($this->getObjectives() as $objective_id) {
             include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
             $seq = ilLORandomTestQuestionPools::lookupSequence($this->parent_obj->getId(), $objective_id, ilObject::_lookupObjId($a_test_ref_id));
             if (!$seq) {
                 return false;
             }
         }
     } else {
         foreach ($this->getObjectives() as $objective_id) {
             include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
             $qsts = ilCourseObjectiveQuestion::lookupQuestionsByObjective(ilObject::_lookupObjId($a_test_ref_id), $objective_id);
             if (!count($qsts)) {
                 return false;
             }
         }
     }
     return true;
 }
 protected function updateFixedQuestions(ilTestSession $session, ilTestSequence $seq)
 {
     foreach ($this->run as $tst_run) {
         $tst_run->clearQuestions();
         include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
         $qst = ilCourseObjectiveQuestion::lookupQuestionsByObjective(ilObject::_lookupObjId($session->getRefId()), $tst_run->getObjectiveId());
         $GLOBALS['ilLog']->write(__METHOD__ . ': ' . print_r($qst, true));
         $points = 0;
         foreach ($qst as $id) {
             $tst_run->addQuestion($id);
             $points += ilCourseObjectiveQuestion::_lookupMaximumPointsOfQuestion($id);
         }
         $tst_run->setMaxPoints($points);
     }
 }