@digabi/exam-engine-core 23.8.5-alpha.0 → 23.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main-bundle.js +1 -1
- package/package.json +3 -3
- package/dist/__tests__/annotations.test.d.ts +0 -2
- package/dist/__tests__/annotations.test.d.ts.map +0 -1
- package/dist/__tests__/annotations.test.js +0 -306
- package/dist/__tests__/annotations.test.js.map +0 -1
- package/dist/__tests__/playwright/Annotations.test.d.ts +0 -2
- package/dist/__tests__/playwright/Annotations.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/Annotations.test.js +0 -201
- package/dist/__tests__/playwright/Annotations.test.js.map +0 -1
- package/dist/__tests__/playwright/attachments/Attachments.test.d.ts +0 -2
- package/dist/__tests__/playwright/attachments/Attachments.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/attachments/Attachments.test.js +0 -30
- package/dist/__tests__/playwright/attachments/Attachments.test.js.map +0 -1
- package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts +0 -2
- package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.d.ts.map +0 -1
- package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js +0 -30
- package/dist/__tests__/playwright/grading-instructions/GradingInstructions.test.js.map +0 -1
- package/dist/__tests__/playwright/stories/Annotations.story.d.ts +0 -15
- package/dist/__tests__/playwright/stories/Annotations.story.d.ts.map +0 -1
- package/dist/__tests__/playwright/stories/Annotations.story.js +0 -27
- package/dist/__tests__/playwright/stories/Annotations.story.js.map +0 -1
- package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts +0 -13
- package/dist/__tests__/playwright/stories/attachments/Attachments.story.d.ts.map +0 -1
- package/dist/__tests__/playwright/stories/attachments/Attachments.story.js +0 -17
- package/dist/__tests__/playwright/stories/attachments/Attachments.story.js.map +0 -1
- package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts +0 -13
- package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts.map +0 -1
- package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js +0 -16
- package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js.map +0 -1
- package/dist/assets/NotoMono.ttf +0 -0
- package/dist/assets/NotoSans-Bold.ttf +0 -0
- package/dist/assets/NotoSans-BoldItalic.ttf +0 -0
- package/dist/assets/NotoSans-Italic.ttf +0 -0
- package/dist/assets/NotoSans-Light.ttf +0 -0
- package/dist/assets/NotoSans-LightItalic.ttf +0 -0
- package/dist/assets/NotoSans-Regular.ttf +0 -0
- package/dist/assets/NotoSans-SemiBold.ttf +0 -0
- package/dist/assets/NotoSans-SemiBoldItalic.ttf +0 -0
- package/dist/assets/closeButton.svg +0 -1
- package/dist/assets/collapse.svg +0 -12
- package/dist/assets/expand.svg +0 -12
- package/dist/assets/helpButton.svg +0 -9
- package/dist/assets/redoButton.svg +0 -5
- package/dist/assets/undoButton.svg +0 -5
- package/dist/components/grading/examAnnotationUtils.d.ts +0 -4
- package/dist/components/grading/examAnnotationUtils.d.ts.map +0 -1
- package/dist/components/grading/examAnnotationUtils.js +0 -123
- package/dist/components/grading/examAnnotationUtils.js.map +0 -1
- package/dist/components/results/DNDAnswerContainer.d.ts +0 -4
- package/dist/components/results/DNDAnswerContainer.d.ts.map +0 -1
- package/dist/components/results/DNDAnswerContainer.js +0 -22
- package/dist/components/results/DNDAnswerContainer.js.map +0 -1
- package/dist/components/shared/AnnotatableText.d.ts +0 -5
- package/dist/components/shared/AnnotatableText.d.ts.map +0 -1
- package/dist/components/shared/AnnotatableText.js +0 -25
- package/dist/components/shared/AnnotatableText.js.map +0 -1
- package/dist/components/shared/AnnotationImageMark.d.ts +0 -16
- package/dist/components/shared/AnnotationImageMark.d.ts.map +0 -1
- package/dist/components/shared/AnnotationImageMark.js +0 -99
- package/dist/components/shared/AnnotationImageMark.js.map +0 -1
- package/dist/components/shared/AnnotationMark.d.ts +0 -9
- package/dist/components/shared/AnnotationMark.d.ts.map +0 -1
- package/dist/components/shared/AnnotationMark.js +0 -14
- package/dist/components/shared/AnnotationMark.js.map +0 -1
- package/dist/components/shared/AnnotationPopup.d.ts +0 -3
- package/dist/components/shared/AnnotationPopup.d.ts.map +0 -1
- package/dist/components/shared/AnnotationPopup.js +0 -24
- package/dist/components/shared/AnnotationPopup.js.map +0 -1
- package/dist/components/shared/AnnotationTextMark.d.ts +0 -11
- package/dist/components/shared/AnnotationTextMark.d.ts.map +0 -1
- package/dist/components/shared/AnnotationTextMark.js +0 -21
- package/dist/components/shared/AnnotationTextMark.js.map +0 -1
- package/dist/components/shared/markText.d.ts +0 -6
- package/dist/components/shared/markText.d.ts.map +0 -1
- package/dist/components/shared/markText.js +0 -77
- package/dist/components/shared/markText.js.map +0 -1
- package/dist/components/surround.d.ts +0 -8
- package/dist/components/surround.d.ts.map +0 -1
- package/dist/components/surround.js +0 -19
- package/dist/components/surround.js.map +0 -1
- package/dist/eslint.config.d.ts +0 -22
- package/dist/eslint.config.d.ts.map +0 -1
- package/dist/eslint.config.js +0 -31
- package/dist/eslint.config.js.map +0 -1
- package/dist/i18n/exam_titles_fi-FI.d.ts +0 -46
- package/dist/i18n/exam_titles_fi-FI.d.ts.map +0 -1
- package/dist/i18n/exam_titles_fi-FI.js +0 -46
- package/dist/i18n/exam_titles_fi-FI.js.map +0 -1
- package/dist/i18n/exam_titles_fi-FI.json +0 -45
- package/dist/i18n/exam_titles_sv-FI.d.ts +0 -46
- package/dist/i18n/exam_titles_sv-FI.d.ts.map +0 -1
- package/dist/i18n/exam_titles_sv-FI.js +0 -46
- package/dist/i18n/exam_titles_sv-FI.js.map +0 -1
- package/dist/i18n/exam_titles_sv-FI.json +0 -45
- package/dist/i18n/exams.d.ts +0 -11
- package/dist/i18n/exams.d.ts.map +0 -1
- package/dist/i18n/exams.js +0 -10
- package/dist/i18n/exams.js.map +0 -1
- package/dist/types/ExamAnnotations.d.ts +0 -46
- package/dist/types/ExamAnnotations.d.ts.map +0 -1
- package/dist/types/ExamAnnotations.js +0 -2
- package/dist/types/ExamAnnotations.js.map +0 -1
@@ -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","sourceRo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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 +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"}
|
package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts
DELETED
@@ -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
|
package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.d.ts.map
DELETED
@@ -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
|
package/dist/__tests__/playwright/stories/grading-intructions/GradingInstructions.story.js.map
DELETED
@@ -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"}
|
package/dist/assets/NotoMono.ttf
DELETED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -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>
|
package/dist/assets/collapse.svg
DELETED
@@ -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>
|
package/dist/assets/expand.svg
DELETED
@@ -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 +0,0 @@
|
|
1
|
-
{"version":3,"file":"examAnnotationUtils.d.ts","sourceRoot":"","sources":["../../../src/components/grading/examAnnotationUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAkB,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAG/E,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,EAAE,eAAe,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,IAAI,QA6C5G"}
|
@@ -1,123 +0,0 @@
|
|
1
|
-
import { textAnnotationFromRange } from './editAnnotations';
|
2
|
-
export function onMouseDownForAnnotation(e, mouseUpCallback) {
|
3
|
-
function onMouseUpAfterAnswerMouseDown() {
|
4
|
-
var _a, _b;
|
5
|
-
window.removeEventListener('mouseup', onMouseUpAfterAnswerMouseDown);
|
6
|
-
/**
|
7
|
-
* selection.anchorNode = where mouse is pressed down (chronologically first)
|
8
|
-
* selection.getRangeAt(0).startContainer = where selection starts (first in DOM)
|
9
|
-
*/
|
10
|
-
const selection = window.getSelection();
|
11
|
-
const initialStartNode = (_a = selection === null || selection === void 0 ? void 0 : selection.anchorNode) === null || _a === void 0 ? void 0 : _a.parentElement;
|
12
|
-
const initialEndNode = (_b = selection === null || selection === void 0 ? void 0 : selection.focusNode) === null || _b === void 0 ? void 0 : _b.parentElement;
|
13
|
-
if (selection && initialStartNode && initialEndNode && selection.toString().length > 0) {
|
14
|
-
const isReversed = initialStartNode.compareDocumentPosition(initialEndNode) & Node.DOCUMENT_POSITION_PRECEDING;
|
15
|
-
const startNode = findAnnotatableNode(initialStartNode, isReversed ? 'previousElementSibling' : 'nextElementSibling');
|
16
|
-
const endNode = findAnnotatableNode(initialEndNode, isReversed ? 'nextElementSibling' : 'previousElementSibling');
|
17
|
-
const hasMarks = selectionContainsNonhiddenMarks(selection);
|
18
|
-
const startNodedisplayNumber = getDisplayNumber(startNode);
|
19
|
-
const endNodeDisplayNumber = getDisplayNumber(endNode);
|
20
|
-
if (startNodedisplayNumber === endNodeDisplayNumber &&
|
21
|
-
isAnnotatable(startNode) &&
|
22
|
-
isAnnotatable(endNode) &&
|
23
|
-
!hasMarks) {
|
24
|
-
const annotations = extractAnnotationsFromSelection(selection);
|
25
|
-
mouseUpCallback({
|
26
|
-
annotationType: 'text',
|
27
|
-
annotationParts: annotations,
|
28
|
-
displayNumber: startNodedisplayNumber !== null && startNodedisplayNumber !== void 0 ? startNodedisplayNumber : '',
|
29
|
-
selectedText: annotations.map(a => a.selectedText).join(' ')
|
30
|
-
});
|
31
|
-
}
|
32
|
-
}
|
33
|
-
}
|
34
|
-
// Do annotations only with left mouse buttons
|
35
|
-
if (e.button !== 0) {
|
36
|
-
return;
|
37
|
-
}
|
38
|
-
window.addEventListener('mouseup', onMouseUpAfterAnswerMouseDown);
|
39
|
-
}
|
40
|
-
const findAnnotatableNode = (node, siblingDirection) => {
|
41
|
-
if (node.matches('.e-annotatable')) {
|
42
|
-
return node;
|
43
|
-
}
|
44
|
-
const sibling = node[siblingDirection];
|
45
|
-
if (sibling instanceof HTMLElement) {
|
46
|
-
if (sibling.matches('.e-annotatable')) {
|
47
|
-
return sibling;
|
48
|
-
}
|
49
|
-
return sibling.querySelector('.e-annotatable') || findAnnotatableNode(sibling, siblingDirection);
|
50
|
-
}
|
51
|
-
return node;
|
52
|
-
};
|
53
|
-
const selectionContainsNonhiddenMarks = (selection) => {
|
54
|
-
const rangeChildren = Array.from(selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0).cloneContents().children);
|
55
|
-
const childIsNonHiddenMark = rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.some(child => child.tagName === 'MARK' && child.getAttribute('data-hidden') === 'false');
|
56
|
-
const childContainsNonHiddenMark = rangeChildren.some(child => child.querySelector('mark[data-hidden="false"]'));
|
57
|
-
return childIsNonHiddenMark || childContainsNonHiddenMark;
|
58
|
-
};
|
59
|
-
const getDisplayNumber = (node) => { var _a; return (_a = node === null || node === void 0 ? void 0 : node.closest('[data-annotation-anchor]')) === null || _a === void 0 ? void 0 : _a.getAttribute('data-annotation-anchor'); };
|
60
|
-
const isAnnotatable = (node) => (node === null || node === void 0 ? void 0 : node.getAttribute('data-annotation-path')) && node.tagName !== 'MARK';
|
61
|
-
const extractAnnotationsFromSelection = (selection) => {
|
62
|
-
var _a, _b;
|
63
|
-
const range = selection.getRangeAt(0);
|
64
|
-
const rangeChildren = Array.from(selection === null || selection === void 0 ? void 0 : selection.getRangeAt(0).cloneContents().children);
|
65
|
-
const firstSelectedNodeInDOM = range.startContainer.parentElement;
|
66
|
-
if (!(rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.length)) {
|
67
|
-
// selection is plain text
|
68
|
-
const annotationAnchor = (_b = (_a = selection === null || selection === void 0 ? void 0 : selection.focusNode) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.getAttribute('data-annotation-path');
|
69
|
-
const startAndLength = textAnnotationFromRange(firstSelectedNodeInDOM, range);
|
70
|
-
return [
|
71
|
-
{
|
72
|
-
annotationAnchor,
|
73
|
-
selectedText: (selection === null || selection === void 0 ? void 0 : selection.toString()) || '',
|
74
|
-
startIndex: (startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.startIndex) || 0,
|
75
|
-
length: (startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.length) || 0
|
76
|
-
}
|
77
|
-
];
|
78
|
-
}
|
79
|
-
else {
|
80
|
-
// selection is in multiple elements
|
81
|
-
const annotations = rangeChildren === null || rangeChildren === void 0 ? void 0 : rangeChildren.reduce((acc, child, index, arr) => {
|
82
|
-
var _a;
|
83
|
-
const childsAnnotationPath = child.getAttribute('data-annotation-path');
|
84
|
-
const isLastRangeChild = index === arr.length - 1;
|
85
|
-
if (childsAnnotationPath) {
|
86
|
-
// child is an annotable node, like <span> text </span>
|
87
|
-
const textContent = (_a = child.textContent) !== null && _a !== void 0 ? _a : '';
|
88
|
-
const newElement = {
|
89
|
-
annotationAnchor: childsAnnotationPath,
|
90
|
-
selectedText: textContent,
|
91
|
-
startIndex: index === 0 ? range.startOffset : 0,
|
92
|
-
length: isLastRangeChild ? range.endOffset : textContent.length
|
93
|
-
};
|
94
|
-
return [...acc, newElement];
|
95
|
-
}
|
96
|
-
else {
|
97
|
-
// child is a node with children, like <b> <span> text </span> </b>
|
98
|
-
const allChildrenWithAnnotationPath = child.querySelectorAll('[data-annotation-path]');
|
99
|
-
allChildrenWithAnnotationPath === null || allChildrenWithAnnotationPath === void 0 ? void 0 : allChildrenWithAnnotationPath.forEach((grandChild, kidIndex) => {
|
100
|
-
var _a;
|
101
|
-
const dataAnnotationPath = grandChild.getAttribute('data-annotation-path');
|
102
|
-
const textContent = (_a = grandChild.textContent) !== null && _a !== void 0 ? _a : '';
|
103
|
-
if (dataAnnotationPath) {
|
104
|
-
const isFirstOfAll = index === 0 && kidIndex === 0;
|
105
|
-
const isLastGrandChild = kidIndex === allChildrenWithAnnotationPath.length - 1;
|
106
|
-
const isLastOfAll = isLastRangeChild && isLastGrandChild;
|
107
|
-
const startAndLength = textAnnotationFromRange(firstSelectedNodeInDOM, range);
|
108
|
-
const newElement = {
|
109
|
-
annotationAnchor: dataAnnotationPath,
|
110
|
-
selectedText: textContent,
|
111
|
-
startIndex: isFirstOfAll ? (startAndLength === null || startAndLength === void 0 ? void 0 : startAndLength.startIndex) || 0 : 0,
|
112
|
-
length: isLastOfAll ? range.endOffset : textContent.length
|
113
|
-
};
|
114
|
-
acc.push(newElement);
|
115
|
-
}
|
116
|
-
});
|
117
|
-
return acc;
|
118
|
-
}
|
119
|
-
}, []);
|
120
|
-
return annotations;
|
121
|
-
}
|
122
|
-
};
|
123
|
-
//# sourceMappingURL=examAnnotationUtils.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"examAnnotationUtils.js","sourceRoot":"","sources":["../../../src/components/grading/examAnnotationUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D,MAAM,UAAU,wBAAwB,CAAC,CAAmB,EAAE,eAA+C;IAC3G,SAAS,6BAA6B;;QACpC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAA;QAEpE;;;WAGG;QAEH,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,EAAE,CAAA;QACvC,MAAM,gBAAgB,GAAG,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,0CAAE,aAAa,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CAAA;oBAChD,IAAI,kBAAkB,EAAE,CAAC;wBACvB,MAAM,YAAY,GAAG,KAAK,KAAK,CAAC,IAAI,QAAQ,KAAK,CAAC,CAAA;wBAClD,MAAM,gBAAgB,GAAG,QAAQ,KAAK,6BAA6B,CAAC,MAAM,GAAG,CAAC,CAAA;wBAC9E,MAAM,WAAW,GAAG,gBAAgB,IAAI,gBAAgB,CAAA;wBACxD,MAAM,cAAc,GAAG,uBAAuB,CAAC,sBAAqC,EAAE,KAAK,CAAC,CAAA;wBAC5F,MAAM,UAAU,GAAG;4BACjB,gBAAgB,EAAE,kBAAkB;4BACpC,YAAY,EAAE,WAAW;4BACzB,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,UAAU,KAAI,CAAC,CAAC,CAAC,CAAC,CAAC;4BAC9D,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM;yBAC3D,CAAA;wBACD,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;oBACtB,CAAC;gBACH,CAAC,CAAC,CAAA;gBACF,OAAO,GAAG,CAAA;YACZ,CAAC;QACH,CAAC,EAAE,EAAsB,CAAC,CAAA;QAE1B,OAAO,WAAW,CAAA;IACpB,CAAC;AACH,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.d.ts","sourceRoot":"","sources":["../../../src/components/results/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAO1C,eAAO,MAAM,kBAAkB,kCAAmC,kBAAkB,sBAuCnF,CAAA"}
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import React, { useContext } from 'react';
|
2
|
-
import { query, queryAll } from '../../dom-utils';
|
3
|
-
import { ResultsContext } from '../context/ResultsContext';
|
4
|
-
import { getAnswerOptionIdsByQuestionId, getAnswerOptionsByOptionId } from '../exam/DNDAnswerContainer';
|
5
|
-
import { DNDTitleAndDroppable } from '../shared/DNDTitleAndDroppable';
|
6
|
-
import { CorrectDNDAnswers } from './CorrectDNDAnswers';
|
7
|
-
export const DNDAnswerContainer = ({ element, renderChildNodes }) => {
|
8
|
-
const { answersByQuestionId, gradingStructure } = useContext(ResultsContext);
|
9
|
-
const answerOptionIdsByQuestionId = getAnswerOptionIdsByQuestionId(element, answersByQuestionId);
|
10
|
-
const answerOptionsByOptionId = getAnswerOptionsByOptionId(element);
|
11
|
-
const dndAnswersWithQuestion = queryAll(element, 'dnd-answer').filter(e => !!query(e, 'dnd-answer-title'));
|
12
|
-
return (React.createElement("div", { className: "e-dnd-answer-container" }, dndAnswersWithQuestion.map(element => {
|
13
|
-
var _a;
|
14
|
-
const questionId = element.getAttribute('question-id');
|
15
|
-
const itemIds = answerOptionIdsByQuestionId[questionId] || [];
|
16
|
-
const answerOptionElements = (_a = (answerOptionIdsByQuestionId[questionId] || [])) === null || _a === void 0 ? void 0 : _a.map(id => (answerOptionsByOptionId === null || answerOptionsByOptionId === void 0 ? void 0 : answerOptionsByOptionId[id]) || null).filter(Boolean);
|
17
|
-
return (React.createElement(React.Fragment, { key: questionId },
|
18
|
-
React.createElement(DNDTitleAndDroppable, { key: questionId, element: element, answerOptionElements: answerOptionElements, renderChildNodes: renderChildNodes, itemIds: itemIds, page: "results" }),
|
19
|
-
gradingStructure && (React.createElement(CorrectDNDAnswers, { key: `${questionId}-correct`, element: element, renderChildNodes: renderChildNodes, answerOptionsById: answerOptionsByOptionId }))));
|
20
|
-
})));
|
21
|
-
};
|
22
|
-
//# sourceMappingURL=DNDAnswerContainer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.js","sourceRoot":"","sources":["../../../src/components/results/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,OAA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AE,CAAC,KAAI,IAAI,EAChD,MAAM,CAAC,OAAO,CAAC,CAAA;QAElB,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,UAAU;YAC7B,oBAAC,oBAAoB,IACnB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,oBAAoB,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,SAAS,GACd;YAED,gBAAgB,IAAI,CACnB,oBAAC,iBAAiB,IAChB,GAAG,EAAE,GAAG,UAAU,UAAU,EAC5B,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,uBAAuB,GAC1C,CACH,CACc,CAClB,CAAA;IACH,CAAC,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"AnnotatableText.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnnotatableText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAMzC,eAAO,MAAM,eAAe,aAAc;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,+BA6BvD,CAAA"}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import React, { useContext } from 'react';
|
2
|
-
import { getElementPath } from '../../dom-utils';
|
3
|
-
import { AnnotationContext } from '../context/AnnotationProvider';
|
4
|
-
import { IsInSidebarContext } from '../context/IsInSidebarContext';
|
5
|
-
import { markText } from './markText';
|
6
|
-
export const AnnotatableText = ({ node }) => {
|
7
|
-
var _a, _b;
|
8
|
-
const annotationContextData = useContext(AnnotationContext);
|
9
|
-
const { isInSidebar } = useContext(IsInSidebarContext);
|
10
|
-
const canNotBeAnnotated = !annotationContextData.annotationsEnabled || ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.trim().length) === 0 || isInSidebar !== undefined;
|
11
|
-
if (canNotBeAnnotated) {
|
12
|
-
return node.textContent;
|
13
|
-
}
|
14
|
-
const { textAnnotations, onClickAnnotation, setNewAnnotationRef, newAnnotation } = annotationContextData;
|
15
|
-
const path = getElementPath(node);
|
16
|
-
const newAnnotationPartsForThisNode = (newAnnotation === null || newAnnotation === void 0 ? void 0 : newAnnotation.annotationType) === 'text'
|
17
|
-
? ((_b = newAnnotation === null || newAnnotation === void 0 ? void 0 : newAnnotation.annotationParts) === null || _b === void 0 ? void 0 : _b.filter(p => p.annotationAnchor === path)) || []
|
18
|
-
: [];
|
19
|
-
const savedAnnotationsForThisNode = (textAnnotations === null || textAnnotations === void 0 ? void 0 : textAnnotations[path]) || [];
|
20
|
-
const allAnnotationsForThisNode = [...savedAnnotationsForThisNode, ...newAnnotationPartsForThisNode];
|
21
|
-
return (React.createElement("span", { className: "e-annotatable", key: path, "data-annotation-path": path, "data-testid": path }, allAnnotationsForThisNode.length > 0 && onClickAnnotation
|
22
|
-
? markText(node.textContent, allAnnotationsForThisNode, onClickAnnotation, setNewAnnotationRef)
|
23
|
-
: node.textContent));
|
24
|
-
};
|
25
|
-
//# sourceMappingURL=AnnotatableText.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"AnnotatableText.js","sourceRoot":"","sources":["../../../src/components/shared/AnnotatableText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,IAAI,EAAkB,EAAE,EAAE;;IAC1D,MAAM,qBAAqB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC3D,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|
@@ -1,16 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { AnnotationRect, NewExamAnnotation, NewExamImageAnnotation } from '../../types/ExamAnnotations';
|
3
|
-
export declare const AnnotationImageMark: React.NamedExoticComponent<{
|
4
|
-
rect: NewExamImageAnnotation["rect"];
|
5
|
-
onClickAnnotation: (e: React.MouseEvent<HTMLElement, MouseEvent>, annotationId: number) => void;
|
6
|
-
setNewAnnotationRef: (e: HTMLElement | null) => void;
|
7
|
-
annotationId?: number;
|
8
|
-
markNumber?: number;
|
9
|
-
resolved?: boolean;
|
10
|
-
}>;
|
11
|
-
export declare function useImageAnnotation(anchor: string, description: string, setNewAnnotation: (a: NewExamAnnotation | null) => void): {
|
12
|
-
elementRef: React.RefObject<HTMLElement>;
|
13
|
-
annotationRect: AnnotationRect | undefined;
|
14
|
-
onMouseDown: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
15
|
-
};
|
16
|
-
//# sourceMappingURL=AnnotationImageMark.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"AnnotationImageMark.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnnotationImageMark.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAmD,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAGvG,eAAO,MAAM,mBAAmB;UAQxB,sBAAsB,CAAC,MAAM,CAAC;uBACjB,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,YAAY,EAAE,MAAM,KAAK,IAAI;yBAC1E,CAAC,CAAC,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI;mBACrC,MAAM;iBACR,MAAM;eACR,OAAO;EA6ClB,CAAA;AAEF,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,gBAAgB,EAAE,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,KAAK,IAAI;;;qBA4DnB,KAAK,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC;EAkB9E"}
|