'Returns a set() of block_ids indicating which of the possible children
have been selected to display to the current user.
This reads and updates the "selected" field, which has user_state scope.
Note: self.selected and the return value contain block_ids. To get
actual BlockUsageLocators, it is necessary to use self.children,
because the block_ids alone do not specify the block type.'

def selected_children(self):

    if hasattr(self, '_selected_set'):
        return self._selected_set
    block_keys = self.make_selection(self.selected, self.children, self.max_count, 'random')
    lib_tools = self.runtime.service(self, 'library_tools')
    format_block_keys = (lambda keys: lib_tools.create_block_analytics_summary(self.location.course_key, keys))
    self.publish_selected_children_events(block_keys, format_block_keys, self._publish_event)
    selected = block_keys['selected']
    self.selected = list(selected)
    self._selected_set = selected
    return selected
