From 188e0a1e3be09a02b83de6653468a2bbfb535384 Mon Sep 17 00:00:00 2001 From: Zacharis278 Date: Fri, 19 Jul 2024 10:27:44 -0400 Subject: [PATCH 1/2] fix: null checking issue in exam entry --- src/data/thunks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/thunks.js b/src/data/thunks.js index 76ebca13..a0be8555 100644 --- a/src/data/thunks.js +++ b/src/data/thunks.js @@ -546,7 +546,6 @@ export function getAllowProctoringOptOut(allowProctoringOptOut) { export function checkExamEntry() { return async (dispatch, getState) => { const { exam } = getState().specialExams; - const useLegacyAttemptAPI = exam.attempt.use_legacy_attempt_api; // Check only applies to LTI exams if ( !exam?.attempt @@ -561,6 +560,7 @@ export function checkExamEntry() { setTimeout(() => reject(), EXAM_START_TIMEOUT_MILLISECONDS); }), ]).catch(() => { + const useLegacyAttemptAPI = exam.attempt.use_legacy_attempt_api; dispatch(setApiError({ errorMsg: 'Something has gone wrong with your exam. Proctoring application not detected.' })); updateAttemptAfter(exam.course_id, exam.content_id, endExamWithFailure(exam.attempt.attempt_id, 'exam reentry disallowed', useLegacyAttemptAPI))(dispatch); }); From 07b92a5e096a223fe8fce79ce544e0839cc9b476 Mon Sep 17 00:00:00 2001 From: Zacharis278 Date: Fri, 19 Jul 2024 10:34:58 -0400 Subject: [PATCH 2/2] fix: we don't even need to evaluate this --- src/data/thunks.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/data/thunks.js b/src/data/thunks.js index a0be8555..16fb61c0 100644 --- a/src/data/thunks.js +++ b/src/data/thunks.js @@ -560,9 +560,8 @@ export function checkExamEntry() { setTimeout(() => reject(), EXAM_START_TIMEOUT_MILLISECONDS); }), ]).catch(() => { - const useLegacyAttemptAPI = exam.attempt.use_legacy_attempt_api; dispatch(setApiError({ errorMsg: 'Something has gone wrong with your exam. Proctoring application not detected.' })); - updateAttemptAfter(exam.course_id, exam.content_id, endExamWithFailure(exam.attempt.attempt_id, 'exam reentry disallowed', useLegacyAttemptAPI))(dispatch); + updateAttemptAfter(exam.course_id, exam.content_id, endExamWithFailure(exam.attempt.attempt_id, 'exam reentry disallowed', false))(dispatch); }); } };