course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id) course_id = course_key.to_deprecated_string() # CourseDescriptorWithMixins course = get_course_with_access(user, 'load', course_key, depth=2) # CourseDescriptorWithMixins course_module = get_module_for_descriptor(user, request, course, field_data_cache, course_key) # SequenceDescriptorWithMixins chapter_descriptor = course.get_child_by(lambda m: m.location.name == chapter) # SequenceDescriptorWithMixins section_descriptor = chapter_descriptor.get_child_by(lambda m: m.location.name == section) section_descriptor = modulestore().get_item(section_descriptor.location, depth=None) staff_access = has_access(user, 'staff', course) registered = registered_for_course(course, user) #用戶是否註冊課程