@digabi/exam-engine-core 19.15.5-alpha.6 → 19.15.6-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/examServerApi.js +1 -1
- package/dist/__tests__/examServerApi.js.map +1 -1
- package/dist/__tests__/testExamRendering.js +2 -1
- package/dist/__tests__/testExamRendering.js.map +1 -1
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/components/exam/Exam.d.ts.map +1 -1
- package/dist/components/exam/Exam.js +7 -6
- package/dist/components/exam/Exam.js.map +1 -1
- 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 +25 -0
- package/dist/components/exam/ExamineExam.js.map +1 -0
- package/dist/components/results/DropdownAnswer.js +5 -5
- package/dist/components/results/DropdownAnswer.js.map +1 -1
- package/dist/components/results/EndExamSession.d.ts +5 -0
- package/dist/components/results/EndExamSession.d.ts.map +1 -0
- package/dist/components/results/EndExamSession.js +43 -0
- package/dist/components/results/EndExamSession.js.map +1 -0
- package/dist/components/results/MultiLineAnswer.js +1 -1
- package/dist/components/results/MultiLineAnswer.js.map +1 -1
- package/dist/components/results/Question.js +1 -1
- package/dist/components/results/Question.js.map +1 -1
- package/dist/components/results/QuestionTitle.js +3 -3
- package/dist/components/results/QuestionTitle.js.map +1 -1
- package/dist/components/results/Results.d.ts +1 -0
- package/dist/components/results/Results.d.ts.map +1 -1
- package/dist/components/results/Results.js +19 -22
- package/dist/components/results/Results.js.map +1 -1
- package/dist/components/results/SingleLineAnswer.js +1 -1
- package/dist/components/results/SingleLineAnswer.js.map +1 -1
- package/dist/components/results/internal/QuestionScoresContainer.js +3 -3
- package/dist/components/results/internal/QuestionScoresContainer.js.map +1 -1
- package/dist/components/results/isExamExaminePageHook.d.ts +2 -0
- package/dist/components/results/isExamExaminePageHook.d.ts.map +1 -0
- package/dist/components/results/{isExamFinishPageHook.js → isExamExaminePageHook.js} +2 -2
- package/dist/components/results/isExamExaminePageHook.js.map +1 -0
- package/dist/i18n/fi-FI.d.ts +10 -5
- package/dist/i18n/fi-FI.d.ts.map +1 -1
- package/dist/i18n/fi-FI.js +10 -5
- package/dist/i18n/fi-FI.js.map +1 -1
- package/dist/i18n/sv-FI.d.ts.map +1 -1
- package/dist/i18n/sv-FI.js +10 -5
- package/dist/i18n/sv-FI.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main.css +1 -1
- package/dist/types/ExamServerAPI.d.ts +2 -1
- package/dist/types/ExamServerAPI.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/components/AttachmentContext.d.ts +0 -14
- package/dist/components/AttachmentContext.d.ts.map +0 -1
- package/dist/components/AttachmentContext.js +0 -12
- package/dist/components/AttachmentContext.js.map +0 -1
- package/dist/components/AttachmentLink.d.ts +0 -6
- package/dist/components/AttachmentLink.d.ts.map +0 -1
- package/dist/components/AttachmentLink.js +0 -24
- package/dist/components/AttachmentLink.js.map +0 -1
- package/dist/components/AttachmentLinkAnchor.d.ts +0 -7
- package/dist/components/AttachmentLinkAnchor.d.ts.map +0 -1
- package/dist/components/AttachmentLinkAnchor.js +0 -4
- package/dist/components/AttachmentLinkAnchor.js.map +0 -1
- package/dist/components/AttachmentLinks.d.ts +0 -6
- package/dist/components/AttachmentLinks.d.ts.map +0 -1
- package/dist/components/AttachmentLinks.js +0 -58
- package/dist/components/AttachmentLinks.js.map +0 -1
- package/dist/components/Attachments.d.ts +0 -5
- package/dist/components/Attachments.d.ts.map +0 -1
- package/dist/components/Attachments.js +0 -43
- package/dist/components/Attachments.js.map +0 -1
- package/dist/components/AttachmentsAttachment.d.ts +0 -5
- package/dist/components/AttachmentsAttachment.d.ts.map +0 -1
- package/dist/components/AttachmentsAttachment.js +0 -8
- package/dist/components/AttachmentsAttachment.js.map +0 -1
- package/dist/components/AttachmentsAttachmentTitle.d.ts +0 -6
- package/dist/components/AttachmentsAttachmentTitle.d.ts.map +0 -1
- package/dist/components/AttachmentsAttachmentTitle.js +0 -12
- package/dist/components/AttachmentsAttachmentTitle.js.map +0 -1
- package/dist/components/AttachmentsExternalMaterial.d.ts +0 -9
- package/dist/components/AttachmentsExternalMaterial.d.ts.map +0 -1
- package/dist/components/AttachmentsExternalMaterial.js +0 -40
- package/dist/components/AttachmentsExternalMaterial.js.map +0 -1
- package/dist/components/AttachmentsQuestion.d.ts +0 -5
- package/dist/components/AttachmentsQuestion.d.ts.map +0 -1
- package/dist/components/AttachmentsQuestion.js +0 -16
- package/dist/components/AttachmentsQuestion.js.map +0 -1
- package/dist/components/AttachmentsQuestionTitle.d.ts +0 -6
- package/dist/components/AttachmentsQuestionTitle.d.ts.map +0 -1
- package/dist/components/AttachmentsQuestionTitle.js +0 -13
- package/dist/components/AttachmentsQuestionTitle.js.map +0 -1
- package/dist/components/Audio.d.ts +0 -6
- package/dist/components/Audio.d.ts.map +0 -1
- package/dist/components/Audio.js +0 -29
- package/dist/components/Audio.js.map +0 -1
- package/dist/components/AudioGroup.d.ts +0 -6
- package/dist/components/AudioGroup.d.ts.map +0 -1
- package/dist/components/AudioGroup.js +0 -9
- package/dist/components/AudioGroup.js.map +0 -1
- package/dist/components/AudioPlaybackError.d.ts +0 -7
- package/dist/components/AudioPlaybackError.d.ts.map +0 -1
- package/dist/components/AudioPlaybackError.js +0 -12
- package/dist/components/AudioPlaybackError.js.map +0 -1
- package/dist/components/AudioTest.d.ts +0 -6
- package/dist/components/AudioTest.d.ts.map +0 -1
- package/dist/components/AudioTest.js +0 -29
- package/dist/components/AudioTest.js.map +0 -1
- package/dist/components/ChoiceAnswer.d.ts +0 -12
- package/dist/components/ChoiceAnswer.d.ts.map +0 -1
- package/dist/components/ChoiceAnswer.js +0 -60
- package/dist/components/ChoiceAnswer.js.map +0 -1
- package/dist/components/CommonExamContext.d.ts +0 -16
- package/dist/components/CommonExamContext.d.ts.map +0 -1
- package/dist/components/CommonExamContext.js +0 -22
- package/dist/components/CommonExamContext.js.map +0 -1
- package/dist/components/DropdownAnswer.d.ts +0 -12
- package/dist/components/DropdownAnswer.d.ts.map +0 -1
- package/dist/components/DropdownAnswer.js +0 -85
- package/dist/components/DropdownAnswer.js.map +0 -1
- package/dist/components/Exam.d.ts +0 -40
- package/dist/components/Exam.d.ts.map +0 -1
- package/dist/components/Exam.js +0 -106
- package/dist/components/Exam.js.map +0 -1
- package/dist/components/ExamAttachment.d.ts +0 -5
- package/dist/components/ExamAttachment.d.ts.map +0 -1
- package/dist/components/ExamAttachment.js +0 -8
- package/dist/components/ExamAttachment.js.map +0 -1
- package/dist/components/ExamContext.d.ts +0 -10
- package/dist/components/ExamContext.d.ts.map +0 -1
- package/dist/components/ExamContext.js +0 -11
- package/dist/components/ExamContext.js.map +0 -1
- package/dist/components/ExamFooter.d.ts +0 -6
- package/dist/components/ExamFooter.d.ts.map +0 -1
- package/dist/components/ExamFooter.js +0 -7
- package/dist/components/ExamFooter.js.map +0 -1
- package/dist/components/ExamInstruction.d.ts +0 -6
- package/dist/components/ExamInstruction.d.ts.map +0 -1
- package/dist/components/ExamInstruction.js +0 -6
- package/dist/components/ExamInstruction.js.map +0 -1
- package/dist/components/ExamQuestion.d.ts +0 -5
- package/dist/components/ExamQuestion.d.ts.map +0 -1
- package/dist/components/ExamQuestion.js +0 -16
- package/dist/components/ExamQuestion.js.map +0 -1
- package/dist/components/ExamQuestionInstruction.d.ts +0 -6
- package/dist/components/ExamQuestionInstruction.d.ts.map +0 -1
- package/dist/components/ExamQuestionInstruction.js +0 -6
- package/dist/components/ExamQuestionInstruction.js.map +0 -1
- package/dist/components/ExamQuestionTitle.d.ts +0 -6
- package/dist/components/ExamQuestionTitle.d.ts.map +0 -1
- package/dist/components/ExamQuestionTitle.js +0 -25
- package/dist/components/ExamQuestionTitle.js.map +0 -1
- package/dist/components/ExamSection.d.ts +0 -5
- package/dist/components/ExamSection.d.ts.map +0 -1
- package/dist/components/ExamSection.js +0 -30
- package/dist/components/ExamSection.js.map +0 -1
- package/dist/components/ExamSectionTitle.d.ts +0 -6
- package/dist/components/ExamSectionTitle.d.ts.map +0 -1
- package/dist/components/ExamSectionTitle.js +0 -21
- package/dist/components/ExamSectionTitle.js.map +0 -1
- package/dist/components/ExternalMaterialList.d.ts +0 -10
- package/dist/components/ExternalMaterialList.d.ts.map +0 -1
- package/dist/components/ExternalMaterialList.js +0 -31
- package/dist/components/ExternalMaterialList.js.map +0 -1
- package/dist/components/File.d.ts +0 -6
- package/dist/components/File.d.ts.map +0 -1
- package/dist/components/File.js +0 -15
- package/dist/components/File.js.map +0 -1
- package/dist/components/Formula.d.ts +0 -6
- package/dist/components/Formula.d.ts.map +0 -1
- package/dist/components/Formula.js +0 -12
- package/dist/components/Formula.js.map +0 -1
- package/dist/components/Hints.d.ts +0 -6
- package/dist/components/Hints.d.ts.map +0 -1
- package/dist/components/Hints.js +0 -32
- package/dist/components/Hints.js.map +0 -1
- package/dist/components/Image.d.ts +0 -6
- package/dist/components/Image.d.ts.map +0 -1
- package/dist/components/Image.js +0 -25
- package/dist/components/Image.js.map +0 -1
- package/dist/components/ImageOverlay.d.ts +0 -6
- package/dist/components/ImageOverlay.d.ts.map +0 -1
- package/dist/components/ImageOverlay.js +0 -45
- package/dist/components/ImageOverlay.js.map +0 -1
- package/dist/components/ProgressBar.d.ts +0 -6
- package/dist/components/ProgressBar.d.ts.map +0 -1
- package/dist/components/ProgressBar.js +0 -18
- package/dist/components/ProgressBar.js.map +0 -1
- package/dist/components/QuestionContext.d.ts +0 -14
- package/dist/components/QuestionContext.d.ts.map +0 -1
- package/dist/components/QuestionContext.js +0 -20
- package/dist/components/QuestionContext.js.map +0 -1
- package/dist/components/Reference.d.ts +0 -6
- package/dist/components/Reference.d.ts.map +0 -1
- package/dist/components/Reference.js +0 -63
- package/dist/components/Reference.js.map +0 -1
- package/dist/components/References.d.ts +0 -6
- package/dist/components/References.d.ts.map +0 -1
- package/dist/components/References.js +0 -23
- package/dist/components/References.js.map +0 -1
- package/dist/components/ResponsiveMediaContainer.d.ts +0 -17
- package/dist/components/ResponsiveMediaContainer.d.ts.map +0 -1
- package/dist/components/ResponsiveMediaContainer.js +0 -20
- package/dist/components/ResponsiveMediaContainer.js.map +0 -1
- package/dist/components/RestrictedAudioPlayer.d.ts +0 -11
- package/dist/components/RestrictedAudioPlayer.d.ts.map +0 -1
- package/dist/components/RestrictedAudioPlayer.js +0 -29
- package/dist/components/RestrictedAudioPlayer.js.map +0 -1
- package/dist/components/RichTextAnswer.d.ts +0 -31
- package/dist/components/RichTextAnswer.d.ts.map +0 -1
- package/dist/components/RichTextAnswer.js +0 -70
- package/dist/components/RichTextAnswer.js.map +0 -1
- package/dist/components/SaveIndicator.d.ts +0 -5
- package/dist/components/SaveIndicator.d.ts.map +0 -1
- package/dist/components/SaveIndicator.js +0 -15
- package/dist/components/SaveIndicator.js.map +0 -1
- package/dist/components/Score.d.ts +0 -6
- package/dist/components/Score.d.ts.map +0 -1
- package/dist/components/Score.js +0 -13
- package/dist/components/Score.js.map +0 -1
- package/dist/components/Section.d.ts +0 -3
- package/dist/components/Section.d.ts.map +0 -1
- package/dist/components/Section.js +0 -7
- package/dist/components/Section.js.map +0 -1
- package/dist/components/SectionContext.d.ts +0 -13
- package/dist/components/SectionContext.d.ts.map +0 -1
- package/dist/components/SectionContext.js +0 -21
- package/dist/components/SectionContext.js.map +0 -1
- package/dist/components/SectionInstruction.d.ts +0 -6
- package/dist/components/SectionInstruction.d.ts.map +0 -1
- package/dist/components/SectionInstruction.js +0 -6
- package/dist/components/SectionInstruction.js.map +0 -1
- package/dist/components/TableOfContents.d.ts +0 -13
- package/dist/components/TableOfContents.d.ts.map +0 -1
- package/dist/components/TableOfContents.js +0 -66
- package/dist/components/TableOfContents.js.map +0 -1
- package/dist/components/TextAnswer.d.ts +0 -6
- package/dist/components/TextAnswer.d.ts.map +0 -1
- package/dist/components/TextAnswer.js +0 -16
- package/dist/components/TextAnswer.js.map +0 -1
- package/dist/components/TextAnswerInput.d.ts +0 -37
- package/dist/components/TextAnswerInput.d.ts.map +0 -1
- package/dist/components/TextAnswerInput.js +0 -145
- package/dist/components/TextAnswerInput.js.map +0 -1
- package/dist/components/Video.d.ts +0 -6
- package/dist/components/Video.d.ts.map +0 -1
- package/dist/components/Video.js +0 -15
- package/dist/components/Video.js.map +0 -1
- package/dist/components/exam/FinishExam.d.ts +0 -5
- package/dist/components/exam/FinishExam.d.ts.map +0 -1
- package/dist/components/exam/FinishExam.js +0 -17
- package/dist/components/exam/FinishExam.js.map +0 -1
- package/dist/components/results/AnnotationList.d.ts +0 -5
- package/dist/components/results/AnnotationList.d.ts.map +0 -1
- package/dist/components/results/AnnotationList.js +0 -40
- package/dist/components/results/AnnotationList.js.map +0 -1
- package/dist/components/results/ResultsChoiceAnswer.d.ts +0 -6
- package/dist/components/results/ResultsChoiceAnswer.d.ts.map +0 -1
- package/dist/components/results/ResultsChoiceAnswer.js +0 -60
- package/dist/components/results/ResultsChoiceAnswer.js.map +0 -1
- package/dist/components/results/ResultsContext.d.ts +0 -20
- package/dist/components/results/ResultsContext.d.ts.map +0 -1
- package/dist/components/results/ResultsContext.js +0 -68
- package/dist/components/results/ResultsContext.js.map +0 -1
- package/dist/components/results/ResultsDropdownAnswer.d.ts +0 -6
- package/dist/components/results/ResultsDropdownAnswer.d.ts.map +0 -1
- package/dist/components/results/ResultsDropdownAnswer.js +0 -41
- package/dist/components/results/ResultsDropdownAnswer.js.map +0 -1
- package/dist/components/results/ResultsExamQuestion.d.ts +0 -5
- package/dist/components/results/ResultsExamQuestion.d.ts.map +0 -1
- package/dist/components/results/ResultsExamQuestion.js +0 -23
- package/dist/components/results/ResultsExamQuestion.js.map +0 -1
- package/dist/components/results/ResultsExamQuestionAutoScore.d.ts +0 -10
- package/dist/components/results/ResultsExamQuestionAutoScore.d.ts.map +0 -1
- package/dist/components/results/ResultsExamQuestionAutoScore.js +0 -16
- package/dist/components/results/ResultsExamQuestionAutoScore.js.map +0 -1
- package/dist/components/results/ResultsExamQuestionManualScore.d.ts +0 -11
- package/dist/components/results/ResultsExamQuestionManualScore.d.ts.map +0 -1
- package/dist/components/results/ResultsExamQuestionManualScore.js +0 -62
- package/dist/components/results/ResultsExamQuestionManualScore.js.map +0 -1
- package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts +0 -9
- package/dist/components/results/ResultsExamQuestionScoresContainer.d.ts.map +0 -1
- package/dist/components/results/ResultsExamQuestionScoresContainer.js +0 -8
- package/dist/components/results/ResultsExamQuestionScoresContainer.js.map +0 -1
- package/dist/components/results/ResultsExamQuestionTitle.d.ts +0 -6
- package/dist/components/results/ResultsExamQuestionTitle.d.ts.map +0 -1
- package/dist/components/results/ResultsExamQuestionTitle.js +0 -22
- package/dist/components/results/ResultsExamQuestionTitle.js.map +0 -1
- package/dist/components/results/ResultsExamSection.d.ts +0 -5
- package/dist/components/results/ResultsExamSection.d.ts.map +0 -1
- package/dist/components/results/ResultsExamSection.js +0 -17
- package/dist/components/results/ResultsExamSection.js.map +0 -1
- package/dist/components/results/ResultsScoredTextAnswer.d.ts +0 -6
- package/dist/components/results/ResultsScoredTextAnswer.d.ts.map +0 -1
- package/dist/components/results/ResultsScoredTextAnswer.js +0 -22
- package/dist/components/results/ResultsScoredTextAnswer.js.map +0 -1
- package/dist/components/results/ResultsSingleLineAnswer.d.ts +0 -12
- package/dist/components/results/ResultsSingleLineAnswer.d.ts.map +0 -1
- package/dist/components/results/ResultsSingleLineAnswer.js +0 -12
- package/dist/components/results/ResultsSingleLineAnswer.js.map +0 -1
- package/dist/components/results/ResultsTextAnswer.d.ts +0 -6
- package/dist/components/results/ResultsTextAnswer.d.ts.map +0 -1
- package/dist/components/results/ResultsTextAnswer.js +0 -51
- package/dist/components/results/ResultsTextAnswer.js.map +0 -1
- package/dist/components/results/helpers.d.ts +0 -9
- package/dist/components/results/helpers.d.ts.map +0 -1
- package/dist/components/results/helpers.js +0 -10
- package/dist/components/results/helpers.js.map +0 -1
- package/dist/components/results/isExamFinishPageHook.d.ts +0 -2
- package/dist/components/results/isExamFinishPageHook.d.ts.map +0 -1
- package/dist/components/results/isExamFinishPageHook.js.map +0 -1
- package/dist/components/types.d.ts +0 -110
- package/dist/components/types.d.ts.map +0 -1
- package/dist/components/types.js +0 -1
- package/dist/components/types.js.map +0 -1
- package/dist/components/withContext.d.ts +0 -3
- package/dist/components/withContext.d.ts.map +0 -1
- package/dist/components/withContext.js +0 -12
- package/dist/components/withContext.js.map +0 -1
@@ -1,70 +0,0 @@
|
|
1
|
-
import classNames from 'classnames';
|
2
|
-
import * as _ from 'lodash-es';
|
3
|
-
import React from 'react';
|
4
|
-
import { CommonExamContext } from './CommonExamContext';
|
5
|
-
const richTextEditor = require('rich-text-editor/dist/rich-text-editor');
|
6
|
-
export default class RichTextAnswer extends React.PureComponent {
|
7
|
-
constructor(props) {
|
8
|
-
super(props);
|
9
|
-
this.handleSaveError = (err) => {
|
10
|
-
const key = (() => {
|
11
|
-
switch (_.get(err, 'response.status')) {
|
12
|
-
case 409:
|
13
|
-
return 'screenshot-byte-limit-reached';
|
14
|
-
case 413:
|
15
|
-
return 'screenshot-too-big';
|
16
|
-
default:
|
17
|
-
return 'screenshot-upload-failed';
|
18
|
-
}
|
19
|
-
})();
|
20
|
-
this.props.onError({ key });
|
21
|
-
};
|
22
|
-
this.handleChange = (data) => {
|
23
|
-
const { onChange, onError, maxImages } = this.props;
|
24
|
-
if (data.error) {
|
25
|
-
onError({
|
26
|
-
key: 'screenshot-limit-exceeded',
|
27
|
-
options: { limit: maxImages },
|
28
|
-
});
|
29
|
-
}
|
30
|
-
else {
|
31
|
-
this.lastHTML = data.answerHTML;
|
32
|
-
onChange(data.answerHTML, data.answerText);
|
33
|
-
}
|
34
|
-
};
|
35
|
-
this.ref = React.createRef();
|
36
|
-
this.lastHTML = this.props.answer ? this.props.answer.value : '';
|
37
|
-
}
|
38
|
-
componentDidMount() {
|
39
|
-
const { current } = this.ref;
|
40
|
-
const { answer, saveScreenshot, maxImages } = this.props;
|
41
|
-
if (current) {
|
42
|
-
if (answer) {
|
43
|
-
current.innerHTML = answer.value;
|
44
|
-
}
|
45
|
-
richTextEditor.makeRichText(current, {
|
46
|
-
locale: this.context.language.slice(0, 2).toUpperCase(),
|
47
|
-
screenshot: {
|
48
|
-
saver: ({ data, type }) => saveScreenshot(data instanceof Blob ? data : new Blob([data], { type })).catch((err) => {
|
49
|
-
this.handleSaveError(err);
|
50
|
-
throw err; // Rethrow error so rich-text-editor can handle it.
|
51
|
-
}),
|
52
|
-
limit: maxImages,
|
53
|
-
},
|
54
|
-
}, _.after(2, this.handleChange) /* TODO: Why does r-t-e send a change event in the beginning? */);
|
55
|
-
}
|
56
|
-
}
|
57
|
-
componentDidUpdate() {
|
58
|
-
const { current } = this.ref;
|
59
|
-
// Don't update element unless value has changed from last known value to prevent cursor jumping
|
60
|
-
if (current && this.props.answer && this.props.answer.value !== this.lastHTML) {
|
61
|
-
current.innerHTML = this.lastHTML = this.props.answer.value;
|
62
|
-
}
|
63
|
-
}
|
64
|
-
render() {
|
65
|
-
const { className, questionId } = this.props;
|
66
|
-
return (React.createElement("div", { ref: this.ref, className: classNames('text-answer text-answer--multi-line', className), "data-question-id": questionId }));
|
67
|
-
}
|
68
|
-
}
|
69
|
-
RichTextAnswer.contextType = CommonExamContext;
|
70
|
-
//# sourceMappingURL=RichTextAnswer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"RichTextAnswer.js","sourceRoot":"","sources":["../../src/components/RichTextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAIvD,MAAM,cAAc,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAA;AAiBxE,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,KAAK,CAAC,aAAwB;IAMxE,YAAY,KAAY;QACtB,KAAK,CAAC,KAA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CAAC,KAAK,CAAA;QAE5C,OAAO,CACL,6BACE,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,SAAS,EAAE,UAAU,CAAC,qCAAqC,EAAE,SAAS,CAAC,sBACrD,UAAU,GAC5B,CACH,CAAA;IACH,CAAC;;AAtFM,0BAAW,GAAG,iBAAiB,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SaveIndicator.d.ts","sourceRoot":"","sources":["../../src/components/SaveIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,iBAAS,aAAa,uBAcrB;;AAED,wBAAwC"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { Translation } from 'react-i18next';
|
3
|
-
import { useSelector } from 'react-redux';
|
4
|
-
import { getGlobalSaveState } from '../store/selectors';
|
5
|
-
function SaveIndicator() {
|
6
|
-
const state = useSelector(getGlobalSaveState());
|
7
|
-
if (state === 'initial') {
|
8
|
-
return null;
|
9
|
-
}
|
10
|
-
return (React.createElement("div", { className: "save-indicator" },
|
11
|
-
React.createElement("span", { className: 'save-indicator-text--' + state },
|
12
|
-
React.createElement(Translation, null, (t) => t('answer-saved')))));
|
13
|
-
}
|
14
|
-
export default React.memo(SaveIndicator);
|
15
|
-
//# sourceMappingURL=SaveIndicator.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SaveIndicator.js","sourceRoot":"","sources":["../../src/components/SaveIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAGvD,SAAS,aAAa;IACpB,MAAM,KAAK,GAAc,WAAW,CAAC,kBAAkB,EAAE,CAAC,CAAA;IAE1D,IAAI,KAAK,KAAK,SAAS,EAAE;QACvB,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,CACL,6BAAK,SAAS,EAAC,gBAAgB;QAC7B,8BAAM,SAAS,EAAE,uBAAuB,GAAG,KAAK;YAC9C,oBAAC,WAAW,QAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAe,CAChD,CACH,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Score.d.ts","sourceRoot":"","sources":["../../src/components/Score.tsx"],"names":[],"mappings":";AAIA,wBAAgB,KAAK,CAAC,EAAE,IAAc,EAAE,KAAK,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,eAetG"}
|
package/dist/components/Score.js
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
import classNames from 'classnames';
|
2
|
-
import React from 'react';
|
3
|
-
import { useTranslation } from 'react-i18next';
|
4
|
-
export function Score({ size = 'small', score }) {
|
5
|
-
const { t } = useTranslation();
|
6
|
-
const Tag = size === 'inline' ? 'sup' : 'span';
|
7
|
-
return (React.createElement(Tag, { className: classNames('e-score e-nowrap', {
|
8
|
-
'e-score--small e-font-size-m e-semibold': size === 'small',
|
9
|
-
'e-score--large e-font-size-l e-semibold': size === 'large',
|
10
|
-
'e-score--inline e-font-size-xs': size === 'inline',
|
11
|
-
}), "aria-label": t('points-screen-reader', { count: score }) }, t('points', { count: score })));
|
12
|
-
}
|
13
|
-
//# sourceMappingURL=Score.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Score.js","sourceRoot":"","sources":["../../src/components/Score.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,UAAU,KAAK,CAAC,EAAE,IAAI,GAAG,OAAO,EAAE,KAAK,EAA0D;IACrG,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,MAAM,GAAG,GAAG,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAA;IAC9C,OAAO,CACL,oBAAC,GAAG,IACF,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE;YACxC,yCAAyC,EAAE,IAAI,KAAK,OAAO;YAC3D,yCAAyC,EAAE,IAAI,KAAK,OAAO;YAC3D,gCAAgC,EAAE,IAAI,KAAK,QAAQ;SACpD,CAAC,gBACU,CAAC,CAAC,sBAAsB,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,IAEtD,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAC1B,CACP,CAAA;AACH,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../src/components/Section.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,eAG7G"}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import classNames from 'classnames';
|
2
|
-
import React from 'react';
|
3
|
-
export default function Section(props) {
|
4
|
-
const className = classNames('e-section e-bg-color-off-white e-pad-6', props.className);
|
5
|
-
return React.createElement("section", Object.assign({}, { ...props, className }), props.children);
|
6
|
-
}
|
7
|
-
//# sourceMappingURL=Section.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../../src/components/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,KAA8E;IAC5G,MAAM,SAAS,GAAG,UAAU,CAAC,wCAAwC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;IACvF,OAAO,iDAAa,EAAE,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC,QAAQ,CAAW,CAAA;AACzE,CAAC"}
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
-
export interface SectionContext {
|
4
|
-
casForbidden: boolean;
|
5
|
-
displayNumber: string;
|
6
|
-
maxAnswers?: number;
|
7
|
-
minAnswers?: number;
|
8
|
-
maxScore: number;
|
9
|
-
childQuestions: Element[];
|
10
|
-
}
|
11
|
-
export declare const SectionContext: React.Context<SectionContext>;
|
12
|
-
export declare const withSectionContext: (Component: React.ComponentType<ExamComponentProps>) => React.ComponentType<ExamComponentProps>;
|
13
|
-
//# sourceMappingURL=SectionContext.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SectionContext.d.ts","sourceRoot":"","sources":["../../src/components/SectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,EAAE,MAAM,CAAA;IAChB,cAAc,EAAE,OAAO,EAAE,CAAA;CAC1B;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBAAkB,iGAkB7B,CAAA"}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { getNumericAttribute, mapChildElements } from '../dom-utils';
|
3
|
-
import { withContext } from './withContext';
|
4
|
-
export const SectionContext = React.createContext({});
|
5
|
-
export const withSectionContext = withContext(SectionContext, ({ element }) => {
|
6
|
-
const casForbidden = element.getAttribute('cas-forbidden') === 'true';
|
7
|
-
const displayNumber = element.getAttribute('display-number');
|
8
|
-
const maxAnswers = getNumericAttribute(element, 'max-answers');
|
9
|
-
const minAnswers = getNumericAttribute(element, 'min-answers');
|
10
|
-
const maxScore = getNumericAttribute(element, 'max-score');
|
11
|
-
const childQuestions = mapChildElements(element, (childElement) => childElement).filter((parentNode) => parentNode.localName === 'question');
|
12
|
-
return {
|
13
|
-
casForbidden,
|
14
|
-
displayNumber,
|
15
|
-
maxAnswers,
|
16
|
-
minAnswers,
|
17
|
-
maxScore,
|
18
|
-
childQuestions,
|
19
|
-
};
|
20
|
-
});
|
21
|
-
//# sourceMappingURL=SectionContext.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SectionContext.js","sourceRoot":"","sources":["../../src/components/SectionContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAY3C,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAiB,EAAoB,CAAC,CAAA;AAEvF,MAAM,CAAC,MAAM,kBAAkB,GAAG,WAAW,CAAqC,cAAc,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;IAChH,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM,CAAA;IACrE,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAA;IAC7D,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAE,CAAA;IAC/D,MAAM,UAAU,GAAG,mBAAmB,CAAC,OAAO,EAAE,aAAa,CAAE,CAAA;IAC/D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAE,CAAA;IAC3D,MAAM,cAAc,GAAG,gBAAgB,CAAC,OAAO,EAAE,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,MAAM,CACrF,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,KAAK,UAAU,CACpD,CAAA;IAED,OAAO;QACL,YAAY;QACZ,aAAa;QACb,UAAU;QACV,UAAU;QACV,QAAQ;QACR,cAAc;KACf,CAAA;AACH,CAAC,CAAC,CAAA"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
-
declare function SectionInstruction({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
|
4
|
-
declare const _default: React.MemoExoticComponent<typeof SectionInstruction>;
|
5
|
-
export default _default;
|
6
|
-
//# sourceMappingURL=SectionInstruction.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SectionInstruction.d.ts","sourceRoot":"","sources":["../../src/components/SectionInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,kBAAkB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAE5E;;AAED,wBAA6C"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
function SectionInstruction({ element, renderChildNodes }) {
|
3
|
-
return React.createElement("div", { className: "e-mrg-b-2" }, renderChildNodes(element));
|
4
|
-
}
|
5
|
-
export default React.memo(SectionInstruction);
|
6
|
-
//# sourceMappingURL=SectionInstruction.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"SectionInstruction.js","sourceRoot":"","sources":["../../src/components/SectionInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,SAAS,kBAAkB,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IAC3E,OAAO,6BAAK,SAAS,EAAC,WAAW,IAAE,gBAAgB,CAAC,OAAO,CAAC,CAAO,CAAA;AACrE,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA"}
|
@@ -1,13 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TableOfContents.d.ts","sourceRoot":"","sources":["../../src/components/TableOfContents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAA0B,kBAAkB,EAAiB,MAAM,2BAA2B,CAAA;AA8BrG,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;AA4DD,iBAAS,eAAe,CAAC,MAAM,EAAE,kBAAkB,eAmBlD;;AAED,wBAA0C"}
|
@@ -1,66 +0,0 @@
|
|
1
|
-
import React, { useContext } from 'react';
|
2
|
-
import { Translation, useTranslation } from 'react-i18next';
|
3
|
-
import { createRenderChildNodes, RenderOptions } from '../createRenderChildNodes';
|
4
|
-
import { findChildElement } from '../dom-utils';
|
5
|
-
import { url } from '../url';
|
6
|
-
import AnsweringInstructions from './AnsweringInstructions';
|
7
|
-
import { CommonExamContext } from './CommonExamContext';
|
8
|
-
import { QuestionContext, withQuestionContext } from './QuestionContext';
|
9
|
-
import { SectionContext, withSectionContext } from './SectionContext';
|
10
|
-
function TOCSection({ element }) {
|
11
|
-
const { maxAnswers, minAnswers, displayNumber, childQuestions } = useContext(SectionContext);
|
12
|
-
const sectionTitle = findChildElement(element, 'section-title');
|
13
|
-
return (React.createElement("li", null,
|
14
|
-
sectionTitle && (React.createElement(TOCSectionTitle, Object.assign({}, {
|
15
|
-
element: sectionTitle,
|
16
|
-
displayNumber,
|
17
|
-
maxAnswers,
|
18
|
-
minAnswers,
|
19
|
-
childQuestions,
|
20
|
-
}))),
|
21
|
-
React.createElement("ol", { className: "e-list-data e-pad-l-0" }, renderChildNodes(element, RenderOptions.SkipHTML))));
|
22
|
-
}
|
23
|
-
function TOCSectionTitle({ element, displayNumber, minAnswers, maxAnswers, childQuestions }) {
|
24
|
-
const { numberOfSections } = useContext(CommonExamContext);
|
25
|
-
const { t } = useTranslation();
|
26
|
-
return (React.createElement("header", null,
|
27
|
-
element.hasChildNodes() && (React.createElement("b", null,
|
28
|
-
numberOfSections > 1 && t('part', { displayNumber }),
|
29
|
-
" ",
|
30
|
-
element && renderChildNodes(element))),
|
31
|
-
maxAnswers != null && (React.createElement("div", null,
|
32
|
-
React.createElement(AnsweringInstructions, { maxAnswers: maxAnswers, minAnswers: minAnswers, childQuestions: childQuestions, type: "toc-section" })))));
|
33
|
-
}
|
34
|
-
function TOCQuestion({ element }) {
|
35
|
-
const { attachmentsURL } = useContext(CommonExamContext);
|
36
|
-
const { level, displayNumber, maxScore } = useContext(QuestionContext);
|
37
|
-
const hasExternalAttachments = findChildElement(element, 'external-material') != null;
|
38
|
-
const questionTitle = findChildElement(element, 'question-title');
|
39
|
-
return level === 0 ? (React.createElement("li", { "data-list-number": displayNumber + '.' },
|
40
|
-
React.createElement("div", { className: "e-columns" },
|
41
|
-
questionTitle && (React.createElement("span", { className: "e-column" },
|
42
|
-
React.createElement("a", { href: url('', { hash: displayNumber }) }, renderChildNodes(questionTitle)))),
|
43
|
-
hasExternalAttachments && (React.createElement("span", { className: "e-column e-column--narrow" },
|
44
|
-
React.createElement("a", { href: url(attachmentsURL, { hash: displayNumber }), target: "attachments" },
|
45
|
-
React.createElement(Translation, null, (t) => t('material'))))),
|
46
|
-
React.createElement("span", { className: "e-column e-column--narrow table-of-contents--score-column" },
|
47
|
-
React.createElement(Translation, null, (t) => t('points', { count: maxScore })))))) : null;
|
48
|
-
}
|
49
|
-
const renderChildNodes = createRenderChildNodes({
|
50
|
-
section: withSectionContext(TOCSection),
|
51
|
-
question: withQuestionContext(TOCQuestion),
|
52
|
-
});
|
53
|
-
function TableOfContents(_props) {
|
54
|
-
const { root, maxScore } = useContext(CommonExamContext);
|
55
|
-
return (React.createElement("nav", { className: "table-of-contents e-mrg-b-6", "aria-labelledby": "toc-title" },
|
56
|
-
React.createElement("h2", { id: "toc-title" },
|
57
|
-
React.createElement(Translation, null, (t) => t('toc-heading'))),
|
58
|
-
React.createElement("ol", { className: "e-list-plain e-pad-l-0" }, renderChildNodes(root)),
|
59
|
-
React.createElement("div", { className: "e-columns" },
|
60
|
-
React.createElement("strong", { className: "e-column" },
|
61
|
-
React.createElement(Translation, null, (t) => t('exam-total'))),
|
62
|
-
React.createElement("strong", { className: "e-column e-column--narrow table-of-contents--score-column" },
|
63
|
-
React.createElement(Translation, null, (t) => t('points', { count: maxScore }))))));
|
64
|
-
}
|
65
|
-
export default React.memo(TableOfContents);
|
66
|
-
//# sourceMappingURL=TableOfContents.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":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AED,eAAe,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA"}
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { ExamComponentProps } from '../createRenderChildNodes';
|
3
|
-
declare function TextAnswer(props: ExamComponentProps): JSX.Element;
|
4
|
-
declare const _default: React.MemoExoticComponent<typeof TextAnswer>;
|
5
|
-
export default _default;
|
6
|
-
//# sourceMappingURL=TextAnswer.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TextAnswer.d.ts","sourceRoot":"","sources":["../../src/components/TextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,iBAAS,UAAU,CAAC,KAAK,EAAE,kBAAkB,eAe5C;;AAED,wBAAqC"}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { findChildElement } from '../dom-utils';
|
3
|
-
import { shortDisplayNumber } from '../shortDisplayNumber';
|
4
|
-
import TextAnswerInput from './TextAnswerInput';
|
5
|
-
function TextAnswer(props) {
|
6
|
-
const { element, renderChildNodes } = props;
|
7
|
-
const displayNumber = element.getAttribute('display-number');
|
8
|
-
const hint = findChildElement(element, 'hint');
|
9
|
-
const textAnswer = React.createElement(TextAnswerInput, Object.assign({}, props));
|
10
|
-
return hint ? (React.createElement("label", { className: "e-nowrap" },
|
11
|
-
React.createElement("sup", { className: "e-text-answer-display-number e-color-darkgrey" }, shortDisplayNumber(displayNumber)),
|
12
|
-
React.createElement("span", { className: "e-screen-reader-only" }, renderChildNodes(hint)),
|
13
|
-
textAnswer)) : (textAnswer);
|
14
|
-
}
|
15
|
-
export default React.memo(TextAnswer);
|
16
|
-
//# sourceMappingURL=TextAnswer.js.map
|
@@ -1 +0,0 @@
|
|
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;AAG/C,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,8BAAM,SAAS,EAAC,sBAAsB,IAAE,gBAAgB,CAAC,IAAI,CAAC,CAAQ;QACrE,UAAU,CACL,CACT,CAAC,CAAC,CAAC,CACF,UAAU,CACX,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA"}
|
@@ -1,37 +0,0 @@
|
|
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
|
-
maxImages: number;
|
11
|
-
saveAnswer: typeof actions.saveAnswer;
|
12
|
-
selectAnswerVersion: typeof actions.selectAnswerVersion;
|
13
|
-
showAnswerHistory: boolean;
|
14
|
-
supportsAnswerHistory: boolean;
|
15
|
-
type: 'rich-text' | 'multi-line' | 'single-line';
|
16
|
-
}
|
17
|
-
interface State {
|
18
|
-
error: AnswerError | null;
|
19
|
-
}
|
20
|
-
export declare class TextAnswerInput extends React.PureComponent<Props, State> {
|
21
|
-
private ref;
|
22
|
-
constructor(props: Props);
|
23
|
-
componentDidMount(): void;
|
24
|
-
componentDidUpdate(): void;
|
25
|
-
onChange: (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
|
26
|
-
onRichTextChange: (answerHtml: string, answerText: string) => void;
|
27
|
-
onFocus: () => void;
|
28
|
-
onBlur: () => void;
|
29
|
-
onError: (error: AnswerError) => void;
|
30
|
-
clearErrors: () => void;
|
31
|
-
resize(): void;
|
32
|
-
render(): JSX.Element;
|
33
|
-
}
|
34
|
-
export declare function getCharacterCount(answerText: string): number;
|
35
|
-
declare const _default: import("react-redux").ConnectedComponent<typeof TextAnswerInput, Pick<React.ClassAttributes<typeof TextAnswerInput> & Props, "className" | "ref" | "key" | "element" | "renderChildNodes"> & ExamComponentProps>;
|
36
|
-
export default _default;
|
37
|
-
//# sourceMappingURL=TextAnswerInput.d.ts.map
|
@@ -1 +0,0 @@
|
|
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;AAG9D,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,SAAS,EAAE,MAAM,CAAA;IACjB,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;IAIjB,kBAAkB;IAIlB,QAAQ,6EAcP;IAED,gBAAgB,mDAaf;IAED,OAAO,aAEN;IAED,MAAM,aAEL;IAED,OAAO,+BAIN;IAED,WAAW,aAEV;IAED,MAAM;IAgBN,MAAM;CAyFP;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D;;AAmBD,wBAKmB"}
|
@@ -1,145 +0,0 @@
|
|
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
|
-
const borderWidthPx = 2;
|
12
|
-
const borderHeightPx = 1;
|
13
|
-
export class TextAnswerInput extends React.PureComponent {
|
14
|
-
constructor(props) {
|
15
|
-
super(props);
|
16
|
-
this.onChange = (event) => {
|
17
|
-
const { element, saveAnswer } = this.props;
|
18
|
-
const questionId = getNumericAttribute(element, 'question-id');
|
19
|
-
const displayNumber = element.getAttribute('display-number');
|
20
|
-
const value = event.currentTarget.value.trim();
|
21
|
-
const answer = {
|
22
|
-
type: 'text',
|
23
|
-
questionId,
|
24
|
-
value,
|
25
|
-
characterCount: getCharacterCount(value),
|
26
|
-
displayNumber,
|
27
|
-
};
|
28
|
-
saveAnswer(answer);
|
29
|
-
this.clearErrors();
|
30
|
-
};
|
31
|
-
this.onRichTextChange = (answerHtml, answerText) => {
|
32
|
-
const { element, saveAnswer } = this.props;
|
33
|
-
const questionId = getNumericAttribute(element, 'question-id');
|
34
|
-
const displayNumber = element.getAttribute('display-number');
|
35
|
-
const answer = {
|
36
|
-
type: 'richText',
|
37
|
-
questionId,
|
38
|
-
value: answerHtml,
|
39
|
-
characterCount: getCharacterCount(answerText),
|
40
|
-
displayNumber,
|
41
|
-
};
|
42
|
-
saveAnswer(answer);
|
43
|
-
this.clearErrors();
|
44
|
-
};
|
45
|
-
this.onFocus = () => {
|
46
|
-
this.props.answerFocused(getNumericAttribute(this.props.element, 'question-id'));
|
47
|
-
};
|
48
|
-
this.onBlur = () => {
|
49
|
-
this.props.answerBlurred(getNumericAttribute(this.props.element, 'question-id'));
|
50
|
-
};
|
51
|
-
this.onError = (error) => {
|
52
|
-
this.setState({
|
53
|
-
error,
|
54
|
-
});
|
55
|
-
};
|
56
|
-
this.clearErrors = () => {
|
57
|
-
this.setState({ error: null });
|
58
|
-
};
|
59
|
-
this.ref = React.createRef();
|
60
|
-
this.state = {
|
61
|
-
error: null,
|
62
|
-
};
|
63
|
-
}
|
64
|
-
componentDidMount() {
|
65
|
-
this.resize();
|
66
|
-
}
|
67
|
-
componentDidUpdate() {
|
68
|
-
this.resize();
|
69
|
-
}
|
70
|
-
resize() {
|
71
|
-
const { current } = this.ref;
|
72
|
-
if (current) {
|
73
|
-
if (this.props.type === 'multi-line') {
|
74
|
-
const { scrollX, scrollY } = window;
|
75
|
-
current.style.height = 'auto';
|
76
|
-
current.style.height = current.scrollHeight + borderHeightPx + 'px';
|
77
|
-
window.scrollTo(scrollX, scrollY);
|
78
|
-
}
|
79
|
-
else if (this.props.type === 'single-line') {
|
80
|
-
current.style.width = '0';
|
81
|
-
current.style.width = current.scrollWidth + borderWidthPx + 'px';
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
render() {
|
86
|
-
const { answer, className, element, maxImages, selectAnswerVersion, showAnswerHistory, supportsAnswerHistory, type, } = this.props;
|
87
|
-
const { error } = this.state;
|
88
|
-
const questionId = getNumericAttribute(element, 'question-id');
|
89
|
-
const maxScore = getNumericAttribute(element, 'max-score');
|
90
|
-
const value = answer && answer.value;
|
91
|
-
switch (type) {
|
92
|
-
case 'rich-text':
|
93
|
-
return (React.createElement(React.Fragment, null,
|
94
|
-
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, maxImages: maxImages, questionId: questionId }))),
|
95
|
-
React.createElement(AnswerToolbar, Object.assign({}, {
|
96
|
-
answer,
|
97
|
-
element,
|
98
|
-
selectAnswerVersion,
|
99
|
-
showAnswerHistory,
|
100
|
-
supportsAnswerHistory,
|
101
|
-
error,
|
102
|
-
}))));
|
103
|
-
case 'multi-line':
|
104
|
-
return (React.createElement(React.Fragment, null,
|
105
|
-
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 }),
|
106
|
-
React.createElement(AnswerToolbar, Object.assign({}, {
|
107
|
-
answer,
|
108
|
-
element,
|
109
|
-
selectAnswerVersion,
|
110
|
-
showAnswerHistory,
|
111
|
-
supportsAnswerHistory,
|
112
|
-
}))));
|
113
|
-
case 'single-line':
|
114
|
-
default:
|
115
|
-
return (React.createElement("span", { className: "e-nowrap" },
|
116
|
-
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 }),
|
117
|
-
React.createElement(QuestionContext.Consumer, null, ({ answers }) => answers.length > 1 && React.createElement(Score, { score: maxScore, size: "inline" }))));
|
118
|
-
}
|
119
|
-
}
|
120
|
-
}
|
121
|
-
export function getCharacterCount(answerText) {
|
122
|
-
return answerText.replace(/\s/g, '').length;
|
123
|
-
}
|
124
|
-
function mapStateToProps(state, { element }) {
|
125
|
-
const type = (element.getAttribute('type') || 'single-line');
|
126
|
-
const questionId = getNumericAttribute(element, 'question-id');
|
127
|
-
const answer = state.answers.answersById[questionId];
|
128
|
-
const supportsAnswerHistory = state.answers.supportsAnswerHistory;
|
129
|
-
const showAnswerHistory = state.answers.supportsAnswerHistory && state.answers.serverQuestionIds.has(questionId);
|
130
|
-
const maxImages = getNumericAttribute(element, 'max-images');
|
131
|
-
return {
|
132
|
-
answer,
|
133
|
-
showAnswerHistory,
|
134
|
-
supportsAnswerHistory,
|
135
|
-
type,
|
136
|
-
maxImages: maxImages !== undefined ? maxImages : 50,
|
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
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"TextAnswerInput.js","sourceRoot":"","sources":["../../src/components/TextAnswerInput.tsx"],"names":[],"mappings":"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O,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"}
|
@@ -1,6 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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"}
|
package/dist/components/Video.js
DELETED
@@ -1,15 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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 +0,0 @@
|
|
1
|
-
{"version":3,"file":"FinishExam.d.ts","sourceRoot":"","sources":["../../../src/components/exam/FinishExam.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,iBAAS,UAAU,sBAoBlB;;AAED,wBAAqC"}
|