function getStatus($a_course_id) { include_once './Modules/TestQuestionPool/classes/class.assQuestion.php'; include_once 'Modules/Course/classes/class.ilCourseObjective.php'; // begin-patch lok $objective_ids = ilCourseObjective::_getObjectiveIds($a_course_id, true); // end-patch lok $objectives = ilCourseObjectiveResult::_readAssignedObjectives($objective_ids); $accomplished = $this->getAccomplished($a_course_id); $suggested = $this->getSuggested($a_course_id); if (!count($objective_ids)) { return IL_OBJECTIVE_STATUS_EMPTY; } if (count($accomplished) == count($objective_ids)) { return IL_OBJECTIVE_STATUS_FINISHED; } $all_pretest_answered = false; $all_final_answered = false; foreach ($objectives as $data) { if (assQuestion::_areAnswered($this->getUserId(), $data['questions'])) { if ($data['tst_status']) { $all_final_answered = true; } else { $all_pretest_answered = true; } } } if ($all_final_answered) { return IL_OBJECTIVE_STATUS_FINAL; } if ($all_pretest_answered and !count($suggested)) { return IL_OBJECTIVE_STATUS_PRETEST_NON_SUGGEST; } elseif ($all_pretest_answered) { return IL_OBJECTIVE_STATUS_PRETEST; } return IL_OBJECTIVE_STATUS_NONE; }