@digabi/exam-engine-core 23.9.1 → 23.9.3-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/dist/__tests__/examServerApi.d.ts.map +1 -1
  2. package/dist/__tests__/examServerApi.js +2 -0
  3. package/dist/__tests__/examServerApi.js.map +1 -1
  4. package/dist/__tests__/playwright/exam/AudioAnswer.test.d.ts +2 -0
  5. package/dist/__tests__/playwright/exam/AudioAnswer.test.d.ts.map +1 -0
  6. package/dist/__tests__/playwright/exam/AudioAnswer.test.js +30 -0
  7. package/dist/__tests__/playwright/exam/AudioAnswer.test.js.map +1 -0
  8. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.d.ts +8 -0
  9. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.d.ts.map +1 -0
  10. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.js +34 -0
  11. package/dist/__tests__/playwright/stories/exam/AudioAnswer.story.js.map +1 -0
  12. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  13. package/dist/components/context/QuestionContext.d.ts.map +1 -1
  14. package/dist/components/context/QuestionContext.js +1 -1
  15. package/dist/components/context/QuestionContext.js.map +1 -1
  16. package/dist/components/exam/AudioAnswer.d.ts +7 -0
  17. package/dist/components/exam/AudioAnswer.d.ts.map +1 -0
  18. package/dist/components/exam/AudioAnswer.js +79 -0
  19. package/dist/components/exam/AudioAnswer.js.map +1 -0
  20. package/dist/components/exam/Exam.d.ts.map +1 -1
  21. package/dist/components/exam/Exam.js +3 -1
  22. package/dist/components/exam/Exam.js.map +1 -1
  23. package/dist/components/grading/GradingAnswer.d.ts +2 -6
  24. package/dist/components/grading/GradingAnswer.d.ts.map +1 -1
  25. package/dist/components/grading/GradingAnswer.js +4 -3
  26. package/dist/components/grading/GradingAnswer.js.map +1 -1
  27. package/dist/components/results/AudioAnswer.d.ts +6 -0
  28. package/dist/components/results/AudioAnswer.d.ts.map +1 -0
  29. package/dist/components/results/AudioAnswer.js +33 -0
  30. package/dist/components/results/AudioAnswer.js.map +1 -0
  31. package/dist/components/results/Results.d.ts.map +1 -1
  32. package/dist/components/results/Results.js +3 -1
  33. package/dist/components/results/Results.js.map +1 -1
  34. package/dist/dom-utils.js +1 -1
  35. package/dist/dom-utils.js.map +1 -1
  36. package/dist/i18n/fi-FI.d.ts +3 -0
  37. package/dist/i18n/fi-FI.d.ts.map +1 -1
  38. package/dist/i18n/fi-FI.js +3 -0
  39. package/dist/i18n/fi-FI.js.map +1 -1
  40. package/dist/i18n/sv-FI.d.ts.map +1 -1
  41. package/dist/i18n/sv-FI.js +3 -0
  42. package/dist/i18n/sv-FI.js.map +1 -1
  43. package/dist/main-bundle.js +18 -18
  44. package/dist/main-bundle.js.LICENSE.txt +7 -0
  45. package/dist/main.css +1 -1
  46. package/dist/parser/parseExamStructure.d.ts +8 -1
  47. package/dist/parser/parseExamStructure.d.ts.map +1 -1
  48. package/dist/parser/parseExamStructure.js +1 -1
  49. package/dist/parser/parseExamStructure.js.map +1 -1
  50. package/dist/store/cas/sagas.d.ts +1 -1
  51. package/dist/types/ExamAnswer.d.ts +5 -1
  52. package/dist/types/ExamAnswer.d.ts.map +1 -1
  53. package/dist/types/ExamServerAPI.d.ts +4 -0
  54. package/dist/types/ExamServerAPI.d.ts.map +1 -1
  55. package/dist/types/GradingStructure.d.ts +7 -1
  56. package/dist/types/GradingStructure.d.ts.map +1 -1
  57. package/dist/validateAnswers.d.ts.map +1 -1
  58. package/dist/validateAnswers.js +1 -0
  59. package/dist/validateAnswers.js.map +1 -1
  60. package/package.json +4 -3
  61. package/dist/assets/NotoMono.ttf +0 -0
  62. package/dist/assets/NotoSans-Bold.ttf +0 -0
  63. package/dist/assets/NotoSans-BoldItalic.ttf +0 -0
  64. package/dist/assets/NotoSans-Italic.ttf +0 -0
  65. package/dist/assets/NotoSans-Light.ttf +0 -0
  66. package/dist/assets/NotoSans-LightItalic.ttf +0 -0
  67. package/dist/assets/NotoSans-Regular.ttf +0 -0
  68. package/dist/assets/NotoSans-SemiBold.ttf +0 -0
  69. package/dist/assets/NotoSans-SemiBoldItalic.ttf +0 -0
  70. package/dist/components/grading/examAnnotationUtils.d.ts +0 -4
  71. package/dist/components/grading/examAnnotationUtils.d.ts.map +0 -1
  72. package/dist/components/grading/examAnnotationUtils.js +0 -123
  73. package/dist/components/grading/examAnnotationUtils.js.map +0 -1
  74. package/dist/components/surround.d.ts +0 -8
  75. package/dist/components/surround.d.ts.map +0 -1
  76. package/dist/components/surround.js +0 -19
  77. package/dist/components/surround.js.map +0 -1
  78. package/dist/types/ExamAnnotations.d.ts +0 -46
  79. package/dist/types/ExamAnnotations.d.ts.map +0 -1
  80. package/dist/types/ExamAnnotations.js +0 -2
  81. package/dist/types/ExamAnnotations.js.map +0 -1
Binary file
Binary file
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { NewExamAnnotation } from '../../types/ExamAnnotations';
3
- export declare function onMouseDownForAnnotation(e: React.MouseEvent, mouseUpCallback: (a: NewExamAnnotation) => void): void;
4
- //# sourceMappingURL=examAnnotationUtils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"examAnnotationUtils.d.ts","sourceRoot":"","sources":["../../../src/components/grading/examAnnotationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAkB,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAG/E,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,QA6C5G"}
@@ -1,123 +0,0 @@
1
- import { textAnnotationFromRange } from './editAnnotations';
2
- export function onMouseDownForAnnotation(e, mouseUpCallback) {
3
- function onMouseUpAfterAnswerMouseDown() {
4
- var _a, _b;
5
- window.removeEventListener('mouseup', onMouseUpAfterAnswerMouseDown);
6
- /**
7
- * selection.anchorNode = where mouse is pressed down (chronologically first)
8
- * selection.getRangeAt(0).startContainer = where selection starts (first in DOM)
9
- */
10
- const selection = window.getSelection();
11
- const initialStartNode = (_a = selection === null || selection === void 0 ? void 0 : selection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
12
- const initialEndNode = (_b = selection === null || selection === void 0 ? void 0 : selection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
13
- if (selection && initialStartNode && initialEndNode && selection.toString().length > 0) {
14
- const isReversed = initialStartNode.compareDocumentPosition(initialEndNode) & Node.DOCUMENT_POSITION_PRECEDING;
15
- const startNode = findAnnotatableNode(initialStartNode, isReversed ? 'previousElementSibling' : 'nextElementSibling');
16
- const endNode = findAnnotatableNode(initialEndNode, isReversed ? 'nextElementSibling' : 'previousElementSibling');
17
- const hasMarks = selectionContainsNonhiddenMarks(selection);
18
- const startNodedisplayNumber = getDisplayNumber(startNode);
19
- const endNodeDisplayNumber = getDisplayNumber(endNode);
20
- if (startNodedisplayNumber === endNodeDisplayNumber &&
21
- isAnnotatable(startNode) &&
22
- isAnnotatable(endNode) &&
23
- !hasMarks) {
24
- const annotations = extractAnnotationsFromSelection(selection);
25
- mouseUpCallback({
26
- annotationType: 'text',
27
- annotationParts: annotations,
28
- displayNumber: startNodedisplayNumber !== null && startNodedisplayNumber !== void 0 ? startNodedisplayNumber : '',
29
- selectedText: annotations.map(a => a.selectedText).join(' ')
30
- });
31
- }
32
- }
33
- }
34
- // Do annotations only with left mouse buttons
35
- if (e.button !== 0) {
36
- return;
37
- }
38
- window.addEventListener('mouseup', onMouseUpAfterAnswerMouseDown);
39
- }
40
- const findAnnotatableNode = (node, siblingDirection) => {
41
- if (node.matches('.e-annotatable')) {
42
- return node;
43
- }
44
- const sibling = node[siblingDirection];
45
- if (sibling instanceof HTMLElement) {
46
- if (sibling.matches('.e-annotatable')) {
47
- return sibling;
48
- }
49
- return sibling.querySelector('.e-annotatable') || findAnnotatableNode(sibling, siblingDirection);
50
- }
51
- return node;
52
- };
53
- const selectionContainsNonhiddenMarks = (selection) => {
54
- const rangeChildren = Array.from(selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0).cloneContents().children);
55
- const childIsNonHiddenMark = rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.some(child => child.tagName === 'MARK' && child.getAttribute('data-hidden') === 'false');
56
- const childContainsNonHiddenMark = rangeChildren.some(child => child.querySelector('mark[data-hidden="false"]'));
57
- return childIsNonHiddenMark || childContainsNonHiddenMark;
58
- };
59
- const getDisplayNumber = (node) => { var _a; return (_a = node === null || node === void 0 ? void 0 : node.closest('[data-annotation-anchor]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-annotation-anchor'); };
60
- const isAnnotatable = (node) => (node === null || node === void 0 ? void 0 : node.getAttribute('data-annotation-path')) && node.tagName !== 'MARK';
61
- const extractAnnotationsFromSelection = (selection) => {
62
- var _a, _b;
63
- const range = selection.getRangeAt(0);
64
- const rangeChildren = Array.from(selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0).cloneContents().children);
65
- const firstSelectedNodeInDOM = range.startContainer.parentElement;
66
- if (!(rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.length)) {
67
- // selection is plain text
68
- 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');
69
- const startAndLength = textAnnotationFromRange(firstSelectedNodeInDOM, range);
70
- return [
71
- {
72
- annotationAnchor,
73
- selectedText: (selection === null || selection === void 0 ? void 0 : selection.toString()) || '',
74
- startIndex: (startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.startIndex) || 0,
75
- length: (startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.length) || 0
76
- }
77
- ];
78
- }
79
- else {
80
- // selection is in multiple elements
81
- const annotations = rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.reduce((acc, child, index, arr) => {
82
- var _a;
83
- const childsAnnotationPath = child.getAttribute('data-annotation-path');
84
- const isLastRangeChild = index === arr.length - 1;
85
- if (childsAnnotationPath) {
86
- // child is an annotable node, like <span> text </span>
87
- const textContent = (_a = child.textContent) !== null && _a !== void 0 ? _a : '';
88
- const newElement = {
89
- annotationAnchor: childsAnnotationPath,
90
- selectedText: textContent,
91
- startIndex: index === 0 ? range.startOffset : 0,
92
- length: isLastRangeChild ? range.endOffset : textContent.length
93
- };
94
- return [...acc, newElement];
95
- }
96
- else {
97
- // child is a node with children, like <b> <span> text </span> </b>
98
- const allChildrenWithAnnotationPath = child.querySelectorAll('[data-annotation-path]');
99
- allChildrenWithAnnotationPath === null || allChildrenWithAnnotationPath === void 0 ? void 0 : allChildrenWithAnnotationPath.forEach((grandChild, kidIndex) => {
100
- var _a;
101
- const dataAnnotationPath = grandChild.getAttribute('data-annotation-path');
102
- const textContent = (_a = grandChild.textContent) !== null && _a !== void 0 ? _a : '';
103
- if (dataAnnotationPath) {
104
- const isFirstOfAll = index === 0 && kidIndex === 0;
105
- const isLastGrandChild = kidIndex === allChildrenWithAnnotationPath.length - 1;
106
- const isLastOfAll = isLastRangeChild && isLastGrandChild;
107
- const startAndLength = textAnnotationFromRange(firstSelectedNodeInDOM, range);
108
- const newElement = {
109
- annotationAnchor: dataAnnotationPath,
110
- selectedText: textContent,
111
- startIndex: isFirstOfAll ? (startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.startIndex) || 0 : 0,
112
- length: isLastOfAll ? range.endOffset : textContent.length
113
- };
114
- acc.push(newElement);
115
- }
116
- });
117
- return acc;
118
- }
119
- }, []);
120
- return annotations;
121
- }
122
- };
123
- //# sourceMappingURL=examAnnotationUtils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"examAnnotationUtils.js","sourceRoot":"","sources":["../../../src/components/grading/examAnnotationUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,UAAU,w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AC,gBAAgB,CAAC,wBAAwB,CAAC,CAAA;gBACtF,6BAA6B,aAA7B,6BAA6B,uBAA7B,6BAA6B,CAAE,OAAO,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE;;oBAC9D,MAAM,kBAAkB,GAAG,UAAU,CAAC,YAAY,CAAC,sBAAsB,CAAC,CAAA;oBAC1E,MAAM,WAAW,GAAG,MAAA,UAAU,CAAC,WAAW,mCAAI,EAAE,CAAA;oBAChD,IAAI,kBAAkB,EAAE,CAAC;wBACvB,MAAM,YAAY,GAAG,KAAK,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,CAAA;wBAClD,MAAM,gBAAgB,GAAG,QAAQ,KAAK,6BAA6B,CAAC,MAAM,GAAG,CAAC,CAAA;wBAC9E,MAAM,WAAW,GAAG,gBAAgB,IAAI,gBAAgB,CAAA;wBACxD,MAAM,cAAc,GAAG,uBAAuB,CAAC,sBAAqC,EAAE,KAAK,CAAC,CAAA;wBAC5F,MAAM,UAAU,GAAG;4BACjB,gBAAgB,EAAE,kBAAkB;4BACpC,YAAY,EAAE,WAAW;4BACzB,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,KAAI,CAAC,CAAC,CAAC,CAAC,CAAC;4BAC9D,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM;yBAC3D,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,8 +0,0 @@
1
- import React from 'react';
2
- import { ExamComponentProps } from '../createRenderChildNodes';
3
- /** Surrounds an Exam component with a static HTML element.
4
- *
5
- * @example surround(Question, 'div', {className: 'foobar'})
6
- */
7
- export default function surround<K extends keyof JSX.IntrinsicElements>(Component: React.ComponentType<ExamComponentProps>, Tag: K, props?: JSX.IntrinsicElements[K]): React.ComponentType<ExamComponentProps>;
8
- //# sourceMappingURL=surround.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"surround.d.ts","sourceRoot":"","sources":["../../src/components/surround.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,iBAAiB,EACpE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,EAClD,GAAG,EAAE,CAAC,EACN,KAAK,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,GAC/B,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAczC"}
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { getDisplayName } from '../getDisplayName';
3
- /** Surrounds an Exam component with a static HTML element.
4
- *
5
- * @example surround(Question, 'div', {className: 'foobar'})
6
- */
7
- export default function surround(Component, Tag, props) {
8
- const Wrapped = (componentProps) => {
9
- // Can't seem to be able to limit the type to HTML elements that accept children.
10
- // So as a hack, type them as any inside the function to make the compiler happy.
11
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
12
- const TagAsAny = Tag;
13
- return (React.createElement(TagAsAny, { ...props },
14
- React.createElement(Component, { ...componentProps })));
15
- };
16
- Wrapped.displayName = `Surround(${getDisplayName(Component)})`;
17
- return Wrapped;
18
- }
19
- //# sourceMappingURL=surround.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"surround.js","sourceRoot":"","sources":["../../src/components/surround.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAGlD;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAC9B,SAAkD,EAClD,GAAM,EACN,KAAgC;IAEhC,MAAM,OAAO,GAAG,CAAC,cAAkC,EAAE,EAAE;QACrD,iFAAiF;QACjF,iFAAiF;QACjF,mEAAmE;QACnE,MAAM,QAAQ,GAAG,GAAU,CAAA;QAC3B,OAAO,CACL,oBAAC,QAAQ,OAAK,KAAK;YACjB,oBAAC,SAAS,OAAK,cAAc,GAAI,CACxB,CACZ,CAAA;IACH,CAAC,CAAA;IACD,OAAO,CAAC,WAAW,GAAG,YAAY,cAAc,CAAC,SAAS,CAAC,GAAG,CAAA;IAC9D,OAAO,OAAO,CAAA;AAChB,CAAC"}
@@ -1,46 +0,0 @@
1
- export interface NewExamAnnotationBase {
2
- displayNumber: string;
3
- }
4
- interface ExamAnnotationBase extends NewExamAnnotationBase {
5
- annotationId: number;
6
- markNumber: number;
7
- resolved?: boolean;
8
- hidden?: boolean;
9
- }
10
- type ExamTextAnnotationAttributes = {
11
- annotationType: 'text';
12
- selectedText: string;
13
- annotationParts: AnnotationPart[];
14
- };
15
- export type NewExamTextAnnotation = NewExamAnnotationBase & ExamTextAnnotationAttributes;
16
- export type ExamTextAnnotation = ExamAnnotationBase & ExamTextAnnotationAttributes;
17
- type ExamImageAnnotationAttributes = {
18
- annotationType: 'image';
19
- annotationAnchor: string;
20
- rect: AnnotationRect;
21
- description: string;
22
- };
23
- export type NewExamImageAnnotation = NewExamAnnotationBase & ExamImageAnnotationAttributes;
24
- export type ExamImageAnnotation = ExamAnnotationBase & ExamImageAnnotationAttributes;
25
- export type NewExamAnnotation = NewExamTextAnnotation | NewExamImageAnnotation;
26
- export type ExamAnnotation = ExamTextAnnotation | ExamImageAnnotation;
27
- export interface AnnotationPart {
28
- annotationAnchor: string;
29
- selectedText: string;
30
- startIndex: number;
31
- length: number;
32
- markNumber?: number;
33
- hidden?: boolean;
34
- resolved?: boolean;
35
- }
36
- export type WithAnnotationId<T> = T & {
37
- annotationId: number;
38
- };
39
- export type AnnotationRect = {
40
- x1: number;
41
- y1: number;
42
- x2: number;
43
- y2: number;
44
- };
45
- export {};
46
- //# sourceMappingURL=ExamAnnotations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExamAnnotations.d.ts","sourceRoot":"","sources":["../../src/types/ExamAnnotations.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,UAAU,kBAAmB,SAAQ,qBAAqB;IACxD,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,KAAK,4BAA4B,GAAG;IAClC,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,eAAe,EAAE,cAAc,EAAE,CAAA;CAClC,CAAA;AACD,MAAM,MAAM,qBAAqB,GAAG,qBAAqB,GAAG,4BAA4B,CAAA;AACxF,MAAM,MAAM,kBAAkB,GAAG,kBAAkB,GAAG,4BAA4B,CAAA;AAElF,KAAK,6BAA6B,GAAG;IACnC,cAAc,EAAE,OAAO,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;IACxB,IAAI,EAAE,cAAc,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,sBAAsB,GAAG,qBAAqB,GAAG,6BAA6B,CAAA;AAC1F,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,GAAG,6BAA6B,CAAA;AAEpF,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG,sBAAsB,CAAA;AAC9E,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAAG,mBAAmB,CAAA;AAErE,MAAM,WAAW,cAAc;IAC7B,gBAAgB,EAAE,MAAM,CAAA;IACxB,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,CAAA;AAE9D,MAAM,MAAM,cAAc,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ExamAnnotations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExamAnnotations.js","sourceRoot":"","sources":["../../src/types/ExamAnnotations.ts"],"names":[],"mappings":""}