original_string: public static function count_competencies($courseid) {
          global $DB;
  
          $sql = 'SELECT COUNT(comp.id)
                    FROM {' . self::TABLE . '} coursecomp
                    JOIN {' . competency::TABLE . '} comp
                      ON coursecomp.competencyid = comp.id
                   WHERE coursecomp.courseid = ? ';
          $params = array($courseid);
  
          $results = $DB->count_records_sql($sql, $params);
  
          return $results;
      }
code: public static function count_competencies($courseid) {
          global $DB;
  
          $sql = 'SELECT COUNT(comp.id)
                    FROM {' . self::TABLE . '} coursecomp
                    JOIN {' . competency::TABLE . '} comp
                      ON coursecomp.competencyid = comp.id
                   WHERE coursecomp.courseid = ? ';
          $params = array($courseid);
  
          $results = $DB->count_records_sql($sql, $params);
  
          return $results;
      }
code_tokens: public static function count_competencies ( $ courseid ) { global $ DB ; $ sql = 'SELECT COUNT(comp.id)
                    FROM {' . self :: TABLE . '} coursecomp
                    JOIN {' . competency :: TABLE . '} comp
                      ON coursecomp.competencyid = comp.id
                   WHERE coursecomp.courseid = ? ' ; $ params = array ( $ courseid ) ; $ results = $ DB -> count_records_sql ( $ sql , $ params ) ; return $ results ; }
docstring: Count the competencies in this course.
  
  @param int $courseid The course id
  @return int
docstring_tokens: Count the competencies in this course .