Skip to content

Commit

Permalink
fix: [BD-26] Error status doesn't work properly (#29)
Browse files Browse the repository at this point in the history
* fix: Error status doesn't work properly

* fix: Incorrect eye image on the timer block
  • Loading branch information
UvgenGen authored Jun 29, 2021
1 parent 028414e commit 804210f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
14 changes: 9 additions & 5 deletions src/data/thunks.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
fetchExamReviewPolicy,
resetAttempt,
declineAttempt,
endExamWithFailure,
} from './api';
import { isEmpty } from '../helpers';
import {
Expand Down Expand Up @@ -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);
});
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const EntranceProctoredExamInstructions = ({ skipProctoredExam }) => {
<p>
<FormattedMessage
id="exam.ReadyToResumeProctoredExamInstructions.text"
ddefaultMessage="You will have {totalTime} to complete your exam."
defaultMessage="You will have {totalTime} to complete your exam."
values={{ totalTime }}
/>
</p>
Expand Down
4 changes: 2 additions & 2 deletions src/timer/CountDownTimer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ const CountDownTimer = injectIntl((props) => {
})}
>
{isShowTimer
? <Icon data-testid="hide-timer" src={Visibility} onClick={hideTimer} />
: <Icon data-testid="show-timer" src={VisibilityOff} onClick={showTimer} />}
? <Icon data-testid="hide-timer" src={VisibilityOff} onClick={hideTimer} />
: <Icon data-testid="show-timer" src={Visibility} onClick={showTimer} />}
</span>
</div>
);
Expand Down

0 comments on commit 804210f

Please sign in to comment.