original_string: public static function count_competencies_in_course($courseid) {
          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 course_competency::count_competencies($courseid);
      }
code: public static function count_competencies_in_course($courseid) {
          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 course_competency::count_competencies($courseid);
      }
code_tokens: public static function count_competencies_in_course ( $ courseid ) { 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 course_competency :: count_competencies ( $ courseid ) ; }
docstring: Count all the competencies in a course.
  
  @param int $courseid The id of the course to check.
  @return int
docstring_tokens: Count all the competencies in a course .