feat: show error on courses with unknown proctoring providers (#35445)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user