diff --git a/src/data/thunks.js b/src/data/thunks.js index 827dbce3..2c35ccdb 100644 --- a/src/data/thunks.js +++ b/src/data/thunks.js @@ -12,6 +12,7 @@ import { fetchExamReviewPolicy, resetAttempt, declineAttempt, + endExamWithFailure, } from './api'; import { isEmpty } from '../helpers'; import { @@ -340,12 +341,15 @@ export function expireExam() { * @param workerUrl - location of the worker from the provider */ export function pingAttempt(timeoutInSeconds, workerUrl) { - return async (dispatch) => { + return async (dispatch, getState) => { await pingApplication(timeoutInSeconds, workerUrl) - .catch((error) => handleAPIError( - { message: error ? error.message : 'Worker failed to respond.' }, - dispatch, - )); + .catch(async (error) => { + const { exam, activeAttempt } = getState().examState; + const message = error ? error.message : 'Worker failed to respond.'; + await updateAttemptAfter( + exam.course_id, exam.content_id, endExamWithFailure(activeAttempt.attempt_id, message), + )(dispatch); + }); }; } diff --git a/src/instructions/proctored_exam/EntranceProctoredExamInstructions.jsx b/src/instructions/proctored_exam/EntranceProctoredExamInstructions.jsx index fe9080f9..d2190ecb 100644 --- a/src/instructions/proctored_exam/EntranceProctoredExamInstructions.jsx +++ b/src/instructions/proctored_exam/EntranceProctoredExamInstructions.jsx @@ -25,7 +25,7 @@ const EntranceProctoredExamInstructions = ({ skipProctoredExam }) => {

diff --git a/src/timer/CountDownTimer.jsx b/src/timer/CountDownTimer.jsx index 7ceca588..1eb10d90 100644 --- a/src/timer/CountDownTimer.jsx +++ b/src/timer/CountDownTimer.jsx @@ -33,8 +33,8 @@ const CountDownTimer = injectIntl((props) => { })} > {isShowTimer - ? - : } + ? + : } );