-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add escalation email to ProctoringSettingsView
This commit renames the CourseProviderSettingsView view to ProctoringSettingsView to accomodate additional settings beyond just provider settings; this more closely mirrors the purpose of the analogous edx-proctoring view. This commit also adds the escalation email to the response under the proctoring_escalation_email key. This changes allows the escalation email to appear in the error interstitial in the learning MFE.
- Loading branch information
1 parent
ceceedd
commit 8ea7452
Showing
15 changed files
with
77 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ | |
create_or_update_course_exam_configuration, | ||
get_active_attempt_for_user, | ||
get_attempt_by_id, | ||
get_course_exam_configuration_by_course_id, | ||
get_course_exams, | ||
get_current_exam_attempt, | ||
get_exam_attempt_time_remaining, | ||
|
@@ -729,38 +730,44 @@ def get(self, request, course_id, content_id): # pylint: disable=unused-argumen | |
return Response(data) | ||
|
||
|
||
class CourseProviderSettingsView(ExamsAPIView): | ||
class ProctoringSettingsView(ExamsAPIView): | ||
""" | ||
Endpoint for getting provider related settings. | ||
Endpoint for getting an exam's proctoring settings, including course-wide settings like the escalation email and | ||
exam-specific settings like provider settings. | ||
exam/provider_settings/course_id/{course_id}/exam_id/{exam_id} | ||
Supports: | ||
HTTP GET: | ||
Returns provider specific information given an exam_id | ||
Returns exam configuration settings given an exam_id | ||
{ | ||
provider_tech_support_email: '', | ||
provider_tech_support_phone: '', | ||
provider_name: 'test provider', | ||
escalation_name: '[email protected]', | ||
} | ||
""" | ||
|
||
authentication_classes = (JwtAuthentication,) | ||
permission_classes = (IsAuthenticated,) | ||
|
||
def get(self, request, course_id, exam_id): # pylint: disable=unused-argument | ||
def get(self, request, course_id, exam_id): | ||
""" | ||
HTTP GET handler. Returns provider specific information given an exam_id | ||
HTTP GET handler. Returns exam configuration settings given an exam_id | ||
The course_id is provided as a path parameter to account for the exams middleware | ||
The course_id is provided as a path parameter to account for the exams ExamRequestMiddleware router. | ||
""" | ||
provider = get_provider_by_exam_id(exam_id) | ||
config_data = get_course_exam_configuration_by_course_id(course_id) | ||
|
||
data = {} | ||
|
||
if provider: | ||
return Response({ | ||
'provider_tech_support_email': provider.tech_support_email, | ||
'provider_tech_support_phone': provider.tech_support_phone, | ||
'provider_name': provider.verbose_name, | ||
}) | ||
return Response({}) | ||
data['provider_tech_support_email'] = provider.tech_support_email | ||
data['provider_tech_support_phone'] = provider.tech_support_phone | ||
data['provider_name'] = provider.verbose_name | ||
|
||
data['proctoring_escalation_email'] = config_data.escalation_email | ||
|
||
return Response(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
""" | ||
Public data structures for the core applictaion. | ||
""" | ||
from attrs import field, frozen, validators | ||
|
||
|
||
@frozen | ||
class CourseExamConfigurationData: | ||
course_id: str = field(validator=validators.instance_of(str)) | ||
provider: str = field(validator=validators.instance_of(str)) | ||
allow_opt_out: field(validator=validators.instance_of(str)) | ||
escalation_email: str = field(validator=validators.instance_of(str)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
|
||
|
||
# A central location for most common version constraints | ||
# (across edx repos) for pip-installation. | ||
# | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters