Example #1
0
 /**
  * 
  * @param type $a_container_id
  * @param type $a_objective_id
  * @param type $a_test_type
  */
 public static function lookupObjectiveRequiredPercentage($a_container_id, $a_objective_id, $a_test_ref_id, $a_max_points)
 {
     include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
     $settings = ilLOSettings::getInstanceByObjId($a_container_id);
     include_once './Modules/Course/classes/Objectives/class.ilLOTestAssignments.php';
     $assignments = ilLOTestAssignments::getInstance($a_container_id);
     $a_test_type = $assignments->getTypeByTest($a_test_ref_id);
     if ($assignments->isSeparateTest($a_test_ref_id)) {
         include_once './Services/Object/classes/class.ilObjectFactory.php';
         $factory = new ilObjectFactory();
         $tst = $factory->getInstanceByRefId($a_test_ref_id, FALSE);
         if ($tst instanceof ilObjTest) {
             $schema = $tst->getMarkSchema();
             foreach ($schema->getMarkSteps() as $mark) {
                 if ($mark->getPassed()) {
                     return (int) $mark->getMinimumLevel();
                 }
             }
         }
     }
     $tst_ref_id = $a_test_ref_id;
     if (self::lookupRandomTest(ilObject::_lookupObjId($tst_ref_id))) {
         include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
         return (int) ilLORandomTestQuestionPools::lookupLimit($a_container_id, $a_objective_id, $a_test_type);
     } else {
         include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
         $limit = ilCourseObjectiveQuestion::loookupTestLimit(ilObject::_lookupObjId($tst_ref_id), $a_objective_id);
         return $limit;
     }
 }
Example #2
0
 /**
  * 
  * @param type $a_container_id
  * @param type $a_objective_id
  * @param type $a_test_type
  */
 public static function lookupObjectiveRequiredPercentage($a_container_id, $a_objective_id, $a_test_type, $a_max_points)
 {
     include_once './Modules/Course/classes/Objectives/class.ilLOSettings.php';
     $settings = ilLOSettings::getInstanceByObjId($a_container_id);
     if ($a_test_type == ilLOSettings::TYPE_TEST_QUALIFIED) {
         $tst_ref_id = $settings->getQualifiedTest();
     } else {
         $tst_ref_id = $settings->getInitialTest();
     }
     if (self::lookupRandomTest(ilObject::_lookupObjId($tst_ref_id))) {
         include_once './Modules/Course/classes/Objectives/class.ilLORandomTestQuestionPools.php';
         return (int) ilLORandomTestQuestionPools::lookupLimit($a_container_id, $a_objective_id, $a_test_type);
     } else {
         include_once './Modules/Course/classes/class.ilCourseObjectiveQuestion.php';
         $limit = ilCourseObjectiveQuestion::loookupTestLimit(ilObject::_lookupObjId($tst_ref_id), $a_objective_id);
         return $limit;
     }
 }