@digabi/exam-engine-core 20.4.2 → 20.5.1-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/annotations.test.d.ts.map +1 -1
- package/dist/__tests__/annotations.test.js +31 -20
- package/dist/__tests__/annotations.test.js.map +1 -1
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/components/RenderIf.d.ts.map +1 -1
- package/dist/components/attachments/Attachments.d.ts.map +1 -1
- package/dist/components/attachments/Attachments.js +7 -9
- package/dist/components/attachments/Attachments.js.map +1 -1
- package/dist/components/context/AnnotationProvider.d.ts.map +1 -1
- package/dist/components/context/AnnotationProvider.js +18 -2
- package/dist/components/context/AnnotationProvider.js.map +1 -1
- package/dist/components/context/GradingInstructionContext.d.ts +9 -0
- package/dist/components/context/GradingInstructionContext.d.ts.map +1 -0
- package/dist/components/context/GradingInstructionContext.js +3 -0
- package/dist/components/context/GradingInstructionContext.js.map +1 -0
- package/dist/components/context/IsInSidebarContext.d.ts +0 -1
- package/dist/components/context/IsInSidebarContext.d.ts.map +1 -1
- package/dist/components/context/ResultsContext.d.ts.map +1 -1
- package/dist/components/context/ResultsContext.js.map +1 -1
- package/dist/components/context/TOCContext.d.ts +0 -1
- package/dist/components/context/TOCContext.d.ts.map +1 -1
- package/dist/components/context/withContext.d.ts.map +1 -1
- package/dist/components/exam/ChoiceAnswer.d.ts.map +1 -1
- package/dist/components/exam/ChoiceAnswer.js +16 -14
- package/dist/components/exam/ChoiceAnswer.js.map +1 -1
- package/dist/components/exam/Exam.d.ts.map +1 -1
- package/dist/components/exam/Exam.js +0 -2
- package/dist/components/exam/Exam.js.map +1 -1
- package/dist/components/exam/FinishExam.d.ts.map +1 -1
- package/dist/components/exam/FinishExam.js +3 -7
- package/dist/components/exam/FinishExam.js.map +1 -1
- package/dist/components/exam/RichTextAnswer.d.ts +1 -1
- package/dist/components/exam/RichTextAnswer.d.ts.map +1 -1
- package/dist/components/exam/TextAnswer.d.ts.map +1 -1
- package/dist/components/exam/TextAnswer.js +6 -4
- package/dist/components/exam/TextAnswer.js.map +1 -1
- package/dist/components/exam/internal/ProgressBar.d.ts.map +1 -1
- package/dist/components/exam/internal/ProgressBar.js +1 -0
- package/dist/components/exam/internal/ProgressBar.js.map +1 -1
- package/dist/components/grading/editAnnotations.d.ts.map +1 -1
- package/dist/components/grading/editAnnotations.js +2 -1
- package/dist/components/grading/editAnnotations.js.map +1 -1
- package/dist/components/grading/examAnnotationUtils.d.ts +0 -1
- package/dist/components/grading/examAnnotationUtils.d.ts.map +1 -1
- package/dist/components/grading/examAnnotationUtils.js +26 -33
- package/dist/components/grading/examAnnotationUtils.js.map +1 -1
- package/dist/components/grading-instructions/AnswerGradingInstruction.d.ts.map +1 -1
- package/dist/components/grading-instructions/AnswerGradingInstruction.js +7 -2
- package/dist/components/grading-instructions/AnswerGradingInstruction.js.map +1 -1
- package/dist/components/grading-instructions/EditableGradingInstruction.d.ts +5 -0
- package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -0
- package/dist/components/grading-instructions/EditableGradingInstruction.js +25 -0
- package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -0
- package/dist/components/grading-instructions/ExamGradingInstruction.d.ts.map +1 -1
- package/dist/components/grading-instructions/ExamGradingInstruction.js +7 -2
- package/dist/components/grading-instructions/ExamGradingInstruction.js.map +1 -1
- package/dist/components/grading-instructions/GradingInstructionProvider.d.ts +9 -0
- package/dist/components/grading-instructions/GradingInstructionProvider.d.ts.map +1 -0
- package/dist/components/grading-instructions/GradingInstructionProvider.js +8 -0
- package/dist/components/grading-instructions/GradingInstructionProvider.js.map +1 -0
- package/dist/components/grading-instructions/GradingInstructions.d.ts +2 -1
- package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
- package/dist/components/grading-instructions/GradingInstructions.js +40 -40
- package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
- package/dist/components/shared/AnnotatableText.d.ts +2 -4
- package/dist/components/shared/AnnotatableText.d.ts.map +1 -1
- package/dist/components/shared/AnnotatableText.js +19 -19
- package/dist/components/shared/AnnotatableText.js.map +1 -1
- package/dist/components/shared/AnswerIndicator.d.ts +1 -1
- package/dist/components/shared/AnswerIndicator.d.ts.map +1 -1
- package/dist/components/shared/AnswerIndicator.js +10 -9
- package/dist/components/shared/AnswerIndicator.js.map +1 -1
- package/dist/components/shared/AnswerLengthInfo.d.ts +1 -1
- package/dist/components/shared/AnswerLengthInfo.d.ts.map +1 -1
- package/dist/components/shared/AttachmentLink.d.ts +1 -1
- package/dist/components/shared/AttachmentLink.d.ts.map +1 -1
- package/dist/components/shared/AttachmentLinks.d.ts +1 -1
- package/dist/components/shared/AttachmentLinks.d.ts.map +1 -1
- package/dist/components/shared/References.d.ts.map +1 -1
- package/dist/components/shared/References.js +1 -0
- package/dist/components/shared/References.js.map +1 -1
- package/dist/components/shared/TOCQuestion.js +1 -1
- package/dist/components/shared/TOCQuestion.js.map +1 -1
- package/dist/createRenderChildNodes.d.ts.map +1 -1
- package/dist/createRenderChildNodes.js +2 -12
- package/dist/createRenderChildNodes.js.map +1 -1
- package/dist/i18n/index.d.ts +1 -2
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main.css +1 -1
- package/dist/store/answers/reducer.d.ts.map +1 -1
- package/dist/store/audio/reducer.d.ts.map +1 -1
- package/dist/store/audio/sagas.d.ts.map +1 -1
- package/dist/store/audio/sagas.js +3 -1
- package/dist/store/audio/sagas.js.map +1 -1
- package/dist/store/cas/reducer.d.ts.map +1 -1
- package/dist/store/index.d.ts +1 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/selectors.d.ts +1 -1
- package/package.json +4 -4
- package/dist/components/context/AnnotationContext.d.ts +0 -8
- package/dist/components/context/AnnotationContext.d.ts.map +0 -1
- package/dist/components/context/AnnotationContext.js +0 -3
- package/dist/components/context/AnnotationContext.js.map +0 -1
- package/dist/components/exam/ExamineExam.d.ts +0 -5
- package/dist/components/exam/ExamineExam.d.ts.map +0 -1
- package/dist/components/exam/ExamineExam.js +0 -20
- package/dist/components/exam/ExamineExam.js.map +0 -1
- package/dist/components/grading/reactAnnotation.d.ts +0 -4
- package/dist/components/grading/reactAnnotation.d.ts.map +0 -1
- package/dist/components/grading/reactAnnotation.js +0 -54
- package/dist/components/grading/reactAnnotation.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 +0 -7
- package/dist/components/results/isExamFinishPageHook.js.map +0 -1
- package/dist/components/shared/CreateAnnotationPopup.d.ts +0 -6
- package/dist/components/shared/CreateAnnotationPopup.d.ts.map +0 -1
- package/dist/components/shared/CreateAnnotationPopup.js +0 -11
- package/dist/components/shared/CreateAnnotationPopup.js.map +0 -1
@@ -1,18 +1,29 @@
|
|
1
1
|
import { textAnnotationFromRange } from './editAnnotations';
|
2
2
|
export function onMouseDownForAnnotation(e, mouseUpCallback) {
|
3
|
-
function onMouseUpAfterAnswerMouseDown(
|
4
|
-
|
3
|
+
function onMouseUpAfterAnswerMouseDown() {
|
4
|
+
var _a, _b, _c, _d, _e;
|
5
5
|
window.removeEventListener('mouseup', onMouseUpAfterAnswerMouseDown);
|
6
|
-
|
6
|
+
/**
|
7
|
+
* selection.anchorNode = where mouse is pressed down (chronologically first)
|
8
|
+
* selection.getRangeAt(0).startContainer = where selection starts (first in DOM)
|
9
|
+
*/
|
7
10
|
const selection = window.getSelection();
|
8
|
-
|
11
|
+
const startNode = (_a = selection === null || selection === void 0 ? void 0 : selection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
|
12
|
+
const endNode = (_b = selection === null || selection === void 0 ? void 0 : selection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
|
13
|
+
const endNodePath = endNode === null || endNode === void 0 ? void 0 : endNode.getAttribute('data-annotation-path');
|
14
|
+
if (selection && endNodePath && hasOnlyOneTextElementSelected()) {
|
9
15
|
const range = selection.getRangeAt(0);
|
10
|
-
const
|
11
|
-
|
16
|
+
const displayNumber = ((_d = (_c = startNode === null || startNode === void 0 ? void 0 : startNode.parentElement) === null || _c === void 0 ? void 0 : _c.closest('div[data-annotation-anchor]')) === null || _d === void 0 ? void 0 : _d.getAttribute('data-annotation-anchor')) || '';
|
17
|
+
const startAndLength = textAnnotationFromRange((_e = selection.focusNode) === null || _e === void 0 ? void 0 : _e.parentElement, range);
|
18
|
+
if (!startAndLength || !(startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.length)) {
|
12
19
|
return;
|
13
20
|
}
|
14
|
-
const
|
15
|
-
|
21
|
+
const position = {
|
22
|
+
startIndex: startAndLength.startIndex,
|
23
|
+
length: startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.length,
|
24
|
+
selectedText: selection.toString()
|
25
|
+
};
|
26
|
+
mouseUpCallback({ ...position, annotationAnchor: endNodePath, displayNumber });
|
16
27
|
}
|
17
28
|
}
|
18
29
|
// Do annotations only with left mouse buttons
|
@@ -21,31 +32,13 @@ export function onMouseDownForAnnotation(e, mouseUpCallback) {
|
|
21
32
|
}
|
22
33
|
window.addEventListener('mouseup', onMouseUpAfterAnswerMouseDown);
|
23
34
|
}
|
24
|
-
|
35
|
+
function hasOnlyOneTextElementSelected() {
|
36
|
+
var _a, _b;
|
25
37
|
const selection = window.getSelection();
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
return false;
|
32
|
-
}
|
33
|
-
const startContainer = sel.getRangeAt(0).startContainer;
|
34
|
-
const endContainer = sel.getRangeAt(0).endContainer;
|
35
|
-
const startParent = startContainer.parentElement;
|
36
|
-
const endParent = endContainer.parentElement;
|
37
|
-
const visibleMarkTagExistsInSelection = Array.from(sel.getRangeAt(0).cloneContents().children).some(child => child.tagName === 'MARK' && child.getAttribute('data-hidden') === 'false');
|
38
|
-
return (sel.rangeCount > 0 &&
|
39
|
-
startParent === endParent &&
|
40
|
-
(startParent === null || startParent === void 0 ? void 0 : startParent.tagName) !== 'MARK' &&
|
41
|
-
!visibleMarkTagExistsInSelection);
|
42
|
-
}
|
43
|
-
function isRangeSelection(sel) {
|
44
|
-
return (sel === null || sel === void 0 ? void 0 : sel.type) === 'Range';
|
45
|
-
}
|
46
|
-
function textSelectedInRange(sel) {
|
47
|
-
const range = sel === null || sel === void 0 ? void 0 : sel.getRangeAt(0);
|
48
|
-
return !!sel.rangeCount && range.toString().length > 0;
|
49
|
-
}
|
38
|
+
const rangeChildren = selection && Array.from(selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0).cloneContents().children);
|
39
|
+
const visibleMarkTagExistsInSelection = rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.some(child => child.tagName === 'MARK' && child.getAttribute('data-hidden') === 'false');
|
40
|
+
const startNode = (_a = selection === null || selection === void 0 ? void 0 : selection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
|
41
|
+
const endNode = (_b = selection === null || selection === void 0 ? void 0 : selection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
|
42
|
+
return !visibleMarkTagExistsInSelection && startNode === endNode;
|
50
43
|
}
|
51
44
|
//# sourceMappingURL=examAnnotationUtils.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"examAnnotationUtils.js","sourceRoot":"","sources":["../../../src/components/grading/examAnnotationUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,UAAU,wBAAwB,CAAC,CAAmB,EAAE,eAAiC;IAC7F,SAAS,6BAA6B,CAAC,
|
1
|
+
{"version":3,"file":"examAnnotationUtils.js","sourceRoot":"","sources":["../../../src/components/grading/examAnnotationUtils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,UAAU,wBAAwB,CAAC,CAAmB,EAAE,eAAiC;IAC7F,SAAS,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F,CAAC;IACH,CAAC;IAED,8CAA8C;IAC9C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnB,OAAM;IACR,CAAC;IACD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAA;AACnE,CAAC;AAED,SAAS,6BAA6B;;IACpC,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAA;IAEvC,MAAM,aAAa,GAAG,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,CAAC,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC,CAAA;IAChG,MAAM,+BAA+B,GAAG,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,IAAI,CACzD,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,IAAI,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,OAAO,CACnF,CAAA;IAED,MAAM,SAAS,GAAG,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,0CAAE,aAAa,CAAA;IACtD,MAAM,OAAO,GAAG,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,SAAS,0CAAE,aAAa,CAAA;IACnD,OAAO,CAAC,+BAA+B,IAAI,SAAS,KAAK,OAAO,CAAA;AAClE,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnswerGradingInstruction.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/AnswerGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"AnswerGradingInstruction.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/AnswerGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAIjE,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAOzE,CAAA;AAED,eAAe,wBAAwB,CAAA"}
|
@@ -1,4 +1,9 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { GradingInstructionContext } from '../context/GradingInstructionContext';
|
3
|
+
import { EditableGradingInstruction } from './EditableGradingInstruction';
|
4
|
+
const AnswerGradingInstruction = ({ element, renderChildNodes }) => {
|
5
|
+
const { editable } = useContext(GradingInstructionContext);
|
6
|
+
return (React.createElement("div", { className: "e-answer-grading-instruction e-multiline-results-text-answer e-mrg-b-2 e-pad-l-2" }, editable ? React.createElement(EditableGradingInstruction, { element: element }) : renderChildNodes(element)));
|
7
|
+
};
|
3
8
|
export default AnswerGradingInstruction;
|
4
9
|
//# sourceMappingURL=AnswerGradingInstruction.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnswerGradingInstruction.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/AnswerGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"AnswerGradingInstruction.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/AnswerGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAEzE,MAAM,wBAAwB,GAAgD,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE;IAC9G,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAA;IAC1D,OAAO,CACL,6BAAK,SAAS,EAAC,kFAAkF,IAC9F,QAAQ,CAAC,CAAC,CAAC,oBAAC,0BAA0B,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CACpF,CACP,CAAA;AACH,CAAC,CAAA;AAED,eAAe,wBAAwB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EditableGradingInstruction.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/EditableGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwC,MAAM,OAAO,CAAA;AAM5D,wBAAgB,0BAA0B,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,qBAuB3E"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
2
|
+
import { makeRichText } from 'rich-text-editor';
|
3
|
+
import { GradingInstructionContext } from '../context/GradingInstructionContext';
|
4
|
+
import { CommonExamContext } from '../context/CommonExamContext';
|
5
|
+
import { QuestionContext } from '../context/QuestionContext';
|
6
|
+
export function EditableGradingInstruction({ element }) {
|
7
|
+
const { language } = useContext(CommonExamContext);
|
8
|
+
const { displayNumber } = useContext(QuestionContext);
|
9
|
+
const { onContentChange, saveScreenshot } = useContext(GradingInstructionContext);
|
10
|
+
const answerGradingInstructionDiv = useRef(null);
|
11
|
+
useEffect(() => {
|
12
|
+
if (answerGradingInstructionDiv.current) {
|
13
|
+
makeRichText(answerGradingInstructionDiv.current, {
|
14
|
+
locale: language.startsWith('sv') ? 'SV' : 'FI',
|
15
|
+
screenshotSaver: saveScreenshot ? ({ type, data }) => saveScreenshot(type, data, displayNumber) : undefined,
|
16
|
+
forceInit: true,
|
17
|
+
screenshotImageSelector: 'img[src^="data:image/png"], img[src^="data:image/jpeg"]',
|
18
|
+
fileTypes: ['image/png', 'image/jpeg']
|
19
|
+
}, ({ answerHTML }) => (onContentChange ? onContentChange(answerHTML, displayNumber) : () => { }));
|
20
|
+
answerGradingInstructionDiv.current.replaceChildren(element);
|
21
|
+
}
|
22
|
+
}, [language]);
|
23
|
+
return React.createElement("div", { ref: answerGradingInstructionDiv });
|
24
|
+
}
|
25
|
+
//# sourceMappingURL=EditableGradingInstruction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"EditableGradingInstruction.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/EditableGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAA;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,MAAM,UAAU,0BAA0B,CAAC,EAAE,OAAO,EAAwB;IAC1E,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAClD,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IACrD,MAAM,EAAE,eAAe,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAA;IACjF,MAAM,2BAA2B,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IAEhE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,2BAA2B,CAAC,OAAO,EAAE,CAAC;YACxC,YAAY,CACV,2BAA2B,CAAC,OAAO,EACnC;gBACE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;gBAC/C,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS;gBAC3G,SAAS,EAAE,IAAI;gBACf,uBAAuB,EAAE,yDAAyD;gBAClF,SAAS,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC;aACvC,EACD,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAC9F,CAAA;YACD,2BAA2B,CAAC,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;QAC9D,CAAC;IACH,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IACd,OAAO,6BAAK,GAAG,EAAE,2BAA2B,GAAI,CAAA;AAClD,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExamGradingInstruction.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/ExamGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"ExamGradingInstruction.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/ExamGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAIjE,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAQvE,CAAA;AACD,eAAe,sBAAsB,CAAA"}
|
@@ -1,4 +1,9 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { GradingInstructionContext } from '../context/GradingInstructionContext';
|
3
|
+
import { EditableGradingInstruction } from './EditableGradingInstruction';
|
4
|
+
const ExamGradingInstruction = ({ element, renderChildNodes }) => {
|
5
|
+
const { editable } = useContext(GradingInstructionContext);
|
6
|
+
return (React.createElement("div", { className: "e-exam-grading-instruction notification e-pad-4", "data-annotation-anchor": "exam-grading-instruction" }, editable ? React.createElement(EditableGradingInstruction, { element: element }) : renderChildNodes(element)));
|
7
|
+
};
|
3
8
|
export default ExamGradingInstruction;
|
4
9
|
//# sourceMappingURL=ExamGradingInstruction.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ExamGradingInstruction.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/ExamGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"ExamGradingInstruction.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/ExamGradingInstruction.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAA;AAEzE,MAAM,sBAAsB,GAAgD,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE;IAC5G,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAA;IAE1D,OAAO,CACL,6BAAK,SAAS,EAAC,iDAAiD,4BAAwB,0BAA0B,IAC/G,QAAQ,CAAC,CAAC,CAAC,oBAAC,0BAA0B,IAAC,OAAO,EAAE,OAAO,GAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CACpF,CACP,CAAA;AACH,CAAC,CAAA;AACD,eAAe,sBAAsB,CAAA"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
export interface GradingInstructionProps {
|
3
|
+
children?: React.ReactNode;
|
4
|
+
editable?: boolean;
|
5
|
+
onContentChange?: (answerHTML: string, displayNumber?: string) => void;
|
6
|
+
saveScreenshot?: (type: string, data: Buffer, displayNumber?: string) => Promise<string>;
|
7
|
+
}
|
8
|
+
export declare const GradingInstructionProvider: ({ editable, onContentChange, saveScreenshot, children }: GradingInstructionProps) => React.JSX.Element;
|
9
|
+
//# sourceMappingURL=GradingInstructionProvider.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GradingInstructionProvider.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstructionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,eAAe,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACtE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACzF;AAED,eAAO,MAAM,0BAA0B,4DAKpC,uBAAuB,sBAUzB,CAAA"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { GradingInstructionContext } from '../context/GradingInstructionContext';
|
3
|
+
export const GradingInstructionProvider = ({ editable, onContentChange, saveScreenshot, children }) => (React.createElement(GradingInstructionContext.Provider, { value: {
|
4
|
+
editable: editable !== null && editable !== void 0 ? editable : false,
|
5
|
+
onContentChange: onContentChange ? onContentChange : () => { },
|
6
|
+
saveScreenshot
|
7
|
+
} }, children));
|
8
|
+
//# sourceMappingURL=GradingInstructionProvider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GradingInstructionProvider.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstructionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AAShF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,EACzC,QAAQ,EACR,eAAe,EACf,cAAc,EACd,QAAQ,EACgB,EAAE,EAAE,CAAC,CAC7B,oBAAC,yBAAyB,CAAC,QAAQ,IACjC,KAAK,EAAE;QACL,QAAQ,EAAE,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI,KAAK;QAC3B,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC;QAC7D,cAAc;KACf,IAEA,QAAQ,CAC0B,CACtC,CAAA"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { AnnotationProps, CommonExamProps } from '../exam/Exam';
|
3
|
+
import { GradingInstructionProps } from './GradingInstructionProvider';
|
3
4
|
export declare const GradingInstructionsPageTitle: React.FunctionComponent;
|
4
|
-
declare const _default: React.MemoExoticComponent<React.ComponentType<CommonExamProps & AnnotationProps>>;
|
5
|
+
declare const _default: React.MemoExoticComponent<React.ComponentType<CommonExamProps & AnnotationProps & GradingInstructionProps>>;
|
5
6
|
export default _default;
|
6
7
|
//# sourceMappingURL=GradingInstructions.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GradingInstructions.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstructions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"GradingInstructions.d.ts","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstructions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAcpD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAmB/D,OAAO,EAAE,uBAAuB,EAA8B,MAAM,8BAA8B,CAAA;AAiHlG,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,iBAGhD,CAAA;;AAED,wBAAqE"}
|
@@ -1,36 +1,36 @@
|
|
1
1
|
import React, { useContext, useEffect } from 'react';
|
2
|
-
import { CommonExamContext, withCommonExamContext } from '../context/CommonExamContext';
|
3
|
-
import { useCached } from '../../useCached';
|
4
|
-
import { changeLanguage, initI18n, useExamTranslation } from '../../i18n';
|
5
|
-
import { scrollToHash } from '../../scrollToHash';
|
6
2
|
import { I18nextProvider } from 'react-i18next';
|
7
|
-
import Section from './Section';
|
8
|
-
import SectionTitle from './SectionTitle';
|
9
|
-
import Question from './Question';
|
10
|
-
import File from '../shared/File';
|
11
|
-
import ExamGradingInstruction from './ExamGradingInstruction';
|
12
|
-
import AutogradedAnswer from './AutogradedAnswer';
|
13
|
-
import Image from '../shared/Image';
|
14
|
-
import Formula from '../shared/Formula';
|
15
|
-
import AutogradedAnswerOption from './AutogradedAnswerOption';
|
16
|
-
import QuestionTitle from './QuestionTitle';
|
17
3
|
import { createRenderChildNodes } from '../../createRenderChildNodes';
|
4
|
+
import { findChildElement, queryAncestors } from '../../dom-utils';
|
5
|
+
import { changeLanguage, initI18n, useExamTranslation } from '../../i18n';
|
18
6
|
import { examTitleId } from '../../ids';
|
7
|
+
import { scrollToHash } from '../../scrollToHash';
|
8
|
+
import { useCached } from '../../useCached';
|
19
9
|
import DocumentTitle from '../DocumentTitle';
|
20
|
-
import SectionElement from '../SectionElement';
|
21
|
-
import { findChildElement, queryAncestors } from '../../dom-utils';
|
22
|
-
import { renderIf } from '../RenderIf';
|
23
10
|
import RenderExamElements from '../RenderExamElements';
|
24
|
-
import {
|
25
|
-
import
|
11
|
+
import { renderIf } from '../RenderIf';
|
12
|
+
import SectionElement from '../SectionElement';
|
13
|
+
import { AnnotationProvider } from '../context/AnnotationProvider';
|
14
|
+
import { CommonExamContext, withCommonExamContext } from '../context/CommonExamContext';
|
15
|
+
import QuestionInstruction from '../exam/QuestionInstruction';
|
26
16
|
import mkAttachmentLink from '../shared/AttachmentLink';
|
27
17
|
import mkAttachmentLinks from '../shared/AttachmentLinks';
|
28
|
-
import Recording from './Recording';
|
29
|
-
import QuestionInstruction from '../exam/QuestionInstruction';
|
30
|
-
import { QuestionNumber } from '../shared/QuestionNumber';
|
31
18
|
import ExamTranslation from '../shared/ExamTranslation';
|
32
|
-
import
|
33
|
-
import
|
19
|
+
import File from '../shared/File';
|
20
|
+
import Formula from '../shared/Formula';
|
21
|
+
import Image from '../shared/Image';
|
22
|
+
import { QuestionNumber } from '../shared/QuestionNumber';
|
23
|
+
import { mkTableOfContents } from '../shared/TableOfContents';
|
24
|
+
import AnswerGradingInstruction from './AnswerGradingInstruction';
|
25
|
+
import AutogradedAnswer from './AutogradedAnswer';
|
26
|
+
import AutogradedAnswerOption from './AutogradedAnswerOption';
|
27
|
+
import ExamGradingInstruction from './ExamGradingInstruction';
|
28
|
+
import Question from './Question';
|
29
|
+
import QuestionTitle from './QuestionTitle';
|
30
|
+
import Recording from './Recording';
|
31
|
+
import Section from './Section';
|
32
|
+
import SectionTitle from './SectionTitle';
|
33
|
+
import { GradingInstructionProvider } from './GradingInstructionProvider';
|
34
34
|
const renderIfWithinGradingInstructionContent = renderIf(({ element }) => queryAncestors(element, [
|
35
35
|
// Keep in sync with lists in mastering/index.ts
|
36
36
|
'answer-grading-instruction',
|
@@ -71,7 +71,7 @@ const renderChildNodes = createRenderChildNodes({
|
|
71
71
|
'section-title': SectionTitle,
|
72
72
|
video: Recording
|
73
73
|
});
|
74
|
-
const GradingInstructions = ({ doc, annotations, onClickAnnotation, onSaveAnnotation }) => {
|
74
|
+
const GradingInstructions = ({ doc, annotations, onClickAnnotation, onSaveAnnotation, editable, onContentChange, saveScreenshot }) => {
|
75
75
|
const root = doc.documentElement;
|
76
76
|
const { date, dateTimeFormatter, dayCode, examCode, language, subjectLanguage } = useContext(CommonExamContext);
|
77
77
|
const examTitle = findChildElement(root, 'exam-title');
|
@@ -86,21 +86,21 @@ const GradingInstructions = ({ doc, annotations, onClickAnnotation, onSaveAnnota
|
|
86
86
|
useEffect(changeLanguage(i18n, language));
|
87
87
|
useEffect(scrollToHash, []);
|
88
88
|
return (React.createElement(AnnotationProvider, { annotations: annotations, onClickAnnotation: onClickAnnotation, onSaveAnnotation: onSaveAnnotation },
|
89
|
-
React.createElement(
|
90
|
-
React.createElement(
|
91
|
-
React.createElement(
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
89
|
+
React.createElement(GradingInstructionProvider, { editable, onContentChange, saveScreenshot },
|
90
|
+
React.createElement(I18nextProvider, { i18n: i18n },
|
91
|
+
React.createElement("main", { className: "e-exam e-grading-instructions", lang: subjectLanguage },
|
92
|
+
React.createElement(React.StrictMode, null),
|
93
|
+
React.createElement(SectionElement, { "aria-labelledby": examTitleId },
|
94
|
+
React.createElement(DocumentTitle, { id: examTitleId },
|
95
|
+
React.createElement(GradingInstructionsPageTitle, null),
|
96
|
+
" ",
|
97
|
+
examTitle && renderChildNodes(examTitle)),
|
98
|
+
date && (React.createElement("p", null,
|
99
|
+
React.createElement("strong", null, dateTimeFormatter.format(date)))),
|
100
|
+
examGradingInstruction && (React.createElement(ExamGradingInstruction, { element: examGradingInstruction, renderChildNodes })),
|
101
|
+
tableOfContents && (React.createElement("div", { className: "main-toc-container" },
|
102
|
+
React.createElement(TableOfContents, { element: tableOfContents, renderChildNodes })))),
|
103
|
+
renderChildNodes(root))))));
|
104
104
|
};
|
105
105
|
// Wrap to a separate component, since we can't use translation hooks in the root component.
|
106
106
|
export const GradingInstructionsPageTitle = () => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GradingInstructions.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstructions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"GradingInstructions.js","sourceRoot":"","sources":["../../../src/components/grading-instructions/GradingInstructions.tsx"],"names":[],"mapp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CAAA"}
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
|
3
|
-
export declare const AnnotatableText: ({ node, annotationContextData }: {
|
2
|
+
export declare const AnnotatableText: ({ node }: {
|
4
3
|
node: Node;
|
5
|
-
|
6
|
-
}) => React.JSX.Element;
|
4
|
+
}) => string | React.JSX.Element;
|
7
5
|
//# sourceMappingURL=AnnotatableText.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnnotatableText.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnnotatableText.tsx"],"names":[],"mappings":"AACA,OAAO,
|
1
|
+
{"version":3,"file":"AnnotatableText.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnnotatableText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwC,MAAM,OAAO,CAAA;AAS5D,eAAO,MAAM,eAAe,aAAc;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,+BAsGvD,CAAA"}
|
@@ -1,30 +1,30 @@
|
|
1
1
|
import { partition } from 'lodash-es';
|
2
|
-
import React, { useEffect, useRef } from 'react';
|
3
|
-
import { getElementPath
|
4
|
-
import {
|
2
|
+
import React, { useContext, useEffect, useRef } from 'react';
|
3
|
+
import { getElementPath } from '../../dom-utils';
|
4
|
+
import { AnnotationContext } from '../context/AnnotationProvider';
|
5
|
+
import { IsInSidebarContext } from '../context/IsInSidebarContext';
|
5
6
|
const isExamAnnotation = (annotation) => 'annotationId' in annotation;
|
6
|
-
export const AnnotatableText = ({ node
|
7
|
-
|
7
|
+
export const AnnotatableText = ({ node }) => {
|
8
|
+
var _a;
|
9
|
+
const annotationContextData = useContext(AnnotationContext);
|
10
|
+
const { isInSidebar } = useContext(IsInSidebarContext);
|
11
|
+
const { annotations, onClickAnnotation, setNewAnnotationRef, newAnnotation } = annotationContextData;
|
12
|
+
const canNotBeAnnotated = (annotationContextData === null || annotationContextData === void 0 ? void 0 : annotationContextData.annotations) === undefined ||
|
13
|
+
((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim().length) === 0 ||
|
14
|
+
isInSidebar !== undefined;
|
15
|
+
if (canNotBeAnnotated) {
|
16
|
+
return node.textContent;
|
17
|
+
}
|
8
18
|
const path = getElementPath(node);
|
9
19
|
const newAnnotationForThisNode = (newAnnotation === null || newAnnotation === void 0 ? void 0 : newAnnotation.annotationAnchor) === path ? newAnnotation : null;
|
10
20
|
const thisNodeAnnotations = [
|
11
21
|
...((annotations === null || annotations === void 0 ? void 0 : annotations[path]) || []),
|
12
22
|
...(newAnnotationForThisNode ? [newAnnotationForThisNode] : [])
|
13
23
|
];
|
14
|
-
const
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
};
|
19
|
-
function onMouseDown(e) {
|
20
|
-
const target = e.target;
|
21
|
-
const clickIsInPopup = target.closest('.annotation-popup');
|
22
|
-
if (!clickIsInPopup) {
|
23
|
-
setNewAnnotation(null);
|
24
|
-
}
|
25
|
-
onMouseDownForAnnotation(e, mouseUpCallback);
|
26
|
-
}
|
27
|
-
return (React.createElement("span", { onMouseDown: onMouseDown, className: "e-annotatable", key: path }, (thisNodeAnnotations === null || thisNodeAnnotations === void 0 ? void 0 : thisNodeAnnotations.length) > 0 ? markText(node.textContent, thisNodeAnnotations) : node.textContent));
|
24
|
+
const textWithoutLineBreaksAndExtraSpaces = node.textContent.replace(/\n/g, ' ').replace(/\s+/g, ' ');
|
25
|
+
return (React.createElement("span", { className: "e-annotatable", key: path, "data-annotation-path": path, "data-testid": path }, (thisNodeAnnotations === null || thisNodeAnnotations === void 0 ? void 0 : thisNodeAnnotations.length) > 0
|
26
|
+
? markText(textWithoutLineBreaksAndExtraSpaces, thisNodeAnnotations)
|
27
|
+
: textWithoutLineBreaksAndExtraSpaces));
|
28
28
|
function markText(text, annotations) {
|
29
29
|
if (annotations.length === 0) {
|
30
30
|
return [text];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnnotatableText.js","sourceRoot":"","sources":["../../../src/components/shared/AnnotatableText.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"AnnotatableText.js","sourceRoot":"","sources":["../../../src/components/shared/AnnotatableText.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAElE,MAAM,gBAAgB,GAAG,CAAC,UAA8C,EAAgC,EAAE,CACxG,cAAc,IAAI,UAAU,CAAA;AAE9B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,IAAI,EAAkB,EAAE,EAAE;;IAC1D,MAAM,qBAAqB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC3D,MAAM,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAA;IACtD,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,aAAa,EAAE,GAAG,qBAAqB,CAAA;IAEpG,MAAM,iBAAiB,GACrB,CAAA,qBAAqB,aAArB,qBAAqB,uBAArB,qBAAqB,CAAE,WAAW,MAAK,SAAS;QAChD,CAAA,MAAA,IAAI,CAAC,WAAW,0CAAE,IAAI,GAAG,MAAM,MAAK,CAAC;QACrC,WAAW,KAAK,SAAS,CAAA;IAE3B,IAAI,iBAAiB,EAAE,CAAC;QACtB,OAAO,IAAI,CAAC,WAAY,CAAA;IAC1B,CAAC;IAED,MAAM,IAAI,GAAG,cAAc,CAAC,IAAe,C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,CAAC,CAAC,iBAAiB,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAE1F,UAAU;QACV,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,KAAI,6BAAK,SAAS,EAAC,cAAc,kBAAe,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,GAAI,CAC5F,CACR,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnswerIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnswerIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAInD,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,EAAE,OAAO,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;
|
1
|
+
{"version":3,"file":"AnswerIndicator.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnswerIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAe,MAAM,OAAO,CAAA;AAEnC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAInD,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,UAAU,CAAA;IAClB,KAAK,EAAE,OAAO,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;CACtB,CAAA;AAyCD,eAAO,MAAM,SAAS,oCAvCU,KAAK,uBAuCS,CAAA"}
|
@@ -12,15 +12,16 @@ const AnswerIndicator = (props) => {
|
|
12
12
|
e.stopPropagation();
|
13
13
|
window.location.href = `#question-nr-${displayNumber}`;
|
14
14
|
};
|
15
|
-
return (React.createElement("div", {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
React.createElement(
|
15
|
+
return (React.createElement("div", { className: "answer-indicator-container", onClick: onClick, key: id },
|
16
|
+
React.createElement("div", { className: classNames('answer-indicator', {
|
17
|
+
ok: value,
|
18
|
+
error,
|
19
|
+
big: type === 'rich-text'
|
20
|
+
}), "data-indicator-id": id }, (answer === null || answer === void 0 ? void 0 : answer.type) === 'richText' && (React.createElement(React.Fragment, null,
|
21
|
+
(answerIsLongText && (answer === null || answer === void 0 ? void 0 : answer.characterCount) && React.createElement("span", null, answer.characterCount)) || '',
|
22
|
+
answerIsFormula && React.createElement("span", { className: "formula" }, "\u2211"),
|
23
|
+
answerIsImage && (React.createElement("span", { className: "img" },
|
24
|
+
React.createElement(FontAwesomeIcon, { icon: faImage, size: "lg" }))))))));
|
24
25
|
};
|
25
26
|
export const Indicator = memo(AnswerIndicator);
|
26
27
|
//# sourceMappingURL=AnswerIndicator.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AnswerIndicator.js","sourceRoot":"","sources":["../../../src/components/shared/AnswerIndicator.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AACnC,OAAO,UAAU,MAAM,YAAY,CAAA;AAEnC,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAU3D,MAAM,eAAe,GAAG,CAAC,KAAY,EAAE,EAAE;IACvC,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,KAAK,CAAA;IAExD,MAAM,KAAK,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,CAAA;IAC3B,MAAM,gBAAgB,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,MAAK,UA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x"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA
|
1
|
+
{"version":3,"file":"AnswerLengthInfo.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnswerLengthInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;;eAIoC,MAAM;SAAO,MAAM;;AAWhF,wBAA2C"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ExamComponentProps } from '../../createRenderChildNodes';
|
3
|
-
declare const mkAttachmentLink: (type:
|
3
|
+
declare const mkAttachmentLink: (type: "link" | "plain") => React.FunctionComponent<ExamComponentProps>;
|
4
4
|
export default mkAttachmentLink;
|
5
5
|
//# sourceMappingURL=AttachmentLink.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AttachmentLink.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AttachmentLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAOjE,QAAA,MAAM,gBAAgB,SAAU,MAAM,GAAG,OAAO,KAAG,
|
1
|
+
{"version":3,"file":"AttachmentLink.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AttachmentLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAOjE,QAAA,MAAM,gBAAgB,SAAU,MAAM,GAAG,OAAO,KAAG,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAyB5F,CAAA;AAED,eAAe,gBAAgB,CAAA"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { ExamComponentProps } from '../../createRenderChildNodes';
|
3
|
-
declare const mkAttachmentLinks: (type:
|
3
|
+
declare const mkAttachmentLinks: (type: "link" | "plain") => React.FunctionComponent<ExamComponentProps>;
|
4
4
|
export default mkAttachmentLinks;
|
5
5
|
//# sourceMappingURL=AttachmentLinks.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AttachmentLinks.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AttachmentLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAOjE,QAAA,MAAM,iBAAiB,SAAU,MAAM,GAAG,OAAO,KAAG,
|
1
|
+
{"version":3,"file":"AttachmentLinks.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AttachmentLinks.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAOjE,QAAA,MAAM,iBAAiB,SAAU,MAAM,GAAG,OAAO,KAAG,KAAK,CAAC,iBAAiB,CAAC,kBAAkB,CAmC7F,CAAA;AAgCD,eAAe,iBAAiB,CAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"References.d.ts","sourceRoot":"","sources":["../../../src/components/shared/References.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAA0B,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAUzF,iBAAS,UAAU,CAAC,MAAM,EAAE,kBAAkB,
|
1
|
+
{"version":3,"file":"References.d.ts","sourceRoot":"","sources":["../../../src/components/shared/References.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAA0B,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAUzF,iBAAS,UAAU,CAAC,MAAM,EAAE,kBAAkB,4BAwB7C;;AAED,wBAAqC"}
|
@@ -14,6 +14,7 @@ function References(_props) {
|
|
14
14
|
const internalReferences = queryAll(root, 'reference').filter(reference => queryAncestors(reference, 'external-material') == null);
|
15
15
|
return internalReferences.length > 0 ? (React.createElement(SectionElement, { "aria-labelledby": referencesTitleId },
|
16
16
|
React.createElement("h2", { id: referencesTitleId }, t('references.heading')),
|
17
|
+
React.createElement("div", { className: "anchor", id: "references" }),
|
17
18
|
React.createElement("ol", { className: "e-list-data", "data-annotation-anchor": referencesTitleId }, internalReferences.map((reference, i) => {
|
18
19
|
const question = queryAncestors(reference, 'question');
|
19
20
|
const displayNumber = question.getAttribute('display-number');
|