function __construct($unit_obj, $unit, $owner) { $this->owner = $owner; $this->unit_obj = $unit_obj; $this->unit = $unit; $mediathek = elearning_mediathek::get_instance(); $mediathek->set_unit($unit_obj); $this->elearning_course = elearning_mediathek::get_elearning_course_by_id($unit); $this->exam = $this->elearning_course->get_exam_by_type("final_exam"); }
function toggleexam() { $course = elearning_mediathek::get_elearning_course_by_id($this->courseid); $course->get_exam_by_type("final_exam")->set_global_enabled(!$course->get_exam_by_type("final_exam")->is_global_enabled()); if ($course->get_exam_by_type("final_exam")->is_global_enabled()) { echo "true"; } else { echo "false"; } }