public function can_access_course($courseid) {
        $this->init_course_access();
        if (!array_key_exists($courseid, $this->courseaccess)) {
            $this->courseaccess[$courseid] = can_access_course($this->get_course($courseid)) ? 1 : 0;
            $this->cachechangedcourse = true;
        }
        return $this->courseaccess[$courseid];
    }