@digabi/exam-engine-core 19.0.4-alpha.1 → 19.0.4-alpha.3
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/Grading.d.ts.map +1 -1
- package/dist/components/grading/Grading.js +12 -12
- package/dist/components/grading/Grading.js.map +1 -1
- package/dist/components/grading/GradingAnswer.d.ts +7 -3
- package/dist/components/grading/GradingAnswer.d.ts.map +1 -1
- package/dist/components/grading/GradingAnswer.js +118 -67
- package/dist/components/grading/GradingAnswer.js.map +1 -1
- 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 +2 -1
- package/dist/components/grading/editAnnotations.d.ts.map +1 -1
- package/dist/components/grading/editAnnotations.js +7 -5
- package/dist/components/grading/editAnnotations.js.map +1 -1
- 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/largeImageResizer.d.ts +2 -0
- package/dist/components/grading/largeImageResizer.d.ts.map +1 -0
- package/dist/components/grading/largeImageResizer.js +33 -0
- package/dist/components/grading/largeImageResizer.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 +2 -13
- package/dist/components/results/internal/AnnotationList.js.map +1 -1
- package/dist/components/shared/AnnotationListComponent.d.ts +1 -0
- package/dist/components/shared/AnnotationListComponent.d.ts.map +1 -0
- package/dist/components/shared/AnnotationListComponent.js +2 -0
- package/dist/components/shared/AnnotationListComponent.js.map +1 -0
- 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/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/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main.css +1 -1
- package/dist/renderAnnotations.d.ts.map +1 -1
- package/dist/renderAnnotations.js +6 -4
- package/dist/renderAnnotations.js.map +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Grading.d.ts","sourceRoot":"","sources":["../../../src/components/grading/Grading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAA;;
|
1
|
+
{"version":3,"file":"Grading.d.ts","sourceRoot":"","sources":["../../../src/components/grading/Grading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAA;;AAyGtE,wBAA6E"}
|
@@ -49,29 +49,29 @@ function Grading() {
|
|
49
49
|
pregrading: [],
|
50
50
|
censoring: [],
|
51
51
|
});
|
52
|
-
|
53
|
-
|
54
|
-
});
|
55
|
-
const { type: answerType, value } = answersByQuestionId[answerId];
|
56
|
-
if (answerType === 'choice') {
|
52
|
+
const { questionId, type, value, displayNumber } = answersByQuestionId[answerId];
|
53
|
+
if (type === 'choice') {
|
57
54
|
return React.createElement("div", null, "choice answer");
|
58
55
|
}
|
59
|
-
function selectQuestion(
|
60
|
-
e.preventDefault();
|
56
|
+
function selectQuestion(id) {
|
61
57
|
setAnswerId(id);
|
62
58
|
setAnnotations(annotationsStorage.current[id]);
|
63
59
|
}
|
64
60
|
function saveAnnotations(annotations) {
|
65
61
|
annotationsStorage.current[answerId] = annotations;
|
66
|
-
|
62
|
+
console.log('saving: ', annotationsStorage.current);
|
67
63
|
}
|
68
64
|
return (React.createElement(I18nextProvider, { i18n: i18n },
|
69
65
|
React.createElement("main", { className: "e-exam" },
|
70
|
-
React.createElement("div",
|
66
|
+
React.createElement("div", null, answerIds.map((id) => (React.createElement("button", { onClick: () => selectQuestion(id), key: id }, answersByQuestionId[id].displayNumber)))),
|
67
|
+
React.createElement("div", null,
|
68
|
+
"Teht\u00E4v\u00E4 ",
|
69
|
+
displayNumber,
|
70
|
+
" (",
|
71
|
+
questionId,
|
72
|
+
")"),
|
71
73
|
React.createElement(GradingAnswer, { ...{
|
72
|
-
|
73
|
-
answerType,
|
74
|
-
gradingRole: 'censoring',
|
74
|
+
type,
|
75
75
|
value,
|
76
76
|
annotations,
|
77
77
|
saveAnnotations,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Grading.js","sourceRoot":"","sources":["../../../src/components/grading/Grading.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C,SAAS,OAAO;IACd,MAAM,EAAE,mBAAmB,EAAE,GAAG,UAAU,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IAAI;QACzB,8BAAM,SAAS,EAAC,QAAQ;YACtB,iCACG,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CACrB,gCAAQ,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,IAC/C,mBAAmB,CAAC,EAAE,CAAC,CAAC,aAAa,CAC/B,CACV,CAAC,CACE;YAEN;;gBACW,aAAa;;gBAAI,UAAU;oBAChC;YACN,oBAAC,aAAa,OACR;oBACF,IAAI;oBACJ,KAAK;oBACL,WAAW;oBACX,eAAe;iBAChB,GACD,CACG,CACS,CACnB,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA"}
|
@@ -5,11 +5,15 @@ type Annotations = {
|
|
5
5
|
censoring: Annotation[];
|
6
6
|
};
|
7
7
|
type GradingType = 'pregrading' | 'censoring';
|
8
|
-
export declare function GradingAnswer({
|
8
|
+
export declare function GradingAnswer({ answer: { type, characterCount, value }, isReadOnly, gradingRole, annotations, saveAnnotations, maxLength, }: {
|
9
|
+
answer: {
|
10
|
+
type: 'richText' | 'text';
|
11
|
+
characterCount: number;
|
12
|
+
value: string;
|
13
|
+
};
|
9
14
|
isReadOnly: boolean;
|
10
|
-
answerType: 'richText' | 'text';
|
11
15
|
gradingRole: GradingType;
|
12
|
-
|
16
|
+
maxLength?: number;
|
13
17
|
annotations: Annotations;
|
14
18
|
saveAnnotations: (annotations: Annotations) => void;
|
15
19
|
}): JSX.Element;
|
@@ -1 +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;
|
1
|
+
{"version":3,"file":"GradingAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/GradingAnswer.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAqBlC,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,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,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,eAwRA"}
|
@@ -1,100 +1,125 @@
|
|
1
1
|
import React, { useLayoutEffect, useRef } from 'react';
|
2
|
-
import { annotationFromMousePosition, hasTextSelectedInAnswerText, imageAnnotationMouseDownInfo, mergeAnnotation,
|
2
|
+
import { annotationFromMousePosition, hasTextSelectedInAnswerText, imageAnnotationMouseDownInfo, mergeAnnotation, selectionHasNothingToUnderline, showAndPositionPopup, textAnnotationFromRange, } from './editAnnotations';
|
3
3
|
import { renderAnnotations, renderImageAnnotationByImage, updateImageAnnotationMarkSize, wrapAllImages, } from '../../renderAnnotations';
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
}
|
8
|
-
export function GradingAnswer({ isReadOnly, answerType, gradingRole, annotations, saveAnnotations, value, }) {
|
4
|
+
import GradingAnswerAnnotationList from './GradingAnswerAnnotationList';
|
5
|
+
import { useExamTranslation } from '../../i18n';
|
6
|
+
import { updateLargeImageWarnings } from './largeImageDetector';
|
7
|
+
export function GradingAnswer({ answer: { type, characterCount, value }, isReadOnly, gradingRole, annotations, saveAnnotations, maxLength, }) {
|
9
8
|
const answerRef = useRef(null);
|
10
9
|
const popupRef = useRef(null);
|
11
10
|
const messageRef = useRef(null);
|
12
11
|
const tooltipRef = useRef(null);
|
13
12
|
let newAnnotationObject;
|
14
|
-
|
15
|
-
|
16
|
-
let mouseDownInfo;
|
17
|
-
let newImageAnnotationMark;
|
18
|
-
let imageAtHand;
|
13
|
+
let savedAnnotations;
|
14
|
+
const imgAnnotationState = { start: undefined, element: undefined, img: undefined };
|
19
15
|
let isPopupVisible = false;
|
20
|
-
let
|
16
|
+
let closeTooltipTimeout;
|
21
17
|
let annotationDataForTooltip;
|
18
|
+
let windowResizeTimeout;
|
19
|
+
let popupPosition;
|
20
|
+
function editExistingAnnotation(e) {
|
21
|
+
if (e.target.closest('.editable')) {
|
22
|
+
toggle(tooltipRef.current, false);
|
23
|
+
showOldAnnotationPopup(popupPosition);
|
24
|
+
}
|
25
|
+
}
|
22
26
|
useLayoutEffect(() => {
|
23
27
|
if (answerRef.current) {
|
24
|
-
|
25
|
-
tooltipRef.current
|
26
|
-
popupRef.current
|
27
|
-
renderAnswerWithAnnotations(
|
28
|
+
savedAnnotations = annotations;
|
29
|
+
toggle(tooltipRef.current, false);
|
30
|
+
toggle(popupRef.current, false);
|
31
|
+
renderAnswerWithAnnotations(savedAnnotations);
|
28
32
|
}
|
33
|
+
window.onresize = () => {
|
34
|
+
clearTimeout(windowResizeTimeout);
|
35
|
+
windowResizeTimeout = setTimeout(() => updateLargeImageWarnings(answerRef.current), 1000);
|
36
|
+
};
|
29
37
|
});
|
30
|
-
|
31
|
-
|
32
|
-
closeTooltip();
|
33
|
-
latestSavedAnnotations[annotationDataForTooltip.type].splice(annotationDataForTooltip.index, 1);
|
34
|
-
annotationDataForTooltip = undefined;
|
35
|
-
saveAnnotations(latestSavedAnnotations);
|
36
|
-
}
|
38
|
+
const { t } = useExamTranslation();
|
39
|
+
const percentage = countSurplusPercentage(characterCount, maxLength);
|
37
40
|
return (React.createElement("div", { className: "e-grading-answer-wrapper" },
|
38
|
-
React.createElement("div", { className: "
|
39
|
-
React.createElement("
|
41
|
+
React.createElement("div", { className: "e-grading-answer e-line-height-l e-mrg-b-1", ref: answerRef, onMouseDown: (e) => onMouseDown(e), onMouseOver: (e) => onMouseOver(e.target) }),
|
42
|
+
React.createElement("div", { className: "e-font-size-xs e-grading-answer-length" },
|
43
|
+
t('answer-length', {
|
44
|
+
count: characterCount,
|
45
|
+
}),
|
46
|
+
percentage > 0 ? (React.createElement("span", { className: "e-grading-answer-max-length-surplus" }, t('max-length-surplus', {
|
47
|
+
maxLength,
|
48
|
+
percentage,
|
49
|
+
}))) : ('')),
|
50
|
+
React.createElement(GradingAnswerAnnotationList, { censoring: annotations.censoring, pregrading: annotations.pregrading, singleGrading: false }),
|
51
|
+
React.createElement("form", { style: { display: 'none' }, ref: popupRef, className: "e-grading-answer-popup e-grading-answer-add-annotation", onSubmit: (e) => onSubmit(e) },
|
40
52
|
React.createElement("input", { name: "message", className: "e-grading-answer-add-annotation-text", type: "text", ref: messageRef }),
|
41
53
|
React.createElement("button", { className: "e-grading-answer-add-annotation-button", type: "submit", "data-i18n": "arpa.annotate" }, "Merkitse")),
|
42
54
|
React.createElement("div", { style: { display: 'none' }, ref: tooltipRef, className: "e-grading-answer-tooltip e-grading-answer-popup", onMouseOver: onMouseOverTooltip, onMouseOut: closeTooltip },
|
43
|
-
React.createElement("span", { className: "e-grading-answer-tooltip-label" }, "tooltip text"),
|
55
|
+
React.createElement("span", { onClick: (e) => editExistingAnnotation(e), className: "e-grading-answer-tooltip-label" }, "tooltip text"),
|
44
56
|
React.createElement("button", { onClick: (e) => removeAnnotation(e), className: "e-grading-answer-tooltip-remove" }, "\u00D7"))));
|
57
|
+
function removeAnnotation(e) {
|
58
|
+
e.preventDefault();
|
59
|
+
closeTooltip();
|
60
|
+
savedAnnotations[annotationDataForTooltip.type].splice(annotationDataForTooltip.index, 1);
|
61
|
+
annotationDataForTooltip = undefined;
|
62
|
+
saveAnnotations(savedAnnotations);
|
63
|
+
}
|
45
64
|
function closeTooltip() {
|
46
|
-
|
47
|
-
tooltipRef.current
|
65
|
+
closeTooltipTimeout = setTimeout(() => {
|
66
|
+
toggle(tooltipRef.current, false);
|
48
67
|
}, 400);
|
49
68
|
}
|
50
69
|
function onMouseOverTooltip() {
|
51
|
-
clearTimeout(
|
70
|
+
clearTimeout(closeTooltipTimeout);
|
52
71
|
}
|
53
72
|
function onMouseOut(e) {
|
54
73
|
const target = e.target;
|
55
74
|
if (target.tagName === 'MARK') {
|
56
|
-
clearTimeout(
|
75
|
+
clearTimeout(closeTooltipTimeout);
|
57
76
|
closeTooltip();
|
58
77
|
}
|
59
78
|
answerRef.current.removeEventListener('mouseout', onMouseOut);
|
60
79
|
}
|
61
80
|
function showTooltip(target) {
|
62
|
-
clearTimeout(
|
81
|
+
clearTimeout(closeTooltipTimeout);
|
63
82
|
const tooltip = tooltipRef.current;
|
64
|
-
const type = target.dataset
|
65
|
-
tooltip.
|
66
|
-
isReadOnly || type !== gradingRole ? 'none' : 'initial';
|
83
|
+
const { type, listIndex, message } = target.dataset;
|
84
|
+
tooltip.classList.toggle('editable', !isReadOnly && type === gradingRole);
|
67
85
|
const rect = target.getBoundingClientRect();
|
68
|
-
|
69
|
-
|
70
|
-
|
86
|
+
popupPosition = rect;
|
87
|
+
Object.assign(tooltip.style, showAndPositionPopup(rect, answerRef.current));
|
88
|
+
tooltip.querySelector('.e-grading-answer-tooltip-label').textContent = message || '–';
|
89
|
+
annotationDataForTooltip = { index: Number(listIndex), type: type, message: message || '' };
|
71
90
|
answerRef.current.addEventListener('mouseout', onMouseOut);
|
72
91
|
}
|
73
|
-
function onMouseOver(
|
74
|
-
const target = e.target;
|
92
|
+
function onMouseOver(target) {
|
75
93
|
if (target.tagName === 'MARK' &&
|
76
94
|
!isPopupVisible &&
|
77
95
|
(!hasTextSelectedInAnswerText() || isReadOnly) &&
|
78
|
-
!
|
96
|
+
!imgAnnotationState.element) {
|
79
97
|
showTooltip(target);
|
80
98
|
}
|
81
99
|
}
|
82
100
|
function showAnnotationPopup(rect) {
|
83
|
-
|
84
|
-
|
85
|
-
|
101
|
+
annotationDataForTooltip = undefined;
|
102
|
+
setupAnnotationPopup(rect, '');
|
103
|
+
}
|
104
|
+
function showOldAnnotationPopup(rect) {
|
105
|
+
setupAnnotationPopup(rect, annotationDataForTooltip.message);
|
106
|
+
}
|
107
|
+
function setupAnnotationPopup(rect, message) {
|
108
|
+
Object.assign(popupRef.current.style, showAndPositionPopup(rect, answerRef.current));
|
86
109
|
const inputElement = messageRef.current;
|
87
|
-
inputElement.value =
|
110
|
+
inputElement.value = message;
|
88
111
|
inputElement.focus();
|
89
112
|
isPopupVisible = true;
|
113
|
+
window.addEventListener('keydown', onKeyUp);
|
90
114
|
}
|
91
115
|
function closePopupAndRefresh() {
|
92
116
|
newAnnotationObject = undefined;
|
93
|
-
|
94
|
-
|
117
|
+
imgAnnotationState.element = undefined;
|
118
|
+
imgAnnotationState.img = undefined;
|
95
119
|
isPopupVisible = false;
|
96
|
-
|
97
|
-
|
120
|
+
window.removeEventListener('keydown', onKeyUp);
|
121
|
+
toggle(popupRef.current, false);
|
122
|
+
renderAnswerWithAnnotations(savedAnnotations);
|
98
123
|
}
|
99
124
|
function onMouseDown(e) {
|
100
125
|
var _a;
|
@@ -106,24 +131,29 @@ export function GradingAnswer({ isReadOnly, answerType, gradingRole, annotations
|
|
106
131
|
return;
|
107
132
|
}
|
108
133
|
const target = e.target;
|
109
|
-
|
110
|
-
if (!
|
134
|
+
const img = ((_a = target.closest('.e-annotation-wrapper')) === null || _a === void 0 ? void 0 : _a.querySelector('img')) || undefined;
|
135
|
+
if (!img) {
|
111
136
|
return;
|
112
137
|
}
|
113
|
-
|
114
|
-
|
138
|
+
img.addEventListener('dragstart', preventDefaults);
|
139
|
+
imgAnnotationState.start = imageAnnotationMouseDownInfo(e, img);
|
140
|
+
imgAnnotationState.img = img;
|
115
141
|
window.addEventListener('mousemove', onMouseMoveForImageAnnotation);
|
116
142
|
}
|
117
143
|
function onWindowMouseUp(e) {
|
118
|
-
|
144
|
+
var _a, _b;
|
145
|
+
(_a = imgAnnotationState.img) === null || _a === void 0 ? void 0 : _a.removeEventListener('dragstart', preventDefaults);
|
119
146
|
window.removeEventListener('mousemove', onMouseMoveForImageAnnotation);
|
120
147
|
window.removeEventListener('mouseup', onWindowMouseUp);
|
121
148
|
if (isPopupVisible && e.target.closest('.popup') === null) {
|
122
149
|
closePopupAndRefresh();
|
123
150
|
return;
|
124
151
|
}
|
125
|
-
if (
|
126
|
-
showAnnotationPopup(
|
152
|
+
if (imgAnnotationState.element) {
|
153
|
+
showAnnotationPopup((_b = imgAnnotationState.element) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect());
|
154
|
+
return;
|
155
|
+
}
|
156
|
+
if (isPopupVisible) {
|
127
157
|
return;
|
128
158
|
}
|
129
159
|
const selection = window.getSelection();
|
@@ -135,30 +165,31 @@ export function GradingAnswer({ isReadOnly, answerType, gradingRole, annotations
|
|
135
165
|
const position = textAnnotationFromRange(answerRef.current, range);
|
136
166
|
newAnnotationObject = { ...position, type: 'text', message: '' };
|
137
167
|
showAnnotationPopup(range.getBoundingClientRect());
|
138
|
-
const newAnnotations = { ...
|
139
|
-
newAnnotations[gradingRole] = mergeAnnotation(answerRef.current, newAnnotationObject,
|
168
|
+
const newAnnotations = { ...savedAnnotations };
|
169
|
+
newAnnotations[gradingRole] = mergeAnnotation(answerRef.current, newAnnotationObject, savedAnnotations[gradingRole]);
|
140
170
|
renderAnswerWithAnnotations(newAnnotations);
|
141
171
|
}
|
142
172
|
}
|
143
173
|
function onMouseMoveForImageAnnotation(e) {
|
144
174
|
preventDefaults(e);
|
145
|
-
newAnnotationObject = annotationFromMousePosition(e,
|
146
|
-
if (
|
147
|
-
updateImageAnnotationMarkSize(
|
175
|
+
newAnnotationObject = annotationFromMousePosition(e, imgAnnotationState.start);
|
176
|
+
if (imgAnnotationState.element) {
|
177
|
+
updateImageAnnotationMarkSize(imgAnnotationState.element, newAnnotationObject);
|
148
178
|
}
|
149
179
|
else {
|
150
|
-
|
180
|
+
imgAnnotationState.element = renderImageAnnotationByImage(imgAnnotationState.img, '', newAnnotationObject, gradingRole, 999);
|
151
181
|
}
|
152
182
|
}
|
153
183
|
function renderAnswerWithAnnotations(annotations) {
|
154
184
|
const container = answerRef.current;
|
155
|
-
if (
|
185
|
+
if (type === 'richText') {
|
156
186
|
container.innerHTML = value;
|
187
|
+
wrapAllImages(container);
|
188
|
+
updateLargeImageWarnings(container);
|
157
189
|
}
|
158
190
|
else {
|
159
191
|
container.textContent = value;
|
160
192
|
}
|
161
|
-
wrapAllImages(container);
|
162
193
|
renderAnnotations(container, annotations.pregrading, annotations.censoring);
|
163
194
|
//TODO make titles optional for annotation rendering
|
164
195
|
container.querySelectorAll('mark').forEach((mark) => mark.removeAttribute('title'));
|
@@ -166,14 +197,34 @@ export function GradingAnswer({ isReadOnly, answerType, gradingRole, annotations
|
|
166
197
|
function onSubmit(e) {
|
167
198
|
e.preventDefault();
|
168
199
|
const message = messageRef.current.value;
|
169
|
-
|
170
|
-
|
171
|
-
|
200
|
+
if (annotationDataForTooltip) {
|
201
|
+
savedAnnotations[annotationDataForTooltip.type][annotationDataForTooltip.index].message = message;
|
202
|
+
}
|
203
|
+
else {
|
204
|
+
savedAnnotations[gradingRole] = mergeAnnotation(answerRef.current, { ...newAnnotationObject, message }, savedAnnotations[gradingRole] || []);
|
205
|
+
}
|
206
|
+
toggle(popupRef.current, false);
|
207
|
+
saveAnnotations(savedAnnotations);
|
172
208
|
}
|
173
209
|
function onKeyUp(e) {
|
174
|
-
if (e.key === 'Escape' &&
|
210
|
+
if (e.key === 'Escape' && isPopupVisible) {
|
175
211
|
closePopupAndRefresh();
|
176
212
|
}
|
177
213
|
}
|
178
214
|
}
|
215
|
+
function preventDefaults(e) {
|
216
|
+
e.preventDefault();
|
217
|
+
e.stopPropagation();
|
218
|
+
}
|
219
|
+
function countSurplusPercentage(characters, maxCharacters) {
|
220
|
+
if (!maxCharacters || characters <= maxCharacters) {
|
221
|
+
return 0;
|
222
|
+
}
|
223
|
+
return Math.floor((100 * characters) / maxCharacters - 100);
|
224
|
+
}
|
225
|
+
function toggle(element, isVisible) {
|
226
|
+
if (element instanceof HTMLElement) {
|
227
|
+
element.style.display = isVisible ? 'initial' : 'none';
|
228
|
+
}
|
229
|
+
}
|
179
230
|
//# sourceMappingURL=GradingAnswer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"GradingAnswer.js","sourceRoot":"","sources":["../../../src/components/grading/GradingAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEjE,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,eAAe,EAEf,
|
1
|
+
{"version":3,"file":"GradingAnswer.js","sourceRoot":"","sources":["../../../src/components/grading/GradingAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAa,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEjE,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,4BAA4B,EAC5B,eAAe,EAEf,8BAA8B,EAC9B,oBAAoB,EACpB,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,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AAK/D,MAAM,UA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C7D,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"}
|
@@ -6,7 +6,8 @@ export declare function textAnnotationFromRange(answerTextNode: Element, range:
|
|
6
6
|
};
|
7
7
|
export declare function toNodeLength(node: Node): number | undefined;
|
8
8
|
export declare function allNodesUnder(el: Node, documentObject?: Document): Node[];
|
9
|
-
export declare function
|
9
|
+
export declare function showAndPositionPopup(boundingRect: DOMRect, container: HTMLDivElement): {
|
10
|
+
display: string;
|
10
11
|
top: string;
|
11
12
|
left: string;
|
12
13
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"editAnnotations.d.ts","sourceRoot":"","sources":["../../../src/components/grading/editAnnotations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAkB,MAAM,mBAAmB,CAAA;AAC/E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK;;;EAgB5E;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,sBAEtC;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,cAAc,WAAW,GAAG,IAAI,EAAE,CAQzE;AAED,wBAAgB,
|
1
|
+
{"version":3,"file":"editAnnotations.d.ts","sourceRoot":"","sources":["../../../src/components/grading/editAnnotations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAkB,MAAM,mBAAmB,CAAA;AAC/E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK;;;EAgB5E;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,sBAEtC;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,cAAc,WAAW,GAAG,IAAI,EAAE,CAQzE;AAED,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc;;;;EAepF;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"}
|
@@ -22,22 +22,24 @@ export function toNodeLength(node) {
|
|
22
22
|
export function allNodesUnder(el, documentObject = document) {
|
23
23
|
let n = null;
|
24
24
|
const a = [];
|
25
|
-
const walk = documentObject.createTreeWalker(el, NodeFilter.
|
25
|
+
const walk = documentObject.createTreeWalker(el, NodeFilter.SHOW_TEXT + NodeFilter.SHOW_ELEMENT, null);
|
26
26
|
while ((n = walk.nextNode())) {
|
27
27
|
a.push(n);
|
28
28
|
}
|
29
29
|
return a;
|
30
30
|
}
|
31
|
-
export function
|
31
|
+
export function showAndPositionPopup(boundingRect, container) {
|
32
32
|
if (container) {
|
33
33
|
const containerRect = container.getBoundingClientRect();
|
34
34
|
return {
|
35
|
+
display: 'block',
|
35
36
|
top: String(boundingRect.bottom - containerRect.top + 10) + 'px',
|
36
37
|
left: String(boundingRect.left - containerRect.left) + 'px',
|
37
38
|
};
|
38
39
|
}
|
39
40
|
else {
|
40
41
|
return {
|
42
|
+
display: 'block',
|
41
43
|
top: '0px',
|
42
44
|
left: '0px',
|
43
45
|
};
|
@@ -55,8 +57,8 @@ export function hasTextSelectedInAnswerText() {
|
|
55
57
|
const startContainer = sel.getRangeAt(0).startContainer;
|
56
58
|
const endContainer = sel.getRangeAt(0).endContainer;
|
57
59
|
return (sel.rangeCount > 0 &&
|
58
|
-
((_a = startContainer.parentElement) === null || _a === void 0 ? void 0 : _a.closest('.answer')) !== null &&
|
59
|
-
((_b = endContainer.parentElement) === null || _b === void 0 ? void 0 : _b.closest('.answer')) !== null &&
|
60
|
+
((_a = startContainer.parentElement) === null || _a === void 0 ? void 0 : _a.closest('.e-grading-answer')) !== null &&
|
61
|
+
((_b = endContainer.parentElement) === null || _b === void 0 ? void 0 : _b.closest('.e-grading-answer')) !== null &&
|
60
62
|
((_c = startContainer.parentElement) === null || _c === void 0 ? void 0 : _c.closest('.remove-annotation-popup')) === null);
|
61
63
|
}
|
62
64
|
function isRangeSelection(sel) {
|
@@ -154,7 +156,7 @@ export function annotationFromMousePosition(e, { bbox, attachmentIndex, startX,
|
|
154
156
|
}
|
155
157
|
}
|
156
158
|
export function imageAnnotationMouseDownInfo(e, image) {
|
157
|
-
const targetAnswerText = image.closest('.answer');
|
159
|
+
const targetAnswerText = image.closest('.e-grading-answer');
|
158
160
|
const attachmentIndex = Array.from(targetAnswerText.querySelectorAll('img')).findIndex((img) => img === image);
|
159
161
|
const attachmentWrapper = targetAnswerText.querySelectorAll('.e-annotation-wrapper').item(attachmentIndex);
|
160
162
|
const bbox = attachmentWrapper.getBoundingClientRect();
|
@@ -1 +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,MAAc;QACrE,MAAM,cAAc,GAAG,cAAc,KAAK,cAAc,CAAA;QACxD,MAAM,SAAS,GAAG,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,cAAc,CAAA;QACrF,MAAM,YAAY,GAAW,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAA;QACxD,MAAM,oBAAoB,GAAG,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,CAAA;QACnF,OAAO,YAAY,GAAG,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAA;IACrE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAU;;IACrC,OAAO,IAAI,CAAC,QAAQ,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