-
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.
feat: [BD-26][EDUCATOR-5811] Add missed proctored exam instruction pa…
…ges (#18) * feat: [BD-26] Add missed proctored exam instruction pages * test: add test for ready to resume and error instructions * fix: use values from backend instead of hardcoding Co-authored-by: Viktor Rusakov <[email protected]>
- Loading branch information
1 parent
3106b5a
commit 2b9effb
Showing
6 changed files
with
167 additions
and
8 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
37 changes: 30 additions & 7 deletions
37
src/instructions/proctored_exam/EntranceProctoredExamInstructions.jsx
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
58 changes: 58 additions & 0 deletions
58
src/instructions/proctored_exam/ErrorProctoredExamInstructions.jsx
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,58 @@ | ||
import React, { useContext } from 'react'; | ||
import { FormattedMessage } from '@edx/frontend-platform/i18n'; | ||
import { Container, Hyperlink, MailtoLink } from '@edx/paragon'; | ||
import ExamStateContext from '../../context'; | ||
import Footer from './Footer'; | ||
|
||
const ErrorProctoredExamInstructions = () => { | ||
const state = useContext(ExamStateContext); | ||
const { | ||
link_urls: linkUrls, | ||
platform_name: platformName, | ||
proctoring_escalation_email: proctoringEscalationEmail, | ||
} = state.proctoringSettings || {}; | ||
const contactUsUrl = linkUrls && linkUrls.contact_us; | ||
|
||
const renderBody = () => { | ||
if (proctoringEscalationEmail) { | ||
return ( | ||
<FormattedMessage | ||
id="exam.ErrorProctoredExamInstructions.text1" | ||
defaultMessage={'A system error has occurred with your proctored exam. ' | ||
+ 'Please reach out to your course team at {supportLink} for assistance, ' | ||
+ 'and return to the exam once you receive further instructions.'} | ||
values={{ supportLink: <MailtoLink to={proctoringEscalationEmail}>{proctoringEscalationEmail}</MailtoLink> }} | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<FormattedMessage | ||
id="exam.ErrorProctoredExamInstructions.text2" | ||
defaultMessage={'A system error has occurred with your proctored exam. ' | ||
+ 'Please reach out to {supportLink} for assistance, and return to ' | ||
+ 'the exam once you receive further instructions.'} | ||
values={{ supportLink: <Hyperlink href={contactUsUrl} target="_blank">{platformName} Support</Hyperlink> }} | ||
/> | ||
); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<Container className="border py-5 mb-4"> | ||
<div className="h3"> | ||
<FormattedMessage | ||
id="exam.ErrorProctoredExamInstructions.title" | ||
defaultMessage="Error with proctored exam" | ||
/> | ||
</div> | ||
<p className="mb-0"> | ||
{renderBody()} | ||
</p> | ||
</Container> | ||
<Footer /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ErrorProctoredExamInstructions; |
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