@digabi/exam-engine-core 23.8.1 → 23.8.2-alpha.1

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 (180) 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/Exam.test.js +17 -18
  5. package/dist/__tests__/playwright/exam/Exam.test.js.map +1 -1
  6. package/dist/__tests__/playwright/stories/exam/Exam.story.d.ts +1 -5
  7. package/dist/__tests__/playwright/stories/exam/Exam.story.d.ts.map +1 -1
  8. package/dist/__tests__/playwright/stories/exam/Exam.story.js +7 -45
  9. package/dist/__tests__/playwright/stories/exam/Exam.story.js.map +1 -1
  10. package/dist/__tests__/playwright/utils/utils.d.ts +1 -1
  11. package/dist/__tests__/playwright/utils/utils.d.ts.map +1 -1
  12. package/dist/__tests__/playwright/utils/utils.js +2 -2
  13. package/dist/__tests__/playwright/utils/utils.js.map +1 -1
  14. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  15. package/dist/components/context/QuestionContext.d.ts.map +1 -1
  16. package/dist/components/context/QuestionContext.js +1 -1
  17. package/dist/components/context/QuestionContext.js.map +1 -1
  18. package/dist/components/exam/AudioAnswer.d.ts +7 -0
  19. package/dist/components/exam/AudioAnswer.d.ts.map +1 -0
  20. package/dist/components/exam/AudioAnswer.js +79 -0
  21. package/dist/components/exam/AudioAnswer.js.map +1 -0
  22. package/dist/components/exam/AudioAnswerRecorder.d.ts +10 -0
  23. package/dist/components/exam/AudioAnswerRecorder.d.ts.map +1 -0
  24. package/dist/components/exam/AudioAnswerRecorder.js +28 -0
  25. package/dist/components/exam/AudioAnswerRecorder.js.map +1 -0
  26. package/dist/components/exam/Exam.d.ts.map +1 -1
  27. package/dist/components/exam/Exam.js +13 -2
  28. package/dist/components/exam/Exam.js.map +1 -1
  29. package/dist/components/exam/OralAnswer.d.ts +6 -0
  30. package/dist/components/exam/OralAnswer.d.ts.map +1 -0
  31. package/dist/components/exam/OralAnswer.js +18 -0
  32. package/dist/components/exam/OralAnswer.js.map +1 -0
  33. package/dist/components/grading/GradingAnswer.d.ts +2 -6
  34. package/dist/components/grading/GradingAnswer.d.ts.map +1 -1
  35. package/dist/components/grading/GradingAnswer.js +4 -3
  36. package/dist/components/grading/GradingAnswer.js.map +1 -1
  37. package/dist/components/results/AudioAnswer.d.ts +6 -0
  38. package/dist/components/results/AudioAnswer.d.ts.map +1 -0
  39. package/dist/components/results/AudioAnswer.js +29 -0
  40. package/dist/components/results/AudioAnswer.js.map +1 -0
  41. package/dist/components/results/Results.d.ts.map +1 -1
  42. package/dist/components/results/Results.js +3 -1
  43. package/dist/components/results/Results.js.map +1 -1
  44. package/dist/components/shared/internal/AudioError.d.ts +8 -0
  45. package/dist/components/shared/internal/AudioError.d.ts.map +1 -0
  46. package/dist/components/shared/internal/AudioError.js +17 -0
  47. package/dist/components/shared/internal/AudioError.js.map +1 -0
  48. package/dist/components/shared/internal/AudioRecordingError.d.ts +8 -0
  49. package/dist/components/shared/internal/AudioRecordingError.d.ts.map +1 -0
  50. package/dist/components/shared/internal/AudioRecordingError.js +17 -0
  51. package/dist/components/shared/internal/AudioRecordingError.js.map +1 -0
  52. package/dist/dom-utils.js +1 -1
  53. package/dist/dom-utils.js.map +1 -1
  54. package/dist/i18n/fi-FI.d.ts +4 -0
  55. package/dist/i18n/fi-FI.d.ts.map +1 -1
  56. package/dist/i18n/fi-FI.js +4 -0
  57. package/dist/i18n/fi-FI.js.map +1 -1
  58. package/dist/i18n/sv-FI.d.ts.map +1 -1
  59. package/dist/i18n/sv-FI.js +4 -0
  60. package/dist/i18n/sv-FI.js.map +1 -1
  61. package/dist/index.d.ts +1 -1
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/main-bundle.js +13 -13
  64. package/dist/main-bundle.js.LICENSE.txt +7 -0
  65. package/dist/main.css +1 -1
  66. package/dist/node_modules_music-metadata_lib_aiff_AiffParser_js.main-bundle.js +33 -0
  67. package/dist/node_modules_music-metadata_lib_dsdiff_DsdiffParser_js.main-bundle.js +26 -0
  68. package/dist/node_modules_music-metadata_lib_dsf_DsfParser_js.main-bundle.js +33 -0
  69. package/dist/node_modules_music-metadata_lib_wavpack_WavPackParser_js.main-bundle.js +26 -0
  70. package/dist/parser/parseExamStructure.d.ts +8 -1
  71. package/dist/parser/parseExamStructure.d.ts.map +1 -1
  72. package/dist/parser/parseExamStructure.js +1 -1
  73. package/dist/parser/parseExamStructure.js.map +1 -1
  74. package/dist/types/ExamAnswer.d.ts +5 -1
  75. package/dist/types/ExamAnswer.d.ts.map +1 -1
  76. package/dist/types/ExamServerAPI.d.ts +4 -0
  77. package/dist/types/ExamServerAPI.d.ts.map +1 -1
  78. package/dist/types/GradingStructure.d.ts +7 -1
  79. package/dist/types/GradingStructure.d.ts.map +1 -1
  80. package/dist/validateAnswers.d.ts.map +1 -1
  81. package/dist/validateAnswers.js +1 -0
  82. package/dist/validateAnswers.js.map +1 -1
  83. package/dist/vendors-node_modules_music-metadata_lib_asf_AsfParser_js.main-bundle.js +40 -0
  84. package/dist/vendors-node_modules_music-metadata_lib_flac_FlacParser_js.main-bundle.js +47 -0
  85. package/dist/vendors-node_modules_music-metadata_lib_id3v2_ID3v2Parser_js.main-bundle.js +26 -0
  86. package/dist/vendors-node_modules_music-metadata_lib_matroska_MatroskaParser_js.main-bundle.js +40 -0
  87. package/dist/vendors-node_modules_music-metadata_lib_mp4_MP4Parser_js.main-bundle.js +33 -0
  88. package/dist/vendors-node_modules_music-metadata_lib_mpeg_MpegParser_js.main-bundle.js +47 -0
  89. package/dist/vendors-node_modules_music-metadata_lib_musepack_MusepackParser_js.main-bundle.js +68 -0
  90. package/dist/vendors-node_modules_music-metadata_lib_ogg_OggParser_js.main-bundle.js +82 -0
  91. package/dist/vendors-node_modules_music-metadata_lib_wav_WaveParser_js.main-bundle.js +40 -0
  92. package/package.json +4 -3
  93. package/dist/__tests__/annotations.test.d.ts +0 -2
  94. package/dist/__tests__/annotations.test.d.ts.map +0 -1
  95. package/dist/__tests__/annotations.test.js +0 -306
  96. package/dist/__tests__/annotations.test.js.map +0 -1
  97. package/dist/__tests__/playwright/Annotations.test.d.ts +0 -2
  98. package/dist/__tests__/playwright/Annotations.test.d.ts.map +0 -1
  99. package/dist/__tests__/playwright/Annotations.test.js +0 -201
  100. package/dist/__tests__/playwright/Annotations.test.js.map +0 -1
  101. package/dist/__tests__/playwright/attachments/Attachments.test.d.ts +0 -2
  102. package/dist/__tests__/playwright/attachments/Attachments.test.d.ts.map +0 -1
  103. package/dist/__tests__/playwright/attachments/Attachments.test.js +0 -30
  104. package/dist/__tests__/playwright/attachments/Attachments.test.js.map +0 -1
  105. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts +0 -2
  106. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts.map +0 -1
  107. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js +0 -30
  108. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js.map +0 -1
  109. package/dist/__tests__/playwright/stories/Annotations.story.d.ts +0 -15
  110. package/dist/__tests__/playwright/stories/Annotations.story.d.ts.map +0 -1
  111. package/dist/__tests__/playwright/stories/Annotations.story.js +0 -27
  112. package/dist/__tests__/playwright/stories/Annotations.story.js.map +0 -1
  113. package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts +0 -13
  114. package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts.map +0 -1
  115. package/dist/__tests__/playwright/stories/attachments/Attachments.story.js +0 -17
  116. package/dist/__tests__/playwright/stories/attachments/Attachments.story.js.map +0 -1
  117. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts +0 -13
  118. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts.map +0 -1
  119. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js +0 -16
  120. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js.map +0 -1
  121. package/dist/assets/closeButton.svg +0 -1
  122. package/dist/assets/collapse.svg +0 -12
  123. package/dist/assets/expand.svg +0 -12
  124. package/dist/assets/helpButton.svg +0 -9
  125. package/dist/assets/redoButton.svg +0 -5
  126. package/dist/assets/undoButton.svg +0 -5
  127. package/dist/components/grading/examAnnotationUtils.d.ts +0 -4
  128. package/dist/components/grading/examAnnotationUtils.d.ts.map +0 -1
  129. package/dist/components/grading/examAnnotationUtils.js +0 -123
  130. package/dist/components/grading/examAnnotationUtils.js.map +0 -1
  131. package/dist/components/results/DNDAnswerContainer.d.ts +0 -4
  132. package/dist/components/results/DNDAnswerContainer.d.ts.map +0 -1
  133. package/dist/components/results/DNDAnswerContainer.js +0 -22
  134. package/dist/components/results/DNDAnswerContainer.js.map +0 -1
  135. package/dist/components/shared/AnnotatableText.d.ts +0 -5
  136. package/dist/components/shared/AnnotatableText.d.ts.map +0 -1
  137. package/dist/components/shared/AnnotatableText.js +0 -25
  138. package/dist/components/shared/AnnotatableText.js.map +0 -1
  139. package/dist/components/shared/AnnotationImageMark.d.ts +0 -16
  140. package/dist/components/shared/AnnotationImageMark.d.ts.map +0 -1
  141. package/dist/components/shared/AnnotationImageMark.js +0 -99
  142. package/dist/components/shared/AnnotationImageMark.js.map +0 -1
  143. package/dist/components/shared/AnnotationMark.d.ts +0 -9
  144. package/dist/components/shared/AnnotationMark.d.ts.map +0 -1
  145. package/dist/components/shared/AnnotationMark.js +0 -14
  146. package/dist/components/shared/AnnotationMark.js.map +0 -1
  147. package/dist/components/shared/AnnotationPopup.d.ts +0 -3
  148. package/dist/components/shared/AnnotationPopup.d.ts.map +0 -1
  149. package/dist/components/shared/AnnotationPopup.js +0 -24
  150. package/dist/components/shared/AnnotationPopup.js.map +0 -1
  151. package/dist/components/shared/AnnotationTextMark.d.ts +0 -11
  152. package/dist/components/shared/AnnotationTextMark.d.ts.map +0 -1
  153. package/dist/components/shared/AnnotationTextMark.js +0 -21
  154. package/dist/components/shared/AnnotationTextMark.js.map +0 -1
  155. package/dist/components/shared/markText.d.ts +0 -6
  156. package/dist/components/shared/markText.d.ts.map +0 -1
  157. package/dist/components/shared/markText.js +0 -77
  158. package/dist/components/shared/markText.js.map +0 -1
  159. package/dist/eslint.config.d.ts +0 -22
  160. package/dist/eslint.config.d.ts.map +0 -1
  161. package/dist/eslint.config.js +0 -31
  162. package/dist/eslint.config.js.map +0 -1
  163. package/dist/i18n/exam_titles_fi-FI.d.ts +0 -46
  164. package/dist/i18n/exam_titles_fi-FI.d.ts.map +0 -1
  165. package/dist/i18n/exam_titles_fi-FI.js +0 -46
  166. package/dist/i18n/exam_titles_fi-FI.js.map +0 -1
  167. package/dist/i18n/exam_titles_fi-FI.json +0 -45
  168. package/dist/i18n/exam_titles_sv-FI.d.ts +0 -46
  169. package/dist/i18n/exam_titles_sv-FI.d.ts.map +0 -1
  170. package/dist/i18n/exam_titles_sv-FI.js +0 -46
  171. package/dist/i18n/exam_titles_sv-FI.js.map +0 -1
  172. package/dist/i18n/exam_titles_sv-FI.json +0 -45
  173. package/dist/i18n/exams.d.ts +0 -11
  174. package/dist/i18n/exams.d.ts.map +0 -1
  175. package/dist/i18n/exams.js +0 -10
  176. package/dist/i18n/exams.js.map +0 -1
  177. package/dist/types/ExamAnnotations.d.ts +0 -46
  178. package/dist/types/ExamAnnotations.d.ts.map +0 -1
  179. package/dist/types/ExamAnnotations.js +0 -2
  180. package/dist/types/ExamAnnotations.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"Annotations.test.d.ts","sourceRoot":"","sources":["../../../__tests__/playwright/Annotations.test.tsx"],"names":[],"mappings":""}
@@ -1,201 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const experimental_ct_react_1 = require("@playwright/experimental-ct-react");
8
- const utils_1 = require("./utils/utils");
9
- const Annotations_story_1 = require("./stories/Annotations.story");
10
- const lodash_1 = require("lodash");
11
- experimental_ct_react_1.test.describe('Annotations', () => {
12
- let masteredExam;
13
- experimental_ct_react_1.test.beforeAll(async () => {
14
- masteredExam = await (0, utils_1.setupMasteredExam)('FF');
15
- });
16
- (0, experimental_ct_react_1.test)('annotation popup is not rendered if annotation props are not passed', async ({ mount, page }) => {
17
- const component = await mount(react_1.default.createElement(Annotations_story_1.AnnotationsStory, { masteredExam: masteredExam }));
18
- const element = component.locator('.exam-question-instruction');
19
- await (0, utils_1.annotateText)(element, page);
20
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).not.toBeVisible();
21
- });
22
- (0, experimental_ct_react_1.test)('text can be annotated and annotations can be viewed when annotation props are passed', async ({ mount, page }) => {
23
- let callbackArgs = { newAnnotation: {}, comment: '', annotationId: -1 };
24
- const existingAnnotations = [
25
- { id: 1, startIndex: 27, selectedText: 'pienempi' },
26
- { id: 2, startIndex: 166, selectedText: 'yhteisössä' },
27
- { id: 3, startIndex: 59, selectedText: 'esimerkiksi', hidden: true },
28
- { id: 4, startIndex: 142, selectedText: 'mikä' },
29
- { id: 4, startIndex: 147, selectedText: 'ero' },
30
- { id: 5, startIndex: 59, selectedText: 'esimerkiksi' },
31
- { id: 6, startIndex: 62, selectedText: 'merkiksi jo' },
32
- { id: 7, startIndex: 65, selectedText: 'kiksi jokin' },
33
- { id: 8, startIndex: 71, selectedText: 'jokin koulu' }
34
- ];
35
- const component = await mount(react_1.default.createElement(Annotations_story_1.AnnotationsStory, { masteredExam: masteredExam, annotations: createTextAnnotations(existingAnnotations), onClickAnnotation: (_event, annotationId) => {
36
- callbackArgs = { ...callbackArgs, annotationId };
37
- }, onSaveAnnotation: {
38
- fn: (newAnnotation, comment) => {
39
- callbackArgs = { ...callbackArgs, newAnnotation, comment };
40
- }
41
- } }));
42
- const annottatableElement = component.locator('.exam-question-instruction');
43
- const annotationLocator = (id) => component.locator(`[data-annotation-id="${id}"]`);
44
- await experimental_ct_react_1.test.step('rendering annotations', async () => {
45
- await experimental_ct_react_1.test.step('non-hidden, unique and not-overlapping annotations are rendered correctly', async () => {
46
- for (const annotation of existingAnnotations.slice(0, 2)) {
47
- await (0, experimental_ct_react_1.expect)(annotationLocator(annotation.id)).toBeVisible();
48
- await (0, experimental_ct_react_1.expect)(annotationLocator(annotation.id)).toHaveText(annotation.selectedText);
49
- await (0, experimental_ct_react_1.expect)(annotationLocator(annotation.id).locator('+ sup')).toHaveAttribute('data-content', annotation.id.toString());
50
- }
51
- });
52
- await experimental_ct_react_1.test.step('hidden annotations are hidden', async () => {
53
- await (0, experimental_ct_react_1.expect)(annotationLocator(3)).toBeHidden();
54
- await (0, experimental_ct_react_1.expect)(annotationLocator(3).locator('+ sup')).toBeHidden();
55
- await (0, experimental_ct_react_1.expect)(annotationLocator(3).locator('..')).toHaveAttribute('data-annotation-path', 'e:exam:0 > e:section:1 > e:question:2 > e:question-instruction:1 > span:0 > p:1 > #text:0');
56
- });
57
- await experimental_ct_react_1.test.step('if two annotations have same id, only latter renders <sup>', async () => {
58
- const marks = await annotationLocator(4).all();
59
- await (0, experimental_ct_react_1.expect)(marks[0]).toHaveText('mikä');
60
- await (0, experimental_ct_react_1.expect)(marks[0].locator('+ sup')).not.toBeVisible();
61
- await (0, experimental_ct_react_1.expect)(marks[1]).toHaveText('ero');
62
- await (0, experimental_ct_react_1.expect)(marks[1]).toBeVisible();
63
- await (0, experimental_ct_react_1.expect)(marks[1].locator('+ sup')).toHaveAttribute('data-content', '4');
64
- });
65
- await experimental_ct_react_1.test.step('annotations can not overlap — overlapping annotations are not rendered', async () => {
66
- await (0, experimental_ct_react_1.expect)(annotationLocator(5)).toBeVisible();
67
- await (0, experimental_ct_react_1.expect)(annotationLocator(5).locator('+ sup')).toBeVisible();
68
- await (0, experimental_ct_react_1.expect)(annotationLocator(5)).toHaveText('esimerkiksi');
69
- await (0, experimental_ct_react_1.expect)(annotationLocator(6)).toBeHidden();
70
- await (0, experimental_ct_react_1.expect)(annotationLocator(6).locator('+ sup')).toBeHidden();
71
- await (0, experimental_ct_react_1.expect)(annotationLocator(6)).toHaveText('');
72
- await (0, experimental_ct_react_1.expect)(annotationLocator(7)).toBeHidden();
73
- await (0, experimental_ct_react_1.expect)(annotationLocator(7).locator('+ sup')).toBeHidden();
74
- await (0, experimental_ct_react_1.expect)(annotationLocator(7)).toHaveText('');
75
- await (0, experimental_ct_react_1.expect)(annotationLocator(8)).toBeVisible();
76
- await (0, experimental_ct_react_1.expect)(annotationLocator(8).locator('+ sup')).toBeVisible();
77
- await (0, experimental_ct_react_1.expect)(annotationLocator(8)).toHaveText('jokin koulu');
78
- });
79
- });
80
- await experimental_ct_react_1.test.step('creating annotations', async () => {
81
- await experimental_ct_react_1.test.step('annotation popup appears when text is selected', async () => {
82
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).not.toBeVisible();
83
- await (0, utils_1.annotateText)(annottatableElement, page);
84
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).toBeVisible();
85
- });
86
- await experimental_ct_react_1.test.step('callback is called when annotation is saved', async () => {
87
- const textbox = component.locator('.comment-content');
88
- await textbox.fill('New comment');
89
- await component.getByText('Tallenna').click();
90
- (0, experimental_ct_react_1.expect)(callbackArgs.comment).toBe('New comment');
91
- (0, experimental_ct_react_1.expect)(callbackArgs.newAnnotation).toStrictEqual({
92
- annotationParts: [
93
- {
94
- annotationAnchor: 'e:exam:0 > e:section:1 > e:question:2 > e:question-instruction:1 > span:0 > p:0 > #text:0',
95
- selectedText: 'Sekä moraali että tavat pyr',
96
- startIndex: 0,
97
- length: 27
98
- }
99
- ],
100
- annotationType: 'text',
101
- displayNumber: '2',
102
- selectedText: 'Sekä moraali että tavat pyr'
103
- });
104
- });
105
- await experimental_ct_react_1.test.step('popup field is empty when creating new annotation', async () => {
106
- await (0, utils_1.annotateText)(annottatableElement, page);
107
- await (0, experimental_ct_react_1.expect)(component.locator('.comment-content')).toHaveText('');
108
- });
109
- await experimental_ct_react_1.test.step('popup can be closed', async () => {
110
- await component.getByText('Peru').click();
111
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).not.toBeVisible();
112
- });
113
- await experimental_ct_react_1.test.step('callback is called when annotation is clicked', async () => {
114
- await component.locator('[data-annotation-id="1"]').click();
115
- (0, experimental_ct_react_1.expect)(callbackArgs.annotationId).toStrictEqual(1);
116
- });
117
- });
118
- });
119
- (0, experimental_ct_react_1.test)('"August 2024" annotations are added to dom when provided', async ({ mount }) => {
120
- /** the difference of startIndex between an "August 2024 annotation" and a normal annotation
121
- * (in this case, but the index varies depending on the exam content)
122
- */
123
- const startIndexDifference = 24;
124
- const component = await mount(react_1.default.createElement(Annotations_story_1.AnnotationsStory, { masteredExam: masteredExam, annotations: createTextAnnotations([
125
- { id: 1, startIndex: 166 - startIndexDifference, selectedText: 'yhteisössä' }
126
- ]), onClickAnnotation: () => { }, onSaveAnnotation: { fn: () => { } } }));
127
- await (0, experimental_ct_react_1.expect)(component.locator('[data-annotation-id="1"]')).toBeVisible();
128
- await (0, experimental_ct_react_1.expect)(component.locator('[data-annotation-id="1"]')).toHaveText('yhteisössä');
129
- await (0, experimental_ct_react_1.expect)(component.locator('[data-annotation-id="1"] + sup')).toHaveAttribute('data-content', '1');
130
- });
131
- (0, experimental_ct_react_1.test)('annotation popup is not closed when annotation save fails', async ({ mount, page }) => {
132
- const errorMessage = 'save failed';
133
- const component = await mount(react_1.default.createElement(Annotations_story_1.AnnotationsStory, { masteredExam: masteredExam, annotations: [], onClickAnnotation: () => { }, onSaveAnnotation: { fn: () => { }, result: errorMessage } }));
134
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).not.toBeVisible();
135
- await (0, utils_1.annotateText)(component.locator('.exam-question-instruction'), page);
136
- await component.locator('.comment-content').fill('New comment');
137
- await component.getByText('Tallenna').click();
138
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).toBeVisible();
139
- await (0, experimental_ct_react_1.expect)(component.getByText(errorMessage)).toBeVisible();
140
- });
141
- (0, experimental_ct_react_1.test)('formulas can be annotated with image annotations', async ({ mount, page }) => {
142
- const masteredExam = await (0, utils_1.setupMasteredExam)('N');
143
- let callbackArgs = { newAnnotation: {}, comment: '', annotationId: -1 };
144
- const component = await mount(react_1.default.createElement(Annotations_story_1.AnnotationsStory, { masteredExam: masteredExam, annotations: [], onClickAnnotation: (_event, annotationId) => {
145
- callbackArgs = { ...callbackArgs, annotationId };
146
- }, onSaveAnnotation: {
147
- fn: (newAnnotation, comment) => {
148
- callbackArgs = { ...callbackArgs, newAnnotation, comment };
149
- }
150
- } }));
151
- const annottatableElement = component.locator('.e-formula.e-annotatable').nth(0);
152
- await experimental_ct_react_1.test.step('creating annotations', async () => {
153
- await experimental_ct_react_1.test.step('annotation popup appears when text is selected', async () => {
154
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).not.toBeVisible();
155
- await (0, utils_1.annotateImage)(annottatableElement, page);
156
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).toBeVisible();
157
- });
158
- await experimental_ct_react_1.test.step('callback is called when annotation is saved', async () => {
159
- const textbox = component.locator('.comment-content');
160
- await textbox.fill('New comment');
161
- await component.getByText('Tallenna').click();
162
- (0, experimental_ct_react_1.expect)(callbackArgs.comment).toBe('New comment');
163
- (0, experimental_ct_react_1.expect)(callbackArgs.newAnnotation).toStrictEqual({
164
- annotationType: 'image',
165
- displayNumber: '2',
166
- annotationAnchor: 'e:exam:0 > e:section:1 > e:question:2 > e:question-instruction:1 > span:0 > p:1 > e:formula:false',
167
- description: 'kaava 4(x+1)=4x+4',
168
- rect: {
169
- x1: 0,
170
- x2: 1,
171
- y1: 0,
172
- y2: 1
173
- }
174
- });
175
- });
176
- });
177
- });
178
- function createTextAnnotations(annotations) {
179
- const annotationsById = (0, lodash_1.groupBy)(annotations, 'id');
180
- return Object.keys(annotationsById).map((id, index) => {
181
- const annotationParts = annotationsById[id];
182
- return {
183
- annotationType: 'text',
184
- annotationId: Number(id),
185
- selectedText: annotations.map(a => a.selectedText).join(' '),
186
- type: 'text',
187
- displayNumber: '2',
188
- hidden: annotationParts.some(a => a.hidden),
189
- markNumber: index + 1,
190
- annotationParts: annotationParts.map(p => ({
191
- startIndex: p.startIndex,
192
- length: p.selectedText.length,
193
- annotationAnchor: 'e:exam:0 > e:section:1 > e:question:2 > e:question-instruction:1 > span:0 > p:1 > #text:0',
194
- selectedText: p.selectedText,
195
- annotationId: Number(id)
196
- }))
197
- };
198
- });
199
- }
200
- });
201
- //# sourceMappingURL=Annotations.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Annotations.test.js","sourceRoot":"","sources":["../../../__tests__/playwright/Annotations.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,6EAAgE;AAChE,yCAA8E;AAC9E,mEAA8D;AAE9D,mCAAgC;AAEhC,4BAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAChC,IAAI,YAA2D,CAAA;IAE/D,4BAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACxB,YAAY,GAAG,MAAM,IAAA,yBAAiB,EAAC,IAAI,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;IAEF,IAAA,4BAAI,EAAC,qEAAqE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QACpG,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,8BAAC,oCAAgB,IAAC,YAAY,EAAE,YAAY,GAAI,CAAC,CAAA;QAC/E,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAA;QAE/D,MAAM,IAAA,oBAAY,EAAC,OAAO,EAAE,IAAI,CAAC,CAAA;QACjC,MAAM,IAAA,8BAAM,EAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,C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CAAC;gBACxB,YAAY,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBAC5D,IAAI,EAAE,MAAM;gBACZ,aAAa,EAAE,GAAG;gBAClB,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;gBAC3C,UAAU,EAAE,KAAK,GAAG,CAAC;gBACrB,eAAe,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;oBACzC,UAAU,EAAE,CAAC,CAAC,UAAU;oBACxB,MAAM,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM;oBAC7B,gBAAgB,EAAE,2FAA2F;oBAC7G,YAAY,EAAE,CAAC,CAAC,YAAY;oBAC5B,YAAY,EAAE,MAAM,CAAC,EAAE,CAAC;iBACzB,CAAC,CAAC;aACJ,CAAA;QACH,CAAC,CAAC,CAAA;IACJ,CAAC;AAGH,CAAC,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Attachments.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Attachments.test.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/attachments/Attachments.test.tsx"],"names":[],"mappings":""}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const experimental_ct_react_1 = require("@playwright/experimental-ct-react");
8
- const utils_1 = require("../utils/utils");
9
- const Attachments_story_1 = require("../stories/attachments/Attachments.story");
10
- experimental_ct_react_1.test.describe('Attachments', () => {
11
- let masteredExam;
12
- experimental_ct_react_1.test.beforeAll(async () => {
13
- masteredExam = await (0, utils_1.setupMasteredExam)('FF');
14
- });
15
- (0, experimental_ct_react_1.test)('text can be annotated inside attachments', async ({ mount, page }) => {
16
- let callbackArg = '';
17
- const component = await mount(react_1.default.createElement(Attachments_story_1.AttachmentsStory, { masteredExam: masteredExam, annotations: [], onClickAnnotation: () => { }, onSaveAnnotation: (_newAnnotation, comment) => {
18
- callbackArg = comment;
19
- } }));
20
- const annottatableElement = component.locator('.e-annotatable').first();
21
- const textbox = component.locator('.comment-content');
22
- await (0, experimental_ct_react_1.expect)(annottatableElement).toBeVisible();
23
- await (0, utils_1.annotateText)(annottatableElement, page);
24
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).toBeVisible();
25
- await textbox.fill('New comment');
26
- await component.getByText('Tallenna').click();
27
- (0, experimental_ct_react_1.expect)(callbackArg).toBe('New comment');
28
- });
29
- });
30
- //# sourceMappingURL=Attachments.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Attachments.test.js","sourceRoot":"","sources":["../../../../__tests__/playwright/attachments/Attachments.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,6EAAgE;AAChE,0CAAgE;AAChE,gFAA2E;AAE3E,4BAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAChC,IAAI,YAA2D,CAAA;IAE/D,4BAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACxB,YAAY,GAAG,MAAM,IAAA,yBAAiB,EAAC,IAAI,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;IAEF,IAAA,4BAAI,EAAC,0CAA0C,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QACzE,IAAI,WAAW,GAAG,EAAE,CAAA;QACpB,MAAM,SAAS,GAAG,MAAM,KAAK,CAC3B,8BAAC,oCAAgB,IACf,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,EAAE,EACf,iBAAiB,EAAE,GAAG,EAAE,GAAE,CAAC,EAC3B,gBAAgB,EAAE,CAAC,cAAc,EAAE,OAAe,EAAE,EAAE;gBACpD,WAAW,GAAG,OAAO,CAAA;YACvB,CAAC,GACD,CACH,CAAA;QACD,MAAM,mBAAmB,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAA;QACvE,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;QAErD,MAAM,IAAA,8BAAM,EAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAA;QAC/C,MAAM,IAAA,oBAAY,EAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;QAC7C,MAAM,IAAA,8BAAM,EAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;QAE5D,MAAM,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QACjC,MAAM,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAA;QAC7C,IAAA,8BAAM,EAAC,WAAW,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=GradingInstructions.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GradingInstructions.test.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/grading-instructions/GradingInstructions.test.tsx"],"names":[],"mappings":""}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_1 = __importDefault(require("react"));
7
- const experimental_ct_react_1 = require("@playwright/experimental-ct-react");
8
- const utils_1 = require("../utils/utils");
9
- const GradingInstructions_story_1 = require("../stories/grading-intructions/GradingInstructions.story");
10
- experimental_ct_react_1.test.describe('Grading Instructions', () => {
11
- let masteredExam;
12
- experimental_ct_react_1.test.beforeAll(async () => {
13
- masteredExam = await (0, utils_1.setupMasteredExam)('FF');
14
- });
15
- (0, experimental_ct_react_1.test)('text can be annotated inside grading instructions', async ({ mount, page }) => {
16
- let callbackArg = '';
17
- const component = await mount(react_1.default.createElement(GradingInstructions_story_1.GradingInstructionStory, { masteredExam: masteredExam, annotations: [], onClickAnnotation: () => { }, onSaveAnnotation: (_newAnnotation, comment) => {
18
- callbackArg = comment;
19
- } }));
20
- const annottatableElement = component.locator('.e-annotatable').first();
21
- const textbox = component.locator('.comment-content');
22
- await (0, experimental_ct_react_1.expect)(annottatableElement).toBeVisible();
23
- await (0, utils_1.annotateText)(annottatableElement, page);
24
- await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).toBeVisible();
25
- await textbox.fill('New comment');
26
- await component.getByText('Tallenna').click();
27
- (0, experimental_ct_react_1.expect)(callbackArg).toBe('New comment');
28
- });
29
- });
30
- //# sourceMappingURL=GradingInstructions.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GradingInstructions.test.js","sourceRoot":"","sources":["../../../../__tests__/playwright/grading-instructions/GradingInstructions.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,6EAAgE;AAChE,0CAAgE;AAChE,wGAAkG;AAElG,4BAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACzC,IAAI,YAA2D,CAAA;IAE/D,4BAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACxB,YAAY,GAAG,MAAM,IAAA,yBAAiB,EAAC,IAAI,CAAC,CAAA;IAC9C,CAAC,CAAC,CAAA;IAEF,IAAA,4BAAI,EAAC,mDAAmD,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QAClF,IAAI,WAAW,GAAG,EAAE,CAAA;QACpB,MAAM,SAAS,GAAG,MAAM,KAAK,CAC3B,8BAAC,mDAAuB,IACtB,YAAY,EAAE,YAAY,EAC1B,WAAW,EAAE,EAAE,EACf,iBAAiB,EAAE,GAAG,EAAE,GAAE,CAAC,EAC3B,gBAAgB,EAAE,CAAC,cAAc,EAAE,OAAe,EAAE,EAAE;gBACpD,WAAW,GAAG,OAAO,CAAA;YACvB,CAAC,GACD,CACH,CAAA;QACD,MAAM,mBAAmB,GAAG,SAAS,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,CAAA;QACvE,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;QAErD,MAAM,IAAA,8BAAM,EAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAA;QAC/C,MAAM,IAAA,oBAAY,EAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;QAC7C,MAAM,IAAA,8BAAM,EAAC,SAAS,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;QAE5D,MAAM,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QACjC,MAAM,SAAS,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,KAAK,EAAE,CAAA;QAC7C,IAAA,8BAAM,EAAC,WAAW,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { MasteringResult } from '@digabi/exam-engine-mastering';
3
- import { ExamAnnotation, NewExamAnnotation } from '../../../src';
4
- interface AnnotationsStoryProps {
5
- masteredExam: MasteringResult;
6
- annotations?: ExamAnnotation[];
7
- onClickAnnotation?: (e: React.MouseEvent<HTMLElement, MouseEvent>, annotationId: number) => void;
8
- onSaveAnnotation?: {
9
- fn: (annotation: NewExamAnnotation, comment: string) => void;
10
- result?: string;
11
- };
12
- }
13
- export declare const AnnotationsStory: React.FC<AnnotationsStoryProps>;
14
- export {};
15
- //# sourceMappingURL=Annotations.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Annotations.story.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/stories/Annotations.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAO/D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhE,UAAU,qBAAqB;IAC7B,YAAY,EAAE,eAAe,CAAA;IAC7B,WAAW,CAAC,EAAE,cAAc,EAAE,CAAA;IAC9B,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IAChG,gBAAgB,CAAC,EAAE;QAAE,EAAE,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CACrG;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA6B5D,CAAA"}
@@ -1,27 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AnnotationsStory = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const Exam_1 = require("../../../src/components/exam/Exam");
9
- const ExamComponentWrapper_1 = require("../utils/ExamComponentWrapper");
10
- const parseExam_1 = __importDefault(require("../../../src/parser/parseExam"));
11
- const dom_utils_1 = require("../../../src/dom-utils");
12
- const Question_1 = __importDefault(require("../../../src/components/exam/Question"));
13
- const AnnotationProvider_1 = require("../../../src/components/context/AnnotationProvider");
14
- const AnnotationsStory = ({ masteredExam, annotations, onClickAnnotation, onSaveAnnotation }) => {
15
- const doc = (0, parseExam_1.default)(masteredExam.xml, true);
16
- const [_question1, question2] = (0, dom_utils_1.queryAll)(doc.documentElement, 'question', false);
17
- return (react_1.default.createElement(ExamComponentWrapper_1.ExamComponentWrapper, { doc: doc, resolveAttachment: (filename) => `/${masteredExam.examCode}/attachments/${filename}` },
18
- react_1.default.createElement(AnnotationProvider_1.AnnotationProvider, { annotations: annotations, onClickAnnotation: onClickAnnotation, onSaveAnnotation: onSaveAnnotation
19
- ? (...args) => {
20
- onSaveAnnotation.fn(...args);
21
- return Promise.resolve(onSaveAnnotation.result);
22
- }
23
- : undefined },
24
- react_1.default.createElement(Question_1.default, { element: question2, renderChildNodes: Exam_1.renderChildNodes }))));
25
- };
26
- exports.AnnotationsStory = AnnotationsStory;
27
- //# sourceMappingURL=Annotations.story.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Annotations.story.js","sourceRoot":"","sources":["../../../../__tests__/playwright/stories/Annotations.story.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAEzB,4DAAoE;AACpE,wEAAoE;AACpE,8EAAqD;AACrD,sDAAiD;AACjD,qFAA4D;AAC5D,2FAAuF;AAUhF,MAAM,gBAAgB,GAAoC,CAAC,EAChE,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EACjB,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,IAAA,mBAAS,EAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC7C,MAAM,CAAC,UAAU,EAAE,SAAS,CAAC,GAAG,IAAA,oBAAQ,EAAC,GAAG,CAAC,eAAe,EAAE,UAAU,EAAE,KAAK,CAAC,CAAA;IAChF,OAAO,CACL,8BAAC,2CAAoB,IACnB,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,QAAQ,gBAAgB,QAAQ,EAAE;QAE5F,8BAAC,uCAAkB,IACjB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EACd,gBAAgB;gBACd,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE;oBACV,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,CAAA;oBAC5B,OAAO,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAA;gBACjD,CAAC;gBACH,CAAC,CAAC,SAAS;YAGf,8BAAC,kBAAQ,IAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,uBAAgB,GAAI,CACjD,CACA,CACxB,CAAA;AACH,CAAC,CAAA;AA7BY,QAAA,gBAAgB,oBA6B5B"}
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { MasteringResult } from '@digabi/exam-engine-mastering';
3
- import { ExamAnnotation, NewExamAnnotation } from '../../../../src';
4
- import '../../../../src/css/main.less';
5
- interface AttachmentsStoryProps {
6
- masteredExam: MasteringResult;
7
- annotations?: ExamAnnotation[];
8
- onClickAnnotation?: (e: React.MouseEvent<HTMLElement, MouseEvent>, annotationId: number) => void;
9
- onSaveAnnotation?: (annotation: NewExamAnnotation, comment: string) => void;
10
- }
11
- export declare const AttachmentsStory: React.FC<AttachmentsStoryProps>;
12
- export {};
13
- //# sourceMappingURL=Attachments.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Attachments.story.d.ts","sourceRoot":"","sources":["../../../../../__tests__/playwright/stories/attachments/Attachments.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnE,OAAO,+BAA+B,CAAA;AAEtC,UAAU,qBAAqB;IAC7B,YAAY,EAAE,eAAe,CAAA;IAC7B,WAAW,CAAC,EAAE,cAAc,EAAE,CAAA;IAC9B,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IAChG,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5E;AAED,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAkB5D,CAAA"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.AttachmentsStory = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const parseExam_1 = __importDefault(require("../../../../src/parser/parseExam"));
9
- const Attachments_1 = __importDefault(require("../../../../src/components/attachments/Attachments"));
10
- const examServerApi_1 = require("../../../examServerApi");
11
- require("../../../../src/css/main.less");
12
- const AttachmentsStory = ({ masteredExam, annotations, onClickAnnotation, onSaveAnnotation }) => {
13
- const doc = (0, parseExam_1.default)(masteredExam.xml, true);
14
- return (react_1.default.createElement(Attachments_1.default, { doc: doc, resolveAttachment: (filename) => `/${masteredExam.examCode}/attachments/${filename}`, attachmentsURL: "/attachments", annotations: annotations, onClickAnnotation: onClickAnnotation, onSaveAnnotation: onSaveAnnotation, examServerApi: examServerApi_1.examServerApi }));
15
- };
16
- exports.AttachmentsStory = AttachmentsStory;
17
- //# sourceMappingURL=Attachments.story.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Attachments.story.js","sourceRoot":"","sources":["../../../../../__tests__/playwright/stories/attachments/Attachments.story.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAEzB,iFAAwD;AACxD,qGAA4E;AAE5E,0DAAsD;AACtD,yCAAsC;AAS/B,MAAM,gBAAgB,GAAoC,CAAC,EAChE,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EACjB,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,IAAA,mBAAS,EAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC7C,OAAO,CACL,8BAAC,qBAAW,IACV,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,QAAQ,gBAAgB,QAAQ,EAAE,EAC5F,cAAc,EAAC,cAAc,EAC7B,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,6BAAa,GAC5B,CACH,CAAA;AACH,CAAC,CAAA;AAlBY,QAAA,gBAAgB,oBAkB5B"}
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { MasteringResult } from '@digabi/exam-engine-mastering';
3
- import { ExamAnnotation, NewExamAnnotation } from '../../../../src';
4
- import '../../../../src/css/main.less';
5
- interface GradingInstructionsStoryProps {
6
- masteredExam: MasteringResult;
7
- annotations?: ExamAnnotation[];
8
- onClickAnnotation?: (e: React.MouseEvent<HTMLElement, MouseEvent>, annotationId: number) => void;
9
- onSaveAnnotation?: (annotation: NewExamAnnotation, comment: string) => void;
10
- }
11
- export declare const GradingInstructionStory: React.FC<GradingInstructionsStoryProps>;
12
- export {};
13
- //# sourceMappingURL=GradingInstructions.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GradingInstructions.story.d.ts","sourceRoot":"","sources":["../../../../../__tests__/playwright/stories/grading-intructions/GradingInstructions.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,+BAA+B,CAAA;AAEtC,UAAU,6BAA6B;IACrC,YAAY,EAAE,eAAe,CAAA;IAC7B,WAAW,CAAC,EAAE,cAAc,EAAE,CAAA;IAC9B,iBAAiB,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI,CAAA;IAChG,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5E;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,6BAA6B,CAoB3E,CAAA"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.GradingInstructionStory = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const parseExam_1 = __importDefault(require("../../../../src/parser/parseExam"));
9
- const GradingInstructions_1 = __importDefault(require("../../../../src/components/grading-instructions/GradingInstructions"));
10
- require("../../../../src/css/main.less");
11
- const GradingInstructionStory = ({ masteredExam, annotations, onClickAnnotation, onSaveAnnotation }) => {
12
- const doc = (0, parseExam_1.default)(masteredExam.xml, true);
13
- return (react_1.default.createElement(GradingInstructions_1.default, { doc: doc, resolveAttachment: (filename) => `/${masteredExam.examCode}/attachments/${filename}`, answers: [], attachmentsURL: "/attachments", annotations: annotations, onClickAnnotation: onClickAnnotation, onSaveAnnotation: onSaveAnnotation ? (...args) => { var _a; return Promise.resolve((_a = onSaveAnnotation(...args)) !== null && _a !== void 0 ? _a : undefined); } : undefined }));
14
- };
15
- exports.GradingInstructionStory = GradingInstructionStory;
16
- //# sourceMappingURL=GradingInstructions.story.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"GradingInstructions.story.js","sourceRoot":"","sources":["../../../../../__tests__/playwright/stories/grading-intructions/GradingInstructions.story.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AAEzB,iFAAwD;AACxD,8HAAqG;AAErG,yCAAsC;AAS/B,MAAM,uBAAuB,GAA4C,CAAC,EAC/E,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EACjB,EAAE,EAAE;IACH,MAAM,GAAG,GAAG,IAAA,mBAAS,EAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC7C,OAAO,CACL,8BAAC,6BAAmB,IAClB,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,QAAQ,gBAAgB,QAAQ,EAAE,EAC5F,OAAO,EAAE,EAAE,EACX,cAAc,EAAC,cAAc,EAC7B,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EACd,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,WAAC,OAAA,OAAO,CAAC,OAAO,CAAC,MAAA,gBAAgB,CAAC,GAAG,IAAI,CAAC,mCAAI,SAAS,CAAC,CAAA,EAAA,CAAC,CAAC,CAAC,SAAS,GAErG,CACH,CAAA;AACH,CAAC,CAAA;AApBY,QAAA,uBAAuB,2BAoBnC"}
@@ -1 +0,0 @@
1
- <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="30" viewBox="0 0 30 30"><defs><clipPath id="clip-path"><path d="M141.57-89.324v-2.34H143.2v2.34A2.3,2.3,0,0,1,140.9-87.03H130.1a2.3,2.3,0,0,1-2.292-2.294v-17.029a2.294,2.294,0,0,1,2.292-2.292h10.8a2.3,2.3,0,0,1,2.295,2.292v2.342H141.57v-2.342a.669.669,0,0,0-.67-.667H130.1a.667.667,0,0,0-.667.667v17.029a.668.668,0,0,0,.667.669h10.8A.67.67,0,0,0,141.57-89.324Zm3.271-13.579a1.069,1.069,0,0,1,1.825-.755l5.065,5.065a1.065,1.065,0,0,1,0,1.511l-5.065,5.067a1.07,1.07,0,0,1-1.825-.757v-2.412h-6.633a2.3,2.3,0,0,1-2.3-2.3v-.7a2.3,2.3,0,0,1,2.3-2.3h6.633V-102.9" fill="none" clip-rule="evenodd"/></clipPath><clipPath id="clip-path-2"><ellipse cx="10" cy="-29.606" rx="15" ry="14.933" fill="none"/></clipPath></defs><title>closeButton</title><rect width="30" height="30" fill="#fff" opacity="0"/><line x1="25" y1="5" x2="5" y2="25" fill="none" stroke="#6d6d6d" stroke-miterlimit="10" stroke-width="3"/><line x1="5" y1="5" x2="25" y2="25" fill="none" stroke="#6d6d6d" stroke-miterlimit="10" stroke-width="3"/></svg>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg width="19px" height="12px" viewBox="0 0 19 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
- <!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
4
- <title>Page 1</title>
5
- <desc>Created with Sketch.</desc>
6
- <defs></defs>
7
- <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
- <g id="Kuuntelu-kokelas-painaa-nappia-Copy-18" transform="translate(-1068.000000, -19.000000)" stroke-width="3" stroke="#359BB7">
9
- <polyline id="Page-1" transform="translate(1077.999981, 26.000000) rotate(180.000000) translate(-1077.999981, -26.000000) " points="1085.99996 22 1077.99996 30 1070 22"></polyline>
10
- </g>
11
- </g>
12
- </svg>
@@ -1,12 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
- <svg width="18px" height="12px" viewBox="0 0 18 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
- <!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
4
- <title>Page 1</title>
5
- <desc>Created with Sketch.</desc>
6
- <defs></defs>
7
- <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
- <g id="Kuuntelu-kokelas-painaa-nappia-Copy-18" transform="translate(-1069.000000, -21.000000)" stroke-width="3" stroke="#359BB7">
9
- <polyline id="Page-1" points="1085.99996 22 1077.99996 30 1070 22"></polyline>
10
- </g>
11
- </g>
12
- </svg>
@@ -1,9 +0,0 @@
1
- <svg version="1.1"
2
- xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
3
- x="0px" y="0px" width="20px" height="20px" viewBox="0 0 20 20" enable-background="new 0 0 20 20" xml:space="preserve">
4
- <path fill="#359BB7" d="M10,20C4.48,20,0,15.52,0,10C0,4.48,4.48,0,10,0s10,4.48,10,10C20,15.52,15.52,20,10,20z M5.57,5.88
5
- c-0.14,0.21-0.09,0.5,0.11,0.66l1.4,1.06c0.21,0.16,0.51,0.12,0.67-0.09c0.72-0.91,1.21-1.44,2.31-1.44c0.82,0,1.84,0.53,1.84,1.33
6
- c0,0.6-0.5,0.91-1.31,1.37c-0.95,0.53-2.2,1.19-2.2,2.85v0.16c0,0.27,0.22,0.48,0.48,0.48h2.26c0.27,0,0.48-0.22,0.48-0.48v-0.05
7
- c0-1.15,3.35-1.2,3.35-4.3c0-2.34-2.43-4.11-4.7-4.11C8.07,3.31,6.67,4.23,5.57,5.88z M8.15,15.16c0,1.02,0.83,1.85,1.85,1.85
8
- s1.85-0.83,1.85-1.85s-0.83-1.85-1.85-1.85S8.15,14.14,8.15,15.16z"/>
9
- </svg>
@@ -1,5 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20px" height="20px" viewBox="0 0 20 20" version="1.1">
2
- <g id="surface1">
3
- <path fill="#359BB7" d="M 18.316406 1.253906 C 18.859375 1.253906 19.378906 1.675781 19.378906 2.3125 L 19.378906 8.007812 C 19.378906 8.421875 19.042969 8.757812 18.628906 8.757812 L 12.9375 8.757812 C 12.300781 8.757812 11.882812 8.238281 11.882812 7.695312 C 11.882812 7.4375 11.976562 7.171875 12.191406 6.957031 L 13.953125 5.195312 C 12.851562 4.289062 11.460938 3.761719 9.996094 3.761719 C 6.554688 3.761719 3.753906 6.5625 3.753906 10.003906 C 3.753906 13.449219 6.554688 16.246094 9.996094 16.246094 C 12.851562 16.246094 13.488281 14.75 14.492188 14.75 C 15.214844 14.75 15.742188 15.335938 15.742188 15.996094 C 15.742188 17.367188 12.554688 18.75 10 18.75 C 5.179688 18.75 1.253906 14.824219 1.253906 10.003906 C 1.253906 5.183594 5.179688 1.265625 10 1.265625 C 12.132812 1.265625 14.148438 2.0625 15.71875 3.425781 L 17.578125 1.566406 C 17.792969 1.351562 18.058594 1.253906 18.316406 1.253906 Z M 18.316406 1.253906 "/>
4
- </g>
5
- </svg>
@@ -1,5 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20px" height="20px" viewBox="0 0 20 20" version="1.1">
2
- <g id="surface1">
3
- <path fill="#359BB7" d="M 18.75 10 C 18.75 14.820312 14.824219 18.746094 10.003906 18.746094 C 8.097656 18.746094 6.285156 18.136719 4.761719 16.992188 C 4.210938 16.578125 4.097656 15.796875 4.511719 15.242188 C 4.925781 14.691406 5.707031 14.582031 6.261719 14.996094 C 7.351562 15.8125 8.644531 16.242188 10.007812 16.242188 C 13.449219 16.242188 16.25 13.441406 16.25 10 C 16.25 6.558594 13.449219 3.757812 10.007812 3.757812 C 8.542969 3.757812 7.152344 4.285156 6.050781 5.1875 L 7.8125 6.953125 C 8.476562 7.617188 8.007812 8.753906 7.066406 8.753906 L 1.375 8.753906 C 0.960938 8.753906 0.625 8.417969 0.625 8.003906 L 0.625 2.304688 C 0.625 1.367188 1.761719 0.898438 2.425781 1.5625 L 4.285156 3.421875 C 5.855469 2.058594 7.871094 1.253906 10.003906 1.253906 C 14.824219 1.253906 18.75 5.179688 18.75 10 Z M 18.75 10 "/>
4
- </g>
5
- </svg>
@@ -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"}