Skip to content

Commit fa562a6

Browse files
arbiraliTaimoor  Ahmed
andauthored
refactor: Replace ProctorTrack references with Generic Checks (#2645)
This pull request removes frontend-level handling of the ProctorTrack proctoring provider from the frontend-app-authoring application. As part of the broader ProctorTrack deprecation effort (openedx/edx-platform#36329), the backend now provides generic proctoring configuration rules instead of vendor-specific conditions. The frontend has been updated to rely on these generic rules while still performing client-side validation. By removing the ProctorTrack-specific logic and using the backend’s generic configuration model, this change keeps frontend-app-authoring aligned with current backend behavior and avoids relying on deprecated vendor-specific handling. Co-authored-by: Taimoor Ahmed <[email protected]>
1 parent 70c19a3 commit fa562a6

File tree

2 files changed

+88
-54
lines changed

2 files changed

+88
-54
lines changed

plugins/course-apps/proctoring/Settings.jsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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,11 @@ const ProctoringSettings = ({ onClose }) => {
554553
selectedProvider = proctoredExamSettings.proctoring_provider;
555554
}
556555

557-
const isProctortrack = selectedProvider === 'proctortrack';
556+
const requiresEscalationEmailProvidersList = settingsResponse.data.requires_escalation_email_providers;
557+
const isEscalationEmailRequired = requiresEscalationEmailProvidersList.includes(selectedProvider);
558558
const ltiProviderSelected = proctoringProvidersLti.some(p => p.name === selectedProvider);
559559

560-
if (isProctortrack || ltiProviderSelected) {
560+
if (isEscalationEmailRequired || ltiProviderSelected) {
561561
setShowEscalationEmail(true);
562562
}
563563

0 commit comments

Comments
 (0)