-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BD-26][EDUCATOR-5808] Add additional pages for onboarding / practice…
… exams and fix a bug with JS worker (#15) * fix: improve not emitting onStartAttempt message to proctoring backend provider when starting proctored exam (#26) * feat: add entrance pages for onboarding and practice exams + reafactoring * fix: timer text * feat: add rejected and submit exam onboarding instructions pages + more refactoring * refactor: instructions page * fix: updated broken tests * fix: remove unnecessary attributes in tests * fix: revert timer changes * refactor: split startProctoredExam function into two to handle create attempt and start exam actions separately * tests: add new test cases for entrance / rejected onboarding instructions * refactor: rename startExam function to startTimedExam since it's only used for timed exams, add docstring
- Loading branch information
1 parent
ef7110b
commit e44e38e
Showing
29 changed files
with
820 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Container } from '@edx/paragon'; | ||
import { ExamType } from '../constants'; | ||
import { EntranceProctoredExamInstructions } from './proctored_exam'; | ||
import { EntranceOnboardingExamInstructions } from './onboarding_exam'; | ||
import EntrancePracticeExamInstructions from './practice_exam'; | ||
import { StartTimedExamInstructions, TimedExamFooter } from './timed_exam'; | ||
import Footer from './proctored_exam/Footer'; | ||
|
||
const EntranceExamInstructions = ({ examType, skipProctoredExam }) => { | ||
const renderInstructions = () => { | ||
switch (examType) { | ||
case ExamType.PROCTORED: | ||
return <EntranceProctoredExamInstructions skipProctoredExam={skipProctoredExam} />; | ||
case ExamType.ONBOARDING: | ||
return <EntranceOnboardingExamInstructions />; | ||
case ExamType.PRACTICE: | ||
return <EntrancePracticeExamInstructions />; | ||
case ExamType.TIMED: | ||
return <StartTimedExamInstructions />; | ||
default: | ||
return null; | ||
} | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Container className="border py-5 mb-4"> | ||
{renderInstructions()} | ||
</Container> | ||
{examType === ExamType.TIMED | ||
? <TimedExamFooter /> | ||
: <Footer />} | ||
</div> | ||
); | ||
}; | ||
|
||
EntranceExamInstructions.propTypes = { | ||
examType: PropTypes.string.isRequired, | ||
skipProctoredExam: PropTypes.func.isRequired, | ||
}; | ||
|
||
export default EntranceExamInstructions; |
Oops, something went wrong.