original_string: public static function count_proficient_competencies_in_course_for_user($courseid, $userid) {
          static::require_enabled();
          // Check the user have access to the course.
          self::validate_course($courseid);
  
          // First we do a permissions check.
          $context = context_course::instance($courseid);
  
          $capabilities = array('moodle/competency:coursecompetencyview', 'moodle/competency:coursecompetencymanage');
          if (!has_any_capability($capabilities, $context)) {
               throw new required_capability_exception($context, 'moodle/competency:coursecompetencyview', 'nopermissions', '');
          }
  
          // OK - all set.
          return user_competency_course::count_proficient_competencies($courseid, $userid);
      }
code: public static function count_proficient_competencies_in_course_for_user($courseid, $userid) {
          static::require_enabled();
          // Check the user have access to the course.
          self::validate_course($courseid);
  
          // First we do a permissions check.
          $context = context_course::instance($courseid);
  
          $capabilities = array('moodle/competency:coursecompetencyview', 'moodle/competency:coursecompetencymanage');
          if (!has_any_capability($capabilities, $context)) {
               throw new required_capability_exception($context, 'moodle/competency:coursecompetencyview', 'nopermissions', '');
          }
  
          // OK - all set.
          return user_competency_course::count_proficient_competencies($courseid, $userid);
      }
code_tokens: public static function count_proficient_competencies_in_course_for_user ( $ courseid , $ userid ) { static :: require_enabled ( ) ; // Check the user have access to the course. self :: validate_course ( $ courseid ) ; // First we do a permissions check. $ context = context_course :: instance ( $ courseid ) ; $ capabilities = array ( 'moodle/competency:coursecompetencyview' , 'moodle/competency:coursecompetencymanage' ) ; if ( ! has_any_capability ( $ capabilities , $ context ) ) { throw new required_capability_exception ( $ context , 'moodle/competency:coursecompetencyview' , 'nopermissions' , '' ) ; } // OK - all set. return user_competency_course :: count_proficient_competencies ( $ courseid , $ userid ) ; }
docstring: Count the proficient competencies in a course for one user.
  
  @param int $courseid The id of the course to check.
  @param int $userid The id of the user to check.
  @return int
docstring_tokens: Count the proficient competencies in a course for one user .