@digabi/exam-engine-core 19.19.0 → 20.0.0-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 +6 -0
- package/dist/components/AttachmentLink.d.ts.map +1 -0
- package/dist/components/AttachmentLink.js +24 -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 +6 -0
- package/dist/components/AttachmentLinks.d.ts.map +1 -0
- package/dist/components/AttachmentLinks.js +58 -0
- package/dist/components/AttachmentLinks.js.map +1 -0
- package/dist/components/Attachments.d.ts +5 -0
- package/dist/components/Attachments.d.ts.map +1 -0
- package/dist/components/Attachments.js +43 -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 +16 -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 +29 -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 +12 -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 +60 -0
- package/dist/components/ChoiceAnswer.js.map +1 -0
- package/dist/components/CommonExamContext.d.ts +16 -0
- package/dist/components/CommonExamContext.d.ts.map +1 -0
- package/dist/components/CommonExamContext.js +22 -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 +85 -0
- package/dist/components/DropdownAnswer.js.map +1 -0
- package/dist/components/Exam.d.ts +40 -0
- package/dist/components/Exam.d.ts.map +1 -0
- package/dist/components/Exam.js +106 -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 +6 -0
- package/dist/components/ExamQuestionTitle.d.ts.map +1 -0
- package/dist/components/ExamQuestionTitle.js +25 -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 +30 -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 +21 -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 +31 -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 +12 -0
- package/dist/components/Formula.js.map +1 -0
- package/dist/components/Hints.d.ts +6 -0
- package/dist/components/Hints.d.ts.map +1 -0
- package/dist/components/Hints.js +32 -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 +25 -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 +45 -0
- package/dist/components/ImageOverlay.js.map +1 -0
- package/dist/components/ProgressBar.d.ts +6 -0
- package/dist/components/ProgressBar.d.ts.map +1 -0
- package/dist/components/ProgressBar.js +18 -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 +63 -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 +23 -0
- package/dist/components/References.js.map +1 -0
- package/dist/components/ResponsiveMediaContainer.d.ts +17 -0
- package/dist/components/ResponsiveMediaContainer.d.ts.map +1 -0
- package/dist/components/ResponsiveMediaContainer.js +20 -0
- package/dist/components/ResponsiveMediaContainer.js.map +1 -0
- package/dist/components/RestrictedAudioPlayer.d.ts +11 -0
- package/dist/components/RestrictedAudioPlayer.d.ts.map +1 -0
- package/dist/components/RestrictedAudioPlayer.js +29 -0
- package/dist/components/RestrictedAudioPlayer.js.map +1 -0
- package/dist/components/RichTextAnswer.d.ts +31 -0
- package/dist/components/RichTextAnswer.d.ts.map +1 -0
- package/dist/components/RichTextAnswer.js +70 -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 +15 -0
- package/dist/components/SaveIndicator.js.map +1 -0
- package/dist/components/Score.d.ts +6 -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 +3 -0
- package/dist/components/Section.d.ts.map +1 -0
- package/dist/components/Section.js +7 -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 +16 -0
- package/dist/components/TextAnswer.js.map +1 -0
- package/dist/components/TextAnswerInput.d.ts +37 -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/ExamineExam.d.ts +5 -0
- package/dist/components/exam/ExamineExam.d.ts.map +1 -0
- package/dist/components/exam/ExamineExam.js +20 -0
- package/dist/components/exam/ExamineExam.js.map +1 -0
- package/dist/components/exam/FinishExam.d.ts +5 -0
- package/dist/components/exam/FinishExam.d.ts.map +1 -0
- package/dist/components/exam/FinishExam.js +17 -0
- package/dist/components/exam/FinishExam.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 +40 -0
- package/dist/components/results/AnnotationList.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 +60 -0
- package/dist/components/results/ResultsChoiceAnswer.js.map +1 -0
- package/dist/components/results/ResultsContext.d.ts +20 -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 +41 -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 +16 -0
- package/dist/components/results/ResultsExamQuestionAutoScore.js.map +1 -0
- package/dist/components/results/ResultsExamQuestionManualScore.d.ts +11 -0
- package/dist/components/results/ResultsExamQuestionManualScore.d.ts.map +1 -0
- package/dist/components/results/ResultsExamQuestionManualScore.js +62 -0
- package/dist/components/results/ResultsExamQuestionManualScore.js.map +1 -0
- package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts +9 -0
- package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts.map +1 -0
- package/dist/components/results/ResultsExamQuestionScoresContainer.js +8 -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 +22 -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 +17 -0
- package/dist/components/results/ResultsExamSection.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 +12 -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 +51 -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 +10 -0
- package/dist/components/results/helpers.js.map +1 -0
- package/dist/components/results/isExamFinishPageHook.d.ts +2 -0
- package/dist/components/results/isExamFinishPageHook.d.ts.map +1 -0
- package/dist/components/results/isExamFinishPageHook.js +7 -0
- package/dist/components/results/isExamFinishPageHook.js.map +1 -0
- package/dist/components/types.d.ts +110 -0
- package/dist/components/types.d.ts.map +1 -0
- package/dist/components/types.js +1 -0
- package/dist/components/types.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 +1 -1
- package/dist/store/answers/sagas.d.ts.map +1 -1
- package/dist/store/answers/sagas.js +6 -0
- package/dist/store/answers/sagas.js.map +1 -1
- package/dist/types/ExamServerAPI.d.ts +2 -0
- package/dist/types/ExamServerAPI.d.ts.map +1 -1
- package/package.json +3 -3
@@ -0,0 +1,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
export declare type AttachmentContext = {
|
4
|
+
name: string | null;
|
5
|
+
isExternal: false;
|
6
|
+
displayNumber: null;
|
7
|
+
} | {
|
8
|
+
name: string | null;
|
9
|
+
isExternal: true;
|
10
|
+
displayNumber: string;
|
11
|
+
};
|
12
|
+
export declare const AttachmentContext: React.Context<AttachmentContext>;
|
13
|
+
export declare const withAttachmentContext: (Component: React.ComponentType<ExamComponentProps>) => React.ComponentType<ExamComponentProps>;
|
14
|
+
//# sourceMappingURL=AttachmentContext.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentContext.d.ts","sourceRoot":"","sources":["../../src/components/AttachmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,oBAAY,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,KAAK,CAAC;IAAC,aAAa,EAAE,IAAI,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,EAAE,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAA;AAEpE,eAAO,MAAM,iBAAiB,kCAAkE,CAAA;AAEhG,eAAO,MAAM,qBAAqB,iGASjC,CAAA"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { queryAncestors } from '../dom-utils';
|
3
|
+
import { withContext } from './withContext';
|
4
|
+
export const AttachmentContext = React.createContext({});
|
5
|
+
export const withAttachmentContext = withContext(AttachmentContext, ({ element }) => {
|
6
|
+
const isExternal = queryAncestors(element, 'external-material') != null;
|
7
|
+
const name = element.getAttribute('name');
|
8
|
+
return isExternal
|
9
|
+
? { displayNumber: element.getAttribute('display-number'), isExternal, name }
|
10
|
+
: { displayNumber: null, isExternal, name };
|
11
|
+
});
|
12
|
+
//# sourceMappingURL=AttachmentContext.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentContext.js","sourceRoot":"","sources":["../../src/components/AttachmentContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAO3C,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAoB,EAAuB,CAAC,CAAA;AAEhG,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAC9C,iBAAiB,EACjB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IACd,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO,EAAE,mBAAmB,CAAC,IAAI,IAAI,CAAA;IACvE,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAA;IACzC,OAAO,UAAU;QACf,CAAC,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAE,EAAE,UAAU,EAAE,IAAI,EAAE;QAC9E,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAA;AAC/C,CAAC,CACF,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function AttachmentLink({ element }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof AttachmentLink>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=AttachmentLink.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentLink.d.ts","sourceRoot":"","sources":["../../src/components/AttachmentLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAMzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,cAAc,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,eAoBtD;;AAED,wBAAyC"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { Translation } from 'react-i18next';
|
3
|
+
import { query } from '../dom-utils';
|
4
|
+
import { url } from '../url';
|
5
|
+
import AttachmentLinkAnchor from './AttachmentLinkAnchor';
|
6
|
+
import { CommonExamContext } from './CommonExamContext';
|
7
|
+
function AttachmentLink({ element }) {
|
8
|
+
const name = element.getAttribute('ref');
|
9
|
+
const { root } = useContext(CommonExamContext);
|
10
|
+
const { attachmentsURL } = useContext(CommonExamContext);
|
11
|
+
const attachment = query(root, (el) => el.localName === 'attachment' && el.getAttribute('name') === name);
|
12
|
+
const displayNumber = attachment.getAttribute('display-number');
|
13
|
+
const isShort = element.getAttribute('type') === 'short';
|
14
|
+
const href = url(attachmentsURL, { hash: displayNumber });
|
15
|
+
return isShort ? (React.createElement(AttachmentLinkAnchor, { href: href }, displayNumber)) : (React.createElement(React.Fragment, null,
|
16
|
+
'(',
|
17
|
+
React.createElement(AttachmentLinkAnchor, { href: href },
|
18
|
+
React.createElement(Translation, null, (t) => t('material').toLowerCase()),
|
19
|
+
" ",
|
20
|
+
displayNumber),
|
21
|
+
')'));
|
22
|
+
}
|
23
|
+
export default React.memo(AttachmentLink);
|
24
|
+
//# sourceMappingURL=AttachmentLink.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentLink.js","sourceRoot":"","sources":["../../src/components/AttachmentLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,oBAAoB,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,SAAS,cAAc,CAAC,EAAE,OAAO,EAAsB;IACrD,MAAM,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,KAAK,CAAE,CAAA;IACzC,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC9C,MAAM,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IACxD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,SAAS,KAAK,YAAY,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,IAAI,CAAE,CAAA;IAC1G,MAAM,aAAa,GAAG,UAAU,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAA;IAChE,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,OAAO,CAAA;IACxD,MAAM,IAAI,GAAG,GAAG,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,CAAA;IAEzD,OAAO,OAAO,CAAC,CAAC,CAAC,CACf,oBAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI,IAAG,aAAa,CAAwB,CACzE,CAAC,CAAC,CAAC,CACF;QACG,GAAG;QACJ,oBAAC,oBAAoB,IAAC,IAAI,EAAE,IAAI;YAC9B,oBAAC,WAAW,QAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAe;;YAAE,aAAa,CACzD;QACtB,GAAG,CACH,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentLinkAnchor.d.ts","sourceRoot":"","sources":["../../src/components/AttachmentLinkAnchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,QAAA,MAAM,oBAAoB;;;iBAIzB,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
const AttachmentLinkAnchor = ({ children, href }) => (React.createElement("a", { href: href, className: "attachment-link e-nowrap", target: "attachments" }, children));
|
3
|
+
export default AttachmentLinkAnchor;
|
4
|
+
//# sourceMappingURL=AttachmentLinkAnchor.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentLinkAnchor.js","sourceRoot":"","sources":["../../src/components/AttachmentLinkAnchor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,oBAAoB,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAA+C,EAAE,EAAE,CAAC,CAChG,2BAAG,IAAI,EAAE,IAAI,EAAE,SAAS,EAAC,0BAA0B,EAAC,MAAM,EAAC,aAAa,IACrE,QAAQ,CACP,CACL,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function AttachmentLinks({ element }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof AttachmentLinks>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=AttachmentLinks.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentLinks.d.ts","sourceRoot":"","sources":["../../src/components/AttachmentLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAMzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,eAAe,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,eA+BvD;;AAgCD,wBAA0C"}
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { Translation } from 'react-i18next';
|
3
|
+
import { mapChildElements, query } from '../dom-utils';
|
4
|
+
import { url } from '../url';
|
5
|
+
import AttachmentLinkAnchor from './AttachmentLinkAnchor';
|
6
|
+
import { CommonExamContext } from './CommonExamContext';
|
7
|
+
function AttachmentLinks({ element }) {
|
8
|
+
const { root, attachmentsURL } = useContext(CommonExamContext);
|
9
|
+
const displayNumbers = mapChildElements(element, (attachmentLink) => {
|
10
|
+
const name = attachmentLink.getAttribute('ref');
|
11
|
+
const attachment = query(root, (el) => el.localName === 'attachment' && el.getAttribute('name') === name);
|
12
|
+
return attachment.getAttribute('display-number');
|
13
|
+
});
|
14
|
+
const groupedDisplayNumbers = splitWhen(displayNumbers, (displayNumber, i) => {
|
15
|
+
return i > 0 && !isSuccessive(displayNumbers[i - 1], displayNumber);
|
16
|
+
});
|
17
|
+
const isShort = element.getAttribute('type') === 'short';
|
18
|
+
const href = url(attachmentsURL, { hash: displayNumbers[0] });
|
19
|
+
const displayNumbersString = groupedDisplayNumbers
|
20
|
+
.map((group) => {
|
21
|
+
return group.length > 1 ? `${group[0]}–${group[group.length - 1]}` : group[0];
|
22
|
+
})
|
23
|
+
.join(', ');
|
24
|
+
const count = groupedDisplayNumbers[0].length;
|
25
|
+
return isShort ? (React.createElement(AttachmentLinkAnchor, { href: href }, displayNumbersString)) : (React.createElement(React.Fragment, null,
|
26
|
+
'(',
|
27
|
+
React.createElement(AttachmentLinkAnchor, { href: href },
|
28
|
+
React.createElement(Translation, null, (t) => t('material', { count }).toLowerCase()),
|
29
|
+
" ",
|
30
|
+
displayNumbersString),
|
31
|
+
')'));
|
32
|
+
}
|
33
|
+
function splitWhen(array, predicate) {
|
34
|
+
const result = [[]];
|
35
|
+
let prev;
|
36
|
+
for (let i = 0; i < array.length; i++) {
|
37
|
+
const elem = array[i];
|
38
|
+
if (prev && predicate(elem, i, array)) {
|
39
|
+
const group = [elem];
|
40
|
+
result.push(group);
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
const lastGroup = result[result.length - 1];
|
44
|
+
lastGroup.push(elem);
|
45
|
+
}
|
46
|
+
prev = elem;
|
47
|
+
}
|
48
|
+
return result;
|
49
|
+
}
|
50
|
+
function isSuccessive(a, b) {
|
51
|
+
const length = a.length;
|
52
|
+
if (length !== b.length) {
|
53
|
+
return false;
|
54
|
+
}
|
55
|
+
return a.startsWith(b.slice(0, length - 1)) && b.charCodeAt(length - 1) - a.charCodeAt(length - 1) === 1;
|
56
|
+
}
|
57
|
+
export default React.memo(AttachmentLinks);
|
58
|
+
//# sourceMappingURL=AttachmentLinks.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentLinks.js","sourceRoot":"","sources":["../../src/components/AttachmentLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AA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AED,SAAS,YAAY,CAAC,CAAS,EAAE,CAAS;IACxC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAA;IAEvB,IAAI,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE;QACvB,OAAO,KAAK,CAAA;KACb;IACD,OAAO,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAA;AAC1G,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Attachments.d.ts","sourceRoot":"","sources":["../../src/components/Attachments.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAWpD,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;;AAgDlC,wBAA8E"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import React, { useContext, useEffect } from 'react';
|
2
|
+
import { I18nextProvider, Translation } from 'react-i18next';
|
3
|
+
import { createRenderChildNodes } from '../createRenderChildNodes';
|
4
|
+
import { findChildElement } from '../dom-utils';
|
5
|
+
import { initI18n } from '../i18n';
|
6
|
+
import { scrollToHash } from '../scrollToHash';
|
7
|
+
import AttachmentsExternalMaterial from './AttachmentsExternalMaterial';
|
8
|
+
import AttachmentsQuestion from './AttachmentsQuestion';
|
9
|
+
import AttachmentsQuestionTitle from './AttachmentsQuestionTitle';
|
10
|
+
import { CommonExamContext, withCommonExamContext } from './CommonExamContext';
|
11
|
+
import DocumentTitle from './DocumentTitle';
|
12
|
+
import { withExamContext } from './ExamContext';
|
13
|
+
import RenderChildNodes from './RenderChildNodes';
|
14
|
+
import Section from './Section';
|
15
|
+
import { withSectionContext } from './SectionContext';
|
16
|
+
const renderChildNodes = createRenderChildNodes({
|
17
|
+
'external-material': AttachmentsExternalMaterial,
|
18
|
+
'question-title': AttachmentsQuestionTitle,
|
19
|
+
question: AttachmentsQuestion,
|
20
|
+
section: withSectionContext(RenderChildNodes),
|
21
|
+
});
|
22
|
+
function Attachments(_props) {
|
23
|
+
const { root, language, date, dateTimeFormatter, resolveAttachment } = useContext(CommonExamContext);
|
24
|
+
const examTitle = findChildElement(root, 'exam-title');
|
25
|
+
const examStylesheet = root.getAttribute('exam-stylesheet');
|
26
|
+
const externalMaterial = findChildElement(root, 'external-material');
|
27
|
+
const i18n = initI18n(language, root.getAttribute('exam-code'), root.getAttribute('day-code'));
|
28
|
+
useEffect(scrollToHash, []);
|
29
|
+
return (React.createElement(I18nextProvider, { i18n: i18n },
|
30
|
+
React.createElement("main", { className: "e-exam attachments" },
|
31
|
+
React.createElement(React.StrictMode, null),
|
32
|
+
examStylesheet && React.createElement("link", { rel: "stylesheet", href: resolveAttachment(examStylesheet) }),
|
33
|
+
React.createElement(Section, { "aria-labelledby": "title" },
|
34
|
+
examTitle && (React.createElement(DocumentTitle, { id: "title" },
|
35
|
+
renderChildNodes(examTitle),
|
36
|
+
examTitle.textContent.includes(',') ? '; ' : ', ',
|
37
|
+
React.createElement(Translation, null, (t) => t('attachments-page-title').toLowerCase()))),
|
38
|
+
React.createElement("div", { className: "e-semibold e-mrg-b-6" }, dateTimeFormatter.format(date)),
|
39
|
+
externalMaterial && (React.createElement(AttachmentsExternalMaterial, Object.assign({}, { element: externalMaterial, renderChildNodes, forceRender: true })))),
|
40
|
+
renderChildNodes(root))));
|
41
|
+
}
|
42
|
+
export default React.memo(withExamContext(withCommonExamContext(Attachments)));
|
43
|
+
//# sourceMappingURL=Attachments.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Attachments.js","sourceRoot":"","sources":["../../src/components/Attachments.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,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":"AttachmentsAttachment.d.ts","sourceRoot":"","sources":["../../src/components/AttachmentsAttachment.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;;AAY9D,wBAAuE"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { AttachmentContext, withAttachmentContext } from './AttachmentContext';
|
3
|
+
function AttachmentsAttachment({ element, renderChildNodes }) {
|
4
|
+
const { displayNumber, isExternal } = useContext(AttachmentContext);
|
5
|
+
return isExternal ? (React.createElement("figure", { id: displayNumber, className: "attachments-attachment e-mrg-0 e-mrg-t-8" }, renderChildNodes(element))) : null;
|
6
|
+
}
|
7
|
+
export default React.memo(withAttachmentContext(AttachmentsAttachment));
|
8
|
+
//# sourceMappingURL=AttachmentsAttachment.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentsAttachment.js","sourceRoot":"","sources":["../../src/components/AttachmentsAttachment.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,qBAAqB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IAC9E,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAEnE,OAAO,UAAU,CAAC,CAAC,CAAC,CAClB,gCAAQ,EAAE,EAAE,aAAc,EAAE,SAAS,EAAC,0CAA0C,IAC7E,gBAAgB,CAAC,OAAO,CAAC,CACnB,CACV,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,qBAAqB,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function AttachmentsAttachmentTitle({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof AttachmentsAttachmentTitle>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=AttachmentsAttachmentTitle.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentsAttachmentTitle.d.ts","sourceRoot":"","sources":["../../src/components/AttachmentsAttachmentTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,0BAA0B,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAUpF;;AAED,wBAAqD"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { NBSP } from '../dom-utils';
|
3
|
+
import { AttachmentContext } from './AttachmentContext';
|
4
|
+
function AttachmentsAttachmentTitle({ element, renderChildNodes }) {
|
5
|
+
const { displayNumber } = useContext(AttachmentContext);
|
6
|
+
return (React.createElement("h3", null,
|
7
|
+
displayNumber,
|
8
|
+
NBSP,
|
9
|
+
renderChildNodes(element)));
|
10
|
+
}
|
11
|
+
export default React.memo(AttachmentsAttachmentTitle);
|
12
|
+
//# sourceMappingURL=AttachmentsAttachmentTitle.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentsAttachmentTitle.js","sourceRoot":"","sources":["../../src/components/AttachmentsAttachmentTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAGvD,SAAS,0BAA0B,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACnF,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAEvD,OAAO,CACL;QACG,aAAa;QACb,IAAI;QACJ,gBAAgB,CAAC,OAAO,CAAC,CACvB,CACN,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAA"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
interface AttachmentsExternalMaterialProps extends ExamComponentProps {
|
4
|
+
forceRender?: boolean;
|
5
|
+
}
|
6
|
+
declare function AttachmentsExternalMaterial({ element, forceRender }: AttachmentsExternalMaterialProps): JSX.Element | null;
|
7
|
+
declare const _default: React.MemoExoticComponent<typeof AttachmentsExternalMaterial>;
|
8
|
+
export default _default;
|
9
|
+
//# sourceMappingURL=AttachmentsExternalMaterial.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentsExternalMaterial.d.ts","sourceRoot":"","sources":["../../src/components/AttachmentsExternalMaterial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAA0B,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AA8BtF,UAAU,gCAAiC,SAAQ,kBAAkB;IACnE,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,iBAAS,2BAA2B,CAAC,EAAE,OAAO,EAAE,WAAmB,EAAE,EAAE,gCAAgC,sBAetG;;AAED,wBAAsD"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { createRenderChildNodes } from '../createRenderChildNodes';
|
3
|
+
import { queryAncestors } from '../dom-utils';
|
4
|
+
import AttachmentLink from './AttachmentLink';
|
5
|
+
import AttachmentLinks from './AttachmentLinks';
|
6
|
+
import AttachmentsAttachment from './AttachmentsAttachment';
|
7
|
+
import AttachmentsAttachmentTitle from './AttachmentsAttachmentTitle';
|
8
|
+
import Audio from './Audio';
|
9
|
+
import ExternalMaterialList from './ExternalMaterialList';
|
10
|
+
import File from './File';
|
11
|
+
import Formula from './Formula';
|
12
|
+
import Image from './Image';
|
13
|
+
import Reference from './Reference';
|
14
|
+
import surround from './surround';
|
15
|
+
import Video from './Video';
|
16
|
+
import ImageOverlay from './ImageOverlay';
|
17
|
+
const renderChildNodes = createRenderChildNodes({
|
18
|
+
'attachment-link': AttachmentLink,
|
19
|
+
'attachment-links': AttachmentLinks,
|
20
|
+
'attachment-title': AttachmentsAttachmentTitle,
|
21
|
+
attachment: AttachmentsAttachment,
|
22
|
+
audio: Audio,
|
23
|
+
file: File,
|
24
|
+
image: Image,
|
25
|
+
video: Video,
|
26
|
+
formula: Formula,
|
27
|
+
reference: surround(Reference, 'figcaption', { className: 'e-color-darkgrey e-mrg-y-2 e-font-size-s e-light' }),
|
28
|
+
'image-overlay': ImageOverlay,
|
29
|
+
});
|
30
|
+
function AttachmentsExternalMaterial({ element, forceRender = false }) {
|
31
|
+
if (queryAncestors(element, 'question') == null && !forceRender) {
|
32
|
+
return null;
|
33
|
+
}
|
34
|
+
const attachmentCount = element.children.length;
|
35
|
+
return (React.createElement(React.Fragment, null,
|
36
|
+
attachmentCount > 1 && (React.createElement(ExternalMaterialList, Object.assign({}, { element, renderChildNodes, showTitle: false, forceRender }))),
|
37
|
+
renderChildNodes(element)));
|
38
|
+
}
|
39
|
+
export default React.memo(AttachmentsExternalMaterial);
|
40
|
+
//# sourceMappingURL=AttachmentsExternalMaterial.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentsExternalMaterial.js","sourceRoot":"","sources":["../../src/components/AttachmentsExternalMaterial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,sBAAsB,EAAsB,MAAM,2BAA2B,CAAA;AAC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,GAAG,CAAC,IAAI,CACtB,oBAAC,oBAAoB,oBAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,EAAI,CAC3F;QACA,gBAAgB,CAAC,OAAO,CAAC,CACzB,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,2BAA2B,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentsQuestion.d.ts","sourceRoot":"","sources":["../../src/components/AttachmentsQuestion.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAiB,MAAM,2BAA2B,CAAA;;AA2B7E,wBAAmE"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { RenderOptions } from '../createRenderChildNodes';
|
3
|
+
import { findChildElement, parentElements } from '../dom-utils';
|
4
|
+
import { QuestionContext, withQuestionContext } from './QuestionContext';
|
5
|
+
import Section from './Section';
|
6
|
+
function AttachmentsQuestion({ element, renderChildNodes }) {
|
7
|
+
const { displayNumber, hasExternalMaterial, level } = useContext(QuestionContext);
|
8
|
+
return isTopmostQuestionContainingExternalMaterial(element, hasExternalMaterial, level) ? (React.createElement(Section, { id: displayNumber, "aria-labelledby": displayNumber + '-title' }, renderChildNodes(element, RenderOptions.SkipHTML))) : (React.createElement(React.Fragment, null, renderChildNodes(element, RenderOptions.SkipHTML)));
|
9
|
+
}
|
10
|
+
function isTopmostQuestionContainingExternalMaterial(element, hasExternalMaterial, level) {
|
11
|
+
return (hasExternalMaterial &&
|
12
|
+
(level === 0 ||
|
13
|
+
parentElements(element).every((parent) => parent.localName === 'question' ? !findChildElement(parent, 'external-material') : true)));
|
14
|
+
}
|
15
|
+
export default React.memo(withQuestionContext(AttachmentsQuestion));
|
16
|
+
//# sourceMappingURL=AttachmentsQuestion.js.map
|
@@ -0,0 +1 @@
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AAI,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function AttachmentsQuestionTitle({ element, renderChildNodes }: ExamComponentProps): JSX.Element | null;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof AttachmentsQuestionTitle>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=AttachmentsQuestionTitle.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentsQuestionTitle.d.ts","sourceRoot":"","sources":["../../src/components/AttachmentsQuestionTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,wBAAwB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,sBASlF;;AAED,wBAAmD"}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { useTranslation } from 'react-i18next';
|
3
|
+
import { QuestionContext } from './QuestionContext';
|
4
|
+
function AttachmentsQuestionTitle({ element, renderChildNodes }) {
|
5
|
+
const { displayNumber, hasExternalMaterial } = useContext(QuestionContext);
|
6
|
+
const { t } = useTranslation();
|
7
|
+
return hasExternalMaterial ? (React.createElement("h2", { id: displayNumber + '-title' },
|
8
|
+
t('question', { displayNumber }),
|
9
|
+
". ",
|
10
|
+
renderChildNodes(element))) : null;
|
11
|
+
}
|
12
|
+
export default React.memo(AttachmentsQuestionTitle);
|
13
|
+
//# sourceMappingURL=AttachmentsQuestionTitle.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AttachmentsQuestionTitle.js","sourceRoot":"","sources":["../../src/components/AttachmentsQuestionTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGnD,SAAS,wBAAwB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACjF,MAAM,EAAE,aAAa,EAAE,mBAAmB,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC1E,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAE9B,OAAO,mBAAmB,CAAC,CAAC,CAAC,CAC3B,4BAAI,EAAE,EAAE,aAAa,GAAG,QAAQ;QAC7B,CAAC,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,CAAC;;QAAI,gBAAgB,CAAC,OAAO,CAAC,CAC3D,CACN,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function Audio({ element, className, renderChildNodes }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof Audio>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=Audio.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Audio.d.ts","sourceRoot":"","sources":["../../src/components/Audio.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAQzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,KAAK,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eA+B1E;;AAED,wBAAgC"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import classNames from 'classnames';
|
2
|
+
import React, { useContext } from 'react';
|
3
|
+
import { useTranslation } from 'react-i18next';
|
4
|
+
import { useSelector } from 'react-redux';
|
5
|
+
import { getNumericAttribute } from '../dom-utils';
|
6
|
+
import { getAudioPlaybackError, getPlaybackTimesRemaining } from '../store/selectors';
|
7
|
+
import AudioPlaybackError from './AudioPlaybackError';
|
8
|
+
import { CommonExamContext } from './CommonExamContext';
|
9
|
+
import RestrictedAudioPlayer from './RestrictedAudioPlayer';
|
10
|
+
function Audio({ element, className, renderChildNodes }) {
|
11
|
+
const src = element.getAttribute('src');
|
12
|
+
const restrictedAudioId = getNumericAttribute(element, 'restricted-audio-id');
|
13
|
+
const times = getNumericAttribute(element, 'times');
|
14
|
+
const duration = getNumericAttribute(element, 'duration');
|
15
|
+
const { t } = useTranslation();
|
16
|
+
const audioPlaybackError = times != null && restrictedAudioId != null ? useSelector(getAudioPlaybackError(src, restrictedAudioId)) : undefined;
|
17
|
+
const playbackTimesRemaining = times != null && restrictedAudioId != null
|
18
|
+
? useSelector(getPlaybackTimesRemaining(restrictedAudioId, times))
|
19
|
+
: undefined;
|
20
|
+
const { resolveAttachment } = useContext(CommonExamContext);
|
21
|
+
return (React.createElement("div", { className: classNames('audio e-columns e-columns--center-v e-mrg-b-2', className) },
|
22
|
+
restrictedAudioId != null && times != null ? (React.createElement(RestrictedAudioPlayer, Object.assign({}, { src, restrictedAudioId, duration, times }))) : (React.createElement("audio", { className: "e-column e-column--narrow", preload: "metadata", controls: true },
|
23
|
+
React.createElement("source", { src: resolveAttachment(src) }))),
|
24
|
+
React.createElement("div", { className: "e-column" },
|
25
|
+
React.createElement(AudioPlaybackError, { error: audioPlaybackError }, element.hasChildNodes() && renderChildNodes(element)),
|
26
|
+
playbackTimesRemaining != null && React.createElement("em", null, t('listen-times-remaining', { count: playbackTimesRemaining })))));
|
27
|
+
}
|
28
|
+
export default React.memo(Audio);
|
29
|
+
//# sourceMappingURL=Audio.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Audio.js","sourceRoot":"","s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,SAAS,CAAA;IACf,MAAM,EAAE,iBAAiB,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAE3D,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,+CAA+C,EAAE,SAAS,CAAC;QACnF,iBAAiB,IAAI,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CAC5C,oBAAC,qBAAqB,oBAAK,EAAE,GAAG,EAAE,iBAAiB,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAI,CAC3E,CAAC,CAAC,CAAC,CACF,+BAAO,SAAS,EAAC,2BAA2B,EAAC,OAAO,EAAC,UAAU,EAAC,QAAQ;YACtE,gCAAQ,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC,GAAI,CACjC,CACT;QACD,6BAAK,SAAS,EAAC,UAAU;YACvB,oBAAC,kBAAkB,IAAC,KAAK,EAAE,kBAAkB,IAC1C,OAAO,CAAC,aAAa,EAAE,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAClC;YACpB,sBAAsB,IAAI,IAAI,IAAI,gCAAK,CAAC,CAAC,wBAAwB,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,CAAC,CAAM,CACxG,CACF,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function AudioGroup({ element, className, renderChildNodes }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof AudioGroup>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=AudioGroup.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AudioGroup.d.ts","sourceRoot":"","sources":["../../src/components/AudioGroup.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAS/E;;AAED,wBAAqC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import classNames from 'classnames';
|
2
|
+
import React from 'react';
|
3
|
+
function AudioGroup({ element, className, renderChildNodes }) {
|
4
|
+
return (React.createElement("div", { className: classNames('e-audio-group', className) },
|
5
|
+
React.createElement("div", { className: "e-audio-group--separator e-font-size-xl e-mrg-y-4 e-color-link", role: "separator" }, "\u2732\u2732\u2732"),
|
6
|
+
renderChildNodes(element)));
|
7
|
+
}
|
8
|
+
export default React.memo(AudioGroup);
|
9
|
+
//# sourceMappingURL=AudioGroup.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AudioGroup.js","sourceRoot":"","sources":["../../src/components/AudioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,SAAS,UAAU,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAsB;IAC9E,OAAO,CACL,6BAAK,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE,SAAS,CAAC;QACpD,6BAAK,SAAS,EAAC,gEAAgE,EAAC,IAAI,EAAC,WAAW,yBAE1F;QACL,gBAAgB,CAAC,OAAO,CAAC,CACtB,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { AudioPlaybackError } from '../types/ExamServerAPI';
|
3
|
+
export default function AudioPlaybackError({ error, children, }: {
|
4
|
+
error?: AudioPlaybackError;
|
5
|
+
children?: React.ReactNode;
|
6
|
+
}): JSX.Element;
|
7
|
+
//# sourceMappingURL=AudioPlaybackError.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AudioPlaybackError.d.ts","sourceRoot":"","sources":["../../src/components/AudioPlaybackError.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAK,EACL,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,kBAAkB,CAAA;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B,eAeA"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons/faExclamationTriangle';
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
3
|
+
import React from 'react';
|
4
|
+
import ReactCSSTransitionReplace from 'react-css-transition-replace';
|
5
|
+
import { useTranslation } from 'react-i18next';
|
6
|
+
export default function AudioPlaybackError({ error, children, }) {
|
7
|
+
const { t } = useTranslation();
|
8
|
+
return (React.createElement(ReactCSSTransitionReplace, { transitionName: "e-crossfade", transitionEnterTimeout: 500, transitionLeaveTimeout: 500 }, error != null ? (React.createElement("div", { className: "e-color-error" },
|
9
|
+
React.createElement(FontAwesomeIcon, { icon: faExclamationTriangle, className: "e-mrg-r-1" }),
|
10
|
+
t(`audio-errors.${error}`))) : (React.createElement("div", { key: "no-error" }, children))));
|
11
|
+
}
|
12
|
+
//# sourceMappingURL=AudioPlaybackError.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AudioPlaybackError.js","sourceRoot":"","sources":["../../src/components/AudioPlaybackError.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yDAAyD,CAAA;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,yBAAyB,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAG9C,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAC,EACzC,KAAK,EACL,QAAQ,GAIT;IACC,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAE9B,OAAO,CACL,oBAAC,yBAAyB,IAAC,cAAc,EAAC,aAAa,EAAC,sBAAsB,EAAE,GAAG,EAAE,sBAAsB,EAAE,GAAG,IAC7G,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,CACf,6BAAK,SAAS,EAAC,eAAe;QAC5B,oBAAC,eAAe,IAAC,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAC,WAAW,GAAG;QACrE,CAAC,CAAC,gBAAgB,KAAK,EAAE,CAAC,CACvB,CACP,CAAC,CAAC,CAAC,CACF,6BAAK,GAAG,EAAC,UAAU,IAAE,QAAQ,CAAO,CACrC,CACyB,CAC7B,CAAA;AACH,CAAC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
+
declare function AudioTest({ element }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof AudioTest>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=AudioTest.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AudioTest.d.ts","sourceRoot":"","sources":["../../src/components/AudioTest.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,SAAS,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,eA6BjD;;AAED,wBAAoC"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { faPlay } from '@fortawesome/free-solid-svg-icons/faPlay';
|
2
|
+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
3
|
+
import React from 'react';
|
4
|
+
import { useTranslation } from 'react-i18next';
|
5
|
+
import { useDispatch, useSelector } from 'react-redux';
|
6
|
+
import { getNumericAttribute, NBSP } from '../dom-utils';
|
7
|
+
import { playAudio } from '../store/audio/actions';
|
8
|
+
import { getAudioPlaybackError, getAudioState } from '../store/selectors';
|
9
|
+
import AudioPlaybackError from './AudioPlaybackError';
|
10
|
+
function AudioTest({ element }) {
|
11
|
+
const src = element.getAttribute('src');
|
12
|
+
const duration = getNumericAttribute(element, 'duration');
|
13
|
+
const { t } = useTranslation();
|
14
|
+
const audioState = useSelector(getAudioState(src));
|
15
|
+
const audioPlaybackError = useSelector(getAudioPlaybackError(src));
|
16
|
+
const dispatch = useDispatch();
|
17
|
+
return (React.createElement("div", { className: "e-audio-test notification e-pad-2 e-mrg-b-4" },
|
18
|
+
React.createElement("p", null, t('audio-test.instructions')),
|
19
|
+
React.createElement("div", { className: "e-columns e-columns--center-v e-mrg-b-2" },
|
20
|
+
React.createElement("div", { className: "e-column e-column--narrow" },
|
21
|
+
React.createElement("button", { className: "e-button", disabled: audioState !== 'stopped', onClick: () => audioState === 'stopped' && dispatch(playAudio({ src, duration })) },
|
22
|
+
React.createElement(FontAwesomeIcon, { className: "e-mrg-r-1", icon: faPlay, fixedWidth: true }),
|
23
|
+
t('audio-test.play'))),
|
24
|
+
React.createElement("div", { className: "e-column" },
|
25
|
+
React.createElement(AudioPlaybackError, { error: audioPlaybackError }, NBSP))),
|
26
|
+
React.createElement("div", null, t('audio-test.volume'))));
|
27
|
+
}
|
28
|
+
export default React.memo(AudioTest);
|
29
|
+
//# sourceMappingURL=AudioTest.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AudioTest.js","sourceRoot":"","sources":["../../src/components/AudioTest.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAA;AACjE,OAAO,EAAE,eAAe,EAA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EAAE,MAAM,EAAE,UAAU,SAAG;oBACjE,CAAC,CAAC,iBAAiB,CAAC,CACd,CACL;YACN,6BAAK,SAAS,EAAC,UAAU;gBACvB,oBAAC,kBAAkB,IAAC,KAAK,EAAE,kBAAkB,IAAG,IAAI,CAAsB,CACtE,CACF;QACN,iCAAM,CAAC,CAAC,mBAAmB,CAAC,CAAO,CAC/B,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import * as actions from '../store/answers/actions';
|
3
|
+
import { ExamComponentProps } from '../createRenderChildNodes';
|
4
|
+
import { ChoiceAnswer as ChoiceAnswerT } from '../types/ExamAnswer';
|
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, Pick<ChoiceAnswerProps, "className" | "element" | "renderChildNodes"> & ExamComponentProps>;
|
11
|
+
export default _default;
|
12
|
+
//# sourceMappingURL=ChoiceAnswer.d.ts.map
|