public static function list_course_modules($competencyid, $courseid) {
        global $DB;

        $results = $DB->get_records_sql('SELECT coursemodules.id as id
                                           FROM {' . self::TABLE . '} modcomp
                                           JOIN {course_modules} coursemodules
                                             ON modcomp.cmid = coursemodules.id
                                          WHERE modcomp.competencyid = ? AND coursemodules.course = ?',
                                          array($competencyid, $courseid));

        return array_keys($results);
    }
public static function list_course_modules($competencyid, $courseid) {
        global $DB;

        $results = $DB->get_records_sql('SELECT coursemodules.id as id
                                           FROM {' . self::TABLE . '} modcomp
                                           JOIN {course_modules} coursemodules
                                             ON modcomp.cmid = coursemodules.id
                                          WHERE modcomp.competencyid = ? AND coursemodules.course = ?',
                                          array($competencyid, $courseid));

        return array_keys($results);
    }
public static function list_course_modules ( $ competencyid , $ courseid ) { global $ DB ; $ results = $ DB -> get_records_sql ( 'SELECT coursemodules.id as id
                                           FROM {' . self :: TABLE . '} modcomp
                                           JOIN {course_modules} coursemodules
                                             ON modcomp.cmid = coursemodules.id
                                          WHERE modcomp.competencyid = ? AND coursemodules.course = ?' , array ( $ competencyid , $ courseid ) ) ; return array_keys ( $ results ) ; }
Return the module IDs and visible flags that include this competency in a single course.

@param int $competencyid The competency id
@param int $courseid The course ID.
@return array of ints (cmids)
Return the module IDs and visible flags that include this competency in a single course .