protected function parseLOUserResults()
 {
     global $ilUser;
     $res = array();
     include_once "Modules/Course/classes/Objectives/class.ilLOTestAssignments.php";
     $lo_ass = ilLOTestAssignments::getInstance($this->getContainerObject()->getId());
     include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
     $lur = new ilLOUserResults($this->getContainerObject()->getId(), $ilUser->getId());
     foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
         // show either initial or qualified for objective
         if (isset($types[ilLOUserResults::TYPE_INITIAL])) {
             $initial_status = $types[ilLOUserResults::TYPE_INITIAL]["status"];
         }
         // qualified test has priority
         if (isset($types[ilLOUserResults::TYPE_QUALIFIED])) {
             $result = $types[ilLOUserResults::TYPE_QUALIFIED];
             $result["type"] = ilLOUserResults::TYPE_QUALIFIED;
             $result["initial"] = $types[ilLOUserResults::TYPE_INITIAL];
         } else {
             $result = $types[ilLOUserResults::TYPE_INITIAL];
             $result["type"] = ilLOUserResults::TYPE_INITIAL;
         }
         $result["initial_status"] = $initial_status;
         $result["itest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_INITIAL);
         $result["qtest"] = $lo_ass->getTestByObjective($objective_id, ilLOSettings::TYPE_TEST_QUALIFIED);
         $res[$objective_id] = $result;
     }
     return $res;
 }
Ejemplo n.º 2
0
 protected function parseLOUserResults($a_course_obj_id, $a_user_id)
 {
     $res = array();
     include_once "Modules/Course/classes/Objectives/class.ilLOUserResults.php";
     $lur = new ilLOUserResults($a_course_obj_id, $a_user_id);
     foreach ($lur->getCourseResultsForUserPresentation() as $objective_id => $types) {
         // show either initial or qualified for objective
         if (isset($types[ilLOUserResults::TYPE_INITIAL])) {
             $initial_status = $types[ilLOUserResults::TYPE_INITIAL]["status"];
         }
         // qualified test has priority
         if (isset($types[ilLOUserResults::TYPE_QUALIFIED])) {
             $result = $types[ilLOUserResults::TYPE_QUALIFIED];
             $result["type"] = ilLOUserResults::TYPE_QUALIFIED;
         } else {
             $result = $types[ilLOUserResults::TYPE_INITIAL];
             $result["type"] = ilLOUserResults::TYPE_INITIAL;
         }
         $result["initial_status"] = $initial_status;
         $res[$objective_id] = $result;
     }
     return $res;
 }