'Fragment to render the course reviews fragment.'

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

    course_key = CourseKey.from_string(course_id)
    course = get_course_with_access(request.user, 'load', course_key, check_if_enrolled=False)
    course_url_name = default_course_url_name(course.id)
    course_url = reverse(course_url_name, kwargs={'course_id': unicode(course.id)})
    is_enrolled = CourseEnrollment.is_enrolled(request.user, course.id)
    course_reviews_fragment = CourseReviewsModuleFragmentView().render_to_fragment(request, course=course, **kwargs)
    context = {'course': course, 'course_url': course_url, 'course_reviews_fragment': course_reviews_fragment, 'is_enrolled': is_enrolled}
    html = render_to_string('course_experience/course-reviews-fragment.html', context)
    return Fragment(html)
