public static function list_competencies($courseid) {
        global $DB;

        $sql = 'SELECT comp.*
                  FROM {' . competency::TABLE . '} comp
                  JOIN {' . self::TABLE . '} coursecomp
                    ON coursecomp.competencyid = comp.id
                 WHERE coursecomp.courseid = ?';
        $params = array($courseid);

        $sql .= ' ORDER BY coursecomp.sortorder ASC';
        $results = $DB->get_recordset_sql($sql, $params);
        $instances = array();
        foreach ($results as $result) {
            $comp = new competency(0, $result);
            $instances[$comp->get('id')] = $comp;
        }
        $results->close();

        return $instances;
    }
public static function list_competencies($courseid) {
        global $DB;

        $sql = 'SELECT comp.*
                  FROM {' . competency::TABLE . '} comp
                  JOIN {' . self::TABLE . '} coursecomp
                    ON coursecomp.competencyid = comp.id
                 WHERE coursecomp.courseid = ?';
        $params = array($courseid);

        $sql .= ' ORDER BY coursecomp.sortorder ASC';
        $results = $DB->get_recordset_sql($sql, $params);
        $instances = array();
        foreach ($results as $result) {
            $comp = new competency(0, $result);
            $instances[$comp->get('id')] = $comp;
        }
        $results->close();

        return $instances;
    }
public static function list_competencies ( $ courseid ) { global $ DB ; $ sql = 'SELECT comp.*
                  FROM {' . competency :: TABLE . '} comp
                  JOIN {' . self :: TABLE . '} coursecomp
                    ON coursecomp.competencyid = comp.id
                 WHERE coursecomp.courseid = ?' ; $ params = array ( $ courseid ) ; $ sql .= ' ORDER BY coursecomp.sortorder ASC' ; $ results = $ DB -> get_recordset_sql ( $ sql , $ params ) ; $ instances = array ( ) ; foreach ( $ results as $ result ) { $ comp = new competency ( 0 , $ result ) ; $ instances [ $ comp -> get ( 'id' ) ] = $ comp ; } $ results -> close ( ) ; return $ instances ; }
List the competencies in this course.

@param int $courseid The course id
@return competency[] Indexed by competency ID.
List the competencies in this course .