Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: not all usage keys matching #226

Merged
merged 1 commit into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions edx_exams/apps/api/v1/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
ProctoringProvidersView,
ProctoringSettingsView
)
from edx_exams.apps.core.constants import CONTENT_ID_PATTERN, COURSE_ID_PATTERN, EXAM_ID_PATTERN
from edx_exams.apps.core.constants import COURSE_ID_PATTERN, EXAM_ID_PATTERN, USAGE_KEY_PATTERN

app_name = 'v1'

Expand Down Expand Up @@ -59,7 +59,7 @@
name='instructor-attempts-list'
),
re_path(
fr'student/exam/attempt/course_id/{COURSE_ID_PATTERN}/content_id/{CONTENT_ID_PATTERN}',
fr'student/exam/attempt/course_id/{COURSE_ID_PATTERN}/content_id/{USAGE_KEY_PATTERN}',
CourseExamAttemptView.as_view(),
name='student-course_exam_attempt'
),
Expand Down
2 changes: 1 addition & 1 deletion edx_exams/apps/core/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class Status:

COURSE_ID_PATTERN = rf'(?P<course_id>({INTERNAL_COURSE_KEY_PATTERN}|{EXTERNAL_COURSE_KEY_PATTERN}))'

CONTENT_ID_PATTERN = r'(?P<content_id>([A-Za-z0-9-_:@\+]+))'
USAGE_KEY_PATTERN = r'(?P<content_id>(?:i4x://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pulled from edx-platform. I updated the variable to keep the terminology for this matching string consistent.


EXAM_ID_PATTERN = r'(?P<exam_id>\d+)'
Loading