public function has_activities() {
        $modinfo = get_fast_modinfo($this->course);
        foreach ($modinfo->get_cms() as $cm) {
            if ($cm->completion != COMPLETION_TRACKING_NONE) {
                return true;
            }
        }
        return false;
    }
public function has_activities() {
        $modinfo = get_fast_modinfo($this->course);
        foreach ($modinfo->get_cms() as $cm) {
            if ($cm->completion != COMPLETION_TRACKING_NONE) {
                return true;
            }
        }
        return false;
    }
public function has_activities ( ) { $ modinfo = get_fast_modinfo ( $ this -> course ) ; foreach ( $ modinfo -> get_cms ( ) as $ cm ) { if ( $ cm -> completion != COMPLETION_TRACKING_NONE ) { return true ; } } return false ; }
Return whether or not the course has activities with completion enabled.

@return boolean true when there is at least one activity with completion enabled.
Return whether or not the course has activities with completion enabled .