@digabi/exam-engine-core 19.1.0-alpha.0 → 19.2.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
- package/dist/components/grading/AnswerCharacterCounter.d.ts +6 -0
- package/dist/components/grading/AnswerCharacterCounter.d.ts.map +1 -0
- package/dist/components/grading/AnswerCharacterCounter.js +21 -0
- package/dist/components/grading/AnswerCharacterCounter.js.map +1 -0
- package/dist/components/grading/GradingAnswer.d.ts +22 -0
- package/dist/components/grading/GradingAnswer.d.ts.map +1 -0
- package/dist/components/grading/GradingAnswer.js +242 -0
- package/dist/components/grading/GradingAnswer.js.map +1 -0
- package/dist/components/grading/GradingAnswerAnnotationList.d.ts +9 -0
- package/dist/components/grading/GradingAnswerAnnotationList.d.ts.map +1 -0
- package/dist/components/grading/GradingAnswerAnnotationList.js +19 -0
- package/dist/components/grading/GradingAnswerAnnotationList.js.map +1 -0
- package/dist/components/grading/editAnnotations.d.ts +26 -0
- package/dist/components/grading/editAnnotations.d.ts.map +1 -0
- package/dist/components/grading/editAnnotations.js +177 -0
- package/dist/components/grading/editAnnotations.js.map +1 -0
- package/dist/components/grading/largeImageDetector.d.ts +3 -0
- package/dist/components/grading/largeImageDetector.d.ts.map +1 -0
- package/dist/components/grading/largeImageDetector.js +43 -0
- package/dist/components/grading/largeImageDetector.js.map +1 -0
- package/dist/components/grading-instructions/GradingInstructions.d.ts.map +1 -1
- package/dist/components/grading-instructions/GradingInstructions.js +1 -0
- package/dist/components/grading-instructions/GradingInstructions.js.map +1 -1
- package/dist/components/grading-instructions/GradingInstructionsElements.d.ts +3 -0
- package/dist/components/grading-instructions/GradingInstructionsElements.d.ts.map +1 -0
- package/dist/components/grading-instructions/GradingInstructionsElements.js +14 -0
- package/dist/components/grading-instructions/GradingInstructionsElements.js.map +1 -0
- package/dist/components/results/internal/AnnotationList.d.ts +1 -1
- package/dist/components/results/internal/AnnotationList.d.ts.map +1 -1
- package/dist/components/results/internal/AnnotationList.js +3 -14
- package/dist/components/results/internal/AnnotationList.js.map +1 -1
- package/dist/components/shared/AnnotationLists.d.ts +13 -0
- package/dist/components/shared/AnnotationLists.d.ts.map +1 -0
- package/dist/components/shared/AnnotationLists.js +17 -0
- package/dist/components/shared/AnnotationLists.js.map +1 -0
- package/dist/gradingInstructionsElements.d.ts +3 -0
- package/dist/gradingInstructionsElements.d.ts.map +1 -0
- package/dist/gradingInstructionsElements.js +14 -0
- package/dist/gradingInstructionsElements.js.map +1 -0
- package/dist/i18n/fi-FI.d.ts +1 -0
- package/dist/i18n/fi-FI.d.ts.map +1 -1
- package/dist/i18n/fi-FI.js +1 -0
- package/dist/i18n/fi-FI.js.map +1 -1
- package/dist/i18n/index.d.ts +1 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/sv-FI.d.ts.map +1 -1
- package/dist/i18n/sv-FI.js +1 -0
- package/dist/i18n/sv-FI.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main.css +1 -1
- package/dist/renderAnnotations.d.ts +6 -2
- package/dist/renderAnnotations.d.ts.map +1 -1
- package/dist/renderAnnotations.js +61 -41
- package/dist/renderAnnotations.js.map +1 -1
- package/package.json +2 -2
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AnswerCharacterCounter.d.ts","sourceRoot":"","sources":["../../../src/components/grading/AnswerCharacterCounter.tsx"],"names":[],"mappings":";AAGA,wBAAgB,sBAAsB,CAAC,EACrC,cAAc,EACd,SAAS,GACV,EAAE;IACD,cAAc,EAAE,MAAM,CAAA;IACtB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,eAqBA"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { useExamTranslation } from '../../i18n';
|
3
|
+
export function AnswerCharacterCounter({ characterCount, maxLength, }) {
|
4
|
+
const { t } = useExamTranslation();
|
5
|
+
const percentage = countSurplusPercentage(characterCount, maxLength);
|
6
|
+
return (React.createElement("div", { className: "e-font-size-xs e-grading-answer-length" },
|
7
|
+
t('answer-length', {
|
8
|
+
count: characterCount,
|
9
|
+
}),
|
10
|
+
percentage > 0 ? (React.createElement("span", { className: "e-grading-answer-max-length-surplus" }, t('max-length-surplus', {
|
11
|
+
maxLength,
|
12
|
+
percentage,
|
13
|
+
}))) : ('')));
|
14
|
+
}
|
15
|
+
function countSurplusPercentage(characters, maxCharacters) {
|
16
|
+
if (!maxCharacters || characters <= maxCharacters) {
|
17
|
+
return 0;
|
18
|
+
}
|
19
|
+
return Math.floor((100 * characters) / maxCharacters - 100);
|
20
|
+
}
|
21
|
+
//# sourceMappingURL=AnswerCharacterCounter.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"AnswerCharacterCounter.js","sourceRoot":"","sources":["../../../src/components/grading/AnswerCharacterCounter.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,UAAU,sBAAsB,CAAC,EACrC,cAAc,EACd,SAAS,GAIV;IACC,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,MAAM,UAAU,GAAG,sBAAsB,CAAC,cAAc,EAAE,SAAS,CAAC,CAAA;IAEpE,OAAO,CACL,6BAAK,SAAS,EAAC,wCAAwC;QACpD,CAAC,CAAC,eAAe,EAAE;YAClB,KAAK,EAAE,cAAc;SACtB,CAAC;QACD,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAChB,8BAAM,SAAS,EAAC,qCAAqC,IAClD,CAAC,CAAC,oBAAoB,EAAE;YACvB,SAAS;YACT,UAAU;SACX,CAAC,CACG,CACR,CAAC,CAAC,CAAC,CACF,EAAE,CACH,CACG,CACP,CAAA;AACH,CAAC;AAED,SAAS,sBAAsB,CAAC,UAAkB,EAAE,aAAwC;IAC1F,IAAI,CAAC,aAAa,IAAI,UAAU,IAAI,aAAa,EAAE;QACjD,OAAO,CAAC,CAAA;KACT;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,aAAa,GAAG,GAAG,CAAC,CAAA;AAC7D,CAAC"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Annotation } from '../..';
|
3
|
+
type Annotations = {
|
4
|
+
pregrading: Annotation[];
|
5
|
+
censoring: Annotation[];
|
6
|
+
};
|
7
|
+
type GradingRole = 'pregrading' | 'censoring';
|
8
|
+
export declare function GradingAnswer({ answer: { type, characterCount, value }, language, isReadOnly, gradingRole, annotations, saveAnnotations, maxLength, }: {
|
9
|
+
answer: {
|
10
|
+
type: 'richText' | 'text';
|
11
|
+
characterCount: number;
|
12
|
+
value: string;
|
13
|
+
};
|
14
|
+
language: string;
|
15
|
+
isReadOnly: boolean;
|
16
|
+
gradingRole: GradingRole;
|
17
|
+
maxLength?: number;
|
18
|
+
annotations: Annotations;
|
19
|
+
saveAnnotations: (annotations: Annotations) => void;
|
20
|
+
}): JSX.Element;
|
21
|
+
export {};
|
22
|
+
//# sourceMappingURL=GradingAnswer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GradingAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/GradingAnswer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAyBlC,KAAK,WAAW,GAAG;IAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IAAC,SAAS,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAExE,KAAK,WAAW,GAAG,YAAY,GAAG,WAAW,CAAA;AAC7C,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,EACvC,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,EACX,eAAe,EACf,SAAS,GACV,EAAE;IACD,MAAM,EAAE;QAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAA;IAC5E,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,OAAO,CAAA;IACnB,WAAW,EAAE,WAAW,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,WAAW,CAAA;IACxB,eAAe,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAA;CACpD,eAkSA"}
|
@@ -0,0 +1,242 @@
|
|
1
|
+
import React, { useEffect, useLayoutEffect, useRef } from 'react';
|
2
|
+
import { annotationFromMousePosition, getOverlappingMessages, hasTextSelectedInAnswerText, imageAnnotationMouseDownInfo, mergeAnnotation, selectionHasNothingToUnderline, showAndPositionElement, textAnnotationFromRange, } from './editAnnotations';
|
3
|
+
import { renderAnnotations, renderImageAnnotationByImage, updateImageAnnotationMarkSize, wrapAllImages, } from '../../renderAnnotations';
|
4
|
+
import GradingAnswerAnnotationList from './GradingAnswerAnnotationList';
|
5
|
+
import { changeLanguage, initI18n } from '../../i18n';
|
6
|
+
import { updateLargeImageWarnings } from './largeImageDetector';
|
7
|
+
import { I18nextProvider } from 'react-i18next';
|
8
|
+
import { useCached } from '../../useCached';
|
9
|
+
import { AnswerCharacterCounter } from './AnswerCharacterCounter';
|
10
|
+
export function GradingAnswer({ answer: { type, characterCount, value }, language, isReadOnly, gradingRole, annotations, saveAnnotations, maxLength, }) {
|
11
|
+
const answerRef = useRef(null);
|
12
|
+
const popupRef = useRef(null);
|
13
|
+
const messageRef = useRef(null);
|
14
|
+
const tooltipRef = useRef(null);
|
15
|
+
let newAnnotationObject;
|
16
|
+
let savedAnnotations;
|
17
|
+
const imgAnnotationState = { start: undefined, element: undefined, img: undefined };
|
18
|
+
let isEditAnnotationPopupVisible = false;
|
19
|
+
let annotationDataForTooltip;
|
20
|
+
let annotationPositionForPopup;
|
21
|
+
let hideTooltipTimeout;
|
22
|
+
let windowResizeTimeout;
|
23
|
+
function onAnnotationOrListClick(e) {
|
24
|
+
var _a;
|
25
|
+
const element = e.target;
|
26
|
+
if (element instanceof HTMLElement) {
|
27
|
+
if (element.tagName === 'MARK') {
|
28
|
+
showTooltip(element);
|
29
|
+
}
|
30
|
+
else if (element.tagName === 'LI') {
|
31
|
+
const index = (_a = element.dataset.listNumber) === null || _a === void 0 ? void 0 : _a.replace(')', '');
|
32
|
+
const mark = document.querySelector(`.e-annotation[data-index="${index}"]`);
|
33
|
+
showTooltip(mark);
|
34
|
+
mark.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
35
|
+
}
|
36
|
+
else if (annotationDataForTooltip) {
|
37
|
+
hideTooltip();
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
function editExistingAnnotation(e) {
|
42
|
+
if (e.target.closest('.editable')) {
|
43
|
+
toggle(tooltipRef.current, false);
|
44
|
+
showExistingAnnotationPopup(annotationPositionForPopup);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
useLayoutEffect(() => {
|
48
|
+
if (answerRef.current) {
|
49
|
+
savedAnnotations = annotations;
|
50
|
+
toggle(tooltipRef.current, false);
|
51
|
+
toggle(popupRef.current, false);
|
52
|
+
renderAnswerWithAnnotations(savedAnnotations);
|
53
|
+
}
|
54
|
+
window.onresize = () => {
|
55
|
+
clearTimeout(windowResizeTimeout);
|
56
|
+
windowResizeTimeout = setTimeout(() => updateLargeImageWarnings(answerRef.current), 1000);
|
57
|
+
};
|
58
|
+
});
|
59
|
+
const i18n = useCached(() => initI18n(language));
|
60
|
+
useEffect(changeLanguage(i18n, language));
|
61
|
+
return (React.createElement(I18nextProvider, { i18n: i18n },
|
62
|
+
React.createElement("div", { onClick: (e) => onAnnotationOrListClick(e), className: "e-grading-answer-wrapper" },
|
63
|
+
React.createElement("div", { className: "e-grading-answer e-line-height-l e-mrg-b-1", ref: answerRef, onMouseDown: (e) => onAnswerMouseDown(e), onMouseOver: (e) => onMouseOverAnnotation(e.target) }),
|
64
|
+
React.createElement(AnswerCharacterCounter, { characterCount: characterCount, maxLength: maxLength }),
|
65
|
+
React.createElement(GradingAnswerAnnotationList, { censoring: annotations.censoring, pregrading: annotations.pregrading, singleGrading: false }),
|
66
|
+
React.createElement("form", { style: { display: 'none' }, ref: popupRef, className: "e-grading-answer-popup e-grading-answer-add-annotation", onSubmit: (e) => onSubmitAnnotation(e) },
|
67
|
+
React.createElement("input", { name: "message", className: "e-grading-answer-add-annotation-text", type: "text", ref: messageRef }),
|
68
|
+
React.createElement("button", { className: "e-grading-answer-add-annotation-button", type: "submit", "data-i18n": "arpa.annotate" }, "Merkitse"),
|
69
|
+
React.createElement("button", { className: "e-grading-answer-close-popup", onClick: (e) => {
|
70
|
+
e.preventDefault();
|
71
|
+
hideAnnotationPopupAndRefresh();
|
72
|
+
} }, "\u00D7")),
|
73
|
+
React.createElement("div", { style: { display: 'none' }, ref: tooltipRef, className: "e-grading-answer-tooltip e-grading-answer-popup", onMouseOver: onMouseOverTooltip, onMouseOut: hideTooltip },
|
74
|
+
React.createElement("span", { onClick: (e) => editExistingAnnotation(e), className: "e-grading-answer-tooltip-label" }, "tooltip text"),
|
75
|
+
React.createElement("button", { onClick: (e) => removeAnnotation(e), className: "e-grading-answer-tooltip-remove" }, "\u00D7")))));
|
76
|
+
function removeAnnotation(e) {
|
77
|
+
e.preventDefault();
|
78
|
+
hideTooltip();
|
79
|
+
savedAnnotations[annotationDataForTooltip.role].splice(annotationDataForTooltip.index, 1);
|
80
|
+
annotationDataForTooltip = undefined;
|
81
|
+
saveAnnotations(savedAnnotations);
|
82
|
+
}
|
83
|
+
function hideTooltip() {
|
84
|
+
hideTooltipTimeout = setTimeout(() => {
|
85
|
+
toggle(tooltipRef.current, false);
|
86
|
+
}, 400);
|
87
|
+
}
|
88
|
+
function onMouseOverTooltip() {
|
89
|
+
clearTimeout(hideTooltipTimeout);
|
90
|
+
}
|
91
|
+
function onMouseOutFromTooltip(e) {
|
92
|
+
const target = e.target;
|
93
|
+
if (target.tagName === 'MARK') {
|
94
|
+
clearTimeout(hideTooltipTimeout);
|
95
|
+
hideTooltip();
|
96
|
+
}
|
97
|
+
answerRef.current.removeEventListener('mouseout', onMouseOutFromTooltip);
|
98
|
+
}
|
99
|
+
function showTooltip(target) {
|
100
|
+
clearTimeout(hideTooltipTimeout);
|
101
|
+
const tooltip = tooltipRef.current;
|
102
|
+
const { type, listIndex, message } = target.dataset;
|
103
|
+
tooltip.classList.toggle('editable', !isReadOnly && type === gradingRole);
|
104
|
+
annotationPositionForPopup = target.getBoundingClientRect();
|
105
|
+
showAndPositionElement(annotationPositionForPopup, answerRef.current, tooltip);
|
106
|
+
tooltip.querySelector('.e-grading-answer-tooltip-label').textContent = message || '–';
|
107
|
+
annotationDataForTooltip = { index: Number(listIndex), role: type, message: message || '' };
|
108
|
+
answerRef.current.addEventListener('mouseout', onMouseOutFromTooltip);
|
109
|
+
}
|
110
|
+
function onMouseOverAnnotation(target) {
|
111
|
+
if (target.tagName === 'MARK' &&
|
112
|
+
!isEditAnnotationPopupVisible &&
|
113
|
+
(!hasTextSelectedInAnswerText() || isReadOnly) &&
|
114
|
+
!imgAnnotationState.element) {
|
115
|
+
showTooltip(target);
|
116
|
+
}
|
117
|
+
}
|
118
|
+
function showAnnotationPopup(rect, message) {
|
119
|
+
annotationDataForTooltip = undefined;
|
120
|
+
setupAnnotationPopup(rect, message);
|
121
|
+
}
|
122
|
+
function showExistingAnnotationPopup(rect) {
|
123
|
+
setupAnnotationPopup(rect, annotationDataForTooltip.message);
|
124
|
+
}
|
125
|
+
function setupAnnotationPopup(rect, message) {
|
126
|
+
// Could be active from previous popup
|
127
|
+
window.removeEventListener('keydown', onKeyUpInAnnotationPopup);
|
128
|
+
showAndPositionElement(rect, answerRef.current, popupRef.current);
|
129
|
+
const inputElement = messageRef.current;
|
130
|
+
inputElement.value = message;
|
131
|
+
inputElement.focus();
|
132
|
+
isEditAnnotationPopupVisible = true;
|
133
|
+
window.addEventListener('keydown', onKeyUpInAnnotationPopup);
|
134
|
+
}
|
135
|
+
function hideAnnotationPopupAndRefresh() {
|
136
|
+
newAnnotationObject = undefined;
|
137
|
+
imgAnnotationState.element = undefined;
|
138
|
+
imgAnnotationState.img = undefined;
|
139
|
+
isEditAnnotationPopupVisible = false;
|
140
|
+
window.removeEventListener('keydown', onKeyUpInAnnotationPopup);
|
141
|
+
toggle(popupRef.current, false);
|
142
|
+
renderAnswerWithAnnotations(savedAnnotations);
|
143
|
+
}
|
144
|
+
function onAnswerMouseDown(e) {
|
145
|
+
var _a;
|
146
|
+
if (isReadOnly) {
|
147
|
+
return;
|
148
|
+
}
|
149
|
+
window.addEventListener('mouseup', onWindowMouseUpAfterAnswerMouseDown);
|
150
|
+
// Do annotations only with left mouse buttons
|
151
|
+
if (e.button !== 0) {
|
152
|
+
return;
|
153
|
+
}
|
154
|
+
const target = e.target;
|
155
|
+
const img = ((_a = target.closest('.e-annotation-wrapper')) === null || _a === void 0 ? void 0 : _a.querySelector('img')) || undefined;
|
156
|
+
if (!img) {
|
157
|
+
return;
|
158
|
+
}
|
159
|
+
img.addEventListener('dragstart', preventDefaults); // Prevent dragging images when marking image annotations
|
160
|
+
imgAnnotationState.start = imageAnnotationMouseDownInfo(e, img);
|
161
|
+
imgAnnotationState.img = img;
|
162
|
+
window.addEventListener('mousemove', onMouseMoveForImageAnnotation);
|
163
|
+
}
|
164
|
+
function onWindowMouseUpAfterAnswerMouseDown() {
|
165
|
+
var _a, _b;
|
166
|
+
(_a = imgAnnotationState.img) === null || _a === void 0 ? void 0 : _a.removeEventListener('dragstart', preventDefaults);
|
167
|
+
window.removeEventListener('mousemove', onMouseMoveForImageAnnotation);
|
168
|
+
window.removeEventListener('mouseup', onWindowMouseUpAfterAnswerMouseDown);
|
169
|
+
// Image annotation is being created since shape exists
|
170
|
+
if (imgAnnotationState.element) {
|
171
|
+
showAnnotationPopup((_b = imgAnnotationState.element) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect(), '');
|
172
|
+
return;
|
173
|
+
}
|
174
|
+
// Text annotation
|
175
|
+
const selection = window.getSelection();
|
176
|
+
if (selection && answerRef.current !== null && hasTextSelectedInAnswerText()) {
|
177
|
+
const range = selection.getRangeAt(0);
|
178
|
+
if (selectionHasNothingToUnderline(range)) {
|
179
|
+
return;
|
180
|
+
}
|
181
|
+
const position = textAnnotationFromRange(answerRef.current, range);
|
182
|
+
const message = getOverlappingMessages(savedAnnotations[gradingRole], position.startIndex, position.length);
|
183
|
+
newAnnotationObject = { ...position, type: 'text', message };
|
184
|
+
showAnnotationPopup(range.getBoundingClientRect(), message);
|
185
|
+
const newAnnotations = { ...savedAnnotations };
|
186
|
+
newAnnotations[gradingRole] = mergeAnnotation(answerRef.current, newAnnotationObject, savedAnnotations[gradingRole]);
|
187
|
+
renderAnswerWithAnnotations(newAnnotations);
|
188
|
+
}
|
189
|
+
}
|
190
|
+
function onMouseMoveForImageAnnotation(e) {
|
191
|
+
preventDefaults(e);
|
192
|
+
newAnnotationObject = annotationFromMousePosition(e, imgAnnotationState.start);
|
193
|
+
// Create shape on first mouse move and resize after that
|
194
|
+
if (imgAnnotationState.element) {
|
195
|
+
updateImageAnnotationMarkSize(imgAnnotationState.element, newAnnotationObject);
|
196
|
+
}
|
197
|
+
else {
|
198
|
+
imgAnnotationState.element = renderImageAnnotationByImage(imgAnnotationState.img, '', newAnnotationObject, gradingRole, 999);
|
199
|
+
}
|
200
|
+
}
|
201
|
+
function renderAnswerWithAnnotations(annotations) {
|
202
|
+
const container = answerRef.current;
|
203
|
+
if (type === 'richText') {
|
204
|
+
container.innerHTML = value;
|
205
|
+
wrapAllImages(container);
|
206
|
+
updateLargeImageWarnings(container);
|
207
|
+
}
|
208
|
+
else {
|
209
|
+
container.textContent = value;
|
210
|
+
}
|
211
|
+
renderAnnotations(container, annotations.pregrading, annotations.censoring, false);
|
212
|
+
}
|
213
|
+
function onSubmitAnnotation(e) {
|
214
|
+
e.preventDefault();
|
215
|
+
const message = messageRef.current.value;
|
216
|
+
if (annotationDataForTooltip) {
|
217
|
+
// Editing existing annotation message by clicking tooltip
|
218
|
+
savedAnnotations[annotationDataForTooltip.role][annotationDataForTooltip.index].message = message;
|
219
|
+
}
|
220
|
+
else {
|
221
|
+
// Saving new annotation
|
222
|
+
savedAnnotations[gradingRole] = mergeAnnotation(answerRef.current, { ...newAnnotationObject, message }, savedAnnotations[gradingRole] || []);
|
223
|
+
}
|
224
|
+
toggle(popupRef.current, false);
|
225
|
+
saveAnnotations(savedAnnotations);
|
226
|
+
}
|
227
|
+
function onKeyUpInAnnotationPopup(e) {
|
228
|
+
if (e.key === 'Escape' && isEditAnnotationPopupVisible) {
|
229
|
+
hideAnnotationPopupAndRefresh();
|
230
|
+
}
|
231
|
+
}
|
232
|
+
}
|
233
|
+
function preventDefaults(e) {
|
234
|
+
e.preventDefault();
|
235
|
+
e.stopPropagation();
|
236
|
+
}
|
237
|
+
function toggle(element, isVisible) {
|
238
|
+
if (element instanceof HTMLElement) {
|
239
|
+
element.style.display = isVisible ? 'initial' : 'none';
|
240
|
+
}
|
241
|
+
}
|
242
|
+
//# sourceMappingURL=GradingAnswer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GradingAnswer.js","sourceRoot":"","sources":["../../../src/components/grading/GradingAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE5E,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,EAC5B,eAAe,EAEf,8BAA8B,EAC9B,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,6BAA6B,EAC7B,aAAa,GACd,MAAM,yBAAyB,CAAA;AAChC,OAAO,2BAA2B,MAAM,+BAA+B,CAAA;AACvE,OAAO,E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G,UAAU,CAAC,OAAQ,CAAC,KAAK,CAAA;QACzC,IAAI,wBAAwB,EAAE;YAC5B,0DAA0D;YAC1D,gBAAgB,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,OAAO,CAAA;SAClG;aAAM;YACL,wBAAwB;YACxB,gBAAgB,CAAC,WAAW,CAAC,GAAG,eAAe,CAC7C,SAAS,CAAC,OAAQ,EAClB,EAAE,GAAG,mBAAoB,EAAE,OAAO,EAAE,EACpC,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,CACpC,CAAA;SACF;QACD,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC/B,eAAe,CAAC,gBAAgB,CAAC,CAAA;IACnC,CAAC;IAED,SAAS,wBAAwB,CAAC,CAAgB;QAChD,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,4BAA4B,EAAE;YACtD,6BAA6B,EAAE,CAAA;SAChC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,CAAQ;IAC/B,CAAC,CAAC,cAAc,EAAE,CAAA;IAClB,CAAC,CAAC,eAAe,EAAE,CAAA;AACrB,CAAC;AAED,SAAS,MAAM,CAAC,OAA2B,EAAE,SAAkB;IAC7D,IAAI,OAAO,YAAY,WAAW,EAAE;QAClC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAA;KACvD;AACH,CAAC"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/// <reference types="react" />
|
2
|
+
import { Annotation } from '../../index';
|
3
|
+
declare function GradingAnswerAnnotationList({ pregrading, censoring, singleGrading, }: {
|
4
|
+
pregrading: Annotation[];
|
5
|
+
censoring: Annotation[];
|
6
|
+
singleGrading: boolean;
|
7
|
+
}): JSX.Element;
|
8
|
+
export default GradingAnswerAnnotationList;
|
9
|
+
//# sourceMappingURL=GradingAnswerAnnotationList.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GradingAnswerAnnotationList.d.ts","sourceRoot":"","sources":["../../../src/components/grading/GradingAnswerAnnotationList.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAGxC,iBAAS,2BAA2B,CAAC,EACnC,UAAU,EACV,SAAS,EACT,aAAa,GACd,EAAE;IACD,UAAU,EAAE,UAAU,EAAE,CAAA;IACxB,SAAS,EAAE,UAAU,EAAE,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;CACvB,eAmBA;AAED,eAAe,2BAA2B,CAAA"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { AnnotationLists } from '../shared/AnnotationLists';
|
3
|
+
function GradingAnswerAnnotationList({ pregrading, censoring, singleGrading, }) {
|
4
|
+
const getListOfAnnotations = (annotations, listNumberOffset = 0) => {
|
5
|
+
var _a;
|
6
|
+
return (_a = annotations
|
7
|
+
.filter((a) => a.message.length)
|
8
|
+
.map((annotation, i) => {
|
9
|
+
const numbering = String(listNumberOffset + i + 1) + ')';
|
10
|
+
const message = annotation.message;
|
11
|
+
return { numbering, message };
|
12
|
+
})) !== null && _a !== void 0 ? _a : [];
|
13
|
+
};
|
14
|
+
const pregradingAnnotations = getListOfAnnotations(pregrading);
|
15
|
+
const censoringAnnotations = getListOfAnnotations(censoring, pregradingAnnotations.length);
|
16
|
+
return (React.createElement(AnnotationLists, { pregradingAnnotations: pregradingAnnotations, censoringAnnotations: censoringAnnotations, singleGrading: singleGrading }));
|
17
|
+
}
|
18
|
+
export default GradingAnswerAnnotationList;
|
19
|
+
//# sourceMappingURL=GradingAnswerAnnotationList.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"GradingAnswerAnnotationList.js","sourceRoot":"","sources":["../../../src/components/grading/GradingAnswerAnnotationList.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,SAAS,2BAA2B,CAAC,EACnC,UAAU,EACV,SAAS,EACT,aAAa,GAKd;IACC,MAAM,oBAAoB,GAAG,CAAC,WAAyB,EAAE,gBAAgB,GAAG,CAAC,EAAE,EAAE;;QAC/E,OAAA,MAAA,WAAW;aACR,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;aAC/B,GAAG,CAAC,CAAC,UAAsB,EAAE,CAAS,EAAE,EAAE;YACzC,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAA;YACxD,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAA;YAClC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,CAAA;QAC/B,CAAC,CAAC,mCAAI,EAAE,CAAA;KAAA,CAAA;IAEZ,MAAM,qBAAqB,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAA;IAC9D,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,SAAS,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAC1F,OAAO,CACL,oBAAC,eAAe,IACd,qBAAqB,EAAE,qBAAqB,EAC5C,oBAAoB,EAAE,oBAAoB,EAC1C,aAAa,EAAE,aAAa,GAC5B,CACH,CAAA;AACH,CAAC;AAED,eAAe,2BAA2B,CAAA"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Annotation, ImageAnnotation, TextAnnotation } from '../../types/Score';
|
2
|
+
import React from 'react';
|
3
|
+
export declare function textAnnotationFromRange(answerTextNode: Element, range: Range): {
|
4
|
+
startIndex: number;
|
5
|
+
length: number;
|
6
|
+
};
|
7
|
+
export declare function getOverlappingMessages(currentAnnotations: Annotation[], start: number, length: number): string;
|
8
|
+
export declare function getOverlappingMessagesFromTextAnnotations(currentAnnotations: TextAnnotation[], start: number, length: number): string;
|
9
|
+
export declare function toNodeLength(node: Node): number | undefined;
|
10
|
+
export declare function allNodesUnder(el: Node, documentObject?: Document): Node[];
|
11
|
+
export declare function showAndPositionElement(annotationRect: DOMRect, container: HTMLElement, popup: HTMLElement): void;
|
12
|
+
export declare function hasTextSelectedInAnswerText(): boolean;
|
13
|
+
export declare function selectionHasNothingToUnderline(range: Range): boolean;
|
14
|
+
export declare function mergeAnnotation($answerText: Element, newAnnotation: Annotation, annotations: Annotation[]): Annotation[];
|
15
|
+
export declare function getImageStartIndex($image: Element, $answerText: Element): number;
|
16
|
+
export type NewImageAnnotation = {
|
17
|
+
bbox: DOMRect;
|
18
|
+
attachmentIndex: number;
|
19
|
+
startX: number;
|
20
|
+
startY: number;
|
21
|
+
clientX: number;
|
22
|
+
clientY: number;
|
23
|
+
};
|
24
|
+
export declare function annotationFromMousePosition(e: MouseEvent, { bbox, attachmentIndex, startX, startY, clientX, clientY }: NewImageAnnotation): ImageAnnotation;
|
25
|
+
export declare function imageAnnotationMouseDownInfo(e: React.MouseEvent<HTMLDivElement, MouseEvent>, image: HTMLImageElement): NewImageAnnotation;
|
26
|
+
//# sourceMappingURL=editAnnotations.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"editAnnotations.d.ts","sourceRoot":"","sources":["../../../src/components/grading/editAnnotations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC/E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK;;;EAgB5E;AAED,wBAAgB,sBAAsB,CAAC,kBAAkB,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,UAGrG;AACD,wBAAgB,yCAAyC,CACvD,kBAAkB,EAAE,cAAc,EAAE,EACpC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,UAIf;AACD,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,sBAEtC;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,cAAc,WAAW,GAAG,IAAI,EAAE,CAQzE;AAED,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,QAczG;AAED,wBAAgB,2BAA2B,IAAI,OAAO,CAqCrD;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,KAAK,WAM1D;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,gBA0BzG;AAqBD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,UAKvE;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,OAAO,CAAA;IACb,eAAe,EAAE,MAAM,CAAA;IACvB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AACD,wBAAgB,2BAA2B,CACzC,CAAC,EAAE,UAAU,EACb,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,kBAAkB,GAC9E,eAAe,CA+BjB;AACD,wBAAgB,4BAA4B,CAC1C,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,EAC/C,KAAK,EAAE,gBAAgB,GACtB,kBAAkB,CAUpB"}
|
@@ -0,0 +1,177 @@
|
|
1
|
+
import * as _ from 'lodash-es';
|
2
|
+
export function textAnnotationFromRange(answerTextNode, range) {
|
3
|
+
const answerNodes = allNodesUnder(answerTextNode);
|
4
|
+
const charactersBefore = charactersBeforeContainer(range.startContainer, range.startOffset);
|
5
|
+
const charactersUntilEnd = charactersBeforeContainer(range.endContainer, range.endOffset);
|
6
|
+
return {
|
7
|
+
startIndex: charactersBefore,
|
8
|
+
length: charactersUntilEnd - charactersBefore,
|
9
|
+
};
|
10
|
+
function charactersBeforeContainer(rangeContainer, offset) {
|
11
|
+
const containerIsTag = rangeContainer === answerTextNode;
|
12
|
+
const container = containerIsTag ? rangeContainer.childNodes[offset] : rangeContainer;
|
13
|
+
const offsetInside = containerIsTag ? 0 : offset;
|
14
|
+
const nodesBeforeContainer = _.takeWhile(answerNodes, (node) => node !== container);
|
15
|
+
return offsetInside + _.sum(nodesBeforeContainer.map(toNodeLength));
|
16
|
+
}
|
17
|
+
}
|
18
|
+
export function getOverlappingMessages(currentAnnotations, start, length) {
|
19
|
+
const textAnnotations = currentAnnotations.filter((a) => a.type === 'text');
|
20
|
+
return getOverlappingMessagesFromTextAnnotations(textAnnotations, start, length);
|
21
|
+
}
|
22
|
+
export function getOverlappingMessagesFromTextAnnotations(currentAnnotations, start, length) {
|
23
|
+
const parted = getOverlappingAnnotations(currentAnnotations, { startIndex: start, length, message: '' });
|
24
|
+
return _.compact(parted.overlapping.map((anno) => anno.message)).reduceRight((msg, str) => `${str} / ${msg}`, '');
|
25
|
+
}
|
26
|
+
export function toNodeLength(node) {
|
27
|
+
var _a;
|
28
|
+
return node.nodeType === Node.TEXT_NODE ? (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length : node.nodeName === 'IMG' ? 1 : 0;
|
29
|
+
}
|
30
|
+
export function allNodesUnder(el, documentObject = document) {
|
31
|
+
let n = null;
|
32
|
+
const a = [];
|
33
|
+
const walk = documentObject.createTreeWalker(el, NodeFilter.SHOW_TEXT + NodeFilter.SHOW_ELEMENT, null);
|
34
|
+
while ((n = walk.nextNode())) {
|
35
|
+
a.push(n);
|
36
|
+
}
|
37
|
+
return a;
|
38
|
+
}
|
39
|
+
export function showAndPositionElement(annotationRect, container, popup) {
|
40
|
+
const style = popup.style;
|
41
|
+
if (container) {
|
42
|
+
style.display = 'block';
|
43
|
+
const containerRect = container.getBoundingClientRect();
|
44
|
+
const popupRect = popup.getBoundingClientRect();
|
45
|
+
const left = annotationRect.left - containerRect.left;
|
46
|
+
const top = annotationRect.bottom - containerRect.top + 25;
|
47
|
+
style.top = String(top) + 'px';
|
48
|
+
style.left =
|
49
|
+
String(left + popupRect.width < containerRect.width ? left + 20 : containerRect.width - popupRect.width + 15) +
|
50
|
+
'px';
|
51
|
+
}
|
52
|
+
}
|
53
|
+
export function hasTextSelectedInAnswerText() {
|
54
|
+
const selection = window.getSelection();
|
55
|
+
return (selection !== null &&
|
56
|
+
selectionInAnswerText(selection) &&
|
57
|
+
(isRangeSelection(selection) || textSelectedInRange(selection)));
|
58
|
+
function selectionInAnswerText(sel) {
|
59
|
+
var _a, _b, _c;
|
60
|
+
if (sel.type === 'None' || sel.type === 'Caret' || sel.rangeCount === 0)
|
61
|
+
return false;
|
62
|
+
const startContainer = sel.getRangeAt(0).startContainer;
|
63
|
+
const endContainer = sel.getRangeAt(0).endContainer;
|
64
|
+
return (sel.rangeCount > 0 &&
|
65
|
+
((_a = startContainer.parentElement) === null || _a === void 0 ? void 0 : _a.closest('.e-grading-answer')) !== null &&
|
66
|
+
((_b = endContainer.parentElement) === null || _b === void 0 ? void 0 : _b.closest('.e-grading-answer')) !== null &&
|
67
|
+
((_c = startContainer.parentElement) === null || _c === void 0 ? void 0 : _c.closest('.remove-annotation-popup')) === null);
|
68
|
+
}
|
69
|
+
function isRangeSelection(sel) {
|
70
|
+
return (sel === null || sel === void 0 ? void 0 : sel.type) === 'Range';
|
71
|
+
}
|
72
|
+
function textSelectedInRange(sel) {
|
73
|
+
const range = sel.getRangeAt(0);
|
74
|
+
return (!!sel.rangeCount &&
|
75
|
+
(range.toString().length > 0 ||
|
76
|
+
isParentContainer(range.startContainer) ||
|
77
|
+
isParentContainer(range.endContainer)));
|
78
|
+
}
|
79
|
+
function isParentContainer(container) {
|
80
|
+
return container.classList.contains('answer');
|
81
|
+
}
|
82
|
+
}
|
83
|
+
export function selectionHasNothingToUnderline(range) {
|
84
|
+
var _a;
|
85
|
+
const contents = range.cloneContents();
|
86
|
+
const hasImages = Array.from(contents.childNodes)
|
87
|
+
.map((x) => (x instanceof Element ? x.tagName : null))
|
88
|
+
.includes('IMG');
|
89
|
+
return ((_a = contents.textContent) === null || _a === void 0 ? void 0 : _a.length) === 0 && !hasImages;
|
90
|
+
}
|
91
|
+
export function mergeAnnotation($answerText, newAnnotation, annotations) {
|
92
|
+
// @ts-ignore
|
93
|
+
const parted = getOverlappingAnnotations(annotations, newAnnotation);
|
94
|
+
if (parted.overlapping.length > 0) {
|
95
|
+
parted.overlapping.push(newAnnotation);
|
96
|
+
const mergedStart = _.minBy(parted.overlapping, (range) => range.startIndex);
|
97
|
+
const mergedEnd = _.maxBy(parted.overlapping, (range) => range.startIndex + range.length);
|
98
|
+
const mergedRange = {
|
99
|
+
startIndex: mergedStart.startIndex,
|
100
|
+
length: mergedEnd.startIndex + mergedEnd.length - mergedStart.startIndex,
|
101
|
+
message: newAnnotation.message,
|
102
|
+
};
|
103
|
+
parted.nonOverlapping.push(mergedRange);
|
104
|
+
}
|
105
|
+
else {
|
106
|
+
parted.nonOverlapping.push(newAnnotation);
|
107
|
+
}
|
108
|
+
return _.sortBy(parted.nonOverlapping, (a) => a.type === 'line' || a.type === 'rect'
|
109
|
+
? getImageStartIndex(findAttachment($answerText, a.attachmentIndex), $answerText)
|
110
|
+
: a.startIndex, (a) => (a.type === 'rect' ? a.y : a.type === 'line' ? a.y1 : undefined), (a) => (a.type === 'rect' ? a.x : a.type === 'line' ? a.x1 : undefined));
|
111
|
+
}
|
112
|
+
function findAttachment(container, index) {
|
113
|
+
return container.querySelectorAll('img').item(index);
|
114
|
+
}
|
115
|
+
function getOverlappingAnnotations(annotations, newAnnotation) {
|
116
|
+
const partitioned = _.partition(annotations, (other) => {
|
117
|
+
const newEnd = newAnnotation.startIndex + newAnnotation.length;
|
118
|
+
const otherEnd = other.startIndex + other.length;
|
119
|
+
return ((newAnnotation.startIndex >= other.startIndex && newAnnotation.startIndex <= otherEnd) ||
|
120
|
+
(newEnd >= other.startIndex && newEnd <= otherEnd) ||
|
121
|
+
(newAnnotation.startIndex <= other.startIndex && newEnd >= otherEnd));
|
122
|
+
});
|
123
|
+
return { overlapping: partitioned[0], nonOverlapping: partitioned[1] };
|
124
|
+
}
|
125
|
+
export function getImageStartIndex($image, $answerText) {
|
126
|
+
const range = document.createRange();
|
127
|
+
const referenceNode = $image;
|
128
|
+
range.selectNode(referenceNode);
|
129
|
+
return textAnnotationFromRange($answerText, range).startIndex;
|
130
|
+
}
|
131
|
+
export function annotationFromMousePosition(e, { bbox, attachmentIndex, startX, startY, clientX, clientY }) {
|
132
|
+
const lineThresholdPx = 10;
|
133
|
+
const currentX = clamp((e.clientX - bbox.left) / bbox.width);
|
134
|
+
const currentY = clamp((e.clientY - bbox.top) / bbox.height);
|
135
|
+
const isVerticalLine = Math.abs(clientX - e.clientX) <= lineThresholdPx;
|
136
|
+
const isHorizontalLine = Math.abs(clientY - e.clientY) <= lineThresholdPx;
|
137
|
+
const type = isVerticalLine || isHorizontalLine ? 'line' : 'rect';
|
138
|
+
switch (type) {
|
139
|
+
case 'rect': {
|
140
|
+
return {
|
141
|
+
type: 'rect',
|
142
|
+
attachmentIndex,
|
143
|
+
x: Math.min(startX, currentX),
|
144
|
+
y: Math.min(startY, currentY),
|
145
|
+
width: Math.abs(currentX - startX),
|
146
|
+
height: Math.abs(currentY - startY),
|
147
|
+
message: '',
|
148
|
+
};
|
149
|
+
}
|
150
|
+
case 'line': {
|
151
|
+
return {
|
152
|
+
type: 'line',
|
153
|
+
attachmentIndex,
|
154
|
+
x1: isVerticalLine ? startX : Math.min(startX, currentX),
|
155
|
+
y1: isHorizontalLine ? startY : Math.min(startY, currentY),
|
156
|
+
x2: isVerticalLine ? startX : Math.max(startX, currentX),
|
157
|
+
y2: isHorizontalLine ? startY : Math.max(startY, currentY),
|
158
|
+
message: '',
|
159
|
+
};
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
export function imageAnnotationMouseDownInfo(e, image) {
|
164
|
+
const targetAnswerText = image.closest('.e-grading-answer');
|
165
|
+
const attachmentIndex = Array.from(targetAnswerText.querySelectorAll('img')).findIndex((img) => img === image);
|
166
|
+
const attachmentWrapper = targetAnswerText.querySelectorAll('.e-annotation-wrapper').item(attachmentIndex);
|
167
|
+
const bbox = attachmentWrapper.getBoundingClientRect();
|
168
|
+
const clientX = e.clientX;
|
169
|
+
const startX = clamp((clientX - bbox.left) / bbox.width);
|
170
|
+
const clientY = e.clientY;
|
171
|
+
const startY = clamp((clientY - bbox.top) / bbox.height);
|
172
|
+
return { attachmentIndex, bbox, startX, startY, clientX, clientY };
|
173
|
+
}
|
174
|
+
function clamp(n) {
|
175
|
+
return _.clamp(n, 0, 1);
|
176
|
+
}
|
177
|
+
//# sourceMappingURL=editAnnotations.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"editAnnotations.js","sourceRoot":"","sources":["../../../src/components/grading/editAnnotations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAI9B,MAAM,UAAU,uBAAuB,CAAC,cAAuB,EAAE,KAAY;IAC3E,MAAM,WAAW,GAAG,aAAa,CAAC,cAAc,CAAC,CAAA;IACjD,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,WAAW,CAAC,CAAA;IAC3F,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;IACzF,OAAO;QACL,UAAU,EAAE,gBAAgB;QAC5B,MAAM,EAAE,kBAAkB,GAAG,gBAAgB;KAC9C,CAAA;IAED,SAAS,yBAAyB,CAAC,cAAoB,EAAE,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