'Renders the course outline as a fragment.'

def render_to_fragment(self, request, course_id=None, page_context=None, **kwargs):

    course_key = CourseKey.from_string(course_id)
    course_overview = get_course_overview_with_access(request.user, 'load', course_key, check_if_enrolled=True)
    course_block_tree = get_course_outline_block_tree(request, course_id)
    if (not course_block_tree):
        return None
    context = {'csrf': csrf(request)['csrf_token'], 'course': course_overview, 'blocks': course_block_tree}
    html = render_to_string('course_experience/course-outline-fragment.html', context)
    return Fragment(html)
