@@ -41,6 +41,7 @@ const ProctoringSettings = ({ onClose }) => {
4141 const [ loadingPermissionError , setLoadingPermissionError ] = useState ( false ) ;
4242 const [ allowLtiProviders , setAllowLtiProviders ] = useState ( false ) ;
4343 const [ availableProctoringProviders , setAvailableProctoringProviders ] = useState ( [ ] ) ;
44+ const [ requiresEscalationEmailProviders , setRequiresEscalationEmailProviders ] = useState ( [ ] ) ;
4445 const [ ltiProctoringProviders , setLtiProctoringProviders ] = useState ( [ ] ) ;
4546 const [ courseStartDate , setCourseStartDate ] = useState ( '' ) ;
4647 const [ saveSuccess , setSaveSuccess ] = useState ( false ) ;
@@ -84,12 +85,9 @@ const ProctoringSettings = ({ onClose }) => {
8485 } else if ( name === 'proctoringProvider' ) {
8586 const newFormValues = { ...formValues , proctoringProvider : value } ;
8687
87- if ( value === 'proctortrack' ) {
88- setFormValues ( { ...newFormValues , createZendeskTickets : false } ) ;
88+ if ( requiresEscalationEmailProviders . includes ( value ) ) {
89+ setFormValues ( { ...newFormValues } ) ;
8990 setShowEscalationEmail ( true ) ;
90- } else if ( value === 'software_secure' ) {
91- setFormValues ( { ...newFormValues , createZendeskTickets : true } ) ;
92- setShowEscalationEmail ( false ) ;
9391 } else if ( isLtiProvider ( value ) ) {
9492 setFormValues ( newFormValues ) ;
9593 setShowEscalationEmail ( true ) ;
@@ -123,7 +121,7 @@ const ProctoringSettings = ({ onClose }) => {
123121 studioDataToPostBack . proctored_exam_settings . allow_proctoring_opt_out = formValues . allowOptingOut ;
124122 }
125123
126- if ( formValues . proctoringProvider === 'proctortrack' ) {
124+ if ( requiresEscalationEmailProviders . includes ( formValues . proctoringProvider ) ) {
127125 studioDataToPostBack . proctored_exam_settings . proctoring_escalation_email = formValues . escalationEmail === '' ? null : formValues . escalationEmail ;
128126 }
129127
@@ -160,7 +158,7 @@ const ProctoringSettings = ({ onClose }) => {
160158 event . preventDefault ( ) ;
161159 const isLtiProviderSelected = isLtiProvider ( formValues . proctoringProvider ) ;
162160 if (
163- ( formValues . proctoringProvider === 'proctortrack' || isLtiProviderSelected )
161+ ( requiresEscalationEmailProviders . includes ( formValues . proctoringProvider ) || isLtiProviderSelected )
164162 && ! EmailValidator . validate ( formValues . escalationEmail )
165163 && ! ( formValues . escalationEmail === '' && ! formValues . enableProctoredExams )
166164 ) {
@@ -527,6 +525,7 @@ const ProctoringSettings = ({ onClose }) => {
527525 setSubmissionInProgress ( false ) ;
528526 setCourseStartDate ( settingsResponse . data . course_start_date ) ;
529527 setAvailableProctoringProviders ( settingsResponse . data . available_proctoring_providers ) ;
528+ setRequiresEscalationEmailProviders ( settingsResponse . data . requires_escalation_email_providers ) ;
530529
531530 // The list of providers returned by studio settings are the default behavior. If lti_external
532531 // is available as an option display the list of LTI providers returned by the exam service.
@@ -554,10 +553,10 @@ const ProctoringSettings = ({ onClose }) => {
554553 selectedProvider = proctoredExamSettings . proctoring_provider ;
555554 }
556555
557- const isProctortrack = selectedProvider === 'proctortrack' ;
556+ const isEscalationEmailRequired = settingsResponse . data . requires_escalation_email_providers . includes ( selectedProvider ) ;
558557 const ltiProviderSelected = proctoringProvidersLti . some ( p => p . name === selectedProvider ) ;
559558
560- if ( isProctortrack || ltiProviderSelected ) {
559+ if ( isEscalationEmailRequired || ltiProviderSelected ) {
561560 setShowEscalationEmail ( true ) ;
562561 }
563562
0 commit comments