From 804210ff484dc51a031dbbf4aac23da5f0dde059 Mon Sep 17 00:00:00 2001 From: Sagirov Evgeniy <34642612+UvgenGen@users.noreply.github.com> Date: Tue, 29 Jun 2021 21:56:52 +0300 Subject: [PATCH] fix: [BD-26] Error status doesn't work properly (#29) * fix: Error status doesn't work properly * fix: Incorrect eye image on the timer block --- src/data/thunks.js | 14 +++++++++----- .../EntranceProctoredExamInstructions.jsx | 2 +- src/timer/CountDownTimer.jsx | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) 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 }) => {