Skip to content

Commit

Permalink
fix: show correct exam time when allowance is added (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
viktorrusakov authored Jun 17, 2021
1 parent 5b1cba3 commit ca071c8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion src/exam/ExamWrapper.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ store.getState = () => ({
},
exam: {
time_limit_mins: 30,
total_time: '30 minutes',
type: 'timed',
attempt: {},
},
Expand Down Expand Up @@ -63,7 +64,7 @@ describe('SequenceExamWrapper', () => {
can_verify: true,
},
exam: {
time_limit_mins: 30,
total_time: '30 minutes',
type: 'timed',
attempt: {},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('SequenceExamWrapper', () => {
exam: {
type: ExamType.PROCTORED,
is_proctored: true,
time_limit_mins: 30,
total_time: '30 minutes',
attempt: {},
},
},
Expand Down Expand Up @@ -81,10 +81,10 @@ describe('SequenceExamWrapper', () => {
exam: {
type: ExamType.PROCTORED,
is_proctored: true,
time_limit_mins: 30,
attempt: {
attempt_status: 'started',
attempt_id: 1,
total_time: '30 minutes',
},
},
},
Expand Down Expand Up @@ -118,10 +118,10 @@ describe('SequenceExamWrapper', () => {
exam: {
type: ExamType.PROCTORED,
is_proctored: true,
time_limit_mins: 30,
attempt: {
attempt_status: 'ready_to_start',
attempt_id: 1,
total_time: '30 minutes',
},
},
},
Expand Down Expand Up @@ -156,10 +156,10 @@ describe('SequenceExamWrapper', () => {
exam: {
type: ExamType.PROCTORED,
is_proctored: true,
time_limit_mins: 30,
attempt: {
attempt_status: 'submitted',
attempt_id: 1,
total_time: '30 minutes',
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const ReadyToStartProctoredExamInstructions = () => {
getExamReviewPolicy,
startProctoredExam,
} = state;
const { time_limit_mins: examDuration, reviewPolicy } = exam;
const { attempt, reviewPolicy } = exam;
const { total_time: examDuration } = attempt;
const { link_urls: linkUrls, platform_name: platformName } = proctoringSettings;
const rulesUrl = linkUrls && linkUrls.online_proctoring_rules;

Expand All @@ -33,7 +34,7 @@ const ReadyToStartProctoredExamInstructions = () => {
<li data-testid="duration-text">
<FormattedMessage
id="exam.ReadyToStartProctoredExamInstructions.text1"
defaultMessage={'You have {examDuration} minutes to complete this exam.'}
defaultMessage={'You have {examDuration} to complete this exam.'}
values={{ examDuration }}
/>
</li>
Expand Down
6 changes: 3 additions & 3 deletions src/instructions/timed_exam/StartTimedExamInstructions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import ExamStateContext from '../../context';
const StartTimedExamInstructions = () => {
const state = useContext(ExamStateContext);
const { exam, startTimedExam } = state;
const examDuration = exam.time_limit_mins;
const examDuration = exam.total_time;

return (
<>
<div className="h3" data-testid="exam-instructions-title">
<FormattedMessage
id="exam.startExamInstructions.title"
defaultMessage="Subsection is a Timed Exam ({examDuration} minutes)"
defaultMessage="Subsection is a Timed Exam ({examDuration})"
values={{ examDuration }}
/>
</div>
Expand All @@ -31,7 +31,7 @@ const StartTimedExamInstructions = () => {
<FormattedMessage
id="exam.startExamInstructions.text3"
defaultMessage={'After you select "I am ready to start this timed exam", '
+ 'you will have {examDuration} minutes to complete and submit the exam.'}
+ 'you will have {examDuration} to complete and submit the exam.'}
values={{ examDuration }}
/>
</p>
Expand Down

0 comments on commit ca071c8

Please sign in to comment.