'Displays courseware accordion and associated content.  If course, chapter,
and section are all specified, renders the page, or returns an error if they
are invalid.
If section is not specified, displays the accordion opened to the right
chapter.
If neither chapter or section are specified, displays the user\'s most
recent chapter, or the first chapter if this is the user\'s first visit.
Arguments:
request: HTTP request
course_id (unicode): course id
chapter (unicode): chapter url_name
section (unicode): section url_name
position (unicode): position in module, eg of <sequential> module'

@method_decorator(login_required)
@method_decorator(ensure_csrf_cookie)
@method_decorator(cache_control(no_cache=True, no_store=True, must_revalidate=True))
@method_decorator(ensure_valid_course_key)
@method_decorator(data_sharing_consent_required)
def get(self, request, course_id, chapter=None, section=None, position=None):

    self.course_key = CourseKey.from_string(course_id)
    self.request = request
    self.original_chapter_url_name = chapter
    self.original_section_url_name = section
    self.chapter_url_name = chapter
    self.section_url_name = section
    self.position = position
    (self.chapter, self.section) = (None, None)
    self.course = None
    self.url = request.path
    try:
        set_custom_metrics_for_course_key(self.course_key)
        self._clean_position()
        with modulestore().bulk_operations(self.course_key):
            self.course = get_course_with_access(request.user, 'load', self.course_key, depth=CONTENT_DEPTH, check_if_enrolled=True)
            self.is_staff = has_access(request.user, 'staff', self.course)
            self._setup_masquerade_for_effective_user()
            return self._get(request)
    except Exception as exception:
        return CourseTabView.handle_exceptions(request, self.course, exception)
