@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,54 +0,0 @@
|
|
1
|
-
import { textAnnotationFromRange } from './editAnnotations';
|
2
|
-
export function onMouseDownForAnnotation(e, mouseUpCallback) {
|
3
|
-
function onWindowMouseUpAfterAnswerMouseDown(e) {
|
4
|
-
const target = e.target;
|
5
|
-
window.removeEventListener('mouseup', onWindowMouseUpAfterAnswerMouseDown);
|
6
|
-
// Text annotation
|
7
|
-
const selection = window.getSelection();
|
8
|
-
if (selection && hasTextSelectedInAnswerText()) {
|
9
|
-
const range = selection.getRangeAt(0);
|
10
|
-
const position = textAnnotationFromRange(target, range);
|
11
|
-
if (!position) {
|
12
|
-
return;
|
13
|
-
}
|
14
|
-
const selectedText = selection.toString();
|
15
|
-
mouseUpCallback({ ...position, selectedText, range: selection.getRangeAt(0) });
|
16
|
-
}
|
17
|
-
}
|
18
|
-
const isReadOnly = false;
|
19
|
-
// Do annotations only with left mouse buttons and when permitted
|
20
|
-
if (isReadOnly || e.button !== 0) {
|
21
|
-
return;
|
22
|
-
}
|
23
|
-
window.addEventListener('mouseup', onWindowMouseUpAfterAnswerMouseDown);
|
24
|
-
}
|
25
|
-
export function hasTextSelectedInAnswerText() {
|
26
|
-
const selection = window.getSelection();
|
27
|
-
return (selection !== null &&
|
28
|
-
selectionInAnswerText(selection) &&
|
29
|
-
(isRangeSelection(selection) || textSelectedInRange(selection)));
|
30
|
-
function selectionInAnswerText(sel) {
|
31
|
-
if (sel.type === 'None' || sel.type === 'Caret' || sel.rangeCount === 0) {
|
32
|
-
return false;
|
33
|
-
}
|
34
|
-
const startContainer = sel.getRangeAt(0).startContainer;
|
35
|
-
const endContainer = sel.getRangeAt(0).endContainer;
|
36
|
-
const startParent = startContainer.parentElement;
|
37
|
-
const endParent = endContainer.parentElement;
|
38
|
-
return sel.rangeCount > 0 && startParent === endParent;
|
39
|
-
}
|
40
|
-
function isRangeSelection(sel) {
|
41
|
-
return (sel === null || sel === void 0 ? void 0 : sel.type) === 'Range';
|
42
|
-
}
|
43
|
-
function textSelectedInRange(sel) {
|
44
|
-
const range = sel.getRangeAt(0);
|
45
|
-
return (!!sel.rangeCount &&
|
46
|
-
(range.toString().length > 0 ||
|
47
|
-
isParentContainer(range.startContainer) ||
|
48
|
-
isParentContainer(range.endContainer)));
|
49
|
-
}
|
50
|
-
function isParentContainer(container) {
|
51
|
-
return container.classList.contains('answer');
|
52
|
-
}
|
53
|
-
}
|
54
|
-
//# sourceMappingURL=reactAnnotation.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"reactAnnotation.js","sourceRoot":"","sources":["../../../src/components/grading/reactAnnotation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAG3D,MAAM,UAAU,wBAAwB,CAAC,CAAmB,EAAE,eAAiC;IAC7F,SAAS,mCAAmC,CAAC,CAAa;QACxD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAqB,CAAA;QACtC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAA;QAE1E,kBAAkB;QAClB,MAAM,SAAS,GAAG,MAAM,CAAC,YAA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AC,CAAC,CAAC,YAAY,CAAA;QACnD,MAAM,WAAW,GAAG,cAAc,CAAC,aAAa,CAAA;QAChD,MAAM,SAAS,GAAG,YAAY,CAAC,aAAa,CAAA;QAC5C,OAAO,GAAG,CAAC,UAAU,GAAG,CAAC,IAAI,WAAW,KAAK,SAAS,CAAA;IACxD,CAAC;IAED,SAAS,gBAAgB,CAAC,GAAc;QACtC,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,MAAK,OAAO,CAAA;IAC9B,CAAC;IAED,SAAS,mBAAmB,CAAC,GAAc;QACzC,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QAC/B,OAAO,CACL,CAAC,CAAC,GAAG,CAAC,UAAU;YAChB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,MAAM,GAAG,CAAC;gBAC1B,iBAAiB,CAAC,KAAK,CAAC,cAAyB,CAAC;gBAClD,iBAAiB,CAAC,KAAK,CAAC,YAAuB,CAAC,CAAC,CACpD,CAAA;IACH,CAAC;IAED,SAAS,iBAAiB,CAAC,SAAkB;QAC3C,OAAO,SAAS,CAAC,SAAS,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"isExamFinishPageHook.d.ts","sourceRoot":"","sources":["../../../src/components/results/isExamFinishPageHook.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B,eAGvC,CAAA"}
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { useContext } from 'react';
|
2
|
-
import { ResultsContext } from '../context/ResultsContext';
|
3
|
-
export const useIsStudentsFinishExamPage = () => {
|
4
|
-
const { gradingStructure } = useContext(ResultsContext);
|
5
|
-
return gradingStructure === undefined;
|
6
|
-
};
|
7
|
-
//# sourceMappingURL=isExamFinishPageHook.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"isExamFinishPageHook.js","sourceRoot":"","sources":["../../../src/components/results/isExamFinishPageHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,EAAE;IAC9C,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACvD,OAAO,gBAAgB,KAAK,SAAS,CAAA;AACvC,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CreateAnnotationPopup.d.ts","sourceRoot":"","sources":["../../../src/components/shared/CreateAnnotationPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,wBAAgB,qBAAqB,CAAC,EACpC,aAAa,EACb,WAAW,EACZ,EAAE;IACD,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC,WAAW,EAAE,MAAM,IAAI,CAAA;CACxB,qBAyBA"}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import React, { useState } from 'react';
|
2
|
-
export function CreateAnnotationPopup({ updateComment, closeEditor }) {
|
3
|
-
const [comment, setComment] = useState('');
|
4
|
-
return (React.createElement("span", { className: "annotation-popup", style: { position: 'absolute' } },
|
5
|
-
React.createElement("textarea", { className: "comment-content", role: "textbox", "aria-multiline": "true", onChange: e => setComment(e.target.value), value: comment, autoFocus: true }),
|
6
|
-
React.createElement("span", { className: "comment-button-area" },
|
7
|
-
React.createElement("span", null,
|
8
|
-
React.createElement("button", { onClick: () => updateComment(comment), disabled: comment.trim().length === 0 }, "Vastaa"),
|
9
|
-
React.createElement("button", { className: "text-button", onClick: () => closeEditor() }, "Peru")))));
|
10
|
-
}
|
11
|
-
//# sourceMappingURL=CreateAnnotationPopup.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CreateAnnotationPopup.js","sourceRoot":"","sources":["../../../src/components/shared/CreateAnnotationPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEvC,MAAM,UAAU,qBAAqB,CAAC,EACpC,aAAa,EACb,WAAW,EAIZ;IACC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAA;IAElD,OAAO,CACL,8BAAM,SAAS,EAAC,kBAAkB,EAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE;QAChE,kCACE,SAAS,EAAC,iBAAiB,EAC3B,IAAI,EAAC,SAAS,oBACC,MAAM,EACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EACzC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,IAAI,GACf;QACF,8BAAM,SAAS,EAAC,qBAAqB;YACnC;gBACE,gCAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,aAE3E;gBACT,gCAAQ,SAAS,EAAC,aAAa,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,EAAE,WAEnD,CACJ,CACF,CACF,CACR,CAAA;AACH,CAAC"}
|