public function show_only_active_users() {
        global $CFG;

        if (is_null($this->showonlyactiveenrol)) {
            $defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);
            $this->showonlyactiveenrol = get_user_preferences('grade_report_showonlyactiveenrol', $defaultgradeshowactiveenrol);

            if (!is_null($this->context)) {
                $this->showonlyactiveenrol = $this->showonlyactiveenrol ||
                            !has_capability('moodle/course:viewsuspendedusers', $this->context);
            }
        }
        return $this->showonlyactiveenrol;
    }
public function show_only_active_users() {
        global $CFG;

        if (is_null($this->showonlyactiveenrol)) {
            $defaultgradeshowactiveenrol = !empty($CFG->grade_report_showonlyactiveenrol);
            $this->showonlyactiveenrol = get_user_preferences('grade_report_showonlyactiveenrol', $defaultgradeshowactiveenrol);

            if (!is_null($this->context)) {
                $this->showonlyactiveenrol = $this->showonlyactiveenrol ||
                            !has_capability('moodle/course:viewsuspendedusers', $this->context);
            }
        }
        return $this->showonlyactiveenrol;
    }
public function show_only_active_users ( ) { global $ CFG ; if ( is_null ( $ this -> showonlyactiveenrol ) ) { $ defaultgradeshowactiveenrol = ! empty ( $ CFG -> grade_report_showonlyactiveenrol ) ; $ this -> showonlyactiveenrol = get_user_preferences ( 'grade_report_showonlyactiveenrol' , $ defaultgradeshowactiveenrol ) ; if ( ! is_null ( $ this -> context ) ) { $ this -> showonlyactiveenrol = $ this -> showonlyactiveenrol || ! has_capability ( 'moodle/course:viewsuspendedusers' , $ this -> context ) ; } } return $ this -> showonlyactiveenrol ; }
Check is only active users in course should be shown.

@return bool true if only active users should be shown.
Check is only active users in course should be shown .