Normalize urlpatterns
Since these lines of code will now `blame` me, I couldn't bear the thought of their ugly formatting leading back to me.
This commit is contained in:
554
lms/urls.py
554
lms/urls.py
@@ -243,23 +243,29 @@ COURSE_URLS = patterns(
|
||||
url(
|
||||
r'^look_up_registration_code$',
|
||||
'instructor.views.registration_codes.look_up_registration_code',
|
||||
name='look_up_registration_code'
|
||||
name='look_up_registration_code',
|
||||
),
|
||||
url(
|
||||
r'^registration_code_details$',
|
||||
'instructor.views.registration_codes.registration_code_details',
|
||||
name='registration_code_details'
|
||||
)
|
||||
name='registration_code_details',
|
||||
),
|
||||
)
|
||||
urlpatterns += (
|
||||
# jump_to URLs for direct access to a location in the course
|
||||
url(
|
||||
r'^courses/{}/jump_to/(?P<location>.*)$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.jump_to', name="jump_to",
|
||||
r'^courses/{}/jump_to/(?P<location>.*)$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.jump_to',
|
||||
name='jump_to',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/jump_to_id/(?P<module_id>.*)$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.jump_to_id', name="jump_to_id",
|
||||
r'^courses/{}/jump_to_id/(?P<module_id>.*)$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.jump_to_id',
|
||||
name='jump_to_id',
|
||||
),
|
||||
|
||||
# xblock Handler APIs
|
||||
@@ -311,210 +317,501 @@ urlpatterns += (
|
||||
|
||||
url(
|
||||
r'^courses/{}/xqueue/(?P<userid>[^/]*)/(?P<mod_id>.*?)/(?P<dispatch>[^/]*)$'.format(
|
||||
settings.COURSE_ID_PATTERN
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.module_render.xqueue_callback',
|
||||
name='xqueue_callback'
|
||||
name='xqueue_callback',
|
||||
),
|
||||
url(
|
||||
r'^change_setting$',
|
||||
'student.views.change_setting',
|
||||
name='change_setting',
|
||||
),
|
||||
url(r'^change_setting$', 'student.views.change_setting',
|
||||
name='change_setting'),
|
||||
|
||||
# TODO: These views need to be updated before they work
|
||||
url(r'^calculate$', 'util.views.calculate'),
|
||||
|
||||
url(r'^courses/?$', 'branding.views.courses', name="courses"),
|
||||
url(r'^change_enrollment$',
|
||||
'student.views.change_enrollment', name="change_enrollment"),
|
||||
url(r'^change_email_settings$', 'student.views.change_email_settings', name="change_email_settings"),
|
||||
url(
|
||||
r'^change_enrollment$',
|
||||
'student.views.change_enrollment',
|
||||
name='change_enrollment',
|
||||
),
|
||||
url(
|
||||
r'^change_email_settings$',
|
||||
'student.views.change_email_settings',
|
||||
name='change_email_settings',
|
||||
),
|
||||
|
||||
#About the course
|
||||
url(r'^courses/{}/about$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.course_about', name="about_course"),
|
||||
url(
|
||||
r'^courses/{}/about$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.course_about',
|
||||
name='about_course',
|
||||
),
|
||||
|
||||
#Inside the course
|
||||
url(r'^courses/{}/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.course_info', name="course_root"),
|
||||
url(r'^courses/{}/info$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.course_info', name="info"),
|
||||
url(
|
||||
r'^courses/{}/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.course_info',
|
||||
name='course_root',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/info$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.course_info',
|
||||
name='info',
|
||||
),
|
||||
# TODO arjun remove when custom tabs in place, see courseware/courses.py
|
||||
url(r'^courses/{}/syllabus$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.syllabus', name="syllabus"),
|
||||
url(
|
||||
r'^courses/{}/syllabus$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.syllabus',
|
||||
name='syllabus',
|
||||
),
|
||||
|
||||
#Survey associated with a course
|
||||
url(r'^courses/{}/survey$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.course_survey', name="course_survey"),
|
||||
# Survey associated with a course
|
||||
url(
|
||||
r'^courses/{}/survey$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.course_survey',
|
||||
name='course_survey',
|
||||
),
|
||||
|
||||
url(r'^courses/{}/book/(?P<book_index>\d+)/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'staticbook.views.index', name="book"),
|
||||
url(r'^courses/{}/book/(?P<book_index>\d+)/(?P<page>\d+)$'.format(settings.COURSE_ID_PATTERN),
|
||||
'staticbook.views.index', name="book"),
|
||||
url(
|
||||
r'^courses/{}/book/(?P<book_index>\d+)/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'staticbook.views.index',
|
||||
name='book',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/book/(?P<book_index>\d+)/(?P<page>\d+)$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'staticbook.views.index',
|
||||
name='book',
|
||||
),
|
||||
|
||||
url(r'^courses/{}/pdfbook/(?P<book_index>\d+)/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'staticbook.views.pdf_index', name="pdf_book"),
|
||||
url(r'^courses/{}/pdfbook/(?P<book_index>\d+)/(?P<page>\d+)$'.format(settings.COURSE_ID_PATTERN),
|
||||
'staticbook.views.pdf_index', name="pdf_book"),
|
||||
url(
|
||||
r'^courses/{}/pdfbook/(?P<book_index>\d+)/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'staticbook.views.pdf_index',
|
||||
name='pdf_book',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/pdfbook/(?P<book_index>\d+)/(?P<page>\d+)$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'staticbook.views.pdf_index',
|
||||
name='pdf_book',
|
||||
),
|
||||
|
||||
url(r'^courses/{}/pdfbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'staticbook.views.pdf_index', name="pdf_book"),
|
||||
url(
|
||||
r'^courses/{}/pdfbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'staticbook.views.pdf_index',
|
||||
name='pdf_book',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/pdfbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/(?P<page>\d+)$'.format(
|
||||
settings.COURSE_ID_PATTERN
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'staticbook.views.pdf_index', name="pdf_book"
|
||||
'staticbook.views.pdf_index',
|
||||
name='pdf_book',
|
||||
),
|
||||
|
||||
url(r'^courses/{}/htmlbook/(?P<book_index>\d+)/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'staticbook.views.html_index', name="html_book"),
|
||||
url(r'^courses/{}/htmlbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'staticbook.views.html_index', name="html_book"),
|
||||
url(
|
||||
r'^courses/{}/htmlbook/(?P<book_index>\d+)/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'staticbook.views.html_index',
|
||||
name='html_book',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/htmlbook/(?P<book_index>\d+)/chapter/(?P<chapter>\d+)/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'staticbook.views.html_index',
|
||||
name='html_book',
|
||||
),
|
||||
|
||||
url(r'^courses/{}/courseware/?$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.index', name="courseware"),
|
||||
url(r'^courses/{}/courseware/(?P<chapter>[^/]*)/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.index', name="courseware_chapter"),
|
||||
url(r'^courses/{}/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.index', name="courseware_section"),
|
||||
url(
|
||||
r'^courses/{}/courseware/?$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.index',
|
||||
name='courseware',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/courseware/(?P<chapter>[^/]*)/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.index',
|
||||
name='courseware_chapter',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.index',
|
||||
name='courseware_section',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/courseware/(?P<chapter>[^/]*)/(?P<section>[^/]*)/(?P<position>[^/]*)/?$'.format(
|
||||
settings.COURSE_ID_PATTERN
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.index', name="courseware_position"
|
||||
'courseware.views.index',
|
||||
name='courseware_position',
|
||||
),
|
||||
|
||||
url(r'^courses/{}/progress$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.progress', name="progress"),
|
||||
url(
|
||||
r'^courses/{}/progress$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.progress',
|
||||
name='progress',
|
||||
),
|
||||
# Takes optional student_id for instructor use--shows profile as that student sees it.
|
||||
url(r'^courses/{}/progress/(?P<student_id>[^/]*)/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.progress', name="student_progress"),
|
||||
url(
|
||||
r'^courses/{}/progress/(?P<student_id>[^/]*)/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.progress',
|
||||
name='student_progress',
|
||||
),
|
||||
|
||||
# For the instructor
|
||||
url(r'^courses/{}/instructor$'.format(settings.COURSE_ID_PATTERN),
|
||||
'instructor.views.instructor_dashboard.instructor_dashboard_2', name="instructor_dashboard"),
|
||||
url(
|
||||
r'^courses/{}/instructor$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'instructor.views.instructor_dashboard.instructor_dashboard_2',
|
||||
name='instructor_dashboard',
|
||||
),
|
||||
|
||||
|
||||
url(r'^courses/{}/set_course_mode_price$'.format(settings.COURSE_ID_PATTERN),
|
||||
'instructor.views.instructor_dashboard.set_course_mode_price', name="set_course_mode_price"),
|
||||
url(r'^courses/{}/instructor/api/'.format(settings.COURSE_ID_PATTERN),
|
||||
url(
|
||||
r'^courses/{}/set_course_mode_price$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'instructor.views.instructor_dashboard.set_course_mode_price',
|
||||
name='set_course_mode_price',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/instructor/api/'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
include('instructor.views.api_urls')),
|
||||
url(r'^courses/{}/remove_coupon$'.format(settings.COURSE_ID_PATTERN),
|
||||
'instructor.views.coupons.remove_coupon', name="remove_coupon"),
|
||||
url(r'^courses/{}/add_coupon$'.format(settings.COURSE_ID_PATTERN),
|
||||
'instructor.views.coupons.add_coupon', name="add_coupon"),
|
||||
url(r'^courses/{}/update_coupon$'.format(settings.COURSE_ID_PATTERN),
|
||||
'instructor.views.coupons.update_coupon', name="update_coupon"),
|
||||
url(r'^courses/{}/get_coupon_info$'.format(settings.COURSE_ID_PATTERN),
|
||||
'instructor.views.coupons.get_coupon_info', name="get_coupon_info"),
|
||||
url(
|
||||
r'^courses/{}/remove_coupon$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'instructor.views.coupons.remove_coupon',
|
||||
name='remove_coupon',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/add_coupon$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'instructor.views.coupons.add_coupon',
|
||||
name='add_coupon',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/update_coupon$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'instructor.views.coupons.update_coupon',
|
||||
name='update_coupon',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/get_coupon_info$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'instructor.views.coupons.get_coupon_info',
|
||||
name='get_coupon_info',
|
||||
),
|
||||
|
||||
url(r'^courses/{}/'.format(settings.COURSE_ID_PATTERN), include(COURSE_URLS)),
|
||||
url(
|
||||
r'^courses/{}/'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
include(COURSE_URLS)
|
||||
),
|
||||
# see ENABLE_INSTRUCTOR_LEGACY_DASHBOARD section for legacy dash urls
|
||||
|
||||
# Open Ended grading views
|
||||
url(r'^courses/{}/staff_grading$'.format(settings.COURSE_ID_PATTERN),
|
||||
'open_ended_grading.views.staff_grading', name='staff_grading'),
|
||||
url(r'^courses/{}/staff_grading/get_next$'.format(settings.COURSE_ID_PATTERN),
|
||||
'open_ended_grading.staff_grading_service.get_next', name='staff_grading_get_next'),
|
||||
url(r'^courses/{}/staff_grading/save_grade$'.format(settings.COURSE_ID_PATTERN),
|
||||
'open_ended_grading.staff_grading_service.save_grade', name='staff_grading_save_grade'),
|
||||
url(r'^courses/{}/staff_grading/get_problem_list$'.format(settings.COURSE_ID_PATTERN),
|
||||
'open_ended_grading.staff_grading_service.get_problem_list', name='staff_grading_get_problem_list'),
|
||||
url(
|
||||
r'^courses/{}/staff_grading$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'open_ended_grading.views.staff_grading',
|
||||
name='staff_grading',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/staff_grading/get_next$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'open_ended_grading.staff_grading_service.get_next',
|
||||
name='staff_grading_get_next',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/staff_grading/save_grade$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'open_ended_grading.staff_grading_service.save_grade',
|
||||
name='staff_grading_save_grade',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/staff_grading/get_problem_list$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'open_ended_grading.staff_grading_service.get_problem_list',
|
||||
name='staff_grading_get_problem_list',
|
||||
),
|
||||
|
||||
# Open Ended problem list
|
||||
url(r'^courses/{}/open_ended_problems$'.format(settings.COURSE_ID_PATTERN),
|
||||
'open_ended_grading.views.student_problem_list', name='open_ended_problems'),
|
||||
url(
|
||||
r'^courses/{}/open_ended_problems$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'open_ended_grading.views.student_problem_list',
|
||||
name='open_ended_problems',
|
||||
),
|
||||
|
||||
# Open Ended flagged problem list
|
||||
url(r'^courses/{}/open_ended_flagged_problems$'.format(settings.COURSE_ID_PATTERN),
|
||||
'open_ended_grading.views.flagged_problem_list', name='open_ended_flagged_problems'),
|
||||
url(r'^courses/{}/open_ended_flagged_problems/take_action_on_flags$'.format(settings.COURSE_ID_PATTERN),
|
||||
'open_ended_grading.views.take_action_on_flags', name='open_ended_flagged_problems_take_action'),
|
||||
url(
|
||||
r'^courses/{}/open_ended_flagged_problems$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'open_ended_grading.views.flagged_problem_list',
|
||||
name='open_ended_flagged_problems',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/open_ended_flagged_problems/take_action_on_flags$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'open_ended_grading.views.take_action_on_flags',
|
||||
name='open_ended_flagged_problems_take_action',
|
||||
),
|
||||
|
||||
# Cohorts management
|
||||
url(r'^courses/{}/cohorts/settings$'.format(settings.COURSE_KEY_PATTERN),
|
||||
url(
|
||||
r'^courses/{}/cohorts/settings$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
'openedx.core.djangoapps.course_groups.views.course_cohort_settings_handler',
|
||||
name="course_cohort_settings"),
|
||||
url(r'^courses/{}/cohorts/(?P<cohort_id>[0-9]+)?$'.format(settings.COURSE_KEY_PATTERN),
|
||||
'openedx.core.djangoapps.course_groups.views.cohort_handler', name="cohorts"),
|
||||
url(r'^courses/{}/cohorts/(?P<cohort_id>[0-9]+)$'.format(settings.COURSE_KEY_PATTERN),
|
||||
name='course_cohort_settings',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/cohorts/(?P<cohort_id>[0-9]+)?$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
'openedx.core.djangoapps.course_groups.views.cohort_handler',
|
||||
name='cohorts',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/cohorts/(?P<cohort_id>[0-9]+)$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
'openedx.core.djangoapps.course_groups.views.users_in_cohort',
|
||||
name="list_cohort"),
|
||||
url(r'^courses/{}/cohorts/(?P<cohort_id>[0-9]+)/add$'.format(settings.COURSE_KEY_PATTERN),
|
||||
name='list_cohort',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/cohorts/(?P<cohort_id>[0-9]+)/add$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
'openedx.core.djangoapps.course_groups.views.add_users_to_cohort',
|
||||
name="add_to_cohort"),
|
||||
url(r'^courses/{}/cohorts/(?P<cohort_id>[0-9]+)/delete$'.format(settings.COURSE_KEY_PATTERN),
|
||||
name='add_to_cohort',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/cohorts/(?P<cohort_id>[0-9]+)/delete$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
'openedx.core.djangoapps.course_groups.views.remove_user_from_cohort',
|
||||
name="remove_from_cohort"),
|
||||
url(r'^courses/{}/cohorts/debug$'.format(settings.COURSE_KEY_PATTERN),
|
||||
name='remove_from_cohort',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/cohorts/debug$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
'openedx.core.djangoapps.course_groups.views.debug_cohort_mgmt',
|
||||
name="debug_cohort_mgmt"),
|
||||
url(r'^courses/{}/cohorts/topics$'.format(settings.COURSE_KEY_PATTERN),
|
||||
name='debug_cohort_mgmt',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/cohorts/topics$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
'openedx.core.djangoapps.course_groups.views.cohort_discussion_topics',
|
||||
name='cohort_discussion_topics'),
|
||||
name='cohort_discussion_topics',
|
||||
),
|
||||
|
||||
# Open Ended Notifications
|
||||
url(r'^courses/{}/open_ended_notifications$'.format(settings.COURSE_ID_PATTERN),
|
||||
'open_ended_grading.views.combined_notifications', name='open_ended_notifications'),
|
||||
url(
|
||||
r'^courses/{}/open_ended_notifications$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'open_ended_grading.views.combined_notifications',
|
||||
name='open_ended_notifications',
|
||||
),
|
||||
|
||||
url(r'^courses/{}/peer_grading$'.format(settings.COURSE_ID_PATTERN),
|
||||
'open_ended_grading.views.peer_grading', name='peer_grading'),
|
||||
url(
|
||||
r'^courses/{}/peer_grading$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'open_ended_grading.views.peer_grading',
|
||||
name='peer_grading',
|
||||
),
|
||||
|
||||
url(r'^courses/{}/notes$'.format(settings.COURSE_ID_PATTERN), 'notes.views.notes', name='notes'),
|
||||
url(r'^courses/{}/notes/'.format(settings.COURSE_ID_PATTERN), include('notes.urls')),
|
||||
url(
|
||||
r'^courses/{}/notes$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'notes.views.notes',
|
||||
name='notes',
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/notes/'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
include('notes.urls')
|
||||
),
|
||||
|
||||
# LTI endpoints listing
|
||||
url(r'^courses/{}/lti_rest_endpoints/'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.get_course_lti_endpoints', name='lti_rest_endpoints'),
|
||||
url(
|
||||
r'^courses/{}/lti_rest_endpoints/'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.get_course_lti_endpoints',
|
||||
name='lti_rest_endpoints',
|
||||
),
|
||||
|
||||
# Student account
|
||||
url(r'^account/', include('student_account.urls')),
|
||||
url(
|
||||
r'^account/',
|
||||
include('student_account.urls')
|
||||
),
|
||||
|
||||
# Student profile
|
||||
url(r'^u/(?P<username>[\w.@+-]+)$', 'student_profile.views.learner_profile', name='learner_profile'),
|
||||
url(
|
||||
r'^u/(?P<username>[\w.@+-]+)$',
|
||||
'student_profile.views.learner_profile',
|
||||
name='learner_profile',
|
||||
),
|
||||
|
||||
# Student Notes
|
||||
url(r'^courses/{}/edxnotes'.format(settings.COURSE_ID_PATTERN),
|
||||
include('edxnotes.urls'), name="edxnotes_endpoints"),
|
||||
url(
|
||||
r'^courses/{}/edxnotes'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
include('edxnotes.urls'),
|
||||
name='edxnotes_endpoints',
|
||||
),
|
||||
|
||||
url(r'^api/branding/v1/', include('branding.api_urls')),
|
||||
url(
|
||||
r'^api/branding/v1/',
|
||||
include('branding.api_urls')
|
||||
),
|
||||
)
|
||||
|
||||
if settings.FEATURES["ENABLE_TEAMS"]:
|
||||
# Teams endpoints
|
||||
urlpatterns += (
|
||||
url(r'^api/team/', include('lms.djangoapps.teams.api_urls')),
|
||||
url(r'^courses/{}/teams'.format(settings.COURSE_ID_PATTERN),
|
||||
include('lms.djangoapps.teams.urls'), name="teams_endpoints"),
|
||||
url(
|
||||
r'^api/team/',
|
||||
include('lms.djangoapps.teams.api_urls')
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/teams'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
include('lms.djangoapps.teams.urls'),
|
||||
name='teams_endpoints',
|
||||
),
|
||||
)
|
||||
|
||||
# allow course staff to change to student view of courseware
|
||||
if settings.FEATURES.get('ENABLE_MASQUERADE'):
|
||||
urlpatterns += (
|
||||
url(r'^courses/{}/masquerade$'.format(settings.COURSE_KEY_PATTERN),
|
||||
'courseware.masquerade.handle_ajax', name="masquerade_update"),
|
||||
url(
|
||||
r'^courses/{}/masquerade$'.format(
|
||||
settings.COURSE_KEY_PATTERN,
|
||||
),
|
||||
'courseware.masquerade.handle_ajax',
|
||||
name='masquerade_update',
|
||||
),
|
||||
)
|
||||
|
||||
urlpatterns += (
|
||||
url(r'^courses/{}/generate_user_cert'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.generate_user_cert', name="generate_user_cert"),
|
||||
url(
|
||||
r'^courses/{}/generate_user_cert'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.generate_user_cert',
|
||||
name='generate_user_cert',
|
||||
),
|
||||
)
|
||||
|
||||
# discussion forums live within courseware, so courseware must be enabled first
|
||||
if settings.FEATURES.get('ENABLE_DISCUSSION_SERVICE'):
|
||||
urlpatterns += (
|
||||
url(r'^api/discussion/', include('discussion_api.urls')),
|
||||
url(r'^courses/{}/discussion/'.format(settings.COURSE_ID_PATTERN),
|
||||
include('django_comment_client.urls')),
|
||||
url(r'^notification_prefs/enable/', 'notification_prefs.views.ajax_enable'),
|
||||
url(r'^notification_prefs/disable/', 'notification_prefs.views.ajax_disable'),
|
||||
url(r'^notification_prefs/status/', 'notification_prefs.views.ajax_status'),
|
||||
url(r'^notification_prefs/unsubscribe/(?P<token>[a-zA-Z0-9-_=]+)/',
|
||||
'notification_prefs.views.set_subscription', {'subscribe': False}, name="unsubscribe_forum_update"),
|
||||
url(r'^notification_prefs/resubscribe/(?P<token>[a-zA-Z0-9-_=]+)/',
|
||||
'notification_prefs.views.set_subscription', {'subscribe': True}, name="resubscribe_forum_update"),
|
||||
url(
|
||||
r'^api/discussion/',
|
||||
include('discussion_api.urls')
|
||||
),
|
||||
url(
|
||||
r'^courses/{}/discussion/'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
include('django_comment_client.urls')
|
||||
),
|
||||
url(
|
||||
r'^notification_prefs/enable/',
|
||||
'notification_prefs.views.ajax_enable'
|
||||
),
|
||||
url(
|
||||
r'^notification_prefs/disable/',
|
||||
'notification_prefs.views.ajax_disable'
|
||||
),
|
||||
url(
|
||||
r'^notification_prefs/status/',
|
||||
'notification_prefs.views.ajax_status'
|
||||
),
|
||||
url(
|
||||
r'^notification_prefs/unsubscribe/(?P<token>[a-zA-Z0-9-_=]+)/',
|
||||
'notification_prefs.views.set_subscription',
|
||||
{
|
||||
'subscribe': False,
|
||||
},
|
||||
name='unsubscribe_forum_update',
|
||||
),
|
||||
url(
|
||||
r'^notification_prefs/resubscribe/(?P<token>[a-zA-Z0-9-_=]+)/',
|
||||
'notification_prefs.views.set_subscription',
|
||||
{
|
||||
'subscribe': True,
|
||||
},
|
||||
name='resubscribe_forum_update',
|
||||
),
|
||||
)
|
||||
urlpatterns += (
|
||||
# This MUST be the last view in the courseware--it's a catch-all for custom tabs.
|
||||
url(r'^courses/{}/(?P<tab_slug>[^/]+)/$'.format(settings.COURSE_ID_PATTERN),
|
||||
'courseware.views.static_tab', name="static_tab"),
|
||||
url(
|
||||
r'^courses/{}/(?P<tab_slug>[^/]+)/$'.format(
|
||||
settings.COURSE_ID_PATTERN,
|
||||
),
|
||||
'courseware.views.static_tab',
|
||||
name='static_tab',
|
||||
),
|
||||
)
|
||||
|
||||
if settings.FEATURES.get('ENABLE_STUDENT_HISTORY_VIEW'):
|
||||
@@ -524,7 +821,8 @@ if settings.FEATURES.get('ENABLE_STUDENT_HISTORY_VIEW'):
|
||||
settings.COURSE_ID_PATTERN
|
||||
),
|
||||
'courseware.views.submission_history',
|
||||
name='submission_history'),
|
||||
name='submission_history',
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user