original_string: protected function get_num_competencies_in_course ($courseid) {
  
          if (!isset($this->coursecompetencies[$courseid])) {
              $ccs = \core_competency\api::count_competencies_in_course($courseid);
              // Save the number of competencies per course to avoid another database access in calculate_sample().
              $this->coursecompetencies[$courseid] = $ccs;
          } else {
              $ccs = $this->coursecompetencies[$courseid];
          }
          return $ccs;
      }
code: protected function get_num_competencies_in_course ($courseid) {
  
          if (!isset($this->coursecompetencies[$courseid])) {
              $ccs = \core_competency\api::count_competencies_in_course($courseid);
              // Save the number of competencies per course to avoid another database access in calculate_sample().
              $this->coursecompetencies[$courseid] = $ccs;
          } else {
              $ccs = $this->coursecompetencies[$courseid];
          }
          return $ccs;
      }
code_tokens: protected function get_num_competencies_in_course ( $ courseid ) { if ( ! isset ( $ this -> coursecompetencies [ $ courseid ] ) ) { $ ccs = \ core_competency \ api :: count_competencies_in_course ( $ courseid ) ; // Save the number of competencies per course to avoid another database access in calculate_sample(). $ this -> coursecompetencies [ $ courseid ] = $ ccs ; } else { $ ccs = $ this -> coursecompetencies [ $ courseid ] ; } return $ ccs ; }
docstring: Count the competencies in a course.
  
  Save the value in $coursecompetencies array to prevent new accesses to the database.
  
  @param int $courseid The course id.
  @return int Number of competencies assigned to the course.
docstring_tokens: Count the competencies in a course .