public static function get_blockids_from_moduleid($moduleid) {
        global $DB;

        // Get the context of the module
        $contextid = context_module::instance($moduleid)->id;

        // Get all the block instances which parentcontextid is the module contextid
        $blockids = array();
        $instances = $DB->get_records('block_instances', array('parentcontextid' => $contextid), '', 'id');
        foreach ($instances as $instance) {
            $blockids[] = $instance->id;
        }
        return $blockids;
    }
public static function get_blockids_from_moduleid($moduleid) {
        global $DB;

        // Get the context of the module
        $contextid = context_module::instance($moduleid)->id;

        // Get all the block instances which parentcontextid is the module contextid
        $blockids = array();
        $instances = $DB->get_records('block_instances', array('parentcontextid' => $contextid), '', 'id');
        foreach ($instances as $instance) {
            $blockids[] = $instance->id;
        }
        return $blockids;
    }
public static function get_blockids_from_moduleid ( $ moduleid ) { global $ DB ; // Get the context of the module $ contextid = context_module :: instance ( $ moduleid ) -> id ; // Get all the block instances which parentcontextid is the module contextid $ blockids = array ( ) ; $ instances = $ DB -> get_records ( 'block_instances' , array ( 'parentcontextid' => $ contextid ) , '' , 'id' ) ; foreach ( $ instances as $ instance ) { $ blockids [ ] = $ instance -> id ; } return $ blockids ; }
Given one course module id, return one array with all the block intances that belong to it
Given one course module id return one array with all the block intances that belong to it