public function clear_criteria() {
        global $DB;
        $DB->delete_records('course_completion_criteria', array('course' => $this->course_id));
        $DB->delete_records('course_completion_aggr_methd', array('course' => $this->course_id));

        $this->delete_course_completion_data();
    }