'Updates the given fragment with rendered student views of the given
display_items.  Returns a list of dict objects with information about
the given display_items.'

def _render_student_view_for_items(self, context, display_items, fragment):

    bookmarks_service = self.runtime.service(self, 'bookmarks')
    context['username'] = self.runtime.service(self, 'user').get_current_user().opt_attrs['edx-platform.username']
    display_names = [self.get_parent().display_name_with_default, self.display_name_with_default]
    contents = []
    for item in display_items:
        is_bookmarked = bookmarks_service.is_bookmarked(usage_key=item.scope_ids.usage_id)
        context['bookmarked'] = is_bookmarked
        rendered_item = item.render(STUDENT_VIEW, context)
        fragment.add_frag_resources(rendered_item)
        iteminfo = {'content': rendered_item.content, 'page_title': getattr(item, 'tooltip_title', ''), 'type': item.get_icon_class(), 'id': item.scope_ids.usage_id.to_deprecated_string(), 'bookmarked': is_bookmarked, 'path': '    >    '.join((display_names + [item.display_name_with_default]))}
        contents.append(iteminfo)
    return contents
