@digabi/exam-engine-core 16.4.4 → 16.4.7-alpha.0
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/ChoiceAnswer.d.ts +2 -9
- package/dist/components/exam/ChoiceAnswer.d.ts.map +1 -1
- package/dist/components/exam/ChoiceAnswer.js +15 -20
- package/dist/components/exam/ChoiceAnswer.js.map +1 -1
- package/dist/components/exam/DropdownAnswer.d.ts +2 -9
- package/dist/components/exam/DropdownAnswer.d.ts.map +1 -1
- package/dist/components/exam/DropdownAnswer.js +8 -13
- package/dist/components/exam/DropdownAnswer.js.map +1 -1
- package/dist/components/exam/Hints.d.ts.map +1 -1
- package/dist/components/exam/Hints.js.map +1 -1
- package/dist/components/exam/Question.d.ts.map +1 -1
- package/dist/components/exam/Question.js.map +1 -1
- package/dist/components/exam/Section.d.ts.map +1 -1
- package/dist/components/exam/Section.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/exam/TextAnswer.d.ts.map +1 -1
- package/dist/components/exam/TextAnswer.js +3 -13
- package/dist/components/exam/TextAnswer.js.map +1 -1
- package/dist/components/exam/internal/ErrorIndicator.d.ts.map +1 -1
- package/dist/components/exam/internal/ErrorIndicator.js.map +1 -1
- package/dist/components/exam/internal/TextAnswerInput.d.ts +1 -35
- package/dist/components/exam/internal/TextAnswerInput.d.ts.map +1 -1
- package/dist/components/exam/internal/TextAnswerInput.js +98 -129
- package/dist/components/exam/internal/TextAnswerInput.js.map +1 -1
- 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/grading-instructions/Audio.d.ts +5 -0
- package/dist/components/grading-instructions/Audio.d.ts.map +1 -0
- package/dist/components/grading-instructions/Audio.js +8 -0
- package/dist/components/grading-instructions/Audio.js.map +1 -0
- package/dist/components/grading-instructions/AudioTitle.d.ts +5 -0
- package/dist/components/grading-instructions/AudioTitle.d.ts.map +1 -0
- package/dist/components/grading-instructions/AudioTitle.js +11 -0
- package/dist/components/grading-instructions/AudioTitle.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 -38
- package/dist/main.css +1 -1
- package/dist/store/index.d.ts +4 -0
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js.map +1 -1
- package/package.json +11 -11
- package/dist/main-bundle.js.map +0 -1
@@ -0,0 +1,17 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { findChildElement } from '../dom-utils';
|
3
|
+
import { shortDisplayNumber } from '../shortDisplayNumber';
|
4
|
+
import TextAnswerInput from './TextAnswerInput';
|
5
|
+
import { ScreenReaderOnly } from './ScreenReaderOnly';
|
6
|
+
function TextAnswer(props) {
|
7
|
+
const { element, renderChildNodes } = props;
|
8
|
+
const displayNumber = element.getAttribute('display-number');
|
9
|
+
const hint = findChildElement(element, 'hint');
|
10
|
+
const textAnswer = React.createElement(TextAnswerInput, Object.assign({}, props));
|
11
|
+
return hint ? (React.createElement("label", { className: "e-nowrap" },
|
12
|
+
React.createElement("sup", { className: "e-text-answer-display-number e-color-darkgrey" }, shortDisplayNumber(displayNumber)),
|
13
|
+
React.createElement(ScreenReaderOnly, null, renderChildNodes(hint)),
|
14
|
+
textAnswer)) : (textAnswer);
|
15
|
+
}
|
16
|
+
export default React.memo(TextAnswer);
|
17
|
+
//# sourceMappingURL=TextAnswer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TextAnswer.js","sourceRoot":"","sources":["../../src/components/TextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,eAAe,MAAM,mBAAmB,CAAA;AAE/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD,SAAS,UAAU,CAAC,KAAyB;IAC3C,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,KAAK,CAAA;IAC3C,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAA;IAC7D,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC9C,MAAM,UAAU,GAAG,oBAAC,eAAe,oBAAK,KAAK,EAAI,CAAA;IAEjD,OAAO,IAAI,CAAC,CAAC,CAAC,CACZ,+BAAO,SAAS,EAAC,UAAU;QACzB,6BAAK,SAAS,EAAC,+CAA+C,IAAE,kBAAkB,CAAC,aAAa,CAAC,CAAO;QACxG,oBAAC,gBAAgB,QAAE,gBAAgB,CAAC,IAAI,CAAC,CAAoB;QAC5D,UAAU,CACL,CACT,CAAC,CAAC,CAAC,CACF,UAAU,CACX,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA"}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
import * as actions from '../store/answers/actions';
|
4
|
+
import { RichTextAnswer as RichTextAnswerT, TextAnswer as TextAnswerT } from '../types/ExamAnswer';
|
5
|
+
import { AnswerError } from './RichTextAnswer';
|
6
|
+
interface Props extends ExamComponentProps {
|
7
|
+
answer?: TextAnswerT | RichTextAnswerT;
|
8
|
+
answerBlurred: typeof actions.answerBlurred;
|
9
|
+
answerFocused: typeof actions.answerFocused;
|
10
|
+
saveAnswer: typeof actions.saveAnswer;
|
11
|
+
selectAnswerVersion: typeof actions.selectAnswerVersion;
|
12
|
+
showAnswerHistory: boolean;
|
13
|
+
supportsAnswerHistory: boolean;
|
14
|
+
type: 'rich-text' | 'multi-line' | 'single-line';
|
15
|
+
}
|
16
|
+
interface State {
|
17
|
+
error: AnswerError | null;
|
18
|
+
}
|
19
|
+
export declare class TextAnswerInput extends React.PureComponent<Props, State> {
|
20
|
+
private ref;
|
21
|
+
constructor(props: Props);
|
22
|
+
componentDidMount(): void;
|
23
|
+
componentDidUpdate(): void;
|
24
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
25
|
+
onRichTextChange: (answerHtml: string, answerText: string) => void;
|
26
|
+
onFocus: () => void;
|
27
|
+
onBlur: () => void;
|
28
|
+
onError: (error: AnswerError) => void;
|
29
|
+
clearErrors: () => void;
|
30
|
+
resize(): void;
|
31
|
+
render(): React.ReactNode;
|
32
|
+
}
|
33
|
+
export declare function getCharacterCount(answerText: string): number;
|
34
|
+
declare const _default: import("react-redux").ConnectedComponent<typeof TextAnswerInput, import("react-redux").Omit<React.ClassAttributes<TextAnswerInput> & Props, "type" | "answer" | "selectAnswerVersion" | "showAnswerHistory" | "supportsAnswerHistory" | "saveAnswer" | "answerFocused" | "answerBlurred"> & ExamComponentProps>;
|
35
|
+
export default _default;
|
36
|
+
//# sourceMappingURL=TextAnswerInput.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TextAnswerInput.d.ts","sourceRoot":"","sources":["../../src/components/TextAnswerInput.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAG9D,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,UAAU,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAIlG,OAAuB,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAI9D,UAAU,KAAM,SAAQ,kBAAkB;IACxC,MAAM,CAAC,EAAE,WAAW,GAAG,eAAe,CAAA;IACtC,aAAa,EAAE,OAAO,OAAO,CAAC,aAAa,CAAA;IAC3C,aAAa,EAAE,OAAO,OAAO,CAAC,aAAa,CAAA;IAC3C,UAAU,EAAE,OAAO,OAAO,CAAC,UAAU,CAAA;IACrC,mBAAmB,EAAE,OAAO,OAAO,CAAC,mBAAmB,CAAA;IACvD,iBAAiB,EAAE,OAAO,CAAA;IAC1B,qBAAqB,EAAE,OAAO,CAAA;IAC9B,IAAI,EAAE,WAAW,GAAG,YAAY,GAAG,aAAa,CAAA;CACjD;AAKD,UAAU,KAAK;IACb,KAAK,EAAE,WAAW,GAAG,IAAI,CAAA;CAC1B;AAED,qBAAa,eAAgB,SAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,CAAC;IACpE,OAAO,CAAC,GAAG,CAAyD;gBAExD,KAAK,EAAE,KAAK;IASxB,iBAAiB,IAAI,IAAI;IAIzB,kBAAkB,IAAI,IAAI;IAI1B,QAAQ,UAAW,MAAM,WAAW,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,KAAG,IAAI,CAclF;IAED,gBAAgB,eAAgB,MAAM,cAAc,MAAM,KAAG,IAAI,CAahE;IAED,OAAO,QAAO,IAAI,CAEjB;IAED,MAAM,QAAO,IAAI,CAEhB;IAED,OAAO,UAAW,WAAW,KAAG,IAAI,CAInC;IAED,WAAW,QAAO,IAAI,CAErB;IAED,MAAM,IAAI,IAAI;IAgBd,MAAM,IAAI,KAAK,CAAC,SAAS;CAyF1B;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D;;AAiBD,wBAKmB"}
|
@@ -0,0 +1,145 @@
|
|
1
|
+
import classNames from 'classnames';
|
2
|
+
import React from 'react';
|
3
|
+
import { connect } from 'react-redux';
|
4
|
+
import { getNumericAttribute } from '../dom-utils';
|
5
|
+
import * as actions from '../store/answers/actions';
|
6
|
+
import AnswerToolbar from './AnswerToolbar';
|
7
|
+
import { ExamContext } from './ExamContext';
|
8
|
+
import { QuestionContext } from './QuestionContext';
|
9
|
+
import RichTextAnswer from './RichTextAnswer';
|
10
|
+
import { Score } from './Score';
|
11
|
+
import { answerScoreId } from '../ids';
|
12
|
+
const borderWidthPx = 2;
|
13
|
+
const borderHeightPx = 1;
|
14
|
+
export class TextAnswerInput extends React.PureComponent {
|
15
|
+
constructor(props) {
|
16
|
+
super(props);
|
17
|
+
this.onChange = (event) => {
|
18
|
+
const { element, saveAnswer } = this.props;
|
19
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
20
|
+
const displayNumber = element.getAttribute('display-number');
|
21
|
+
const value = event.currentTarget.value.trim();
|
22
|
+
const answer = {
|
23
|
+
type: 'text',
|
24
|
+
questionId,
|
25
|
+
value,
|
26
|
+
characterCount: getCharacterCount(value),
|
27
|
+
displayNumber,
|
28
|
+
};
|
29
|
+
saveAnswer(answer);
|
30
|
+
this.clearErrors();
|
31
|
+
};
|
32
|
+
this.onRichTextChange = (answerHtml, answerText) => {
|
33
|
+
const { element, saveAnswer } = this.props;
|
34
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
35
|
+
const displayNumber = element.getAttribute('display-number');
|
36
|
+
const answer = {
|
37
|
+
type: 'richText',
|
38
|
+
questionId,
|
39
|
+
value: answerHtml,
|
40
|
+
characterCount: getCharacterCount(answerText),
|
41
|
+
displayNumber,
|
42
|
+
};
|
43
|
+
saveAnswer(answer);
|
44
|
+
this.clearErrors();
|
45
|
+
};
|
46
|
+
this.onFocus = () => {
|
47
|
+
this.props.answerFocused(getNumericAttribute(this.props.element, 'question-id'));
|
48
|
+
};
|
49
|
+
this.onBlur = () => {
|
50
|
+
this.props.answerBlurred(getNumericAttribute(this.props.element, 'question-id'));
|
51
|
+
};
|
52
|
+
this.onError = (error) => {
|
53
|
+
this.setState({
|
54
|
+
error,
|
55
|
+
});
|
56
|
+
};
|
57
|
+
this.clearErrors = () => {
|
58
|
+
this.setState({ error: null });
|
59
|
+
};
|
60
|
+
this.ref = React.createRef();
|
61
|
+
this.state = {
|
62
|
+
error: null,
|
63
|
+
};
|
64
|
+
}
|
65
|
+
componentDidMount() {
|
66
|
+
this.resize();
|
67
|
+
}
|
68
|
+
componentDidUpdate() {
|
69
|
+
this.resize();
|
70
|
+
}
|
71
|
+
resize() {
|
72
|
+
const { current } = this.ref;
|
73
|
+
if (current) {
|
74
|
+
if (this.props.type === 'multi-line') {
|
75
|
+
const { scrollX, scrollY } = window;
|
76
|
+
current.style.height = 'auto';
|
77
|
+
current.style.height = `${current.scrollHeight + borderHeightPx}px`;
|
78
|
+
window.scrollTo(scrollX, scrollY);
|
79
|
+
}
|
80
|
+
else if (this.props.type === 'single-line') {
|
81
|
+
current.style.width = '0';
|
82
|
+
current.style.width = `${current.scrollWidth + borderWidthPx}px`;
|
83
|
+
}
|
84
|
+
}
|
85
|
+
}
|
86
|
+
render() {
|
87
|
+
const { answer, className, element, selectAnswerVersion, showAnswerHistory, supportsAnswerHistory, type, } = this.props;
|
88
|
+
const { error } = this.state;
|
89
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
90
|
+
const maxScore = getNumericAttribute(element, 'max-score');
|
91
|
+
const value = answer && answer.value;
|
92
|
+
const scoreId = answerScoreId(element);
|
93
|
+
switch (type) {
|
94
|
+
case 'rich-text':
|
95
|
+
return (React.createElement(React.Fragment, null,
|
96
|
+
React.createElement(ExamContext.Consumer, null, ({ examServerApi }) => (React.createElement(RichTextAnswer, { answer: answer, className: classNames('text-answer text-answer--rich-text', className), saveScreenshot: (data) => examServerApi.saveScreenshot(questionId, data), onChange: this.onRichTextChange, onError: this.onError, questionId: questionId }))),
|
97
|
+
React.createElement(AnswerToolbar, Object.assign({}, {
|
98
|
+
answer,
|
99
|
+
element,
|
100
|
+
selectAnswerVersion,
|
101
|
+
showAnswerHistory,
|
102
|
+
supportsAnswerHistory,
|
103
|
+
error,
|
104
|
+
}))));
|
105
|
+
case 'multi-line':
|
106
|
+
return (React.createElement(React.Fragment, null,
|
107
|
+
React.createElement("textarea", { className: classNames('text-answer text-answer--multi-line', className), defaultValue: value, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, ref: this.ref, "data-question-id": questionId }),
|
108
|
+
React.createElement(AnswerToolbar, Object.assign({}, {
|
109
|
+
answer,
|
110
|
+
element,
|
111
|
+
selectAnswerVersion,
|
112
|
+
showAnswerHistory,
|
113
|
+
supportsAnswerHistory,
|
114
|
+
}))));
|
115
|
+
case 'single-line':
|
116
|
+
default:
|
117
|
+
return (React.createElement("span", { className: "e-nowrap" },
|
118
|
+
React.createElement("input", { type: "text", className: classNames('text-answer text-answer--single-line', className), defaultValue: value, onChange: this.onChange, onFocus: this.onFocus, onBlur: this.onBlur, ref: this.ref, "data-question-id": questionId, "aria-describedby": scoreId }),
|
119
|
+
React.createElement(QuestionContext.Consumer, null, ({ answers }) => answers.length > 1 && React.createElement(Score, { score: maxScore, size: "inline", id: scoreId }))));
|
120
|
+
}
|
121
|
+
}
|
122
|
+
}
|
123
|
+
export function getCharacterCount(answerText) {
|
124
|
+
return answerText.replace(/\s/g, '').length;
|
125
|
+
}
|
126
|
+
function mapStateToProps(state, { element }) {
|
127
|
+
const type = (element.getAttribute('type') || 'single-line');
|
128
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
129
|
+
const answer = state.answers.answersById[questionId];
|
130
|
+
const supportsAnswerHistory = state.answers.supportsAnswerHistory;
|
131
|
+
const showAnswerHistory = state.answers.supportsAnswerHistory && state.answers.serverQuestionIds.has(questionId);
|
132
|
+
return {
|
133
|
+
answer,
|
134
|
+
showAnswerHistory,
|
135
|
+
supportsAnswerHistory,
|
136
|
+
type,
|
137
|
+
};
|
138
|
+
}
|
139
|
+
export default connect(mapStateToProps, {
|
140
|
+
saveAnswer: actions.saveAnswer,
|
141
|
+
selectAnswerVersion: actions.selectAnswerVersion,
|
142
|
+
answerFocused: actions.answerFocused,
|
143
|
+
answerBlurred: actions.answerBlurred,
|
144
|
+
})(TextAnswerInput);
|
145
|
+
//# sourceMappingURL=TextAnswerInput.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TextAnswerInput.js","sourceRoot":"","sources":["../../src/components/TextAnswerInput.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAErC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAElD,OAAO,KAAK,OAAO,MAAM,0BAA0B,CAAA;AAEnD,OAAO,aAAa,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,cAA+B,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM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AO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,MAAM,CAAA;AAC7C,CAAC;AAED,SAAS,eAAe,CAAC,KAAe,EAAE,EAAE,OAAO,EAAsB;IACvE,MAAM,IAAI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,aAAa,CAA+C,CAAA;IAC1G,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAE,CAAA;IAC/D,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAA8C,CAAA;IACjG,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,CAAC,qBAAqB,CAAA;IACjE,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,CAAC,qBAAqB,IAAI,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;IAEhH,OAAO;QACL,MAAM;QACN,iBAAiB;QACjB,qBAAqB;QACrB,IAAI;KACL,CAAA;AACH,CAAC;AAED,eAAe,OAAO,CAAC,eAAe,EAAE;IACtC,UAAU,EAAE,OAAO,CAAC,UAAU;IAC9B,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;IAChD,aAAa,EAAE,OAAO,CAAC,aAAa;IACpC,aAAa,EAAE,OAAO,CAAC,aAAa;CACrC,CAAC,CAAC,eAAe,CAAC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function Video({ element, className }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof Video>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=Video.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Video.d.ts","sourceRoot":"","sources":["../../src/components/Video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,kBAAkB,eAaxD;;AAED,wBAAgC"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { getNumericAttribute } from '../dom-utils';
|
3
|
+
import { CommonExamContext } from './CommonExamContext';
|
4
|
+
import ResponsiveMediaContainer from './ResponsiveMediaContainer';
|
5
|
+
function Video({ element, className }) {
|
6
|
+
const src = element.getAttribute('src');
|
7
|
+
const width = getNumericAttribute(element, 'width');
|
8
|
+
const height = getNumericAttribute(element, 'height');
|
9
|
+
const { resolveAttachment } = useContext(CommonExamContext);
|
10
|
+
return (React.createElement(ResponsiveMediaContainer, Object.assign({}, { className, width, height }),
|
11
|
+
React.createElement("video", { className: "video", preload: "metadata", controls: true },
|
12
|
+
React.createElement("source", { src: resolveAttachment(src) }))));
|
13
|
+
}
|
14
|
+
export default React.memo(Video);
|
15
|
+
//# sourceMappingURL=Video.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Video.js","sourceRoot":"","sources":["../../src/components/Video.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,wBAAwB,MAAM,4BAA4B,CAAA;AAGjE,SAAS,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAsB;IACvD,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAE,CAAA;IACxC,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAE,CAAA;IACpD,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAE,CAAA;IACtD,MAAM,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAE3D,OAAO,CACL,oBAAC,wBAAwB,oBAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE;QACxD,+BAAO,SAAS,EAAC,OAAO,EAAC,OAAO,EAAC,UAAU,EAAC,QAAQ;YAClD,gCAAQ,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC,GAAI,CACjC,CACiB,CAC5B,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA"}
|
@@ -1,12 +1,5 @@
|
|
1
|
-
|
2
|
-
import * as actions from '../../store/answers/actions';
|
1
|
+
import React from 'react';
|
3
2
|
import { ExamComponentProps } from '../../createRenderChildNodes';
|
4
|
-
|
5
|
-
interface ChoiceAnswerProps extends ExamComponentProps {
|
6
|
-
answer?: ChoiceAnswerT;
|
7
|
-
saveAnswer: typeof actions.saveAnswer;
|
8
|
-
}
|
9
|
-
declare function ChoiceAnswer({ answer, saveAnswer, element, renderChildNodes }: ChoiceAnswerProps): JSX.Element;
|
10
|
-
declare const _default: import("react-redux").ConnectedComponent<typeof ChoiceAnswer, import("react-redux").Omit<ChoiceAnswerProps, "saveAnswer" | "answer"> & ExamComponentProps>;
|
3
|
+
declare const _default: React.NamedExoticComponent<ExamComponentProps>;
|
11
4
|
export default _default;
|
12
5
|
//# sourceMappingURL=ChoiceAnswer.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChoiceAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/ChoiceAnswer.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ChoiceAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/ChoiceAnswer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,MAAM,OAAO,CAAA;AAGtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AAwHjE,wBAAuC"}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import classNames from 'classnames';
|
2
|
-
import React, { useContext } from 'react';
|
3
|
-
import {
|
2
|
+
import React, { useCallback, useContext } from 'react';
|
3
|
+
import { useDispatch, useSelector } from 'react-redux';
|
4
4
|
import { getNumericAttribute, mapChildElements, query } from '../../dom-utils';
|
5
|
-
import * as actions from '../../store/answers/actions';
|
6
5
|
import { QuestionContext } from '../context/QuestionContext';
|
7
|
-
|
6
|
+
import { saveAnswer } from '../../store/answers/actions';
|
7
|
+
const ChoiceAnswerOption = ({ selected, element, renderChildNodes, questionId, onSelect, direction, value, }) => {
|
8
8
|
const className = element.getAttribute('class');
|
9
9
|
const content = (React.createElement("div", { className: classNames('e-choice-answer-option e-column', className, {
|
10
10
|
'e-choice-answer-option--selected': selected,
|
@@ -18,16 +18,18 @@ function ChoiceAnswerOption({ selected, element, renderChildNodes, questionId, o
|
|
18
18
|
React.createElement("label", { className: "e-block e-text-center" },
|
19
19
|
React.createElement("input", { type: "radio", className: "e-radio-button", name: String(questionId), onChange: onSelect, value: value, checked: selected }),
|
20
20
|
content)));
|
21
|
-
}
|
22
|
-
|
23
|
-
const { questionLabelIds } = useContext(QuestionContext);
|
21
|
+
};
|
22
|
+
const ChoiceAnswer = ({ element, renderChildNodes }) => {
|
24
23
|
const questionId = getNumericAttribute(element, 'question-id');
|
24
|
+
const displayNumber = element.getAttribute('display-number');
|
25
25
|
const direction = element.getAttribute('direction') || 'vertical';
|
26
26
|
const className = element.getAttribute('class');
|
27
|
-
const
|
28
|
-
const
|
29
|
-
|
30
|
-
|
27
|
+
const { questionLabelIds } = useContext(QuestionContext);
|
28
|
+
const answer = useSelector((state) => state.answers.answersById[questionId]);
|
29
|
+
const dispatch = useDispatch();
|
30
|
+
const onSelect = useCallback((event) => {
|
31
|
+
dispatch(saveAnswer({ type: 'choice', questionId, value: event.currentTarget.value, displayNumber }));
|
32
|
+
}, [questionId, displayNumber]);
|
31
33
|
return (React.createElement("div", { className: classNames('e-choice-answer e-mrg-b-4', className, {
|
32
34
|
'e-columns': direction === 'horizontal',
|
33
35
|
}), "data-question-id": questionId, role: "radiogroup", "aria-labelledby": questionLabelIds }, mapChildElements(element, (childElement) => {
|
@@ -46,13 +48,6 @@ function ChoiceAnswer({ answer, saveAnswer, element, renderChildNodes }) {
|
|
46
48
|
value,
|
47
49
|
} }));
|
48
50
|
})));
|
49
|
-
}
|
50
|
-
|
51
|
-
const questionId = getNumericAttribute(element, 'question-id');
|
52
|
-
const answer = state.answers.answersById[questionId];
|
53
|
-
return { answer };
|
54
|
-
}
|
55
|
-
export default connect(mapStateToProps, {
|
56
|
-
saveAnswer: actions.saveAnswer,
|
57
|
-
})(ChoiceAnswer);
|
51
|
+
};
|
52
|
+
export default React.memo(ChoiceAnswer);
|
58
53
|
//# sourceMappingURL=ChoiceAnswer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ChoiceAnswer.js","sourceRoot":"","sources":["../../../src/components/exam/ChoiceAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"ChoiceAnswer.js","sourceRoot":"","sources":["../../../src/components/exam/ChoiceAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAG9E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAUxD,MAAM,kBAAkB,GAAG,CAAC,EAC1B,QA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GAAG,MAAM,IAAI,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,KAAK,CAAA;QAEzD,OAAO,CACL,oBAAC,kBAAkB,OACb;gBACF,OAAO,EAAE,YAAY;gBACrB,QAAQ;gBACR,gBAAgB;gBAChB,UAAU;gBACV,GAAG,EAAE,QAAQ;gBACb,SAAS;gBACT,QAAQ;gBACR,KAAK;aACN,GACD,CACH,CAAA;IACH,CAAC,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA"}
|
@@ -1,12 +1,5 @@
|
|
1
|
-
|
1
|
+
import React from 'react';
|
2
2
|
import { ExamComponentProps } from '../../createRenderChildNodes';
|
3
|
-
|
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, "saveAnswer" | "answer"> & ExamComponentProps>;
|
3
|
+
declare const _default: React.NamedExoticComponent<ExamComponentProps>;
|
11
4
|
export default _default;
|
12
5
|
//# sourceMappingURL=DropdownAnswer.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DropdownAnswer.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"DropdownAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DropdownAnswer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAEtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AA2IjE,wBAAyC"}
|
@@ -4,21 +4,23 @@ import classNames from 'classnames';
|
|
4
4
|
import { useSelect } from 'downshift';
|
5
5
|
import * as _ from 'lodash-es';
|
6
6
|
import React, { useContext, useEffect, useRef, useState } from 'react';
|
7
|
-
import {
|
7
|
+
import { useDispatch, useSelector } from 'react-redux';
|
8
8
|
import { findChildElement, getNumericAttribute, mapChildElements, NBSP } from '../../dom-utils';
|
9
9
|
import * as fonts from '../../fonts';
|
10
10
|
import { useExamTranslation } from '../../i18n';
|
11
11
|
import { answerScoreId } from '../../ids';
|
12
|
-
import * as actions from '../../store/answers/actions';
|
13
12
|
import { QuestionContext } from '../context/QuestionContext';
|
14
13
|
import { Score } from '../shared/Score';
|
14
|
+
import { saveAnswer } from '../../store/answers/actions';
|
15
15
|
const menuBorderWidthPx = 2;
|
16
16
|
const roundingErrorCompensationPx = 1;
|
17
17
|
const noAnswer = '';
|
18
18
|
const runningInBrowser = !navigator.userAgent.includes('jsdom/');
|
19
|
-
|
19
|
+
const DropdownAnswer = ({ element, renderChildNodes }) => {
|
20
20
|
const questionId = getNumericAttribute(element, 'question-id');
|
21
21
|
const maxScore = getNumericAttribute(element, 'max-score');
|
22
|
+
const answer = useSelector((state) => state.answers.answersById[questionId]);
|
23
|
+
const dispatch = useDispatch();
|
22
24
|
const displayNumber = element.getAttribute('display-number');
|
23
25
|
const currentlySelectedItem = answer &&
|
24
26
|
answer.value &&
|
@@ -53,7 +55,7 @@ function DropdownAnswer({ element, renderChildNodes, saveAnswer, answer }) {
|
|
53
55
|
itemToString: (item) => (item ? item.textContent : ''),
|
54
56
|
onSelectedItemChange: ({ selectedItem }) => {
|
55
57
|
const value = selectedItem ? selectedItem.getAttribute('option-id') : '';
|
56
|
-
saveAnswer({ type: 'choice', questionId, value, displayNumber });
|
58
|
+
dispatch(saveAnswer({ type: 'choice', questionId, value, displayNumber }));
|
57
59
|
},
|
58
60
|
initialSelectedItem: currentlySelectedItem,
|
59
61
|
});
|
@@ -85,13 +87,6 @@ function DropdownAnswer({ element, renderChildNodes, saveAnswer, answer }) {
|
|
85
87
|
}) },
|
86
88
|
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))))))),
|
87
89
|
answers.length > 1 && React.createElement(Score, { score: maxScore, size: 'inline', id: scoreId })));
|
88
|
-
}
|
89
|
-
|
90
|
-
const questionId = getNumericAttribute(element, 'question-id');
|
91
|
-
const answer = state.answers.answersById[questionId];
|
92
|
-
return { answer };
|
93
|
-
}
|
94
|
-
export default connect(mapStateToprops, {
|
95
|
-
saveAnswer: actions.saveAnswer,
|
96
|
-
})(DropdownAnswer);
|
90
|
+
};
|
91
|
+
export default React.memo(DropdownAnswer);
|
97
92
|
//# sourceMappingURL=DropdownAnswer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DropdownAnswer.js","sourceRoot":"","sources":["../../../src/components/exam/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,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,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,
|
1
|
+
{"version":3,"file":"DropdownAnswer.js","sourceRoot":"","sources":["../../../src/components/exam/DropdownAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,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KAAK,CAAC;iBAC5D,CAAC,EACF,GAAG,EAAE,CAAC,KACF,YAAY,CAAC;oBACf,IAAI;oBACJ,KAAK,EAAE,CAAC;iBACT,CAAC;gBAGF,8BAAM,SAAS,EAAE,UAAU,CAAC,4CAA4C,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,IACjG,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,4CAAkB,CAAC,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAG,IAAI,CAAQ,CAC3F,CACF,CACR,CAAC,CACG,CACF;QACN,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,oBAAC,KAAK,IAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,GAAI,CACzE,CACR,CAAA;AACH,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Hints.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Hints.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAoB,MAAM,8BAA8B,CAAA;
|
1
|
+
{"version":3,"file":"Hints.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Hints.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAoB,MAAM,8BAA8B,CAAA;AAKnF,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAqBtD,CAAA;AAiCD,eAAe,KAAK,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Hints.js","sourceRoot":"","sources":["../../../src/components/exam/Hints.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK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,IAAI,OAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,EAAE,GAAG,EAAE,CAAC,GAAI,CACtE,CAAC,CACE,CACF,CACP,CAAC,CAAC,CAAC,CACF,0CAAG,gBAAgB,CAAC,OAAO,CAAC,CAAI,CACjC,CAAA;AACH,CAAC,CAAA;AAED,SAAS,IAAI,CAAC,EACZ,MAAM,EACN,iBAAiB,EACjB,gBAAgB,GAKjB;IACC,MAAM,UAAU,GAAG,mBAAmB,CAAC,MAAM,EAAE,aAAa,CAAE,CAAA;IAC9D,MAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAA;IAC5D,MAAM,IAAI,GAAG,gBAAgB,CAAC,MAAM,EAAE,MAAM,CAAE,CAAA;IAE9C,OAAO,CACL,2BACE,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE;YACrC,wBAAwB,EAAE,iBAAiB,KAAK,UAAU;SAC3D,CAAC,EACF,OAAO,EAAE,GAAG,EAAE;YACZ,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAc,kCAAkC,UAAU,IAAI,CAAC,CAAA;YACtG,IAAI,QAAQ,EAAE;gBACZ,QAAQ,CAAC,KAAK,EAAE,CAAA;aACjB;QACH,CAAC,sBACiB,UAAU;QAE3B,kBAAkB,CAAC,aAAa,CAAC;;QAAG,gBAAgB,CAAC,IAAI,CAAC,CACzD,CACL,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Question.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Question.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"Question.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Question.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AAoBjE,wBAAwD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Question.js","sourceRoot":"","sources":["../../../src/components/exam/Question.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;
|
1
|
+
{"version":3,"file":"Question.js","sourceRoot":"","sources":["../../../src/components/exam/Question.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;AACzC,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAG1D,SAAS,QAAQ,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACjE,MAAM,SAAS,GAAG,WAAW,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;IAC7D,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,QAAQ,CAAC,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../src/components/exam/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AAqFjE,wBAAsD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../../../src/components/exam/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;
|
1
|
+
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../../../src/components/exam/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAErE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD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EAAE,KAAK,CAAC,iBAAiB,EAAE,CAAC,CACtD,CACL,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,SAAS,EAAC,oCAAoC,IAAE,CAAC,CAAC,sBAAsB,CAAC,CAAO,CACtF,CACG,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../../createRenderChildNodes';
|
3
|
+
export interface TOCSectionTitleProps {
|
4
|
+
element: Element;
|
5
|
+
displayNumber: string;
|
6
|
+
maxAnswers?: number;
|
7
|
+
minAnswers?: number;
|
8
|
+
childQuestions: Element[];
|
9
|
+
}
|
10
|
+
declare function TableOfContents(_props: ExamComponentProps): JSX.Element;
|
11
|
+
declare const _default: React.MemoExoticComponent<typeof TableOfContents>;
|
12
|
+
export default _default;
|
13
|
+
//# sourceMappingURL=TableOfContents.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TableOfContents.d.ts","sourceRoot":"","sources":["../../../src/components/exam/TableOfContents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAA0B,kBAAkB,EAAiB,MAAM,8BAA8B,CAAA;AAkCxG,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,EAAE,OAAO,EAAE,CAAA;CAC1B;AA+DD,iBAAS,eAAe,CAAC,MAAM,EAAE,kBAAkB,eAgBlD;;AAED,wBAA0C"}
|
@@ -0,0 +1,66 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { createRenderChildNodes } from '../../createRenderChildNodes';
|
3
|
+
import { findChildElement, query, queryAncestors } from '../../dom-utils';
|
4
|
+
import { useExamTranslation } from '../../i18n';
|
5
|
+
import { tocSectionTitleId, tocTitleId } from '../../ids';
|
6
|
+
import { url } from '../../url';
|
7
|
+
import AnsweringInstructions from '../AnsweringInstructions';
|
8
|
+
import { CommonExamContext } from '../context/CommonExamContext';
|
9
|
+
import { QuestionContext, withQuestionContext } from '../context/QuestionContext';
|
10
|
+
import { SectionContext, withSectionContext } from '../context/SectionContext';
|
11
|
+
function TOCSection({ element }) {
|
12
|
+
const { maxAnswers, minAnswers, displayNumber, childQuestions } = useContext(SectionContext);
|
13
|
+
const sectionTitle = findChildElement(element, 'section-title');
|
14
|
+
return (React.createElement("li", null,
|
15
|
+
sectionTitle && (React.createElement(TOCSectionTitle, Object.assign({}, {
|
16
|
+
element: sectionTitle,
|
17
|
+
displayNumber,
|
18
|
+
maxAnswers,
|
19
|
+
minAnswers,
|
20
|
+
childQuestions,
|
21
|
+
}))),
|
22
|
+
React.createElement("ol", { className: "e-list-data e-pad-l-0", "aria-labelledby": sectionTitle && tocSectionTitleId(displayNumber) }, renderChildNodes(element, 1 /* SkipHTML */))));
|
23
|
+
}
|
24
|
+
function TOCSectionTitle({ element, displayNumber, minAnswers, maxAnswers, childQuestions }) {
|
25
|
+
const { numberOfSections } = useContext(CommonExamContext);
|
26
|
+
const { t } = useExamTranslation();
|
27
|
+
return (React.createElement(React.Fragment, null,
|
28
|
+
React.createElement("header", { className: "e-semibold", id: tocSectionTitleId(displayNumber) }, element.hasChildNodes() && (React.createElement(React.Fragment, null,
|
29
|
+
numberOfSections > 1 && t('section', { displayNumber }),
|
30
|
+
" ",
|
31
|
+
renderChildNodes(element)))),
|
32
|
+
maxAnswers != null && (React.createElement("div", null,
|
33
|
+
React.createElement(AnsweringInstructions, Object.assign({}, { maxAnswers, minAnswers, childQuestions, type: 'toc-section' }))))));
|
34
|
+
}
|
35
|
+
function TOCQuestion({ element }) {
|
36
|
+
const { attachmentsURL } = useContext(CommonExamContext);
|
37
|
+
const { level, displayNumber, maxScore } = useContext(QuestionContext);
|
38
|
+
const { t } = useExamTranslation();
|
39
|
+
const externalMaterial = query(element, 'external-material');
|
40
|
+
const questionTitle = findChildElement(element, 'question-title');
|
41
|
+
return level === 0 ? (React.createElement("li", { "data-list-number": displayNumber + '.' },
|
42
|
+
React.createElement("div", { className: "e-columns" },
|
43
|
+
questionTitle && (React.createElement("span", { className: "e-column" },
|
44
|
+
React.createElement("a", { href: url('', { hash: displayNumber }) }, renderChildNodes(questionTitle)))),
|
45
|
+
externalMaterial && (React.createElement("span", { className: "e-column e-column--narrow" },
|
46
|
+
React.createElement("a", { href: url(attachmentsURL, {
|
47
|
+
hash: queryAncestors(externalMaterial, 'question').getAttribute('display-number'),
|
48
|
+
}), target: "attachments" }, t('material')))),
|
49
|
+
React.createElement("span", { className: "e-column e-column--narrow table-of-contents--score-column" }, t('points', { count: maxScore }))))) : null;
|
50
|
+
}
|
51
|
+
const renderChildNodes = createRenderChildNodes({
|
52
|
+
section: withSectionContext(TOCSection),
|
53
|
+
question: withQuestionContext(TOCQuestion),
|
54
|
+
});
|
55
|
+
function TableOfContents(_props) {
|
56
|
+
const { root, maxScore } = useContext(CommonExamContext);
|
57
|
+
const { t } = useExamTranslation();
|
58
|
+
return (React.createElement("nav", { className: "table-of-contents e-mrg-b-6", "aria-labelledby": tocTitleId },
|
59
|
+
React.createElement("h2", { id: tocTitleId }, t('toc-heading')),
|
60
|
+
React.createElement("ol", { className: "e-list-plain e-pad-l-0" }, renderChildNodes(root)),
|
61
|
+
React.createElement("div", { className: "e-columns" },
|
62
|
+
React.createElement("strong", { className: "e-column" }, t('exam-total')),
|
63
|
+
React.createElement("strong", { className: "e-column e-column--narrow table-of-contents--score-column" }, t('points', { count: maxScore })))));
|
64
|
+
}
|
65
|
+
export default React.memo(TableOfContents);
|
66
|
+
//# sourceMappingURL=TableOfContents.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TableOfContents.js","sourceRoot":"","sources":["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AAe,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TextAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/TextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"TextAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/TextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGjE,iBAAS,UAAU,CAAC,KAAK,EAAE,kBAAkB,eAe5C;;AAED,wBAAqC"}
|