@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.
Files changed (121) hide show
  1. package/dist/__tests__/annotations.test.d.ts.map +1 -1
  2. package/dist/__tests__/annotations.test.js +31 -20
  3. package/dist/__tests__/annotations.test.js.map +1 -1
  4. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  5. package/dist/components/RenderIf.d.ts.map +1 -1
  6. package/dist/components/attachments/Attachments.d.ts.map +1 -1
  7. package/dist/components/attachments/Attachments.js +7 -9
  8. package/dist/components/attachments/Attachments.js.map +1 -1
  9. package/dist/components/context/AnnotationProvider.d.ts.map +1 -1
  10. package/dist/components/context/AnnotationProvider.js +18 -2
  11. package/dist/components/context/AnnotationProvider.js.map +1 -1
  12. package/dist/components/context/GradingInstructionContext.d.ts +9 -0
  13. package/dist/components/context/GradingInstructionContext.d.ts.map +1 -0
  14. package/dist/components/context/GradingInstructionContext.js +3 -0
  15. package/dist/components/context/GradingInstructionContext.js.map +1 -0
  16. package/dist/components/context/IsInSidebarContext.d.ts +0 -1
  17. package/dist/components/context/IsInSidebarContext.d.ts.map +1 -1
  18. package/dist/components/context/ResultsContext.d.ts.map +1 -1
  19. package/dist/components/context/ResultsContext.js.map +1 -1
  20. package/dist/components/context/TOCContext.d.ts +0 -1
  21. package/dist/components/context/TOCContext.d.ts.map +1 -1
  22. package/dist/components/context/withContext.d.ts.map +1 -1
  23. package/dist/components/exam/ChoiceAnswer.d.ts.map +1 -1
  24. package/dist/components/exam/ChoiceAnswer.js +16 -14
  25. package/dist/components/exam/ChoiceAnswer.js.map +1 -1
  26. package/dist/components/exam/Exam.d.ts.map +1 -1
  27. package/dist/components/exam/Exam.js +0 -2
  28. package/dist/components/exam/Exam.js.map +1 -1
  29. package/dist/components/exam/FinishExam.d.ts.map +1 -1
  30. package/dist/components/exam/FinishExam.js +3 -7
  31. package/dist/components/exam/FinishExam.js.map +1 -1
  32. package/dist/components/exam/RichTextAnswer.d.ts +1 -1
  33. package/dist/components/exam/RichTextAnswer.d.ts.map +1 -1
  34. package/dist/components/exam/TextAnswer.d.ts.map +1 -1
  35. package/dist/components/exam/TextAnswer.js +6 -4
  36. package/dist/components/exam/TextAnswer.js.map +1 -1
  37. package/dist/components/exam/internal/ProgressBar.d.ts.map +1 -1
  38. package/dist/components/exam/internal/ProgressBar.js +1 -0
  39. package/dist/components/exam/internal/ProgressBar.js.map +1 -1
  40. package/dist/components/grading/editAnnotations.d.ts.map +1 -1
  41. package/dist/components/grading/editAnnotations.js +2 -1
  42. package/dist/components/grading/editAnnotations.js.map +1 -1
  43. package/dist/components/grading/examAnnotationUtils.d.ts +0 -1
  44. package/dist/components/grading/examAnnotationUtils.d.ts.map +1 -1
  45. package/dist/components/grading/examAnnotationUtils.js +26 -33
  46. package/dist/components/grading/examAnnotationUtils.js.map +1 -1
  47. package/dist/components/grading-instructions/AnswerGradingInstruction.d.ts.map +1 -1
  48. package/dist/components/grading-instructions/AnswerGradingInstruction.js +7 -2
  49. package/dist/components/grading-instructions/AnswerGradingInstruction.js.map +1 -1
  50. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts +5 -0
  51. package/dist/components/grading-instructions/EditableGradingInstruction.d.ts.map +1 -0
  52. package/dist/components/grading-instructions/EditableGradingInstruction.js +25 -0
  53. package/dist/components/grading-instructions/EditableGradingInstruction.js.map +1 -0
  54. package/dist/components/grading-instructions/ExamGradingInstruction.d.ts.map +1 -1
  55. package/dist/components/grading-instructions/ExamGradingInstruction.js +7 -2
  56. package/dist/components/grading-instructions/ExamGradingInstruction.js.map +1 -1
  57. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts +9 -0
  58. package/dist/components/grading-instructions/GradingInstructionProvider.d.ts.map +1 -0
  59. package/dist/components/grading-instructions/GradingInstructionProvider.js +8 -0
  60. package/dist/components/grading-instructions/GradingInstructionProvider.js.map +1 -0
  61. package/dist/components/grading-instructions/GradingInstructions.d.ts +2 -1
  62. package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
  63. package/dist/components/grading-instructions/GradingInstructions.js +40 -40
  64. package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
  65. package/dist/components/shared/AnnotatableText.d.ts +2 -4
  66. package/dist/components/shared/AnnotatableText.d.ts.map +1 -1
  67. package/dist/components/shared/AnnotatableText.js +19 -19
  68. package/dist/components/shared/AnnotatableText.js.map +1 -1
  69. package/dist/components/shared/AnswerIndicator.d.ts +1 -1
  70. package/dist/components/shared/AnswerIndicator.d.ts.map +1 -1
  71. package/dist/components/shared/AnswerIndicator.js +10 -9
  72. package/dist/components/shared/AnswerIndicator.js.map +1 -1
  73. package/dist/components/shared/AnswerLengthInfo.d.ts +1 -1
  74. package/dist/components/shared/AnswerLengthInfo.d.ts.map +1 -1
  75. package/dist/components/shared/AttachmentLink.d.ts +1 -1
  76. package/dist/components/shared/AttachmentLink.d.ts.map +1 -1
  77. package/dist/components/shared/AttachmentLinks.d.ts +1 -1
  78. package/dist/components/shared/AttachmentLinks.d.ts.map +1 -1
  79. package/dist/components/shared/References.d.ts.map +1 -1
  80. package/dist/components/shared/References.js +1 -0
  81. package/dist/components/shared/References.js.map +1 -1
  82. package/dist/components/shared/TOCQuestion.js +1 -1
  83. package/dist/components/shared/TOCQuestion.js.map +1 -1
  84. package/dist/createRenderChildNodes.d.ts.map +1 -1
  85. package/dist/createRenderChildNodes.js +2 -12
  86. package/dist/createRenderChildNodes.js.map +1 -1
  87. package/dist/i18n/index.d.ts +1 -2
  88. package/dist/i18n/index.d.ts.map +1 -1
  89. package/dist/i18n/index.js.map +1 -1
  90. package/dist/main-bundle.js +1 -1
  91. package/dist/main.css +1 -1
  92. package/dist/store/answers/reducer.d.ts.map +1 -1
  93. package/dist/store/audio/reducer.d.ts.map +1 -1
  94. package/dist/store/audio/sagas.d.ts.map +1 -1
  95. package/dist/store/audio/sagas.js +3 -1
  96. package/dist/store/audio/sagas.js.map +1 -1
  97. package/dist/store/cas/reducer.d.ts.map +1 -1
  98. package/dist/store/index.d.ts +1 -2
  99. package/dist/store/index.d.ts.map +1 -1
  100. package/dist/store/selectors.d.ts +1 -1
  101. package/package.json +4 -4
  102. package/dist/components/context/AnnotationContext.d.ts +0 -8
  103. package/dist/components/context/AnnotationContext.d.ts.map +0 -1
  104. package/dist/components/context/AnnotationContext.js +0 -3
  105. package/dist/components/context/AnnotationContext.js.map +0 -1
  106. package/dist/components/exam/ExamineExam.d.ts +0 -5
  107. package/dist/components/exam/ExamineExam.d.ts.map +0 -1
  108. package/dist/components/exam/ExamineExam.js +0 -20
  109. package/dist/components/exam/ExamineExam.js.map +0 -1
  110. package/dist/components/grading/reactAnnotation.d.ts +0 -4
  111. package/dist/components/grading/reactAnnotation.d.ts.map +0 -1
  112. package/dist/components/grading/reactAnnotation.js +0 -54
  113. package/dist/components/grading/reactAnnotation.js.map +0 -1
  114. package/dist/components/results/isExamFinishPageHook.d.ts +0 -2
  115. package/dist/components/results/isExamFinishPageHook.d.ts.map +0 -1
  116. package/dist/components/results/isExamFinishPageHook.js +0 -7
  117. package/dist/components/results/isExamFinishPageHook.js.map +0 -1
  118. package/dist/components/shared/CreateAnnotationPopup.d.ts +0 -6
  119. package/dist/components/shared/CreateAnnotationPopup.d.ts.map +0 -1
  120. package/dist/components/shared/CreateAnnotationPopup.js +0 -11
  121. 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,YAAY,EAAE,CAAA;QACvC,IAAI,SAAS,I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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,2 +0,0 @@
1
- export declare const useIsStudentsFinishExamPage: () => boolean;
2
- //# sourceMappingURL=isExamFinishPageHook.d.ts.map
@@ -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,6 +0,0 @@
1
- import React from 'react';
2
- export declare function CreateAnnotationPopup({ updateComment, closeEditor }: {
3
- updateComment: (value: string) => void;
4
- closeEditor: () => void;
5
- }): React.JSX.Element;
6
- //# sourceMappingURL=CreateAnnotationPopup.d.ts.map
@@ -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"}