@digabi/exam-engine-core 20.4.2 → 21.0.0-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. package/dist/__tests__/annotations.test.d.ts.map +1 -1
  2. package/dist/__tests__/annotations.test.js +109 -68
  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 +7 -2
  10. package/dist/components/context/AnnotationProvider.d.ts.map +1 -1
  11. package/dist/components/context/AnnotationProvider.js +29 -3
  12. package/dist/components/context/AnnotationProvider.js.map +1 -1
  13. package/dist/components/context/IsInSidebarContext.d.ts +0 -1
  14. package/dist/components/context/IsInSidebarContext.d.ts.map +1 -1
  15. package/dist/components/context/ResultsContext.d.ts.map +1 -1
  16. package/dist/components/context/ResultsContext.js.map +1 -1
  17. package/dist/components/context/TOCContext.d.ts +0 -1
  18. package/dist/components/context/TOCContext.d.ts.map +1 -1
  19. package/dist/components/context/withContext.d.ts.map +1 -1
  20. package/dist/components/exam/ChoiceAnswer.d.ts.map +1 -1
  21. package/dist/components/exam/ChoiceAnswer.js +16 -14
  22. package/dist/components/exam/ChoiceAnswer.js.map +1 -1
  23. package/dist/components/exam/Exam.d.ts +4 -4
  24. package/dist/components/exam/Exam.d.ts.map +1 -1
  25. package/dist/components/exam/Exam.js +0 -2
  26. package/dist/components/exam/Exam.js.map +1 -1
  27. package/dist/components/exam/RichTextAnswer.d.ts +1 -1
  28. package/dist/components/exam/RichTextAnswer.d.ts.map +1 -1
  29. package/dist/components/exam/TextAnswer.d.ts.map +1 -1
  30. package/dist/components/exam/TextAnswer.js +6 -4
  31. package/dist/components/exam/TextAnswer.js.map +1 -1
  32. package/dist/components/exam/internal/ProgressBar.d.ts.map +1 -1
  33. package/dist/components/exam/internal/ProgressBar.js +1 -0
  34. package/dist/components/exam/internal/ProgressBar.js.map +1 -1
  35. package/dist/components/grading/editAnnotations.d.ts.map +1 -1
  36. package/dist/components/grading/editAnnotations.js +2 -1
  37. package/dist/components/grading/editAnnotations.js.map +1 -1
  38. package/dist/components/grading/examAnnotationUtils.d.ts +0 -1
  39. package/dist/components/grading/examAnnotationUtils.d.ts.map +1 -1
  40. package/dist/components/grading/examAnnotationUtils.js +88 -35
  41. package/dist/components/grading/examAnnotationUtils.js.map +1 -1
  42. package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
  43. package/dist/components/grading-instructions/GradingInstructions.js +23 -25
  44. package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
  45. package/dist/components/shared/AnnotatableText.d.ts +4 -4
  46. package/dist/components/shared/AnnotatableText.d.ts.map +1 -1
  47. package/dist/components/shared/AnnotatableText.js +59 -55
  48. package/dist/components/shared/AnnotatableText.js.map +1 -1
  49. package/dist/components/shared/AnnotationPopup.js +4 -4
  50. package/dist/components/shared/AnnotationPopup.js.map +1 -1
  51. package/dist/components/shared/AnswerIndicator.d.ts +1 -1
  52. package/dist/components/shared/AnswerIndicator.d.ts.map +1 -1
  53. package/dist/components/shared/AnswerIndicator.js +10 -9
  54. package/dist/components/shared/AnswerIndicator.js.map +1 -1
  55. package/dist/components/shared/AnswerLengthInfo.d.ts +1 -1
  56. package/dist/components/shared/AnswerLengthInfo.d.ts.map +1 -1
  57. package/dist/components/shared/AttachmentLink.d.ts +1 -1
  58. package/dist/components/shared/AttachmentLink.d.ts.map +1 -1
  59. package/dist/components/shared/AttachmentLinks.d.ts +1 -1
  60. package/dist/components/shared/AttachmentLinks.d.ts.map +1 -1
  61. package/dist/components/shared/References.d.ts.map +1 -1
  62. package/dist/components/shared/References.js +1 -0
  63. package/dist/components/shared/References.js.map +1 -1
  64. package/dist/components/shared/TOCQuestion.js +1 -1
  65. package/dist/components/shared/TOCQuestion.js.map +1 -1
  66. package/dist/createRenderChildNodes.d.ts.map +1 -1
  67. package/dist/createRenderChildNodes.js +2 -12
  68. package/dist/createRenderChildNodes.js.map +1 -1
  69. package/dist/dom-utils.js +2 -2
  70. package/dist/dom-utils.js.map +1 -1
  71. package/dist/i18n/index.d.ts +1 -2
  72. package/dist/i18n/index.d.ts.map +1 -1
  73. package/dist/i18n/index.js.map +1 -1
  74. package/dist/main-bundle.js +1 -1
  75. package/dist/main.css +1 -1
  76. package/dist/store/answers/reducer.d.ts.map +1 -1
  77. package/dist/store/audio/reducer.d.ts.map +1 -1
  78. package/dist/store/audio/sagas.d.ts.map +1 -1
  79. package/dist/store/audio/sagas.js +3 -1
  80. package/dist/store/audio/sagas.js.map +1 -1
  81. package/dist/store/cas/reducer.d.ts.map +1 -1
  82. package/dist/store/index.d.ts +1 -2
  83. package/dist/store/index.d.ts.map +1 -1
  84. package/dist/store/selectors.d.ts +1 -1
  85. package/dist/types/Score.d.ts +17 -3
  86. package/dist/types/Score.d.ts.map +1 -1
  87. package/package.json +4 -4
@@ -1,18 +1,30 @@
1
1
  import { textAnnotationFromRange } from './editAnnotations';
2
2
  export function onMouseDownForAnnotation(e, mouseUpCallback) {
3
- function onMouseUpAfterAnswerMouseDown(e) {
4
- const target = e.target;
3
+ function onMouseUpAfterAnswerMouseDown() {
4
+ var _a, _b;
5
5
  window.removeEventListener('mouseup', onMouseUpAfterAnswerMouseDown);
6
- // Text annotation
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
- if (selection && hasTextSelectedInAnswerText()) {
9
- const range = selection.getRangeAt(0);
10
- const position = textAnnotationFromRange(target, range);
11
- if (!position) {
12
- return;
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
+ if (selection && startNode && endNode && selection.toString().length > 0) {
14
+ const hasMarks = selectionContainsNonhiddenMarks(selection);
15
+ const startNodedisplayNumber = getDisplayNumber(startNode);
16
+ const endNodeDisplayNumber = getDisplayNumber(endNode);
17
+ if (startNodedisplayNumber === endNodeDisplayNumber &&
18
+ isAnnotatable(startNode) &&
19
+ isAnnotatable(endNode) &&
20
+ !hasMarks) {
21
+ const annotations = extractAnnotationsFromSelection(selection);
22
+ mouseUpCallback({
23
+ annotationParts: annotations,
24
+ displayNumber: startNodedisplayNumber,
25
+ selectedText: annotations.map(a => a.selectedText).join(' ')
26
+ });
13
27
  }
14
- const selectedText = selection.toString();
15
- mouseUpCallback({ ...position, selectedText });
16
28
  }
17
29
  }
18
30
  // Do annotations only with left mouse buttons
@@ -21,31 +33,72 @@ export function onMouseDownForAnnotation(e, mouseUpCallback) {
21
33
  }
22
34
  window.addEventListener('mouseup', onMouseUpAfterAnswerMouseDown);
23
35
  }
24
- export function hasTextSelectedInAnswerText() {
25
- const selection = window.getSelection();
26
- return (selection !== null &&
27
- selectionInAnswerText(selection) &&
28
- (isRangeSelection(selection) || textSelectedInRange(selection)));
29
- function selectionInAnswerText(sel) {
30
- if (sel.type === 'None' || sel.type === 'Caret' || sel.rangeCount === 0) {
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';
36
+ const selectionContainsNonhiddenMarks = (selection) => {
37
+ const rangeChildren = Array.from(selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0).cloneContents().children);
38
+ const childIsNonHiddenMark = rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.some(child => child.tagName === 'MARK' && child.getAttribute('data-hidden') === 'false');
39
+ const childContainsNonHiddenMark = rangeChildren.some(child => child.querySelector('mark[data-hidden="false"]'));
40
+ return childIsNonHiddenMark || childContainsNonHiddenMark;
41
+ };
42
+ const getDisplayNumber = (node) => { var _a; return (_a = node === null || node === void 0 ? void 0 : node.closest('div[data-annotation-anchor]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-annotation-anchor'); };
43
+ const isAnnotatable = (node) => (node === null || node === void 0 ? void 0 : node.getAttribute('data-annotation-path')) && node.tagName !== 'MARK';
44
+ const extractAnnotationsFromSelection = (selection) => {
45
+ var _a, _b;
46
+ const range = selection.getRangeAt(0);
47
+ const rangeChildren = Array.from(selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0).cloneContents().children);
48
+ const firstSelectedNodeInDOM = range.startContainer.parentElement;
49
+ if (!(rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.length)) {
50
+ // selection is plain text
51
+ const annotationAnchor = (_b = (_a = selection === null || selection === void 0 ? void 0 : selection.focusNode) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.getAttribute('data-annotation-path');
52
+ const startAndLength = textAnnotationFromRange(firstSelectedNodeInDOM, range);
53
+ return [
54
+ {
55
+ annotationAnchor,
56
+ selectedText: (selection === null || selection === void 0 ? void 0 : selection.toString()) || '',
57
+ startIndex: (startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.startIndex) || 0,
58
+ length: (startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.length) || 0
59
+ }
60
+ ];
45
61
  }
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;
62
+ else {
63
+ // selection is in multiple elements
64
+ const annotations = rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.reduce((acc, child, index, arr) => {
65
+ var _a;
66
+ const childsAnnotationPath = child.getAttribute('data-annotation-path');
67
+ const isLastRangeChild = index === arr.length - 1;
68
+ if (childsAnnotationPath) {
69
+ // child is a text node, like <span> text </span>
70
+ const newElement = {
71
+ annotationAnchor: childsAnnotationPath,
72
+ selectedText: child.textContent || '',
73
+ startIndex: index === 0 ? range.startOffset : 0,
74
+ length: isLastRangeChild ? range.endOffset : ((_a = child.textContent) === null || _a === void 0 ? void 0 : _a.length) || 0
75
+ };
76
+ return [...acc, newElement];
77
+ }
78
+ else {
79
+ // child is a node with children, like <b> <span> text </span> </b>
80
+ const allChildrenWithAnnotationPath = child.querySelectorAll('[data-annotation-path]');
81
+ allChildrenWithAnnotationPath === null || allChildrenWithAnnotationPath === void 0 ? void 0 : allChildrenWithAnnotationPath.forEach((grandChild, kidIndex) => {
82
+ var _a;
83
+ const dataAnnotationPath = grandChild.getAttribute('data-annotation-path');
84
+ if (dataAnnotationPath) {
85
+ const isFirstOfAll = index === 0 && kidIndex === 0;
86
+ const isLastGrandChild = kidIndex === allChildrenWithAnnotationPath.length - 1;
87
+ const isLastOfAll = isLastRangeChild && isLastGrandChild;
88
+ const startAndLength = textAnnotationFromRange(firstSelectedNodeInDOM, range);
89
+ const newElement = {
90
+ annotationAnchor: dataAnnotationPath,
91
+ selectedText: grandChild.textContent || '',
92
+ startIndex: isFirstOfAll ? (startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.startIndex) || 0 : 0,
93
+ length: isLastOfAll ? range.endOffset : ((_a = grandChild.textContent) === null || _a === void 0 ? void 0 : _a.length) || 0
94
+ };
95
+ acc.push(newElement);
96
+ }
97
+ });
98
+ return acc;
99
+ }
100
+ }, []);
101
+ return annotations;
49
102
  }
50
- }
103
+ };
51
104
  //# 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,CAAa;QAClD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAqB,CAAA;QACtC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAA;QAEpE,kBAAkB;QAClB,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAA;QACvC,IAAI,SAAS,IAAI,2BAA2B,EAAE,EAAE,CAAC;YAC/C,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;YACrC,MAAM,QAAQ,GAAG,uBAAuB,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;YACvD,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,OAAM;YACR,CAAC;YACD,MAAM,YAAY,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAA;YACzC,eAAe,CAAC,EAAE,GAAG,QAAQ,EAAE,YAAY,EAAE,CAAC,CAAA;QAChD,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,MAAM,UAAU,2BAA2B;IACzC,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAA;IAEvC,OAAO,CACL,SAAS,KAAK,IAAI;QAClB,qBAAqB,CAAC,SAAS,CAAC;QAChC,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAChE,CAAA;IAED,SAAS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AAC,CAAC;4BAC9D,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA,MAAA,UAAU,CAAC,WAAW,0CAAE,MAAM,KAAI,CAAC;yBAC5E,CAAA;wBACD,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;oBACtB,CAAC;gBACH,CAAC,CAAC,CAAA;gBACF,OAAO,GAAG,CAAA;YACZ,CAAC;QACH,CAAC,EAAE,EAAsB,CAAC,CAAA;QAE1B,OAAO,WAAW,CAAA;IACpB,CAAC;AACH,CAAC,CAAA"}
@@ -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;AACpD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AA6I/D,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,iBAGhD,CAAA;;AAED,wBAAqE"}
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;AA8H/D,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,iBAGhD,CAAA;;AAED,wBAAqE"}
@@ -1,36 +1,35 @@
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 { mkTableOfContents } from '../shared/TableOfContents';
25
- import AnswerGradingInstruction from './AnswerGradingInstruction';
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 { AnnotationProvider } from '../context/AnnotationProvider';
33
- import { AnnotationPopup } from '../shared/AnnotationPopup';
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';
34
33
  const renderIfWithinGradingInstructionContent = renderIf(({ element }) => queryAncestors(element, [
35
34
  // Keep in sync with lists in mastering/index.ts
36
35
  'answer-grading-instruction',
@@ -88,7 +87,6 @@ const GradingInstructions = ({ doc, annotations, onClickAnnotation, onSaveAnnota
88
87
  return (React.createElement(AnnotationProvider, { annotations: annotations, onClickAnnotation: onClickAnnotation, onSaveAnnotation: onSaveAnnotation },
89
88
  React.createElement(I18nextProvider, { i18n: i18n },
90
89
  React.createElement("main", { className: "e-exam e-grading-instructions", lang: subjectLanguage },
91
- React.createElement(AnnotationPopup, null),
92
90
  React.createElement(React.StrictMode, null),
93
91
  React.createElement(SectionElement, { "aria-labelledby": examTitleId },
94
92
  React.createElement(DocumentTitle, { id: examTitleId },
@@ -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;AAEpD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACvF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,OAAO,MAAM,WAAW,CAAA;AAC/B,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,QAAQ,MAAM,YAAY,CAAA;AACjC,OAAO,IAAI,MAAM,gBAAgB,CAAA;AACjC,OAAO,sBAA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,MAAM,CAAC,IAAI,CAAC,CAAU,CAC/C,CACL;oBACA,sBAAsB,IAAI,CACzB,oBAAC,sBAAsB,IAAO,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,GAAM,CACtF;oBACA,eAAe,IAAI,CAClB,6BAAK,SAAS,EAAC,oBAAoB;wBACjC,oBAAC,eAAe,IAAO,OAAO,EAAE,eAAe,EAAE,gBAAgB,GAAM,CACnE,CACP,CACc;gBAChB,gBAAgB,CAAC,IAAI,CAAC,CAClB,CACS,CACC,CACtB,CAAA;AACH,CAAC,CAAA;AAED,4FAA4F;AAC5F,MAAM,CAAC,MAAM,4BAA4B,GAA4B,GAAG,EAAE;IACxE,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,OAAO,0CAAG,CAAC,CAAC,iCAAiC,CAAC,CAAI,CAAA;AACpD,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC,CAAA"}
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;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAC5C,OAAO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,IAAI,CACzB,oBAAC,sBAAsB,IAAO,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,GAAM,CACtF;oBACA,eAAe,IAAI,CAClB,6BAAK,SAAS,EAAC,oBAAoB;wBACjC,oBAAC,eAAe,IAAO,OAAO,EAAE,eAAe,EAAE,gBAAgB,GAAM,CACnE,CACP,CACc;gBAChB,gBAAgB,CAAC,IAAI,CAAC,CAClB,CACS,CACC,CACtB,CAAA;AACH,CAAC,CAAA;AAED,4FAA4F;AAC5F,MAAM,CAAC,MAAM,4BAA4B,GAA4B,GAAG,EAAE;IACxE,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,OAAO,0CAAG,CAAC,CAAC,iCAAiC,CAAC,CAAI,CAAA;AACpD,CAAC,CAAA;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,CAAC,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import { AnnotationContextType } from '../context/AnnotationProvider';
3
- export declare const AnnotatableText: ({ node, annotationContextData }: {
2
+ import { NewRenderableAnnotation, RenderableAnnotation } from '../../types/Score';
3
+ export declare const AnnotatableText: ({ node }: {
4
4
  node: Node;
5
- annotationContextData: AnnotationContextType;
6
- }) => React.JSX.Element;
5
+ }) => string | React.JSX.Element;
6
+ export declare function markText(text: string, annotations: (RenderableAnnotation | NewRenderableAnnotation)[], onClickAnnotation: (e: React.MouseEvent<HTMLElement, MouseEvent>, a: RenderableAnnotation) => void, setNewAnnotationRef: (ref: HTMLElement | undefined) => void): React.ReactNode[];
7
7
  //# 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,KAA4B,MAAM,OAAO,CAAA;AAGhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAMrE,eAAO,MAAM,eAAe,oCAGzB;IACD,IAAI,EAAE,IAAI,CAAA;IACV,qBAAqB,EAAE,qBAAqB,CAAA;CAC7C,sBAqGA,CAAA"}
1
+ {"version":3,"file":"AnnotatableText.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnnotatableText.tsx"],"names":[],"mappings":"AACA,OAAO,KAAwC,MAAM,OAAO,CAAA;AAE5D,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAQjF,eAAO,MAAM,eAAe,aAAc;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,+BAkCvD,CAAA;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,CAAC,oBAAoB,GAAG,uBAAuB,CAAC,EAAE,EAC/D,iBAAiB,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,CAAC,EAAE,oBAAoB,KAAK,IAAI,EAClG,mBAAmB,EAAE,CAAC,GAAG,EAAE,WAAW,GAAG,SAAS,KAAK,IAAI,qBAyF5D"}
@@ -1,64 +1,68 @@
1
1
  import { partition } from 'lodash-es';
2
- import React, { useEffect, useRef } from 'react';
3
- import { getElementPath, queryAncestors } from '../../dom-utils';
4
- import { onMouseDownForAnnotation } from '../grading/examAnnotationUtils';
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, annotationContextData }) => {
7
- const { annotations, onClickAnnotation, setNewAnnotation, setNewAnnotationRef, newAnnotation } = annotationContextData;
7
+ export const AnnotatableText = ({ node }) => {
8
+ var _a, _b;
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
- const newAnnotationForThisNode = (newAnnotation === null || newAnnotation === void 0 ? void 0 : newAnnotation.annotationAnchor) === path ? newAnnotation : null;
10
- const thisNodeAnnotations = [
11
- ...((annotations === null || annotations === void 0 ? void 0 : annotations[path]) || []),
12
- ...(newAnnotationForThisNode ? [newAnnotationForThisNode] : [])
13
- ];
14
- const mouseUpCallback = (annotation) => {
15
- var _a;
16
- const displayNumber = ((_a = queryAncestors(node.parentElement, 'question')) === null || _a === void 0 ? void 0 : _a.getAttribute('display-number')) || '';
17
- setNewAnnotation({ ...annotation, annotationAnchor: path, displayNumber });
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);
19
+ const newAnnotationPartsForThisNode = ((_b = newAnnotation === null || newAnnotation === void 0 ? void 0 : newAnnotation.annotationParts) === null || _b === void 0 ? void 0 : _b.filter(p => p.annotationAnchor === path)) || [];
20
+ const savedAnnotationsForThisNode = (annotations === null || annotations === void 0 ? void 0 : annotations[path]) || [];
21
+ const allAnnotationsForThisNode = [...savedAnnotationsForThisNode, ...newAnnotationPartsForThisNode];
22
+ const textWithoutLineBreaksAndExtraSpaces = node.textContent.replace(/\n/g, ' ').replace(/\s+/g, ' ');
23
+ return (React.createElement("span", { className: "e-annotatable", key: path, "data-annotation-path": path, "data-testid": path }, allAnnotationsForThisNode.length > 0 && onClickAnnotation
24
+ ? markText(textWithoutLineBreaksAndExtraSpaces, allAnnotationsForThisNode, onClickAnnotation, setNewAnnotationRef)
25
+ : textWithoutLineBreaksAndExtraSpaces));
26
+ };
27
+ export function markText(text, annotations, onClickAnnotation, setNewAnnotationRef) {
28
+ if (annotations.length === 0) {
29
+ return [text];
26
30
  }
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));
28
- function markText(text, annotations) {
29
- if (annotations.length === 0) {
30
- return [text];
31
- }
32
- function getMarkedText(annotation) {
33
- return text.substring(annotation.startIndex, annotation.startIndex + annotation.length);
34
- }
35
- const nodes = [];
36
- let lastIndex = 0;
37
- annotations.sort((a, b) => a.startIndex - b.startIndex);
38
- const [validAnnotations, invalidAnnotations] = partition(annotations, annotation => annotation.startIndex >= 0 && annotation.length > 0 && annotation.selectedText === getMarkedText(annotation));
39
- if (invalidAnnotations.length > 0) {
40
- console.error('Invalid annotations:', invalidAnnotations, invalidAnnotations.map(a => `selectedText (${a.selectedText}) does not match text picked by startIndex and length (${getMarkedText(a)})`));
31
+ function getMarkedText(annotation) {
32
+ return text.substring(annotation.startIndex, annotation.startIndex + annotation.length);
33
+ }
34
+ const nodes = [];
35
+ annotations.sort((a, b) => a.startIndex - b.startIndex);
36
+ const [validAnnotations, invalidAnnotations] = partition(annotations, annotation => annotation.startIndex >= 0 && annotation.length > 0 && annotation.selectedText === getMarkedText(annotation));
37
+ if ((invalidAnnotations === null || invalidAnnotations === void 0 ? void 0 : invalidAnnotations.length) > 0) {
38
+ console.error('Invalid annotations:', invalidAnnotations, invalidAnnotations.map(a => `selectedText (${a.selectedText}) does not match text picked by startIndex and length (${getMarkedText(a)})`));
39
+ }
40
+ let lastIndex = 0;
41
+ const [hiddenAnnotations, visibleAnnotations] = partition(validAnnotations, a => a.hidden);
42
+ const getKey = (annotation) => isExamAnnotation(annotation) ? annotation.annotationId + annotation.startIndex : annotation.startIndex;
43
+ hiddenAnnotations.forEach(annotation => {
44
+ const key = getKey(annotation);
45
+ nodes.push(React.createElement("mark", { key: key, className: "e-annotation", "data-annotation-id": isExamAnnotation(annotation) ? annotation.annotationId : '', "data-hidden": "true" }));
46
+ });
47
+ for (const annotation of visibleAnnotations) {
48
+ const markedText = getMarkedText(annotation);
49
+ // Add unmarked text before this mark
50
+ if (annotation.startIndex > lastIndex) {
51
+ nodes.push(text.substring(lastIndex, annotation.startIndex));
41
52
  }
42
- for (const annotation of validAnnotations) {
43
- const markedText = getMarkedText(annotation);
44
- // Add unmarked text before this mark
45
- if (annotation.startIndex > lastIndex) {
46
- nodes.push(text.substring(lastIndex, annotation.startIndex));
47
- }
48
- // Add marked text
49
- const key = isExamAnnotation(annotation) ? annotation.annotationId : annotation.startIndex;
50
- nodes.push(annotation.hidden ? (React.createElement("mark", { key: key, className: "e-annotation", "data-annotation-id": isExamAnnotation(annotation) ? annotation.annotationId : '', "data-hidden": "true" })) : (React.createElement(Mark, { key: key, annotation: annotation, markedText: markedText, onClickAnnotation: onClickAnnotation, setNewAnnotationRef: setNewAnnotationRef })));
51
- // if annotation is hidden and it starts inside another annotation, we must not increment lastIndex (actually it would be decremented)
52
- const hiddenAnnotationInsideCurrentAnnotation = annotation.startIndex < lastIndex && annotation.hidden;
53
- if (!hiddenAnnotationInsideCurrentAnnotation) {
54
- lastIndex = annotation.startIndex + (annotation.hidden ? 0 : annotation.length);
55
- }
53
+ // Add marked text
54
+ const key = getKey(annotation);
55
+ nodes.push(annotation.hidden ? (React.createElement("mark", { key: key, className: "e-annotation", "data-annotation-id": isExamAnnotation(annotation) ? annotation.annotationId : '', "data-hidden": "true" })) : (React.createElement(Mark, { key: key, annotation: annotation, markedText: markedText, onClickAnnotation: onClickAnnotation, setNewAnnotationRef: setNewAnnotationRef })));
56
+ // if annotation is hidden and it starts inside another annotation, we must not increment lastIndex (actually it would be decremented)
57
+ const hiddenAnnotationInsideCurrentAnnotation = annotation.startIndex < lastIndex && annotation.hidden;
58
+ if (!hiddenAnnotationInsideCurrentAnnotation) {
59
+ lastIndex = annotation.startIndex + (annotation.hidden ? 0 : annotation.length);
56
60
  }
57
- // Add remaining unmarked text
58
- nodes.push(text.substring(lastIndex));
59
- return nodes;
60
61
  }
61
- };
62
+ // Add remaining unmarked text
63
+ nodes.push(text.substring(lastIndex));
64
+ return nodes;
65
+ }
62
66
  const Mark = ({ annotation, markedText, onClickAnnotation, setNewAnnotationRef }) => {
63
67
  const markRef = useRef(null);
64
68
  useEffect(() => {
@@ -66,7 +70,7 @@ const Mark = ({ annotation, markedText, onClickAnnotation, setNewAnnotationRef }
66
70
  setNewAnnotationRef(markRef.current);
67
71
  }
68
72
  }, []);
69
- return (React.createElement("mark", { ref: markRef, className: "e-annotation", "data-annotation-id": isExamAnnotation(annotation) ? annotation.annotationId : '', "data-hidden": "false", onClick: e => (isExamAnnotation(annotation) ? onClickAnnotation(e, annotation) : undefined) },
73
+ return (React.createElement("mark", { ref: markRef, className: "e-annotation", "data-annotation-id": isExamAnnotation(annotation) ? annotation.annotationId : '', "data-hidden": "false", "data-annotation-path": annotation.annotationAnchor, onClick: e => (isExamAnnotation(annotation) ? onClickAnnotation(e, annotation) : undefined) },
70
74
  markedText,
71
75
  (annotation === null || annotation === void 0 ? void 0 : annotation.markNumber) && React.createElement("sup", { className: "e-annotation", "data-content": annotation === null || annotation === void 0 ? void 0 : annotation.markNumber })));
72
76
  };
@@ -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;AAChD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAGhE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAg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C,UAAU,CAAC,MAAM,CAAC,CAAA;YACjF,CAAC;QACH,CAAC;QAED,8BAA8B;QAC9B,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAA;QACrC,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC,CAAA;AAED,MAAM,IAAI,GAAG,CAAC,EACZ,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,EAMpB,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,MAAM,CAAc,IAAI,CAAC,CAAA;IACzC,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,CAAC,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,EAAE,CAAC;YACrD,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACtC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IACN,OAAO,CACL,8BACE,GAAG,EAAE,OAAO,EACZ,SAAS,EAAC,cAAc,wBACJ,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,iBACnE,OAAO,EACnB,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,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
+ {"version":3,"file":"AnnotatableText.js","sourceRoot":"","sources":["../../../src/components/shared/AnnotatableText.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,KAA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,mBAAmB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACtC,CAAC;IACH,CAAC,EAAE,EAAE,CAAC,CAAA;IAEN,OAAO,CACL,8BACE,GAAG,EAAE,OAAO,EACZ,SAAS,EAAC,cAAc,wBACJ,gBAAgB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,iBACnE,OAAO,0BACG,UAAU,CAAC,gBAAgB,EACjD,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,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"}
@@ -31,8 +31,8 @@ export function AnnotationPopup() {
31
31
  setNewAnnotation(null);
32
32
  closeMathEditor(textAreaRef.current);
33
33
  };
34
- function updateComment(annotation, comment) {
35
- onSaveAnnotation({ ...annotation, message: comment });
34
+ function createNewAnnotation(annotation, comment) {
35
+ onSaveAnnotation(annotation, comment);
36
36
  closeEditor();
37
37
  }
38
38
  return (React.createElement("div", { className: "annotation-popup", style: { position: 'absolute', opacity: 0 }, ref: popupRef, "data-testid": "annotation-popup" },
@@ -42,8 +42,8 @@ export function AnnotationPopup() {
42
42
  React.createElement("button", { className: "button", onClick: e => {
43
43
  e.stopPropagation();
44
44
  closeMathEditor(textAreaRef.current);
45
- updateComment(newAnnotation, comment);
46
- }, "data-testid": "save-comment", disabled: !saveEnabled }, "Vastaa"),
45
+ createNewAnnotation(newAnnotation, comment);
46
+ }, "data-testid": "save-comment", disabled: !saveEnabled }, "Tallenna"),
47
47
  React.createElement("button", { className: "button text-button", onClick: closeEditor }, "Peru")))));
48
48
  }
49
49
  function showAndPositionElement(mark, popupRef) {
@@ -1 +1 @@
1
- {"version":3,"file":"AnnotationPopup.js","sourceRoot":"","sources":["../../../src/components/shared/AnnotationPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AAEjE,MAAM,UAAU,eAAe;IAC7B,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAA;IAClD,MAAM,WAAW,GAAG,KAAK,CAAC,SAAS,EAAkB,CAAA;IACrD,MAAM,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC7G,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAA;IAClD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAA;IAE9D,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,gBAAgB,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;YAC5C,sBAAsB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,CAAA;YAClD,WAAW,CAAC,OAAO,CAAC,SAAS,GAAG,OAAO,CAAA;YACvC,YAAY,CACV,WAAW,CAAC,OAAO,EACnB;gBACE,MAAM,EAAE,IAAI;gBACZ,eAAe,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;aAC3C,EACD,KAAK,CAAC,EAAE;gBACN,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;gBAC5B,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,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C,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;AAC/E,CAAC"}
@@ -5,7 +5,7 @@ type Props = {
5
5
  type: string;
6
6
  answer: ExamAnswer;
7
7
  error: boolean;
8
- displayNumber: number;
8
+ displayNumber: string;
9
9
  };
10
10
  export declare const Indicator: React.MemoExoticComponent<(props: Props) => React.JSX.Element>;
11
11
  export {};
@@ -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;AA0CD,eAAO,MAAM,SAAS,oCAxCU,KAAK,uBAwCS,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", { key: id, className: classNames('answer-indicator', {
16
- ok: value,
17
- error,
18
- big: type === 'rich-text'
19
- }), "data-indicator-id": id, onClick: onClick }, (answer === null || answer === void 0 ? void 0 : answer.type) === 'richText' && (React.createElement(React.Fragment, null,
20
- (answerIsLongText && (answer === null || answer === void 0 ? void 0 : answer.characterCount) && React.createElement("span", null, answer.characterCount)) || '',
21
- answerIsFormula && React.createElement("span", { className: "formula" }, "\u2211"),
22
- answerIsImage && (React.createElement("span", { className: "img" },
23
- React.createElement(FontAwesomeIcon, { icon: faImage, size: "lg" })))))));
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,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CAAC,QAAQ,CAAC,IAAI,GAAG,gBAAgB,aAAa,EAAE,CAAA;IACxD,CAAC,CAAA;IACD,OAAO,CACL,6BAAK,SAAS,EAAC,4BAA4B,EAAC,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE;QACnE,6BACE,SAAS,EAAE,UAAU,CAAC,kBAAkB,EAAE;gBACxC,EAAE,EAAE,KAAK;gBACT,KAAK;gBACL,GAAG,EAAE,IAAI,KAAK,WAAW;aAC1B,CAAC,uBACiB,EAAE,IAEpB,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,MAAK,UAAU,IAAI,CAC9B;YACG,CAAC,gBAAgB,KAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,cAAc,CAAA,IAAI,kCAAO,MAAM,CAAC,cAAc,CAAQ,CAAC,IAAI,EAAE;YAC1F,eAAe,IAAI,8BAAM,SAAS,EAAC,SAAS,aAAS;YACrD,aAAa,IAAI,CAChB,8BAAM,SAAS,EAAC,KAAK;gBACnB,oBAAC,eAAe,IAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAC,IAAI,GAAG,CACvC,CACR,CACA,CACJ,CACG,CACF,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  declare const _default: React.NamedExoticComponent<{
3
3
  maxLength: number;
4
- id?: string | undefined;
4
+ id?: string;
5
5
  }>;
6
6
  export default _default;
7
7
  //# sourceMappingURL=AnswerLengthInfo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AnswerLengthInfo.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnswerLengthInfo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;;;;;AAezB,wBAA2C"}
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: 'link' | 'plain') => React.FunctionComponent<ExamComponentProps>;
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,MAAM,iBAAiB,CAAC,kBAAkB,CAyB5F,CAAA;AAED,eAAe,gBAAgB,CAAA"}
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"}