feat: show error on courses with unknown proctoring providers (#35445)

This commit is contained in:
Zachary Hancock
2024-09-10 09:02:13 -04:00
committed by GitHub
parent 08bd8b312e
commit 4b827bf9be
3 changed files with 63 additions and 25 deletions

View File

@@ -490,6 +490,24 @@ class CourseMetadata:
enable_proctoring = block.enable_proctored_exams
if enable_proctoring:
if proctoring_provider_model:
proctoring_provider = proctoring_provider_model.get('value')
else:
proctoring_provider = block.proctoring_provider
# If the proctoring provider stored in the course block no longer
# matches the available providers for this instance, show an error
if proctoring_provider not in available_providers:
message = (
f'The proctoring provider configured for this course, \'{proctoring_provider}\', is not valid.'
)
errors.append({
'key': 'proctoring_provider',
'message': message,
'model': proctoring_provider_model
})
# Require a valid escalation email if Proctortrack is chosen as the proctoring provider
escalation_email_model = settings_dict.get('proctoring_escalation_email')
if escalation_email_model:
@@ -497,11 +515,6 @@ class CourseMetadata:
else:
escalation_email = block.proctoring_escalation_email
if proctoring_provider_model:
proctoring_provider = proctoring_provider_model.get('value')
else:
proctoring_provider = block.proctoring_provider
missing_escalation_email_msg = 'Provider \'{provider}\' requires an exam escalation contact.'
if proctoring_provider_model and proctoring_provider == 'proctortrack':
if not escalation_email: