@digabi/exam-engine-core 16.2.3 → 16.4.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/components/AttachmentContext.d.ts +14 -0
- package/dist/components/AttachmentContext.d.ts.map +1 -0
- package/dist/components/AttachmentContext.js +12 -0
- package/dist/components/AttachmentContext.js.map +1 -0
- package/dist/components/AttachmentLink.d.ts +5 -0
- package/dist/components/AttachmentLink.d.ts.map +1 -0
- package/dist/components/AttachmentLink.js +28 -0
- package/dist/components/AttachmentLink.js.map +1 -0
- package/dist/components/AttachmentLinkAnchor.d.ts +7 -0
- package/dist/components/AttachmentLinkAnchor.d.ts.map +1 -0
- package/dist/components/AttachmentLinkAnchor.js +4 -0
- package/dist/components/AttachmentLinkAnchor.js.map +1 -0
- package/dist/components/AttachmentLinks.d.ts +5 -0
- package/dist/components/AttachmentLinks.d.ts.map +1 -0
- package/dist/components/AttachmentLinks.js +62 -0
- package/dist/components/AttachmentLinks.js.map +1 -0
- package/dist/components/Attachments.d.ts +6 -0
- package/dist/components/Attachments.d.ts.map +1 -0
- package/dist/components/Attachments.js +55 -0
- package/dist/components/Attachments.js.map +1 -0
- package/dist/components/AttachmentsAttachment.d.ts +5 -0
- package/dist/components/AttachmentsAttachment.d.ts.map +1 -0
- package/dist/components/AttachmentsAttachment.js +8 -0
- package/dist/components/AttachmentsAttachment.js.map +1 -0
- package/dist/components/AttachmentsAttachmentTitle.d.ts +6 -0
- package/dist/components/AttachmentsAttachmentTitle.d.ts.map +1 -0
- package/dist/components/AttachmentsAttachmentTitle.js +12 -0
- package/dist/components/AttachmentsAttachmentTitle.js.map +1 -0
- package/dist/components/AttachmentsExternalMaterial.d.ts +9 -0
- package/dist/components/AttachmentsExternalMaterial.d.ts.map +1 -0
- package/dist/components/AttachmentsExternalMaterial.js +40 -0
- package/dist/components/AttachmentsExternalMaterial.js.map +1 -0
- package/dist/components/AttachmentsQuestion.d.ts +5 -0
- package/dist/components/AttachmentsQuestion.d.ts.map +1 -0
- package/dist/components/AttachmentsQuestion.js +17 -0
- package/dist/components/AttachmentsQuestion.js.map +1 -0
- package/dist/components/AttachmentsQuestionTitle.d.ts +6 -0
- package/dist/components/AttachmentsQuestionTitle.d.ts.map +1 -0
- package/dist/components/AttachmentsQuestionTitle.js +13 -0
- package/dist/components/AttachmentsQuestionTitle.js.map +1 -0
- package/dist/components/Audio.d.ts +6 -0
- package/dist/components/Audio.d.ts.map +1 -0
- package/dist/components/Audio.js +31 -0
- package/dist/components/Audio.js.map +1 -0
- package/dist/components/AudioGroup.d.ts +6 -0
- package/dist/components/AudioGroup.d.ts.map +1 -0
- package/dist/components/AudioGroup.js +9 -0
- package/dist/components/AudioGroup.js.map +1 -0
- package/dist/components/AudioPlaybackError.d.ts +7 -0
- package/dist/components/AudioPlaybackError.d.ts.map +1 -0
- package/dist/components/AudioPlaybackError.js +13 -0
- package/dist/components/AudioPlaybackError.js.map +1 -0
- package/dist/components/AudioTest.d.ts +6 -0
- package/dist/components/AudioTest.d.ts.map +1 -0
- package/dist/components/AudioTest.js +29 -0
- package/dist/components/AudioTest.js.map +1 -0
- package/dist/components/ChoiceAnswer.d.ts +12 -0
- package/dist/components/ChoiceAnswer.d.ts.map +1 -0
- package/dist/components/ChoiceAnswer.js +62 -0
- package/dist/components/ChoiceAnswer.js.map +1 -0
- package/dist/components/CommonExamContext.d.ts +19 -0
- package/dist/components/CommonExamContext.d.ts.map +1 -0
- package/dist/components/CommonExamContext.js +25 -0
- package/dist/components/CommonExamContext.js.map +1 -0
- package/dist/components/DropdownAnswer.d.ts +12 -0
- package/dist/components/DropdownAnswer.d.ts.map +1 -0
- package/dist/components/DropdownAnswer.js +100 -0
- package/dist/components/DropdownAnswer.js.map +1 -0
- package/dist/components/ErrorIndicator.d.ts +4 -0
- package/dist/components/ErrorIndicator.d.ts.map +1 -0
- package/dist/components/ErrorIndicator.js +43 -0
- package/dist/components/ErrorIndicator.js.map +1 -0
- package/dist/components/Exam.d.ts +32 -0
- package/dist/components/Exam.d.ts.map +1 -0
- package/dist/components/Exam.js +103 -0
- package/dist/components/Exam.js.map +1 -0
- package/dist/components/ExamAttachment.d.ts +5 -0
- package/dist/components/ExamAttachment.d.ts.map +1 -0
- package/dist/components/ExamAttachment.js +8 -0
- package/dist/components/ExamAttachment.js.map +1 -0
- package/dist/components/ExamContext.d.ts +10 -0
- package/dist/components/ExamContext.d.ts.map +1 -0
- package/dist/components/ExamContext.js +11 -0
- package/dist/components/ExamContext.js.map +1 -0
- package/dist/components/ExamFooter.d.ts +6 -0
- package/dist/components/ExamFooter.d.ts.map +1 -0
- package/dist/components/ExamFooter.js +7 -0
- package/dist/components/ExamFooter.js.map +1 -0
- package/dist/components/ExamInstruction.d.ts +6 -0
- package/dist/components/ExamInstruction.d.ts.map +1 -0
- package/dist/components/ExamInstruction.js +6 -0
- package/dist/components/ExamInstruction.js.map +1 -0
- package/dist/components/ExamQuestion.d.ts +5 -0
- package/dist/components/ExamQuestion.d.ts.map +1 -0
- package/dist/components/ExamQuestion.js +16 -0
- package/dist/components/ExamQuestion.js.map +1 -0
- package/dist/components/ExamQuestionInstruction.d.ts +6 -0
- package/dist/components/ExamQuestionInstruction.d.ts.map +1 -0
- package/dist/components/ExamQuestionInstruction.js +6 -0
- package/dist/components/ExamQuestionInstruction.js.map +1 -0
- package/dist/components/ExamQuestionTitle.d.ts +5 -0
- package/dist/components/ExamQuestionTitle.d.ts.map +1 -0
- package/dist/components/ExamQuestionTitle.js +24 -0
- package/dist/components/ExamQuestionTitle.js.map +1 -0
- package/dist/components/ExamSection.d.ts +5 -0
- package/dist/components/ExamSection.d.ts.map +1 -0
- package/dist/components/ExamSection.js +31 -0
- package/dist/components/ExamSection.js.map +1 -0
- package/dist/components/ExamSectionTitle.d.ts +6 -0
- package/dist/components/ExamSectionTitle.d.ts.map +1 -0
- package/dist/components/ExamSectionTitle.js +22 -0
- package/dist/components/ExamSectionTitle.js.map +1 -0
- package/dist/components/ExternalMaterialList.d.ts +10 -0
- package/dist/components/ExternalMaterialList.d.ts.map +1 -0
- package/dist/components/ExternalMaterialList.js +33 -0
- package/dist/components/ExternalMaterialList.js.map +1 -0
- package/dist/components/File.d.ts +6 -0
- package/dist/components/File.d.ts.map +1 -0
- package/dist/components/File.js +15 -0
- package/dist/components/File.js.map +1 -0
- package/dist/components/Formula.d.ts +6 -0
- package/dist/components/Formula.d.ts.map +1 -0
- package/dist/components/Formula.js +13 -0
- package/dist/components/Formula.js.map +1 -0
- package/dist/components/Hints.d.ts +5 -0
- package/dist/components/Hints.d.ts.map +1 -0
- package/dist/components/Hints.js +30 -0
- package/dist/components/Hints.js.map +1 -0
- package/dist/components/Image.d.ts +6 -0
- package/dist/components/Image.d.ts.map +1 -0
- package/dist/components/Image.js +28 -0
- package/dist/components/Image.js.map +1 -0
- package/dist/components/ImageOverlay.d.ts +6 -0
- package/dist/components/ImageOverlay.d.ts.map +1 -0
- package/dist/components/ImageOverlay.js +44 -0
- package/dist/components/ImageOverlay.js.map +1 -0
- package/dist/components/ProgressBar.d.ts +7 -0
- package/dist/components/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar.js +19 -0
- package/dist/components/ProgressBar.js.map +1 -0
- package/dist/components/QuestionContext.d.ts +14 -0
- package/dist/components/QuestionContext.d.ts.map +1 -0
- package/dist/components/QuestionContext.js +20 -0
- package/dist/components/QuestionContext.js.map +1 -0
- package/dist/components/Reference.d.ts +6 -0
- package/dist/components/Reference.d.ts.map +1 -0
- package/dist/components/Reference.js +71 -0
- package/dist/components/Reference.js.map +1 -0
- package/dist/components/References.d.ts +6 -0
- package/dist/components/References.d.ts.map +1 -0
- package/dist/components/References.js +25 -0
- package/dist/components/References.js.map +1 -0
- package/dist/components/ResponsiveMediaContainer.d.ts +18 -0
- package/dist/components/ResponsiveMediaContainer.d.ts.map +1 -0
- package/dist/components/ResponsiveMediaContainer.js +21 -0
- package/dist/components/ResponsiveMediaContainer.js.map +1 -0
- package/dist/components/RestrictedAudioPlayer.d.ts +12 -0
- package/dist/components/RestrictedAudioPlayer.d.ts.map +1 -0
- package/dist/components/RestrictedAudioPlayer.js +32 -0
- package/dist/components/RestrictedAudioPlayer.js.map +1 -0
- package/dist/components/RichTextAnswer.d.ts +33 -0
- package/dist/components/RichTextAnswer.d.ts.map +1 -0
- package/dist/components/RichTextAnswer.js +61 -0
- package/dist/components/RichTextAnswer.js.map +1 -0
- package/dist/components/SaveIndicator.d.ts +5 -0
- package/dist/components/SaveIndicator.d.ts.map +1 -0
- package/dist/components/SaveIndicator.js +16 -0
- package/dist/components/SaveIndicator.js.map +1 -0
- package/dist/components/Score.d.ts +8 -0
- package/dist/components/Score.d.ts.map +1 -0
- package/dist/components/Score.js +13 -0
- package/dist/components/Score.js.map +1 -0
- package/dist/components/Section.d.ts +4 -0
- package/dist/components/Section.d.ts.map +1 -0
- package/dist/components/Section.js +8 -0
- package/dist/components/Section.js.map +1 -0
- package/dist/components/SectionContext.d.ts +13 -0
- package/dist/components/SectionContext.d.ts.map +1 -0
- package/dist/components/SectionContext.js +21 -0
- package/dist/components/SectionContext.js.map +1 -0
- package/dist/components/SectionInstruction.d.ts +6 -0
- package/dist/components/SectionInstruction.d.ts.map +1 -0
- package/dist/components/SectionInstruction.js +6 -0
- package/dist/components/SectionInstruction.js.map +1 -0
- package/dist/components/TableOfContents.d.ts +13 -0
- package/dist/components/TableOfContents.d.ts.map +1 -0
- package/dist/components/TableOfContents.js +66 -0
- package/dist/components/TableOfContents.js.map +1 -0
- package/dist/components/TextAnswer.d.ts +6 -0
- package/dist/components/TextAnswer.d.ts.map +1 -0
- package/dist/components/TextAnswer.js +17 -0
- package/dist/components/TextAnswer.js.map +1 -0
- package/dist/components/TextAnswerInput.d.ts +36 -0
- package/dist/components/TextAnswerInput.d.ts.map +1 -0
- package/dist/components/TextAnswerInput.js +145 -0
- package/dist/components/TextAnswerInput.js.map +1 -0
- package/dist/components/Video.d.ts +6 -0
- package/dist/components/Video.d.ts.map +1 -0
- package/dist/components/Video.js +15 -0
- package/dist/components/Video.js.map +1 -0
- package/dist/components/exam/RichTextAnswer.d.ts.map +1 -1
- package/dist/components/exam/RichTextAnswer.js +7 -9
- package/dist/components/exam/RichTextAnswer.js.map +1 -1
- package/dist/components/exam/TableOfContents.d.ts +13 -0
- package/dist/components/exam/TableOfContents.d.ts.map +1 -0
- package/dist/components/exam/TableOfContents.js +66 -0
- package/dist/components/exam/TableOfContents.js.map +1 -0
- package/dist/components/grading-instruction/AnswerGradingInstruction.d.ts +5 -0
- package/dist/components/grading-instruction/AnswerGradingInstruction.d.ts.map +1 -0
- package/dist/components/grading-instruction/AnswerGradingInstruction.js +6 -0
- package/dist/components/grading-instruction/AnswerGradingInstruction.js.map +1 -0
- package/dist/components/grading-instruction/Audio.d.ts +5 -0
- package/dist/components/grading-instruction/Audio.d.ts.map +1 -0
- package/dist/components/grading-instruction/Audio.js +6 -0
- package/dist/components/grading-instruction/Audio.js.map +1 -0
- package/dist/components/grading-instruction/AudioTitle.d.ts +5 -0
- package/dist/components/grading-instruction/AudioTitle.d.ts.map +1 -0
- package/dist/components/grading-instruction/AudioTitle.js +10 -0
- package/dist/components/grading-instruction/AudioTitle.js.map +1 -0
- package/dist/components/grading-instruction/AutogradedAnswer.d.ts +5 -0
- package/dist/components/grading-instruction/AutogradedAnswer.d.ts.map +1 -0
- package/dist/components/grading-instruction/AutogradedAnswer.js +31 -0
- package/dist/components/grading-instruction/AutogradedAnswer.js.map +1 -0
- package/dist/components/grading-instruction/AutogradedAnswerOption.d.ts +5 -0
- package/dist/components/grading-instruction/AutogradedAnswerOption.d.ts.map +1 -0
- package/dist/components/grading-instruction/AutogradedAnswerOption.js +14 -0
- package/dist/components/grading-instruction/AutogradedAnswerOption.js.map +1 -0
- package/dist/components/grading-instruction/ExamGradingInstruction.d.ts +5 -0
- package/dist/components/grading-instruction/ExamGradingInstruction.d.ts.map +1 -0
- package/dist/components/grading-instruction/ExamGradingInstruction.js +6 -0
- package/dist/components/grading-instruction/ExamGradingInstruction.js.map +1 -0
- package/dist/components/grading-instruction/GradingInstruction.d.ts +5 -0
- package/dist/components/grading-instruction/GradingInstruction.d.ts.map +1 -0
- package/dist/components/grading-instruction/GradingInstruction.js +85 -0
- package/dist/components/grading-instruction/GradingInstruction.js.map +1 -0
- package/dist/components/grading-instruction/Question.d.ts +5 -0
- package/dist/components/grading-instruction/Question.d.ts.map +1 -0
- package/dist/components/grading-instruction/Question.js +12 -0
- package/dist/components/grading-instruction/Question.js.map +1 -0
- package/dist/components/grading-instruction/QuestionTitle.d.ts +5 -0
- package/dist/components/grading-instruction/QuestionTitle.d.ts.map +1 -0
- package/dist/components/grading-instruction/QuestionTitle.js +19 -0
- package/dist/components/grading-instruction/QuestionTitle.js.map +1 -0
- package/dist/components/grading-instruction/Section.d.ts +5 -0
- package/dist/components/grading-instruction/Section.d.ts.map +1 -0
- package/dist/components/grading-instruction/Section.js +10 -0
- package/dist/components/grading-instruction/Section.js.map +1 -0
- package/dist/components/grading-instruction/SectionTitle.d.ts +5 -0
- package/dist/components/grading-instruction/SectionTitle.d.ts.map +1 -0
- package/dist/components/grading-instruction/SectionTitle.js +16 -0
- package/dist/components/grading-instruction/SectionTitle.js.map +1 -0
- package/dist/components/results/AnnotationList.d.ts +5 -0
- package/dist/components/results/AnnotationList.d.ts.map +1 -0
- package/dist/components/results/AnnotationList.js +43 -0
- package/dist/components/results/AnnotationList.js.map +1 -0
- package/dist/components/results/GradingStructure.d.ts +5 -0
- package/dist/components/results/GradingStructure.d.ts.map +1 -0
- package/dist/components/results/GradingStructure.js +21 -0
- package/dist/components/results/GradingStructure.js.map +1 -0
- package/dist/components/results/Hvp.d.ts +15 -0
- package/dist/components/results/Hvp.d.ts.map +1 -0
- package/dist/components/results/Hvp.js +73 -0
- package/dist/components/results/Hvp.js.map +1 -0
- package/dist/components/results/HvpTextAnswer.d.ts +6 -0
- package/dist/components/results/HvpTextAnswer.d.ts.map +1 -0
- package/dist/components/results/HvpTextAnswer.js +51 -0
- package/dist/components/results/HvpTextAnswer.js.map +1 -0
- package/dist/components/results/ResultsChoiceAnswer.d.ts +6 -0
- package/dist/components/results/ResultsChoiceAnswer.d.ts.map +1 -0
- package/dist/components/results/ResultsChoiceAnswer.js +57 -0
- package/dist/components/results/ResultsChoiceAnswer.js.map +1 -0
- package/dist/components/results/ResultsContext.d.ts +18 -0
- package/dist/components/results/ResultsContext.d.ts.map +1 -0
- package/dist/components/results/ResultsContext.js +68 -0
- package/dist/components/results/ResultsContext.js.map +1 -0
- package/dist/components/results/ResultsDropdownAnswer.d.ts +6 -0
- package/dist/components/results/ResultsDropdownAnswer.d.ts.map +1 -0
- package/dist/components/results/ResultsDropdownAnswer.js +43 -0
- package/dist/components/results/ResultsDropdownAnswer.js.map +1 -0
- package/dist/components/results/ResultsExamQuestion.d.ts +5 -0
- package/dist/components/results/ResultsExamQuestion.d.ts.map +1 -0
- package/dist/components/results/ResultsExamQuestion.js +23 -0
- package/dist/components/results/ResultsExamQuestion.js.map +1 -0
- package/dist/components/results/ResultsExamQuestionAutoScore.d.ts +10 -0
- package/dist/components/results/ResultsExamQuestionAutoScore.d.ts.map +1 -0
- package/dist/components/results/ResultsExamQuestionAutoScore.js +17 -0
- package/dist/components/results/ResultsExamQuestionAutoScore.js.map +1 -0
- package/dist/components/results/ResultsExamQuestionManualScore.d.ts +12 -0
- package/dist/components/results/ResultsExamQuestionManualScore.d.ts.map +1 -0
- package/dist/components/results/ResultsExamQuestionManualScore.js +61 -0
- package/dist/components/results/ResultsExamQuestionManualScore.js.map +1 -0
- package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts +10 -0
- package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts.map +1 -0
- package/dist/components/results/ResultsExamQuestionScoresContainer.js +12 -0
- package/dist/components/results/ResultsExamQuestionScoresContainer.js.map +1 -0
- package/dist/components/results/ResultsExamQuestionTitle.d.ts +6 -0
- package/dist/components/results/ResultsExamQuestionTitle.d.ts.map +1 -0
- package/dist/components/results/ResultsExamQuestionTitle.js +21 -0
- package/dist/components/results/ResultsExamQuestionTitle.js.map +1 -0
- package/dist/components/results/ResultsExamSection.d.ts +5 -0
- package/dist/components/results/ResultsExamSection.d.ts.map +1 -0
- package/dist/components/results/ResultsExamSection.js +18 -0
- package/dist/components/results/ResultsExamSection.js.map +1 -0
- package/dist/components/results/ResultsMultiLineAnswer.d.ts +8 -0
- package/dist/components/results/ResultsMultiLineAnswer.d.ts.map +1 -0
- package/dist/components/results/ResultsMultiLineAnswer.js +19 -0
- package/dist/components/results/ResultsMultiLineAnswer.js.map +1 -0
- package/dist/components/results/ResultsScoredTextAnswer.d.ts +6 -0
- package/dist/components/results/ResultsScoredTextAnswer.d.ts.map +1 -0
- package/dist/components/results/ResultsScoredTextAnswer.js +22 -0
- package/dist/components/results/ResultsScoredTextAnswer.js.map +1 -0
- package/dist/components/results/ResultsSingleLineAnswer.d.ts +12 -0
- package/dist/components/results/ResultsSingleLineAnswer.d.ts.map +1 -0
- package/dist/components/results/ResultsSingleLineAnswer.js +23 -0
- package/dist/components/results/ResultsSingleLineAnswer.js.map +1 -0
- package/dist/components/results/ResultsTextAnswer.d.ts +6 -0
- package/dist/components/results/ResultsTextAnswer.d.ts.map +1 -0
- package/dist/components/results/ResultsTextAnswer.js +50 -0
- package/dist/components/results/ResultsTextAnswer.js.map +1 -0
- package/dist/components/results/helpers.d.ts +9 -0
- package/dist/components/results/helpers.d.ts.map +1 -0
- package/dist/components/results/helpers.js +11 -0
- package/dist/components/results/helpers.js.map +1 -0
- package/dist/components/withContext.d.ts +3 -0
- package/dist/components/withContext.d.ts.map +1 -0
- package/dist/components/withContext.js +12 -0
- package/dist/components/withContext.js.map +1 -0
- package/dist/main-bundle.js +9 -17
- package/dist/main.css +1 -1
- package/dist/types/GradingStructure.d.ts +1 -0
- package/dist/types/GradingStructure.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/components/grading-instructions/RecordingTitle.d.ts +0 -5
- package/dist/components/grading-instructions/RecordingTitle.d.ts.map +0 -1
- package/dist/components/grading-instructions/RecordingTitle.js +0 -11
- package/dist/components/grading-instructions/RecordingTitle.js.map +0 -1
- package/dist/components/shared/ImageTitle.d.ts +0 -5
- package/dist/components/shared/ImageTitle.d.ts.map +0 -1
- package/dist/components/shared/ImageTitle.js +0 -7
- package/dist/components/shared/ImageTitle.js.map +0 -1
@@ -0,0 +1,62 @@
|
|
1
|
+
import classNames from 'classnames';
|
2
|
+
import React from 'react';
|
3
|
+
import { connect } from 'react-redux';
|
4
|
+
import { getNumericAttribute, mapChildElements, query } from '../dom-utils';
|
5
|
+
import * as actions from '../store/answers/actions';
|
6
|
+
import AnswerToolbar from './AnswerToolbar';
|
7
|
+
function ChoiceAnswerOption({ selected, element, renderChildNodes, questionId, onSelect, direction, value, }) {
|
8
|
+
const className = element.getAttribute('class');
|
9
|
+
const content = (React.createElement("div", { className: classNames('e-choice-answer-option e-column', className, {
|
10
|
+
'e-choice-answer-option--selected': selected,
|
11
|
+
}) }, renderChildNodes(element)));
|
12
|
+
return direction === 'vertical' ? (React.createElement("div", { className: "e-mrg-b-1" },
|
13
|
+
React.createElement("label", { className: classNames('e-columns', {
|
14
|
+
'e-columns--inline': query(element, ['image', 'video']) == null /* Force full width for options containing responsive media */,
|
15
|
+
}) },
|
16
|
+
React.createElement("input", { type: "radio", className: "e-radio-button e-column e-column--narrow", name: String(questionId), onChange: onSelect, value: value, checked: selected }),
|
17
|
+
content))) : (React.createElement("div", { className: "e-column e-mrg-b-1" },
|
18
|
+
React.createElement("label", { className: "e-block e-text-center" },
|
19
|
+
React.createElement("input", { type: "radio", className: "e-radio-button", name: String(questionId), onChange: onSelect, value: value, checked: selected }),
|
20
|
+
content)));
|
21
|
+
}
|
22
|
+
function ChoiceAnswer({ answer, saveAnswer, element, renderChildNodes }) {
|
23
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
24
|
+
const direction = element.getAttribute('direction') || 'vertical';
|
25
|
+
const className = element.getAttribute('class');
|
26
|
+
const displayNumber = element.getAttribute('display-number');
|
27
|
+
const onSelect = (event) => {
|
28
|
+
saveAnswer({ type: 'choice', questionId, value: event.currentTarget.value, displayNumber });
|
29
|
+
};
|
30
|
+
return (React.createElement(React.Fragment, null,
|
31
|
+
React.createElement("div", { className: classNames('e-choice-answer', className, {
|
32
|
+
'e-columns': direction === 'horizontal',
|
33
|
+
}), "data-question-id": questionId }, mapChildElements(element, (childElement) => {
|
34
|
+
const optionId = childElement.getAttribute('option-id');
|
35
|
+
const isNoAnswer = childElement.getAttribute('type') === 'no-answer';
|
36
|
+
const value = isNoAnswer ? '' : optionId;
|
37
|
+
const selected = answer != null && answer.value === value;
|
38
|
+
return (React.createElement(ChoiceAnswerOption, Object.assign({}, {
|
39
|
+
element: childElement,
|
40
|
+
onSelect,
|
41
|
+
renderChildNodes,
|
42
|
+
questionId,
|
43
|
+
key: optionId,
|
44
|
+
direction,
|
45
|
+
selected,
|
46
|
+
value,
|
47
|
+
})));
|
48
|
+
})),
|
49
|
+
React.createElement(AnswerToolbar, Object.assign({}, {
|
50
|
+
answer,
|
51
|
+
element,
|
52
|
+
}))));
|
53
|
+
}
|
54
|
+
function mapStateToProps(state, { element }) {
|
55
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
56
|
+
const answer = state.answers.answersById[questionId];
|
57
|
+
return { answer };
|
58
|
+
}
|
59
|
+
export default connect(mapStateToProps, {
|
60
|
+
saveAnswer: actions.saveAnswer,
|
61
|
+
})(ChoiceAnswer);
|
62
|
+
//# sourceMappingURL=ChoiceAnswer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ChoiceAnswer.js","sourceRoot":"","sources":["../../src/components/ChoiceAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,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AAgB;gBAChB,UAAU;gBACV,GAAG,EAAE,QAAQ;gBACb,SAAS;gBACT,QAAQ;gBACR,KAAK;aACN,EACD,CACH,CAAA;QACH,CAAC,CAAC,CACE;QACN,oBAAC,aAAa,oBACR;YACF,MAAM;YACN,OAAO;SACR,EACD,CACD,CACJ,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,KAAe,EAAE,EAAE,OAAO,EAAsB;IACvE,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAE,CAAA;IAC/D,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAA8B,CAAA;IACjF,OAAO,EAAE,MAAM,EAAE,CAAA;AACnB,CAAC;AAED,eAAe,OAAO,CAAC,eAAe,EAAE;IACtC,UAAU,EAAE,OAAO,CAAC,UAAU;CAC/B,CAAC,CAAC,YAAY,CAAC,CAAA"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { CommonExamProps } from './Exam';
|
3
|
+
export interface CommonExamContext {
|
4
|
+
attachmentsURL: string;
|
5
|
+
date?: Date;
|
6
|
+
dateTimeFormatter: Intl.DateTimeFormat;
|
7
|
+
/** The language of the exam. */
|
8
|
+
language: string;
|
9
|
+
/** The language of the subject matter. Differs from the language in foreign language exams. */
|
10
|
+
subjectLanguage: string;
|
11
|
+
maxAnswers?: number;
|
12
|
+
maxScore?: number;
|
13
|
+
numberOfSections: number;
|
14
|
+
resolveAttachment: (filename: string) => string;
|
15
|
+
root: Element;
|
16
|
+
}
|
17
|
+
export declare const CommonExamContext: React.Context<CommonExamContext>;
|
18
|
+
export declare function withCommonExamContext<P extends CommonExamProps>(Component: React.ComponentType<P>): React.ComponentType<P>;
|
19
|
+
//# sourceMappingURL=CommonExamContext.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CommonExamContext.d.ts","sourceRoot":"","sources":["../../src/components/CommonExamContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAGxC,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAA;IACtB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,iBAAiB,EAAE,IAAI,CAAC,cAAc,CAAA;IACtC,gCAAgC;IAChC,QAAQ,EAAE,MAAM,CAAA;IAChB,+FAA+F;IAC/F,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/C,IAAI,EAAE,OAAO,CAAA;CACd;AAED,eAAO,MAAM,iBAAiB,kCAA+C,CAAA;AAE7E,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,eAAe,EAC7D,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,GAChC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,CAoBxB"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { getNumericAttribute, queryAll } from '../dom-utils';
|
3
|
+
import { withContext } from './withContext';
|
4
|
+
export const CommonExamContext = React.createContext({});
|
5
|
+
export function withCommonExamContext(Component) {
|
6
|
+
return withContext(CommonExamContext, ({ attachmentsURL, resolveAttachment, doc }) => {
|
7
|
+
const root = doc.documentElement;
|
8
|
+
const maybeDate = root.getAttribute('date');
|
9
|
+
const language = root.getAttribute('exam-lang');
|
10
|
+
const subjectLanguage = root.getAttribute('lang') || language;
|
11
|
+
return {
|
12
|
+
attachmentsURL,
|
13
|
+
date: maybeDate ? new Date(maybeDate) : undefined,
|
14
|
+
dateTimeFormatter: new Intl.DateTimeFormat('fi-FI', { timeZone: 'UTC' }),
|
15
|
+
language,
|
16
|
+
subjectLanguage,
|
17
|
+
maxAnswers: getNumericAttribute(root, 'max-answers'),
|
18
|
+
maxScore: getNumericAttribute(root, 'max-score'),
|
19
|
+
numberOfSections: queryAll(root, 'section').length,
|
20
|
+
resolveAttachment,
|
21
|
+
root,
|
22
|
+
};
|
23
|
+
})(Component);
|
24
|
+
}
|
25
|
+
//# sourceMappingURL=CommonExamContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"CommonExamContext.js","sourceRoot":"","sources":["../../src/components/CommonExamContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAiB3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAC,EAAuB,CAAC,CAAA;AAE7E,MAAM,UAAU,qBAAqB,CACnC,SAAiC;IAEjC,OAAO,WAAW,CAAuB,iBAAiB,EAAE,CAAC,EAAE,cAAc,EAAE,iBAAiB,EAAE,GAAG,EAAE,EAAE,EAAE;QACzG,MAAM,IAAI,GAAG,GAAG,CAAC,eAAe,CAAA;QAChC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;QAC3C,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAE,CAAA;QAChD,MAAM,eAAe,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAA;QAE7D,OAAO;YACL,cAAc;YACd,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,SAAS;YACjD,iBAAiB,EAAE,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;YACxE,QAAQ;YACR,eAAe;YACf,UAAU,EAAE,mBAAmB,CAAC,IAAI,EAAE,aAAa,CAAC;YACpD,QAAQ,EAAE,mBAAmB,CAAC,IAAI,EAAE,WAAW,CAAC;YAChD,gBAAgB,EAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,MAAM;YAClD,iBAAiB;YACjB,IAAI;SACL,CAAA;IACH,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;AACf,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
import * as actions from '../store/answers/actions';
|
4
|
+
import { ChoiceAnswer as ChoiceAnswerT } from '../types/ExamAnswer';
|
5
|
+
interface DropdownAnswerProps extends ExamComponentProps {
|
6
|
+
saveAnswer: typeof actions.saveAnswer;
|
7
|
+
answer?: ChoiceAnswerT;
|
8
|
+
}
|
9
|
+
declare function DropdownAnswer({ element, renderChildNodes, saveAnswer, answer }: DropdownAnswerProps): JSX.Element;
|
10
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof DropdownAnswer, import("react-redux").Omit<DropdownAnswerProps, "answer" | "saveAnswer"> & ExamComponentProps>;
|
11
|
+
export default _default;
|
12
|
+
//# sourceMappingURL=DropdownAnswer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DropdownAnswer.d.ts","sourceRoot":"","sources":["../../src/components/DropdownAnswer.tsx"],"names":[],"mappings":";AAYA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAM9D,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,YAAY,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAInE,UAAU,mBAAoB,SAAQ,kBAAkB;IACtD,UAAU,EAAE,OAAO,OAAO,CAAC,UAAU,CAAA;IACrC,MAAM,CAAC,EAAE,aAAa,CAAA;CACvB;AASD,iBAAS,cAAc,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,mBAAmB,eA+H7F;;AAOD,wBAEkB"}
|
@@ -0,0 +1,100 @@
|
|
1
|
+
import { faChevronDown, faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
3
|
+
import classNames from 'classnames';
|
4
|
+
import { useSelect, } from 'downshift';
|
5
|
+
import * as _ from 'lodash-es';
|
6
|
+
import React, { useContext, useEffect, useRef, useState } from 'react';
|
7
|
+
import { connect } from 'react-redux';
|
8
|
+
import { findChildElement, getNumericAttribute, mapChildElements, NBSP } from '../dom-utils';
|
9
|
+
import * as fonts from '../fonts';
|
10
|
+
import { useExamTranslation } from '../i18n';
|
11
|
+
import { answerScoreId } from '../ids';
|
12
|
+
import * as actions from '../store/answers/actions';
|
13
|
+
import { QuestionContext } from './QuestionContext';
|
14
|
+
import { Score } from './Score';
|
15
|
+
const menuBorderWidthPx = 2;
|
16
|
+
const roundingErrorCompensationPx = 1;
|
17
|
+
const noAnswer = '';
|
18
|
+
const runningInBrowser = !navigator.userAgent.includes('jsdom/');
|
19
|
+
function DropdownAnswer({ element, renderChildNodes, saveAnswer, answer }) {
|
20
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
21
|
+
const maxScore = getNumericAttribute(element, 'max-score');
|
22
|
+
const displayNumber = element.getAttribute('display-number');
|
23
|
+
const currentlySelectedItem = answer &&
|
24
|
+
answer.value &&
|
25
|
+
findChildElement(element, (childElement) => answer.value === childElement.getAttribute('option-id'));
|
26
|
+
const labelRef = useRef(null);
|
27
|
+
const menuRef = React.useRef(null);
|
28
|
+
const [measuring, setMeasuring] = useState(true);
|
29
|
+
if (runningInBrowser) {
|
30
|
+
// Force a re-measure if element changes or fonts are loaded after this
|
31
|
+
// component has been rendered.
|
32
|
+
const [, setFontsLoaded] = useState(fonts.loaded);
|
33
|
+
fonts.ready.then(() => setFontsLoaded(true)).catch((err) => console.error(err));
|
34
|
+
useEffect(() => setMeasuring(true), [element]);
|
35
|
+
useEffect(() => {
|
36
|
+
if (measuring && menuRef.current && labelRef.current) {
|
37
|
+
const menuEl = menuRef.current;
|
38
|
+
const labelEl = labelRef.current;
|
39
|
+
const preferredWidth = _.max(mapChildElements(menuEl, (el) => el.firstElementChild.scrollWidth));
|
40
|
+
// Run the DOM mutations on the next frame to avoid layout trashing in exams with lots of dropdowns.
|
41
|
+
const requestId = requestAnimationFrame(() => {
|
42
|
+
labelEl.style.width = `${preferredWidth + menuBorderWidthPx + roundingErrorCompensationPx}px`;
|
43
|
+
setMeasuring(false);
|
44
|
+
});
|
45
|
+
return () => cancelAnimationFrame(requestId);
|
46
|
+
}
|
47
|
+
});
|
48
|
+
}
|
49
|
+
const items = [noAnswer, ...element.children];
|
50
|
+
const { answers } = useContext(QuestionContext);
|
51
|
+
const { getItemProps, getMenuProps, getToggleButtonProps, highlightedIndex, isOpen, selectedItem } = useSelect({
|
52
|
+
items,
|
53
|
+
itemToString: (item) => (item ? item.textContent : ''),
|
54
|
+
onSelectedItemChange: ({ selectedItem }) => {
|
55
|
+
const value = selectedItem ? selectedItem.getAttribute('option-id') : '';
|
56
|
+
saveAnswer({ type: 'choice', questionId, value, displayNumber });
|
57
|
+
},
|
58
|
+
initialSelectedItem: currentlySelectedItem,
|
59
|
+
});
|
60
|
+
// Until the typings are fixed at https://github.com/downshift-js/downshift/pull/1123/files
|
61
|
+
const getMenuPropsFixed = getMenuProps;
|
62
|
+
const getToggleButtonPropsFixed = getToggleButtonProps;
|
63
|
+
const { t } = useExamTranslation();
|
64
|
+
const scoreId = answerScoreId(element);
|
65
|
+
return (React.createElement("span", { className: "e-nowrap" },
|
66
|
+
React.createElement("span", { className: classNames('e-dropdown-answer e-normal'), "data-question-id": questionId },
|
67
|
+
React.createElement("button", Object.assign({ className: classNames('e-dropdown-answer__toggle-button e-button-plain e-columns', {
|
68
|
+
'e-dropdown-answer__toggle-button--open': isOpen,
|
69
|
+
}) }, getToggleButtonPropsFixed({
|
70
|
+
'aria-describedby': scoreId,
|
71
|
+
// The label text is inside the button, so we don't want an aria-labelledby attribute.
|
72
|
+
'aria-labelledby': undefined,
|
73
|
+
}, { suppressRefError: !runningInBrowser })),
|
74
|
+
React.createElement("span", { className: "e-dropdown-answer__label e-column e-pad-l-1 e-pad-r-4" },
|
75
|
+
React.createElement("span", { className: "e-ellipsis e-block", ref: labelRef }, selectedItem ? (renderChildNodes(selectedItem)) : (React.createElement("span", { "aria-label": t.raw('dropdown-answer.label') }, NBSP)))),
|
76
|
+
React.createElement("span", { className: classNames('e-dropdown-answer__toggle-icon e-text-center e-column e-column--narrow e-column--gapless e-color-link') },
|
77
|
+
React.createElement(FontAwesomeIcon, { icon: isOpen ? faChevronUp : faChevronDown }))),
|
78
|
+
React.createElement("span", Object.assign({}, getMenuPropsFixed({
|
79
|
+
className: classNames('e-dropdown-answer__menu', { 'e-dropdown-answer__menu--open': isOpen }),
|
80
|
+
ref: menuRef,
|
81
|
+
}, { suppressRefError: !runningInBrowser })), items.map((item, i) => (React.createElement("span", Object.assign({ className: classNames('e-dropdown-answer__menu-item e-block e-pad-l-1 e-pad-r-4', {
|
82
|
+
'e-dropdown-answer__menu-item--selected': item === selectedItem,
|
83
|
+
'e-bg-color-off-white': highlightedIndex !== i,
|
84
|
+
'e-bg-color-lighterblue': highlightedIndex === i,
|
85
|
+
}), key: i }, getItemProps({
|
86
|
+
item,
|
87
|
+
index: i,
|
88
|
+
})),
|
89
|
+
React.createElement("span", { className: classNames('e-dropdown-answer__menu-item-inner e-block', { 'e-nowrap': measuring }) }, item ? renderChildNodes(item) : React.createElement("span", { "aria-label": t.raw('dropdown-answer.clear') }, NBSP))))))),
|
90
|
+
answers.length > 1 && React.createElement(Score, { score: maxScore, size: 'inline', id: scoreId })));
|
91
|
+
}
|
92
|
+
function mapStateToprops(state, { element }) {
|
93
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
94
|
+
const answer = state.answers.answersById[questionId];
|
95
|
+
return { answer };
|
96
|
+
}
|
97
|
+
export default connect(mapStateToprops, {
|
98
|
+
saveAnswer: actions.saveAnswer,
|
99
|
+
})(DropdownAnswer);
|
100
|
+
//# sourceMappingURL=DropdownAnswer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DropdownAnswer.js","sourceRoot":"","sources":["../../src/components/DropdownAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAEL,SAAS,GAGV,MAAM,WAAW,CAAA;AAClB,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC5F,OAAO,KAAK,KAAK,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAEtC,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAO/B,MAAM,iBAAiB,GAAG,CAAC,CAAA;AAC3B,MAAM,2BAA2B,GAAG,CAAC,CAAA;AACrC,MAAM,QAAQ,GAAG,EAAE,CAAA;AACnB,MAAM,gBAAgB,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,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../../src/components/ErrorIndicator.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAqB,MAAM,OAAO,CAAA;;AA2DzC,wBAAyC"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
3
|
+
import React, { useContext } from 'react';
|
4
|
+
import { useSelector } from 'react-redux';
|
5
|
+
import { findChildElement } from '../dom-utils';
|
6
|
+
import { useExamTranslation } from '../i18n';
|
7
|
+
import AnsweringInstructions from './AnsweringInstructions';
|
8
|
+
import { CommonExamContext } from './CommonExamContext';
|
9
|
+
const ErrorIndicator = () => {
|
10
|
+
const extraAnswers = useSelector((state) => state.answers.extraAnswers);
|
11
|
+
const { t } = useExamTranslation();
|
12
|
+
return extraAnswers.length > 0 ? (React.createElement("div", { className: "error-indicator e-columns e-columns--inline e-bg-color-error e-color-off-white e-font-size-xs e-pad-1 e-mrg-r-1", role: "alert" },
|
13
|
+
React.createElement("div", { className: "e-column e-column--narrow" },
|
14
|
+
React.createElement(FontAwesomeIcon, { size: "lg", icon: faExclamationTriangle, fixedWidth: true, className: "e-mrg-r-1" })),
|
15
|
+
React.createElement("div", { className: "e-column e-column--gapless" }, extraAnswers.map((extraAnswer) => {
|
16
|
+
const { displayNumber, type } = extraAnswer;
|
17
|
+
return (React.createElement("div", { key: type + displayNumber },
|
18
|
+
type !== 'exam' && type !== 'toc-section'
|
19
|
+
? t(type, { displayNumber }) || React.createElement(FallbackTitle, Object.assign({}, extraAnswer))
|
20
|
+
: '',
|
21
|
+
' ',
|
22
|
+
React.createElement(AnsweringInstructions, Object.assign({}, extraAnswer))));
|
23
|
+
})))) : null;
|
24
|
+
};
|
25
|
+
const FallbackTitle = ({ type, displayNumber }) => {
|
26
|
+
// Hack. M/N exams have set the section translation title to an empty string,
|
27
|
+
// so they can hide the "Osa 1:" text within the exam. In these cases, display
|
28
|
+
// the text content of the corresponding <e:section-title> instead. Hopefully
|
29
|
+
// we can delete this code on some day. 💩
|
30
|
+
if (type === 'section') {
|
31
|
+
const { root } = useContext(CommonExamContext);
|
32
|
+
const section = findChildElement(root, (e) => e.localName === 'section' && e.getAttribute('display-number') === displayNumber);
|
33
|
+
if (section) {
|
34
|
+
const sectionTitle = findChildElement(section, 'section-title');
|
35
|
+
if (sectionTitle) {
|
36
|
+
return React.createElement(React.Fragment, null, sectionTitle.textContent.trim() + ':');
|
37
|
+
}
|
38
|
+
}
|
39
|
+
}
|
40
|
+
return null;
|
41
|
+
};
|
42
|
+
export default React.memo(ErrorIndicator);
|
43
|
+
//# sourceMappingURL=ErrorIndicator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ErrorIndicator.js","sourceRoot":"","sources":["../../src/components/ErrorIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,qBAAqB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAEvD,MAAM,cAAc,GAA4B,GAAG,EAAE;IACnD,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,KAAe,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;IACjF,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAElC,OAAO,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAC/B,6BACE,SAAS,EAAC,iHAAiH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AAI,YAAY,EAAE;gBAChB,OAAO,0CAAG,YAAY,CAAC,WAAY,CAAC,IAAI,EAAE,GAAG,GAAG,CAAI,CAAA;aACrD;SACF;KACF;IACD,OAAO,IAAI,CAAA;AACb,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamAnswer, ExamServerAPI, InitialCasStatus, RestrictedAudioPlaybackStats } from '..';
|
3
|
+
/** Props common to taking the exams and viewing results */
|
4
|
+
export interface CommonExamProps {
|
5
|
+
/** Initial answers */
|
6
|
+
answers: ExamAnswer[];
|
7
|
+
/** The URL for the attachments page */
|
8
|
+
attachmentsURL: string;
|
9
|
+
/** A function that maps an attachment filename to a full URI. */
|
10
|
+
resolveAttachment: (filename: string) => string;
|
11
|
+
/** The exam XML */
|
12
|
+
doc: XMLDocument;
|
13
|
+
/** @deprecated Not used anymore */
|
14
|
+
language?: string;
|
15
|
+
}
|
16
|
+
/** Props related to taking the exam, 'executing' it */
|
17
|
+
export interface ExamProps extends CommonExamProps {
|
18
|
+
/** The status of CAS software on the OS */
|
19
|
+
casStatus: InitialCasStatus;
|
20
|
+
/** The CAS countdown duration in seconds. 60 seconds by default. */
|
21
|
+
casCountdownDuration?: number;
|
22
|
+
/**
|
23
|
+
* Playback statistics about restricted audio files. Used for calculating
|
24
|
+
* whether the user can listen to them any more.
|
25
|
+
*/
|
26
|
+
restrictedAudioPlaybackStats: RestrictedAudioPlaybackStats[];
|
27
|
+
/** Exam Server API implementation */
|
28
|
+
examServerApi: ExamServerAPI;
|
29
|
+
}
|
30
|
+
declare const _default: React.MemoExoticComponent<React.ComponentType<ExamProps>>;
|
31
|
+
export default _default;
|
32
|
+
//# sourceMappingURL=Exam.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Exam.d.ts","sourceRoot":"","sources":["../../src/components/Exam.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAGpD,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,MAAM,IAAI,CAAA;AA0C9F,2DAA2D;AAC3D,MAAM,WAAW,eAAe;IAC9B,sBAAsB;IACtB,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,uCAAuC;IACvC,cAAc,EAAE,MAAM,CAAA;IACtB,iEAAiE;IACjE,iBAAiB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IAC/C,mBAAmB;IACnB,GAAG,EAAE,WAAW,CAAA;IAChB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,uDAAuD;AACvD,MAAM,WAAW,SAAU,SAAQ,eAAe;IAChD,2CAA2C;IAC3C,SAAS,EAAE,gBAAgB,CAAA;IAC3B,oEAAoE;IACpE,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B;;;OAGG;IACH,4BAA4B,EAAE,4BAA4B,EAAE,CAAA;IAC5D,qCAAqC;IACrC,aAAa,EAAE,aAAa,CAAA;CAC7B;;AAuFD,wBAAuE"}
|
@@ -0,0 +1,103 @@
|
|
1
|
+
import React, { useContext, useEffect } from 'react';
|
2
|
+
import { I18nextProvider } from 'react-i18next';
|
3
|
+
import { Provider } from 'react-redux';
|
4
|
+
import { createRenderChildNodes } from '../createRenderChildNodes';
|
5
|
+
import { findChildElement } from '../dom-utils';
|
6
|
+
import { changeLanguage, initI18n } from '../i18n';
|
7
|
+
import { examTitleId } from '../ids';
|
8
|
+
import { parseExamStructure } from '../parser/parseExamStructure';
|
9
|
+
import { scrollToHash } from '../scrollToHash';
|
10
|
+
import { initializeExamStore } from '../store';
|
11
|
+
import { useCached } from '../useCached';
|
12
|
+
import mkAttachmentLink from './AttachmentLink';
|
13
|
+
import mkAttachmentLinks from './AttachmentLinks';
|
14
|
+
import Audio from './Audio';
|
15
|
+
import AudioGroup from './AudioGroup';
|
16
|
+
import AudioTest from './AudioTest';
|
17
|
+
import ChoiceAnswer from './ChoiceAnswer';
|
18
|
+
import { CommonExamContext, withCommonExamContext } from './CommonExamContext';
|
19
|
+
import DocumentTitle from './DocumentTitle';
|
20
|
+
import DropdownAnswer from './DropdownAnswer';
|
21
|
+
import ErrorIndicator from './ErrorIndicator';
|
22
|
+
import ExamAttachment from './ExamAttachment';
|
23
|
+
import { withExamContext } from './ExamContext';
|
24
|
+
import ExamFooter from './ExamFooter';
|
25
|
+
import ExamInstruction from './ExamInstruction';
|
26
|
+
import ExamQuestion from './ExamQuestion';
|
27
|
+
import ExamQuestionInstruction from './ExamQuestionInstruction';
|
28
|
+
import ExamQuestionTitle from './ExamQuestionTitle';
|
29
|
+
import ExamSection from './ExamSection';
|
30
|
+
import ExamSectionTitle from './ExamSectionTitle';
|
31
|
+
import ExternalMaterialList from './ExternalMaterialList';
|
32
|
+
import File from './File';
|
33
|
+
import Formula from './Formula';
|
34
|
+
import Hints from './Hints';
|
35
|
+
import Image from './Image';
|
36
|
+
import ImageOverlay from './ImageOverlay';
|
37
|
+
import References from './References';
|
38
|
+
import SaveIndicator from './SaveIndicator';
|
39
|
+
import Section from './Section';
|
40
|
+
import SectionInstruction from './SectionInstruction';
|
41
|
+
import TableOfContents from './TableOfContents';
|
42
|
+
import TextAnswer from './TextAnswer';
|
43
|
+
import Video from './Video';
|
44
|
+
const renderChildNodes = createRenderChildNodes({
|
45
|
+
attachment: ExamAttachment,
|
46
|
+
'attachment-link': mkAttachmentLink('link'),
|
47
|
+
'attachment-links': mkAttachmentLinks('link'),
|
48
|
+
audio: Audio,
|
49
|
+
'audio-group': AudioGroup,
|
50
|
+
'audio-test': AudioTest,
|
51
|
+
'choice-answer': ChoiceAnswer,
|
52
|
+
'dropdown-answer': DropdownAnswer,
|
53
|
+
'exam-footer': ExamFooter,
|
54
|
+
'external-material': ExternalMaterialList,
|
55
|
+
file: File,
|
56
|
+
formula: Formula,
|
57
|
+
image: Image,
|
58
|
+
question: ExamQuestion,
|
59
|
+
'question-instruction': ExamQuestionInstruction,
|
60
|
+
'question-title': ExamQuestionTitle,
|
61
|
+
hints: Hints,
|
62
|
+
references: References,
|
63
|
+
'scored-text-answer': TextAnswer,
|
64
|
+
'scored-text-answers': Hints,
|
65
|
+
'section-instruction': SectionInstruction,
|
66
|
+
section: ExamSection,
|
67
|
+
'section-title': ExamSectionTitle,
|
68
|
+
'text-answer': TextAnswer,
|
69
|
+
video: Video,
|
70
|
+
'image-overlay': ImageOverlay,
|
71
|
+
});
|
72
|
+
const Exam = ({ doc, casStatus, answers, restrictedAudioPlaybackStats, examServerApi, }) => {
|
73
|
+
const { date, dateTimeFormatter, language, resolveAttachment, root, subjectLanguage } = useContext(CommonExamContext);
|
74
|
+
const examTitle = findChildElement(root, 'exam-title');
|
75
|
+
const examInstruction = findChildElement(root, 'exam-instruction');
|
76
|
+
const tableOfContents = findChildElement(root, 'table-of-contents');
|
77
|
+
const externalMaterial = findChildElement(root, 'external-material');
|
78
|
+
const examStylesheet = root.getAttribute('exam-stylesheet');
|
79
|
+
const store = useCached(() => initializeExamStore(parseExamStructure(doc), casStatus, answers, restrictedAudioPlaybackStats, examServerApi));
|
80
|
+
const examCode = root.getAttribute('exam-code');
|
81
|
+
const dayCode = root.getAttribute('day-code');
|
82
|
+
const i18n = useCached(() => initI18n(language, examCode, dayCode));
|
83
|
+
useEffect(changeLanguage(i18n, language));
|
84
|
+
useEffect(scrollToHash, []);
|
85
|
+
return (React.createElement(Provider, { store: store },
|
86
|
+
React.createElement(I18nextProvider, { i18n: i18n },
|
87
|
+
React.createElement("main", { className: "e-exam", lang: subjectLanguage, "aria-labelledby": examTitleId },
|
88
|
+
React.createElement(React.StrictMode, null),
|
89
|
+
examStylesheet && React.createElement("link", { rel: "stylesheet", href: resolveAttachment(examStylesheet) }),
|
90
|
+
React.createElement(Section, { "aria-labelledby": examTitleId },
|
91
|
+
examTitle && React.createElement(DocumentTitle, { id: examTitleId }, renderChildNodes(examTitle)),
|
92
|
+
date && (React.createElement("p", null,
|
93
|
+
React.createElement("strong", null, dateTimeFormatter.format(date)))),
|
94
|
+
examInstruction && React.createElement(ExamInstruction, Object.assign({}, { element: examInstruction, renderChildNodes })),
|
95
|
+
tableOfContents && React.createElement(TableOfContents, Object.assign({}, { element: tableOfContents, renderChildNodes })),
|
96
|
+
externalMaterial && (React.createElement(ExternalMaterialList, Object.assign({}, { element: externalMaterial, renderChildNodes, forceRender: true })))),
|
97
|
+
renderChildNodes(root),
|
98
|
+
React.createElement("div", { className: "e-footer" },
|
99
|
+
React.createElement(ErrorIndicator, null),
|
100
|
+
React.createElement(SaveIndicator, null))))));
|
101
|
+
};
|
102
|
+
export default React.memo(withExamContext(withCommonExamContext(Exam)));
|
103
|
+
//# sourceMappingURL=Exam.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Exam.js","sourceRoot":"","sources":["../../src/components/Exam.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,gBAAgB,MAAM,kBAAkB,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AAC,eAAe,oBAAK,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,EAAI;oBAC1F,eAAe,IAAI,oBAAC,eAAe,oBAAK,EAAE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,EAAI;oBAC1F,gBAAgB,IAAI,CACnB,oBAAC,oBAAoB,oBAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,EAAI,CACjG,CACO;gBACT,gBAAgB,CAAC,IAAI,CAAC;gBACvB,6BAAK,SAAS,EAAC,UAAU;oBACvB,oBAAC,cAAc,OAAG;oBAClB,oBAAC,aAAa,OAAG,CACb,CACD,CACS,CACT,CACZ,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamAttachment.d.ts","sourceRoot":"","sources":["../../src/components/ExamAttachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;;AAO9D,wBAAgE"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { AttachmentContext, withAttachmentContext } from './AttachmentContext';
|
3
|
+
function ExamAttachment({ element, renderChildNodes }) {
|
4
|
+
const { isExternal } = useContext(AttachmentContext);
|
5
|
+
return !isExternal ? React.createElement("span", { className: "exam-attachment e-mrg-b-2" }, renderChildNodes(element)) : null;
|
6
|
+
}
|
7
|
+
export default React.memo(withAttachmentContext(ExamAttachment));
|
8
|
+
//# sourceMappingURL=ExamAttachment.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamAttachment.js","sourceRoot":"","sources":["../../src/components/ExamAttachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAG9E,SAAS,cAAc,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACvE,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACpD,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,8BAAM,SAAS,EAAC,2BAA2B,IAAE,gBAAgB,CAAC,OAAO,CAAC,CAAQ,CAAC,CAAC,CAAC,IAAI,CAAA;AAC5G,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamProps } from './Exam';
|
3
|
+
import { ExamServerAPI } from '..';
|
4
|
+
export interface ExamContext {
|
5
|
+
casCountdownDuration: number;
|
6
|
+
examServerApi: ExamServerAPI;
|
7
|
+
}
|
8
|
+
export declare const ExamContext: React.Context<ExamContext>;
|
9
|
+
export declare const withExamContext: (Component: React.ComponentType<ExamProps>) => React.ComponentType<ExamProps>;
|
10
|
+
//# sourceMappingURL=ExamContext.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamContext.d.ts","sourceRoot":"","sources":["../../src/components/ExamContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAElC,MAAM,WAAW,WAAW;IAC1B,oBAAoB,EAAE,MAAM,CAAA;IAC5B,aAAa,EAAE,aAAa,CAAA;CAC7B;AAED,eAAO,MAAM,WAAW,4BAAyC,CAAA;AAEjE,eAAO,MAAM,eAAe,+EAO1B,CAAA"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { withContext } from './withContext';
|
3
|
+
export const ExamContext = React.createContext({});
|
4
|
+
export const withExamContext = withContext(ExamContext, (props) => {
|
5
|
+
const { casCountdownDuration, examServerApi } = props;
|
6
|
+
return {
|
7
|
+
casCountdownDuration: casCountdownDuration || 60,
|
8
|
+
examServerApi,
|
9
|
+
};
|
10
|
+
});
|
11
|
+
//# sourceMappingURL=ExamContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamContext.js","sourceRoot":"","sources":["../../src/components/ExamContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAQ3C,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,aAAa,CAAC,EAAiB,CAAC,CAAA;AAEjE,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAyB,WAAW,EAAE,CAAC,KAAgB,EAAE,EAAE;IACnG,MAAM,EAAE,oBAAoB,EAAE,aAAa,EAAE,GAAG,KAAK,CAAA;IAErD,OAAO;QACL,oBAAoB,EAAE,oBAAoB,IAAI,EAAE;QAChD,aAAa;KACd,CAAA;AACH,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function ExamFooter({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof ExamFooter>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=ExamFooter.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamFooter.d.ts","sourceRoot":"","sources":["../../src/components/ExamFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,UAAU,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAEpE;;AAED,wBAAqC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import Section from './Section';
|
3
|
+
function ExamFooter({ element, renderChildNodes }) {
|
4
|
+
return React.createElement(Section, null, renderChildNodes(element));
|
5
|
+
}
|
6
|
+
export default React.memo(ExamFooter);
|
7
|
+
//# sourceMappingURL=ExamFooter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamFooter.js","sourceRoot":"","sources":["../../src/components/ExamFooter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,OAAO,MAAM,WAAW,CAAA;AAG/B,SAAS,UAAU,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACnE,OAAO,oBAAC,OAAO,QAAE,gBAAgB,CAAC,OAAO,CAAC,CAAW,CAAA;AACvD,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function ExamInstruction({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof ExamInstruction>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=ExamInstruction.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamInstruction.d.ts","sourceRoot":"","sources":["../../src/components/ExamInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,eAAe,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAEzE;;AAED,wBAA0C"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
function ExamInstruction({ element, renderChildNodes }) {
|
3
|
+
return React.createElement("div", { className: "exam-instruction notification e-pad-4" }, renderChildNodes(element));
|
4
|
+
}
|
5
|
+
export default React.memo(ExamInstruction);
|
6
|
+
//# sourceMappingURL=ExamInstruction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamInstruction.js","sourceRoot":"","sources":["../../src/components/ExamInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,SAAS,eAAe,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACxE,OAAO,6BAAK,SAAS,EAAC,uCAAuC,IAAE,gBAAgB,CAAC,OAAO,CAAC,CAAO,CAAA;AACjG,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamQuestion.d.ts","sourceRoot":"","sources":["../../src/components/ExamQuestion.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;;AAoB9D,wBAA4D"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import classNames from 'classnames';
|
2
|
+
import React, { useContext } from 'react';
|
3
|
+
import { useSelector } from 'react-redux';
|
4
|
+
import { QuestionContext, withQuestionContext } from './QuestionContext';
|
5
|
+
import { SectionContext } from './SectionContext';
|
6
|
+
function ExamQuestion({ element, renderChildNodes }) {
|
7
|
+
const casStatus = useSelector((state) => state.cas.casStatus);
|
8
|
+
const { casForbidden } = useContext(SectionContext);
|
9
|
+
const { displayNumber, level } = useContext(QuestionContext);
|
10
|
+
return !casForbidden || casStatus === 'forbidden' ? (React.createElement("div", { className: classNames('exam-question', {
|
11
|
+
'e-mrg-b-8 e-clearfix': level === 0,
|
12
|
+
'e-mrg-l-8 e-mrg-y-4': level > 0,
|
13
|
+
}), id: displayNumber }, renderChildNodes(element))) : null;
|
14
|
+
}
|
15
|
+
export default React.memo(withQuestionContext(ExamQuestion));
|
16
|
+
//# sourceMappingURL=ExamQuestion.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ExamQuestion.js","sourceRoot":"","sources":["../../src/components/ExamQuestion.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAGjD,SAAS,YAAY,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACrE,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,KAAe,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IACvE,MAAM,EAAE,YAAY,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACnD,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAE5D,OAAO,CAAC,YAAY,IAAI,SAAS,KAAK,WAAW,CAAC,CAAC,CAAC,CAClD,6BACE,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE;YACrC,sBAAsB,EAAE,KAAK,KAAK,CAAC;YACnC,qBAAqB,EAAE,KAAK,GAAG,CAAC;SACjC,CAAC,EACF,EAAE,EAAE,aAAa,IAEhB,gBAAgB,CAAC,OAAO,CAAC,CACtB,CACP,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAA"}
|