original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Check is only active users in course should be shown.
  
  @return bool true if only active users should be shown.
docstring_tokens: Check is only active users in course should be shown .