@digabi/exam-engine-core 19.0.4-alpha.0 → 19.0.4-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/grading/Grading.d.ts.map +1 -1
- package/dist/components/grading/Grading.js +6 -4
- package/dist/components/grading/Grading.js.map +1 -1
- package/dist/components/grading/GradingAnswer.d.ts +5 -2
- package/dist/components/grading/GradingAnswer.d.ts.map +1 -1
- package/dist/components/grading/GradingAnswer.js +36 -26
- package/dist/components/grading/GradingAnswer.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main.css +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;;AAmHtE,wBAA6E"}
|
@@ -52,8 +52,8 @@ function Grading() {
|
|
52
52
|
useEffect(() => {
|
53
53
|
setAnnotations(annotationsStorage.current[answerId]);
|
54
54
|
});
|
55
|
-
const { type, value } = answersByQuestionId[answerId];
|
56
|
-
if (
|
55
|
+
const { type: answerType, value } = answersByQuestionId[answerId];
|
56
|
+
if (answerType === 'choice') {
|
57
57
|
return React.createElement("div", null, "choice answer");
|
58
58
|
}
|
59
59
|
function selectQuestion(e, id) {
|
@@ -63,13 +63,15 @@ function Grading() {
|
|
63
63
|
}
|
64
64
|
function saveAnnotations(annotations) {
|
65
65
|
annotationsStorage.current[answerId] = annotations;
|
66
|
-
|
66
|
+
setAnnotations({ ...annotationsStorage.current[answerId] });
|
67
67
|
}
|
68
68
|
return (React.createElement(I18nextProvider, { i18n: i18n },
|
69
69
|
React.createElement("main", { className: "e-exam" },
|
70
70
|
React.createElement("div", { className: "grading-navi" }, answerIds.map((id) => id === answerId ? (React.createElement("span", { key: id, className: "grading-navi-item" }, answersByQuestionId[id].displayNumber)) : (React.createElement("a", { className: "grading-navi-item", href: "", onClick: (e) => selectQuestion(e, id), key: id }, answersByQuestionId[id].displayNumber)))),
|
71
71
|
React.createElement(GradingAnswer, { ...{
|
72
|
-
|
72
|
+
isReadOnly: false,
|
73
|
+
answerType,
|
74
|
+
gradingRole: 'censoring',
|
73
75
|
value,
|
74
76
|
annotations,
|
75
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,CAAC,cAAc,CAAC,CAAA;IAE1D,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAA;IAC/C,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;IAExC,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;IAC9D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;QAC1B,OAAO,8CAAqB,CAAA;K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,IAAI,EAAE,IAAI;QACzB,8BAAM,SAAS,EAAC,QAAQ;YACtB,6BAAK,SAAS,EAAC,cAAc,IAC1B,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CACpB,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,CAChB,8BAAM,GAAG,EAAE,EAAE,EAAE,SAAS,EAAC,mBAAmB,IACzC,mBAAmB,CAAC,EAAE,CAAC,CAAC,aAAa,CACjC,CACR,CAAC,CAAC,CAAC,CACF,2BAAG,SAAS,EAAC,mBAAmB,EAAC,IAAI,EAAC,EAAE,EAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,IACpF,mBAAmB,CAAC,EAAE,CAAC,CAAC,aAAa,CACpC,CACL,CACF,CACG;YAEN,oBAAC,aAAa,OACR;oBACF,UAAU,EAAE,KAAK;oBACjB,UAAU;oBACV,WAAW,EAAE,WAAW;oBACxB,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"}
|
@@ -4,8 +4,11 @@ type Annotations = {
|
|
4
4
|
pregrading: Annotation[];
|
5
5
|
censoring: Annotation[];
|
6
6
|
};
|
7
|
-
|
8
|
-
|
7
|
+
type GradingType = 'pregrading' | 'censoring';
|
8
|
+
export declare function GradingAnswer({ isReadOnly, answerType, gradingRole, annotations, saveAnnotations, value, }: {
|
9
|
+
isReadOnly: boolean;
|
10
|
+
answerType: 'richText' | 'text';
|
11
|
+
gradingRole: GradingType;
|
9
12
|
value: string;
|
10
13
|
annotations: Annotations;
|
11
14
|
saveAnnotations: (annotations: Annotations) => void;
|
@@ -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;AAkBlC,KAAK,WAAW,GAAG;IAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IAAC,SAAS,EAAE,UAAU,EAAE,CAAA;CAAE,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;AAkBlC,KAAK,WAAW,GAAG;IAAE,UAAU,EAAE,UAAU,EAAE,CAAC;IAAC,SAAS,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAOxE,KAAK,WAAW,GAAG,YAAY,GAAG,WAAW,CAAA;AAE7C,wBAAgB,aAAa,CAAC,EAC5B,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,eAAe,EACf,KAAK,GACN,EAAE;IACD,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,UAAU,GAAG,MAAM,CAAA;IAC/B,WAAW,EAAE,WAAW,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,WAAW,CAAA;IACxB,eAAe,EAAE,CAAC,WAAW,EAAE,WAAW,KAAK,IAAI,CAAA;CACpD,eA6NA"}
|
@@ -5,7 +5,7 @@ function preventDefaults(e) {
|
|
5
5
|
e.preventDefault();
|
6
6
|
e.stopPropagation();
|
7
7
|
}
|
8
|
-
export function GradingAnswer({
|
8
|
+
export function GradingAnswer({ isReadOnly, answerType, gradingRole, annotations, saveAnnotations, value, }) {
|
9
9
|
const answerRef = useRef(null);
|
10
10
|
const popupRef = useRef(null);
|
11
11
|
const messageRef = useRef(null);
|
@@ -22,6 +22,8 @@ export function GradingAnswer({ type, annotations, saveAnnotations, value, }) {
|
|
22
22
|
useLayoutEffect(() => {
|
23
23
|
if (answerRef.current) {
|
24
24
|
latestSavedAnnotations = annotations;
|
25
|
+
tooltipRef.current.style.display = 'none';
|
26
|
+
popupRef.current.style.display = 'none';
|
25
27
|
renderAnswerWithAnnotations(latestSavedAnnotations);
|
26
28
|
}
|
27
29
|
});
|
@@ -31,21 +33,18 @@ export function GradingAnswer({ type, annotations, saveAnnotations, value, }) {
|
|
31
33
|
latestSavedAnnotations[annotationDataForTooltip.type].splice(annotationDataForTooltip.index, 1);
|
32
34
|
annotationDataForTooltip = undefined;
|
33
35
|
saveAnnotations(latestSavedAnnotations);
|
34
|
-
renderAnswerWithAnnotations(latestSavedAnnotations);
|
35
36
|
}
|
36
37
|
return (React.createElement("div", { className: "e-grading-answer-wrapper" },
|
37
38
|
React.createElement("div", { className: "answer e-grading-answer e-line-height-l e-pad-l-2 e-mrg-b-1", ref: answerRef, onKeyUp: (e) => onKeyUp(e), onMouseDown: (e) => onMouseDown(e), onMouseOver: (e) => onMouseOver(e) }),
|
38
|
-
React.createElement("form", { style: { display: 'none', position: 'absolute' }, ref: popupRef, className: "popup add-annotation
|
39
|
-
React.createElement("input", { name: "message", className: "add-annotation-text", type: "text", ref: messageRef }),
|
40
|
-
React.createElement("
|
41
|
-
|
42
|
-
|
43
|
-
React.createElement("
|
44
|
-
React.createElement("button", { onClick: (e) => removeAnnotation(e), className: "e-annotation-tooltip-remove" }, "\u00D7"))));
|
39
|
+
React.createElement("form", { style: { display: 'none', position: 'absolute' }, ref: popupRef, className: "e-grading-answer-popup e-grading-answer-add-annotation", onSubmit: (e) => onSubmit(e) },
|
40
|
+
React.createElement("input", { name: "message", className: "e-grading-answer-add-annotation-text", type: "text", ref: messageRef }),
|
41
|
+
React.createElement("button", { className: "e-grading-answer-add-annotation-button", type: "submit", "data-i18n": "arpa.annotate" }, "Merkitse")),
|
42
|
+
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"),
|
44
|
+
React.createElement("button", { onClick: (e) => removeAnnotation(e), className: "e-grading-answer-tooltip-remove" }, "\u00D7"))));
|
45
45
|
function closeTooltip() {
|
46
46
|
fadeTooltipOut = setTimeout(() => {
|
47
47
|
tooltipRef.current.style.display = 'none';
|
48
|
-
answerRef.current.appendChild(tooltipRef.current);
|
49
48
|
}, 400);
|
50
49
|
}
|
51
50
|
function onMouseOverTooltip() {
|
@@ -59,16 +58,25 @@ export function GradingAnswer({ type, annotations, saveAnnotations, value, }) {
|
|
59
58
|
}
|
60
59
|
answerRef.current.removeEventListener('mouseout', onMouseOut);
|
61
60
|
}
|
61
|
+
function showTooltip(target) {
|
62
|
+
clearTimeout(fadeTooltipOut);
|
63
|
+
const tooltip = tooltipRef.current;
|
64
|
+
const type = target.dataset.type;
|
65
|
+
tooltip.querySelector('.e-grading-answer-tooltip-remove').style.display =
|
66
|
+
isReadOnly || type !== gradingRole ? 'none' : 'initial';
|
67
|
+
const rect = target.getBoundingClientRect();
|
68
|
+
Object.assign(tooltip.style, popupPosition(rect, answerRef.current), { display: 'block' });
|
69
|
+
tooltip.querySelector('.e-grading-answer-tooltip-label').textContent = target.dataset.message || '–';
|
70
|
+
annotationDataForTooltip = { index: Number(target.dataset.listIndex), type };
|
71
|
+
answerRef.current.addEventListener('mouseout', onMouseOut);
|
72
|
+
}
|
62
73
|
function onMouseOver(e) {
|
63
74
|
const target = e.target;
|
64
|
-
if (target.tagName === 'MARK' &&
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
tooltip.querySelector('.e-annotation-tooltip-label').textContent = target.dataset.message || '–';
|
70
|
-
annotationDataForTooltip = { index: Number(target.dataset.listIndex), type: target.dataset.type };
|
71
|
-
answerRef.current.addEventListener('mouseout', onMouseOut);
|
75
|
+
if (target.tagName === 'MARK' &&
|
76
|
+
!isPopupVisible &&
|
77
|
+
(!hasTextSelectedInAnswerText() || isReadOnly) &&
|
78
|
+
!newImageAnnotationMark) {
|
79
|
+
showTooltip(target);
|
72
80
|
}
|
73
81
|
}
|
74
82
|
function showAnnotationPopup(rect) {
|
@@ -90,6 +98,9 @@ export function GradingAnswer({ type, annotations, saveAnnotations, value, }) {
|
|
90
98
|
}
|
91
99
|
function onMouseDown(e) {
|
92
100
|
var _a;
|
101
|
+
if (isReadOnly) {
|
102
|
+
return;
|
103
|
+
}
|
93
104
|
window.addEventListener('mouseup', onWindowMouseUp);
|
94
105
|
if (e.button !== 0) {
|
95
106
|
return;
|
@@ -124,10 +135,9 @@ export function GradingAnswer({ type, annotations, saveAnnotations, value, }) {
|
|
124
135
|
const position = textAnnotationFromRange(answerRef.current, range);
|
125
136
|
newAnnotationObject = { ...position, type: 'text', message: '' };
|
126
137
|
showAnnotationPopup(range.getBoundingClientRect());
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
});
|
138
|
+
const newAnnotations = { ...latestSavedAnnotations };
|
139
|
+
newAnnotations[gradingRole] = mergeAnnotation(answerRef.current, newAnnotationObject, latestSavedAnnotations[gradingRole]);
|
140
|
+
renderAnswerWithAnnotations(newAnnotations);
|
131
141
|
}
|
132
142
|
}
|
133
143
|
function onMouseMoveForImageAnnotation(e) {
|
@@ -137,12 +147,12 @@ export function GradingAnswer({ type, annotations, saveAnnotations, value, }) {
|
|
137
147
|
updateImageAnnotationMarkSize(newImageAnnotationMark, newAnnotationObject);
|
138
148
|
}
|
139
149
|
else {
|
140
|
-
newImageAnnotationMark = renderImageAnnotationByImage(imageAtHand, '', newAnnotationObject,
|
150
|
+
newImageAnnotationMark = renderImageAnnotationByImage(imageAtHand, '', newAnnotationObject, gradingRole, 999);
|
141
151
|
}
|
142
152
|
}
|
143
153
|
function renderAnswerWithAnnotations(annotations) {
|
144
154
|
const container = answerRef.current;
|
145
|
-
if (
|
155
|
+
if (answerType === 'richText') {
|
146
156
|
container.innerHTML = value;
|
147
157
|
}
|
148
158
|
else {
|
@@ -156,9 +166,9 @@ export function GradingAnswer({ type, annotations, saveAnnotations, value, }) {
|
|
156
166
|
function onSubmit(e) {
|
157
167
|
e.preventDefault();
|
158
168
|
const message = messageRef.current.value;
|
159
|
-
latestSavedAnnotations
|
169
|
+
latestSavedAnnotations[gradingRole] = mergeAnnotation(answerRef.current, { ...newAnnotationObject, message }, latestSavedAnnotations[gradingRole] || []);
|
170
|
+
popupRef.current.style.display = 'none';
|
160
171
|
saveAnnotations(latestSavedAnnotations);
|
161
|
-
closePopupAndRefresh();
|
162
172
|
}
|
163
173
|
function onKeyUp(e) {
|
164
174
|
if (e.key === 'Escape' && newAnnotationObject) {
|
@@ -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,aAAa,EACb,8BAA8B,EAC9B,uBAAuB,GACxB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,6BAA6B,EAC7B,aAAa,GACd,MAAM,yBAAyB,CAAA;AAIhC,SAAS,eAAe,CAAC,CAAQ;IAC/B,CAAC,CAAC,cAAc,EAAE,CAAA;IAClB,CAAC,CAAC,eAAe,EAAE,CAAA;AACrB,CAAC;AAID,MAAM,UAAU,aAAa,CAAC,EAC5B,
|
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,aAAa,EACb,8BAA8B,EAC9B,uBAAuB,GACxB,MAA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