Skip to content

Commit

Permalink
fix: not all usage keys matching
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharis278 committed Dec 14, 2023
1 parent 819af4a commit 5fc0c0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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://?[^/]+/[^/]+/[^/]+/[^@]+(?:@[^/]+)?)|(?:[^/]+))'

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

0 comments on commit 5fc0c0e

Please sign in to comment.