@digabi/exam-engine-core 23.2.2 → 23.2.3-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 (57) hide show
  1. package/dist/__tests__/playwright/Annotations.test.d.ts +2 -0
  2. package/dist/__tests__/playwright/Annotations.test.d.ts.map +1 -0
  3. package/dist/__tests__/playwright/Annotations.test.js +156 -0
  4. package/dist/__tests__/playwright/Annotations.test.js.map +1 -0
  5. package/dist/__tests__/playwright/attachments/Attachments.test.d.ts +2 -0
  6. package/dist/__tests__/playwright/attachments/Attachments.test.d.ts.map +1 -0
  7. package/dist/__tests__/playwright/attachments/Attachments.test.js +30 -0
  8. package/dist/__tests__/playwright/attachments/Attachments.test.js.map +1 -0
  9. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js +3 -14
  10. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js.map +1 -1
  11. package/dist/__tests__/playwright/exam/Exam.test.d.ts +2 -0
  12. package/dist/__tests__/playwright/exam/Exam.test.d.ts.map +1 -0
  13. package/dist/__tests__/playwright/exam/Exam.test.js +30 -0
  14. package/dist/__tests__/playwright/exam/Exam.test.js.map +1 -0
  15. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts +2 -0
  16. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts.map +1 -0
  17. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js +30 -0
  18. package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js.map +1 -0
  19. package/dist/__tests__/playwright/stories/Annotations.story.d.ts +12 -0
  20. package/dist/__tests__/playwright/stories/Annotations.story.d.ts.map +1 -0
  21. package/dist/__tests__/playwright/stories/Annotations.story.js +22 -0
  22. package/dist/__tests__/playwright/stories/Annotations.story.js.map +1 -0
  23. package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts +13 -0
  24. package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts.map +1 -0
  25. package/dist/__tests__/playwright/stories/attachments/Attachments.story.js +17 -0
  26. package/dist/__tests__/playwright/stories/attachments/Attachments.story.js.map +1 -0
  27. package/dist/__tests__/playwright/stories/exam/Exam.story.d.ts +12 -0
  28. package/dist/__tests__/playwright/stories/exam/Exam.story.d.ts.map +1 -0
  29. package/dist/__tests__/playwright/stories/exam/Exam.story.js +56 -0
  30. package/dist/__tests__/playwright/stories/exam/Exam.story.js.map +1 -0
  31. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts +13 -0
  32. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts.map +1 -0
  33. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js +16 -0
  34. package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js.map +1 -0
  35. package/dist/__tests__/playwright/utils/utils.d.ts +5 -0
  36. package/dist/__tests__/playwright/utils/utils.d.ts.map +1 -0
  37. package/dist/__tests__/playwright/utils/utils.js +36 -0
  38. package/dist/__tests__/playwright/utils/utils.js.map +1 -0
  39. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  40. package/dist/components/context/AnnotationProvider.d.ts.map +1 -1
  41. package/dist/components/context/AnnotationProvider.js +2 -1
  42. package/dist/components/context/AnnotationProvider.js.map +1 -1
  43. package/dist/components/exam/multipleContainersKeyboardCoordinates.d.ts +3 -0
  44. package/dist/components/exam/multipleContainersKeyboardCoordinates.d.ts.map +1 -0
  45. package/dist/components/exam/multipleContainersKeyboardCoordinates.js +95 -0
  46. package/dist/components/exam/multipleContainersKeyboardCoordinates.js.map +1 -0
  47. package/dist/components/shared/AnnotationMark.js +1 -1
  48. package/dist/components/shared/AnnotationMark.js.map +1 -1
  49. package/dist/components/shared/DNDAnswerContainer.d.ts +6 -0
  50. package/dist/components/shared/DNDAnswerContainer.d.ts.map +1 -0
  51. package/dist/components/shared/DNDAnswerContainer.js +23 -0
  52. package/dist/components/shared/DNDAnswerContainer.js.map +1 -0
  53. package/dist/main-bundle.js +1 -1
  54. package/dist/main.css +1 -1
  55. package/dist/types/Score.d.ts +2 -0
  56. package/dist/types/Score.d.ts.map +1 -1
  57. package/package.json +4 -4
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Annotations.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Annotations.test.d.ts","sourceRoot":"","sources":["../../../__tests__/playwright/Annotations.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,156 @@
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.annotate)(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: '', renderableAnnotation: {} };
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: createAnnotations(existingAnnotations), onClickAnnotation: (_event, renderableAnnotation) => {
36
+ callbackArgs = { ...callbackArgs, renderableAnnotation };
37
+ }, onSaveAnnotation: (newAnnotation, comment) => {
38
+ callbackArgs = { ...callbackArgs, newAnnotation, comment };
39
+ } }));
40
+ const annottatableElement = component.locator('.exam-question-instruction');
41
+ const annotationLocator = (id) => component.locator(`[data-annotation-id="${id}"]`);
42
+ await experimental_ct_react_1.test.step('rendering annotations', async () => {
43
+ await experimental_ct_react_1.test.step('non-hidden, unique and not-overlapping annotations are rendered correctly', async () => {
44
+ for (const annotation of existingAnnotations.slice(0, 2)) {
45
+ await (0, experimental_ct_react_1.expect)(annotationLocator(annotation.id)).toBeVisible();
46
+ await (0, experimental_ct_react_1.expect)(annotationLocator(annotation.id)).toHaveText(annotation.selectedText);
47
+ await (0, experimental_ct_react_1.expect)(annotationLocator(annotation.id).locator('sup')).toHaveAttribute('data-content', annotation.id.toString());
48
+ }
49
+ });
50
+ await experimental_ct_react_1.test.step('hidden annotations are hidden', async () => {
51
+ await (0, experimental_ct_react_1.expect)(annotationLocator(3)).toBeHidden();
52
+ await (0, experimental_ct_react_1.expect)(annotationLocator(3).locator('sup')).toBeHidden();
53
+ 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');
54
+ });
55
+ await experimental_ct_react_1.test.step('if two annotations have same id, only latter renders <sup>', async () => {
56
+ const marks = await annotationLocator(4).all();
57
+ await (0, experimental_ct_react_1.expect)(marks[0]).toHaveText('mikä');
58
+ await (0, experimental_ct_react_1.expect)(marks[0].locator('sup')).not.toBeVisible();
59
+ await (0, experimental_ct_react_1.expect)(marks[1]).toHaveText('ero');
60
+ await (0, experimental_ct_react_1.expect)(marks[1]).toBeVisible();
61
+ await (0, experimental_ct_react_1.expect)(marks[1].locator('sup')).toHaveAttribute('data-content', '4');
62
+ });
63
+ await experimental_ct_react_1.test.step('annotations can not overlap — overlapping annotations are not rendered', async () => {
64
+ await (0, experimental_ct_react_1.expect)(annotationLocator(5)).toBeVisible();
65
+ await (0, experimental_ct_react_1.expect)(annotationLocator(5).locator('sup')).toBeVisible();
66
+ await (0, experimental_ct_react_1.expect)(annotationLocator(5)).toHaveText('esimerkiksi');
67
+ await (0, experimental_ct_react_1.expect)(annotationLocator(6)).toBeHidden();
68
+ await (0, experimental_ct_react_1.expect)(annotationLocator(6).locator('sup')).toBeHidden();
69
+ await (0, experimental_ct_react_1.expect)(annotationLocator(6)).toHaveText('');
70
+ await (0, experimental_ct_react_1.expect)(annotationLocator(7)).toBeHidden();
71
+ await (0, experimental_ct_react_1.expect)(annotationLocator(7).locator('sup')).toBeHidden();
72
+ await (0, experimental_ct_react_1.expect)(annotationLocator(7)).toHaveText('');
73
+ await (0, experimental_ct_react_1.expect)(annotationLocator(8)).toBeVisible();
74
+ await (0, experimental_ct_react_1.expect)(annotationLocator(8).locator('sup')).toBeVisible();
75
+ await (0, experimental_ct_react_1.expect)(annotationLocator(8)).toHaveText('jokin koulu');
76
+ });
77
+ });
78
+ await experimental_ct_react_1.test.step('creating annotations', async () => {
79
+ await experimental_ct_react_1.test.step('annotation popup appears when text is selected', async () => {
80
+ await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).not.toBeVisible();
81
+ await (0, utils_1.annotate)(annottatableElement, page);
82
+ await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).toBeVisible();
83
+ });
84
+ await experimental_ct_react_1.test.step('callback is called when annotation is saved', async () => {
85
+ const textbox = component.locator('.comment-content');
86
+ await textbox.fill('New comment');
87
+ await component.getByText('Tallenna').click();
88
+ (0, experimental_ct_react_1.expect)(callbackArgs.comment).toBe('New comment');
89
+ (0, experimental_ct_react_1.expect)(callbackArgs.newAnnotation).toStrictEqual({
90
+ annotationParts: [
91
+ {
92
+ annotationAnchor: 'e:exam:0 > e:section:1 > e:question:2 > e:question-instruction:1 > span:0 > p:0 > #text:0',
93
+ selectedText: 'Sekä moraali että tavat pyr',
94
+ startIndex: 0,
95
+ length: 27
96
+ }
97
+ ],
98
+ displayNumber: '2',
99
+ selectedText: 'Sekä moraali että tavat pyr'
100
+ });
101
+ });
102
+ await experimental_ct_react_1.test.step('popup field is empty when creating new annotation', async () => {
103
+ await (0, utils_1.annotate)(annottatableElement, page);
104
+ await (0, experimental_ct_react_1.expect)(component.locator('.comment-content')).toHaveText('');
105
+ });
106
+ await experimental_ct_react_1.test.step('popup can be closed', async () => {
107
+ await component.getByText('Peru').click();
108
+ await (0, experimental_ct_react_1.expect)(component.getByTestId('e-popup')).not.toBeVisible();
109
+ });
110
+ await experimental_ct_react_1.test.step('callback is called when annotation is clicked', async () => {
111
+ await component.locator('[data-annotation-id="1"]').click();
112
+ (0, experimental_ct_react_1.expect)(callbackArgs.renderableAnnotation).toStrictEqual({
113
+ annotationAnchor: 'e:exam:0 > e:section:1 > e:question:2 > e:question-instruction:1 > span:0 > p:1 > #text:0',
114
+ annotationId: 1,
115
+ hidden: false,
116
+ length: 8,
117
+ selectedText: 'pienempi',
118
+ startIndex: 27,
119
+ markNumber: 1
120
+ });
121
+ });
122
+ });
123
+ });
124
+ (0, experimental_ct_react_1.test)('"August 2024" annotations are added to dom when provided', async ({ mount }) => {
125
+ /** the difference of startIndex between an "August 2024 annotation" and a normal annotation
126
+ * (in this case, but the index varies depending on the exam content)
127
+ */
128
+ const startIndexDifference = 24;
129
+ const component = await mount(react_1.default.createElement(Annotations_story_1.AnnotationsStory, { masteredExam: masteredExam, annotations: createAnnotations([{ id: 1, startIndex: 166 - startIndexDifference, selectedText: 'yhteisössä' }]), onClickAnnotation: () => { }, onSaveAnnotation: () => { } }));
130
+ await (0, experimental_ct_react_1.expect)(component.locator('[data-annotation-id="1"]')).toBeVisible();
131
+ await (0, experimental_ct_react_1.expect)(component.locator('[data-annotation-id="1"]')).toHaveText('yhteisössä');
132
+ await (0, experimental_ct_react_1.expect)(component.locator('[data-annotation-id="1"] sup')).toHaveAttribute('data-content', '1');
133
+ });
134
+ function createAnnotations(annotations) {
135
+ const annotationsById = (0, lodash_1.groupBy)(annotations, 'id');
136
+ return Object.keys(annotationsById).map((id, index) => {
137
+ const annotationParts = annotationsById[id];
138
+ return {
139
+ annotationId: Number(id),
140
+ selectedText: annotations.map(a => a.selectedText).join(' '),
141
+ type: 'text',
142
+ displayNumber: '2',
143
+ hidden: annotationParts.some(a => a.hidden),
144
+ markNumber: index + 1,
145
+ annotationParts: annotationParts.map(p => ({
146
+ startIndex: p.startIndex,
147
+ length: p.selectedText.length,
148
+ annotationAnchor: 'e:exam:0 > e:section:1 > e:question:2 > e:question-instruction:1 > span:0 > p:1 > #text:0',
149
+ selectedText: p.selectedText,
150
+ annotationId: Number(id)
151
+ }))
152
+ };
153
+ });
154
+ }
155
+ });
156
+ //# sourceMappingURL=Annotations.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Annotations.test.js","sourceRoot":"","sources":["../../../__tests__/playwright/Annotations.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,6EAAgE;AAChE,yCAA2D;AAC3D,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,IAA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ACL,YAAY,EAAE,MAAM,CAAC,EAAE,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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Attachments.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Attachments.test.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/attachments/Attachments.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
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.annotate)(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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Attachments.test.js","sourceRoot":"","sources":["../../../../__tests__/playwright/attachments/Attachments.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,6EAAgE;AAChE,0CAA4D;AAC5D,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,gBAAQ,EAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;QACzC,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"}
@@ -4,16 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
- const fs_1 = require("fs");
8
- const path_1 = __importDefault(require("path"));
9
7
  const experimental_ct_react_1 = require("@playwright/experimental-ct-react");
10
- const exam_engine_exams_1 = require("@digabi/exam-engine-exams");
11
- const exam_engine_mastering_1 = require("@digabi/exam-engine-mastering");
12
8
  const DNDAnswerContainer_story_1 = require("../stories/exam/DNDAnswerContainer.story");
9
+ const utils_1 = require("../utils/utils");
10
+ experimental_ct_react_1.test.describe.configure({ mode: 'serial' });
13
11
  experimental_ct_react_1.test.describe('DNDAnswerContainer', () => {
14
12
  let masteredExam;
15
13
  experimental_ct_react_1.test.beforeAll(async () => {
16
- masteredExam = await setupMasteredExam();
14
+ masteredExam = await (0, utils_1.setupMasteredExam)();
17
15
  });
18
16
  for (const answerMediaType of ['text', 'image']) {
19
17
  (0, experimental_ct_react_1.test)(`Connect - basic drag and drop functionality for ${answerMediaType} answers`, async ({ mount }) => {
@@ -37,15 +35,6 @@ experimental_ct_react_1.test.describe('DNDAnswerContainer', () => {
37
35
  });
38
36
  }
39
37
  });
40
- async function setupMasteredExam() {
41
- const examPath = (0, exam_engine_exams_1.resolveExam)('SC/SC.xml');
42
- const resolveAttachment = (filename) => path_1.default.resolve(path_1.default.dirname(examPath), 'attachments', filename);
43
- const examXml = (0, fs_1.readFileSync)(examPath, 'utf-8');
44
- const [masteredExam] = await (0, exam_engine_mastering_1.masterExam)(examXml, () => '', (0, exam_engine_mastering_1.getMediaMetadataFromLocalFile)(resolveAttachment), {
45
- removeCorrectAnswers: true
46
- });
47
- return masteredExam;
48
- }
49
38
  async function assertContentMatches(answerContainer, content, mediaType) {
50
39
  if (mediaType === 'text') {
51
40
  await (0, experimental_ct_react_1.expect)(answerContainer).toContainText(content);
@@ -1 +1 @@
1
- {"version":3,"file":"DNDAnswerContainer.test.js","sourceRoot":"","sources":["../../../../__tests__/playwright/exam/DNDAnswerContainer.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,2BAAiC;AACjC,gDAAuB;AACvB,6EAAgE;AAEhE,iEAAuD;AACvD,yEAA0G;AAC1G,uFAAkF;AAElF,4BAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IACvC,IAAI,YAA6B,CAAA;IAEjC,4BAAI,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;QACxB,YAAY,GAAG,MAAM,iBAAiB,EAAE,CAAA;IAC1C,CAAC,CAAC,CAAA;IAEF,KAAK,MAAM,eAAe,IAAI,CAAC,MAAM,EAAE,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mBAAmB,EAAE,eAAe,CAAC,CAAA;IAExF,OAAO;QACL,eAAe;QACf,oBAAoB;QACpB,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,EAAE,kBAA4B;QAChD,mBAAmB,EAAE,mBAA6B;KACnD,CAAA;AACH,CAAC;AAED,KAAK,UAAU,gBAAgB,CAAC,aAAsB,EAAE,SAA2B;IACjF,IAAI,SAAS,KAAK,MAAM,EAAE,CAAC;QACzB,OAAO,MAAM,aAAa,CAAC,WAAW,EAAE,CAAA;IAC1C,CAAC;SAAM,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QACjC,OAAO,MAAM,aAAa,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAA;IAC/D,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Exam.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Exam.test.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/exam/Exam.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
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 Exam_story_1 = require("../stories/exam/Exam.story");
10
+ experimental_ct_react_1.test.describe('Annotations', () => {
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 exam', async ({ mount, page }) => {
16
+ let callbackArg = '';
17
+ const component = await mount(react_1.default.createElement(Exam_story_1.ExamStory, { 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.annotate)(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=Exam.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Exam.test.js","sourceRoot":"","sources":["../../../../__tests__/playwright/exam/Exam.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,6EAAgE;AAChE,0CAA4D;AAC5D,2DAAsD;AAEtD,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,mCAAmC,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;QAClE,IAAI,WAAW,GAAG,EAAE,CAAA;QACpB,MAAM,SAAS,GAAG,MAAM,KAAK,CAC3B,8BAAC,sBAAS,IACR,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,gBAAQ,EAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;QACzC,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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=GradingInstructions.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradingInstructions.test.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/grading-instructions/GradingInstructions.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
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.annotate)(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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GradingInstructions.test.js","sourceRoot":"","sources":["../../../../__tests__/playwright/grading-instructions/GradingInstructions.test.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,6EAAgE;AAChE,0CAA4D;AAC5D,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,gBAAQ,EAAC,mBAAmB,EAAE,IAAI,CAAC,CAAA;QACzC,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"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { MasteringResult } from '@digabi/exam-engine-mastering';
3
+ import { ExamAnnotation, NewExamAnnotation, RenderableAnnotation } from '../../../src';
4
+ interface AnnotationsStoryProps {
5
+ masteredExam: MasteringResult;
6
+ annotations?: ExamAnnotation[];
7
+ onClickAnnotation?: (e: React.MouseEvent<HTMLElement, MouseEvent>, annotation: RenderableAnnotation) => void;
8
+ onSaveAnnotation?: (annotation: NewExamAnnotation, comment: string) => void;
9
+ }
10
+ export declare const AnnotationsStory: React.FC<AnnotationsStoryProps>;
11
+ export {};
12
+ //# sourceMappingURL=Annotations.story.d.ts.map
@@ -0,0 +1 @@
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,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAEtF,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,UAAU,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC5G,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,CAsB5D,CAAA"}
@@ -0,0 +1,22 @@
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
+ react_1.default.createElement(Question_1.default, { element: question2, renderChildNodes: Exam_1.renderChildNodes }))));
20
+ };
21
+ exports.AnnotationsStory = AnnotationsStory;
22
+ //# sourceMappingURL=Annotations.story.js.map
@@ -0,0 +1 @@
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,EAAE,gBAAgB;YAElC,8BAAC,kBAAQ,IAAC,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,uBAAgB,GAAI,CACjD,CACA,CACxB,CAAA;AACH,CAAC,CAAA;AAtBY,QAAA,gBAAgB,oBAsB5B"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { MasteringResult } from '@digabi/exam-engine-mastering';
3
+ import { ExamAnnotation, NewExamAnnotation, RenderableAnnotation } from '../../../../src';
4
+ import '../../../../src/css/main.less';
5
+ interface AttachmentsStoryProps {
6
+ masteredExam: MasteringResult;
7
+ annotations?: ExamAnnotation[];
8
+ onClickAnnotation?: (e: React.MouseEvent<HTMLElement, MouseEvent>, annotation: RenderableAnnotation) => 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
@@ -0,0 +1 @@
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,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEzF,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,UAAU,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC5G,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"}
@@ -0,0 +1,17 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { MasteringResult } from '@digabi/exam-engine-mastering';
3
+ import { ExamAnnotation, NewExamAnnotation, RenderableAnnotation } from '../../../../src';
4
+ interface ExamStoryProps {
5
+ masteredExam: MasteringResult;
6
+ annotations?: ExamAnnotation[];
7
+ onClickAnnotation?: (e: React.MouseEvent<HTMLElement, MouseEvent>, annotation: RenderableAnnotation) => void;
8
+ onSaveAnnotation?: (annotation: NewExamAnnotation, comment: string) => void;
9
+ }
10
+ export declare const ExamStory: React.FC<ExamStoryProps>;
11
+ export {};
12
+ //# sourceMappingURL=Exam.story.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Exam.story.d.ts","sourceRoot":"","sources":["../../../../../__tests__/playwright/stories/exam/Exam.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAI/D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAGzF,UAAU,cAAc;IACtB,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,UAAU,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC5G,gBAAgB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5E;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAkC9C,CAAA"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.ExamStory = void 0;
40
+ const react_1 = __importDefault(require("react"));
41
+ const Exam_1 = __importStar(require("../../../../src/components/exam/Exam"));
42
+ const ExamComponentWrapper_1 = require("../../utils/ExamComponentWrapper");
43
+ const parseExam_1 = __importDefault(require("../../../../src/parser/parseExam"));
44
+ const examServerApi_1 = require("../../../examServerApi");
45
+ const ExamStory = ({ masteredExam, annotations, onClickAnnotation, onSaveAnnotation }) => {
46
+ const doc = (0, parseExam_1.default)(masteredExam.xml, true);
47
+ return (react_1.default.createElement(ExamComponentWrapper_1.ExamComponentWrapper, { doc: doc, resolveAttachment: (filename) => `/${masteredExam.examCode}/attachments/${filename}` },
48
+ react_1.default.createElement(Exam_1.default, { doc: doc, renderChildNodes: Exam_1.renderChildNodes, annotations: annotations, onClickAnnotation: onClickAnnotation, onSaveAnnotation: onSaveAnnotation, resolveAttachment: (filename) => `/${masteredExam.examCode}/attachments/${filename}`, answers: [], attachmentsURL: "/attachments", casStatus: "forbidden", examServerApi: examServerApi_1.examServerApi, studentName: "[Kokelaan Nimi]", showUndoView: false, undoViewProps: {
49
+ questionId: 0,
50
+ title: '',
51
+ close: () => undefined,
52
+ restoreAnswer: () => undefined
53
+ } })));
54
+ };
55
+ exports.ExamStory = ExamStory;
56
+ //# sourceMappingURL=Exam.story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Exam.story.js","sourceRoot":"","sources":["../../../../../__tests__/playwright/stories/exam/Exam.story.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAyB;AAEzB,6EAA6E;AAC7E,2EAAuE;AACvE,iFAAwD;AAExD,0DAAsD;AAS/C,MAAM,SAAS,GAA6B,CAAC,EAClD,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,2CAAoB,IACnB,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,QAAQ,gBAAgB,QAAQ,EAAE;QAE5F,8BAAC,cAAI,IACH,GAAG,EAAE,GAAG,EACR,gBAAgB,EAAE,uBAAgB,EAClC,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,QAAQ,gBAAgB,QAAQ,EAAE,EAC5F,OAAO,EAAE,EAAE,EACX,cAAc,EAAC,cAAc,EAC7B,SAAS,EAAC,WAAW,EACrB,aAAa,EAAE,6BAAa,EAC5B,WAAW,EAAC,iBAAiB,EAC7B,YAAY,EAAE,KAAK,EACnB,aAAa,EAAE;gBACb,UAAU,EAAE,CAAC;gBACb,KAAK,EAAE,EAAE;gBACT,KAAK,EAAE,GAAG,EAAE,CAAC,SAAS;gBACtB,aAAa,EAAE,GAAG,EAAE,CAAC,SAAS;aAC/B,GACD,CACmB,CACxB,CAAA;AACH,CAAC,CAAA;AAlCY,QAAA,SAAS,aAkCrB"}
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { MasteringResult } from '@digabi/exam-engine-mastering';
3
+ import { ExamAnnotation, NewExamAnnotation, RenderableAnnotation } from '../../../../src';
4
+ import '../../../../src/css/main.less';
5
+ interface GradingInstructionsStoryProps {
6
+ masteredExam: MasteringResult;
7
+ annotations?: ExamAnnotation[];
8
+ onClickAnnotation?: (e: React.MouseEvent<HTMLElement, MouseEvent>, annotation: RenderableAnnotation) => 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
@@ -0,0 +1 @@
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,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AACzF,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,UAAU,EAAE,oBAAoB,KAAK,IAAI,CAAA;IAC5G,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,CAkB3E,CAAA"}
@@ -0,0 +1,16 @@
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 }));
14
+ };
15
+ exports.GradingInstructionStory = GradingInstructionStory;
16
+ //# sourceMappingURL=GradingInstructions.story.js.map
@@ -0,0 +1 @@
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,EAAE,gBAAgB,GAClC,CACH,CAAA;AACH,CAAC,CAAA;AAlBY,QAAA,uBAAuB,2BAkBnC"}
@@ -0,0 +1,5 @@
1
+ import { Locator, Page } from '@playwright/test';
2
+ import { MasteringResult } from '@digabi/exam-engine-mastering';
3
+ export declare function setupMasteredExam(subject?: string): Promise<MasteringResult>;
4
+ export declare function annotate(locator: Locator, page: Page): Promise<void>;
5
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/utils/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAEhD,OAAO,EAA6C,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE1G,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,MAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAQxF;AAED,wBAAsB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,iBAc1D"}