original_string: public static function list_courses($competencyid) {
          global $DB;
  
          $results = $DB->get_records_sql('SELECT course.id, course.visible, course.shortname, course.idnumber,
                                                  course.fullname, course.summary, course.summaryformat, course.startdate,
                                                  course.enddate, course.category
                                             FROM {course} course
                                             JOIN {' . self::TABLE . '} coursecomp
                                               ON coursecomp.courseid = course.id
                                            WHERE coursecomp.competencyid = ? ', array($competencyid));
  
          return $results;
      }
code: public static function list_courses($competencyid) {
          global $DB;
  
          $results = $DB->get_records_sql('SELECT course.id, course.visible, course.shortname, course.idnumber,
                                                  course.fullname, course.summary, course.summaryformat, course.startdate,
                                                  course.enddate, course.category
                                             FROM {course} course
                                             JOIN {' . self::TABLE . '} coursecomp
                                               ON coursecomp.courseid = course.id
                                            WHERE coursecomp.competencyid = ? ', array($competencyid));
  
          return $results;
      }
code_tokens: public static function list_courses ( $ competencyid ) { global $ DB ; $ results = $ DB -> get_records_sql ( 'SELECT course.id, course.visible, course.shortname, course.idnumber,
                                                  course.fullname, course.summary, course.summaryformat, course.startdate,
                                                  course.enddate, course.category
                                             FROM {course} course
                                             JOIN {' . self :: TABLE . '} coursecomp
                                               ON coursecomp.courseid = course.id
                                            WHERE coursecomp.competencyid = ? ' , array ( $ competencyid ) ) ; return $ results ; }
docstring: Return partial course records foreach course that contains this competency.
  
  @param int $competencyid The competency id
  @return array[stdClass] Array of course records containg id, visible, shortname, idnumber, fullname
docstring_tokens: Return partial course records foreach course that contains this competency .