@digabi/exam-engine-core 19.1.0-alpha.0 → 19.1.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/AnnotationPopup.d.ts +11 -0
- package/dist/components/grading/AnnotationPopup.d.ts.map +1 -0
- package/dist/components/grading/AnnotationPopup.js +20 -0
- package/dist/components/grading/AnnotationPopup.js.map +1 -0
- 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/AnswerWithAnnotations.d.ts +11 -0
- package/dist/components/grading/AnswerWithAnnotations.d.ts.map +1 -0
- package/dist/components/grading/AnswerWithAnnotations.js +15 -0
- package/dist/components/grading/AnswerWithAnnotations.js.map +1 -0
- package/dist/components/grading/ChoiceAnswer.d.ts +6 -0
- package/dist/components/grading/ChoiceAnswer.d.ts.map +1 -0
- package/dist/components/grading/ChoiceAnswer.js +57 -0
- package/dist/components/grading/ChoiceAnswer.js.map +1 -0
- package/dist/components/grading/DropdownAnswer.d.ts +6 -0
- package/dist/components/grading/DropdownAnswer.d.ts.map +1 -0
- package/dist/components/grading/DropdownAnswer.js +43 -0
- package/dist/components/grading/DropdownAnswer.js.map +1 -0
- package/dist/components/grading/Grading.d.ts +4 -0
- package/dist/components/grading/Grading.d.ts.map +1 -0
- package/dist/components/grading/Grading.js +81 -0
- package/dist/components/grading/Grading.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/MultiLineAnswer.d.ts +14 -0
- package/dist/components/grading/MultiLineAnswer.d.ts.map +1 -0
- package/dist/components/grading/MultiLineAnswer.js +61 -0
- package/dist/components/grading/MultiLineAnswer.js.map +1 -0
- package/dist/components/grading/Question.d.ts +5 -0
- package/dist/components/grading/Question.d.ts.map +1 -0
- package/dist/components/grading/Question.js +23 -0
- package/dist/components/grading/Question.js.map +1 -0
- package/dist/components/grading/QuestionTitle.d.ts +6 -0
- package/dist/components/grading/QuestionTitle.d.ts.map +1 -0
- package/dist/components/grading/QuestionTitle.js +21 -0
- package/dist/components/grading/QuestionTitle.js.map +1 -0
- package/dist/components/grading/Results.d.ts +15 -0
- package/dist/components/grading/Results.d.ts.map +1 -0
- package/dist/components/grading/Results.js +77 -0
- package/dist/components/grading/Results.js.map +1 -0
- package/dist/components/grading/ScoredTextAnswer.d.ts +6 -0
- package/dist/components/grading/ScoredTextAnswer.d.ts.map +1 -0
- package/dist/components/grading/ScoredTextAnswer.js +22 -0
- package/dist/components/grading/ScoredTextAnswer.js.map +1 -0
- package/dist/components/grading/Section.d.ts +5 -0
- package/dist/components/grading/Section.d.ts.map +1 -0
- package/dist/components/grading/Section.js +18 -0
- package/dist/components/grading/Section.js.map +1 -0
- package/dist/components/grading/SingleLineAnswer.d.ts +12 -0
- package/dist/components/grading/SingleLineAnswer.d.ts.map +1 -0
- package/dist/components/grading/SingleLineAnswer.js +23 -0
- package/dist/components/grading/SingleLineAnswer.js.map +1 -0
- package/dist/components/grading/TextAnswer.d.ts +7 -0
- package/dist/components/grading/TextAnswer.d.ts.map +1 -0
- package/dist/components/grading/TextAnswer.js +53 -0
- package/dist/components/grading/TextAnswer.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/internal/AnnotationList.d.ts +5 -0
- package/dist/components/grading/internal/AnnotationList.d.ts.map +1 -0
- package/dist/components/grading/internal/AnnotationList.js +43 -0
- package/dist/components/grading/internal/AnnotationList.js.map +1 -0
- package/dist/components/grading/internal/QuestionAutoScore.d.ts +10 -0
- package/dist/components/grading/internal/QuestionAutoScore.d.ts.map +1 -0
- package/dist/components/grading/internal/QuestionAutoScore.js +17 -0
- package/dist/components/grading/internal/QuestionAutoScore.js.map +1 -0
- package/dist/components/grading/internal/QuestionManualScore.d.ts +12 -0
- package/dist/components/grading/internal/QuestionManualScore.d.ts.map +1 -0
- package/dist/components/grading/internal/QuestionManualScore.js +61 -0
- package/dist/components/grading/internal/QuestionManualScore.js.map +1 -0
- package/dist/components/grading/internal/QuestionScoresContainer.d.ts +10 -0
- package/dist/components/grading/internal/QuestionScoresContainer.d.ts.map +1 -0
- package/dist/components/grading/internal/QuestionScoresContainer.js +12 -0
- package/dist/components/grading/internal/QuestionScoresContainer.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/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/Results2.d.ts +15 -0
- package/dist/components/results/Results2.d.ts.map +1 -0
- package/dist/components/results/Results2.js +79 -0
- package/dist/components/results/Results2.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/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/editAnnotations.d.ts +2 -0
- package/dist/editAnnotations.d.ts.map +1 -0
- package/dist/editAnnotations.js +8 -0
- package/dist/editAnnotations.js.map +1 -0
- package/dist/editAnnotationsOld.d.ts +3 -0
- package/dist/editAnnotationsOld.d.ts.map +1 -0
- package/dist/editAnnotationsOld.js +340 -0
- package/dist/editAnnotationsOld.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":"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,OA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,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;IACpF,CAAC;IAED,SAAS,kBAAkB,CAAC,CAA6B;QACvD,CAAC,CAAC,cAAc,EAAE,CAAA;QAClB,MAAM,OAAO,GAAG,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,14 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Score } from '../..';
|
3
|
+
export declare const MultiLineAnswer: React.FunctionComponent<{
|
4
|
+
type: 'rich-text' | 'single-line';
|
5
|
+
value?: string;
|
6
|
+
score?: Score;
|
7
|
+
}>;
|
8
|
+
export declare function calculatePosition(answerTextNode: HTMLDivElement, range: Range): {
|
9
|
+
startIndex: number;
|
10
|
+
length: number;
|
11
|
+
};
|
12
|
+
export declare function toNodeLength(node: Node): number | undefined;
|
13
|
+
export declare function allNodesUnder(el: Node, documentObject?: Document): Node[];
|
14
|
+
//# sourceMappingURL=MultiLineAnswer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MultiLineAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/MultiLineAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAM7B,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,iBAAiB,CAAC;IACpD,IAAI,EAAE,WAAW,GAAG,aAAa,CAAA;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAwCA,CAAA;AAED,wBAAgB,iBAAiB,CAAC,cAAc,EAAE,cAAc,EAAE,KAAK,EAAE,KAAK;;;EAgB7E;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,sBAEtC;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,cAAc,WAAW,GAAG,IAAI,EAAE,CAQzE"}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
import React, { useLayoutEffect, useRef } from 'react';
|
2
|
+
import { useExamTranslation } from '../../i18n';
|
3
|
+
import { renderAnnotations } from '../../renderAnnotations';
|
4
|
+
import { ScreenReaderOnly } from '../ScreenReaderOnly';
|
5
|
+
import * as _ from 'lodash-es';
|
6
|
+
export const MultiLineAnswer = ({ type, score, value }) => {
|
7
|
+
const { t } = useExamTranslation();
|
8
|
+
const answerRef = useRef(null);
|
9
|
+
useLayoutEffect(() => {
|
10
|
+
var _a, _b, _c, _d;
|
11
|
+
if (answerRef.current) {
|
12
|
+
renderAnnotations(answerRef.current, (_b = (_a = score === null || score === void 0 ? void 0 : score.pregrading) === null || _a === void 0 ? void 0 : _a.annotations) !== null && _b !== void 0 ? _b : [], (_d = (_c = score === null || score === void 0 ? void 0 : score.censoring) === null || _c === void 0 ? void 0 : _c.annotations) !== null && _d !== void 0 ? _d : []);
|
13
|
+
document.addEventListener('selectionchange', onSelect);
|
14
|
+
console.log('annotations rendered2');
|
15
|
+
}
|
16
|
+
});
|
17
|
+
function onSelect(e) {
|
18
|
+
console.log(e);
|
19
|
+
const selection = window.getSelection();
|
20
|
+
if (selection && answerRef.current !== null) {
|
21
|
+
const range = selection.getRangeAt(0);
|
22
|
+
const position = calculatePosition(answerRef.current, range);
|
23
|
+
console.log(position, '\n=== position');
|
24
|
+
}
|
25
|
+
}
|
26
|
+
return type === 'rich-text' ? (React.createElement("div", { className: "e-multiline-results-text-answer e-line-height-l e-pad-l-2 e-mrg-b-1" },
|
27
|
+
React.createElement(ScreenReaderOnly, null, t('screen-reader.answer-begin')),
|
28
|
+
type === 'rich-text' ? (React.createElement("div", { dangerouslySetInnerHTML: { __html: value || '' }, ref: answerRef })) : (React.createElement("div", { className: "e-pre-wrap", ref: answerRef }, value)))) : (React.createElement("span", { className: "text-answer text-answer--single-line" },
|
29
|
+
React.createElement(ScreenReaderOnly, null, t('screen-reader.answer-begin')),
|
30
|
+
React.createElement("span", { className: "e-inline-block", ref: answerRef }, value)));
|
31
|
+
};
|
32
|
+
export function calculatePosition(answerTextNode, range) {
|
33
|
+
const answerNodes = allNodesUnder(answerTextNode);
|
34
|
+
const charactersBefore = charactersBeforeContainer(range.startContainer, range.startOffset);
|
35
|
+
const charactersUntilEnd = charactersBeforeContainer(range.endContainer, range.endOffset);
|
36
|
+
return {
|
37
|
+
startIndex: charactersBefore,
|
38
|
+
length: charactersUntilEnd - charactersBefore,
|
39
|
+
};
|
40
|
+
function charactersBeforeContainer(rangeContainer, offset) {
|
41
|
+
const containerIsTag = rangeContainer === answerTextNode;
|
42
|
+
const container = containerIsTag ? rangeContainer.childNodes[offset] : rangeContainer;
|
43
|
+
const offsetInside = containerIsTag ? 0 : offset;
|
44
|
+
const nodesBeforeContainer = _.takeWhile(answerNodes, (node) => node !== container);
|
45
|
+
return offsetInside + _.sum(nodesBeforeContainer.map(toNodeLength));
|
46
|
+
}
|
47
|
+
}
|
48
|
+
export function toNodeLength(node) {
|
49
|
+
var _a;
|
50
|
+
return node.nodeType === Node.TEXT_NODE ? (_a = node.textContent) === null || _a === void 0 ? void 0 : _a.length : node.nodeName === 'IMG' ? 1 : 0;
|
51
|
+
}
|
52
|
+
export function allNodesUnder(el, documentObject = document) {
|
53
|
+
let n = null;
|
54
|
+
const a = [];
|
55
|
+
const walk = documentObject.createTreeWalker(el, NodeFilter.SHOW_ALL, null);
|
56
|
+
while ((n = walk.nextNode())) {
|
57
|
+
a.push(n);
|
58
|
+
}
|
59
|
+
return a;
|
60
|
+
}
|
61
|
+
//# sourceMappingURL=MultiLineAnswer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MultiLineAnswer.js","sourceRoot":"","sources":["../../../src/components/grading/MultiLineAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAE9B,MAAM,CAAC,MAAM,eAAe,GAIvB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE;IAC9B,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,MAAM,SAAS,GAAG,MAAM,CAAi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;IACrC,OAAO,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,WAAW,0CAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACtG,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,EAAQ,EAAE,cAAc,GAAG,QAAQ;IAC/D,IAAI,CAAC,GAAgB,IAAI,CAAA;IACzB,MAAM,CAAC,GAAW,EAAE,CAAA;IACpB,MAAM,IAAI,GAAG,cAAc,CAAC,gBAAgB,CAAC,EAAE,EAAE,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC3E,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE;QAC5B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;KACV;IACD,OAAO,CAAC,CAAA;AACV,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Question.d.ts","sourceRoot":"","sources":["../../../src/components/grading/Question.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AA2BjE,wBAAwD"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import classNames from 'classnames';
|
2
|
+
import React, { useContext } from 'react';
|
3
|
+
import { findChildrenAnswers, getNumericAttribute } from '../../dom-utils';
|
4
|
+
import { QuestionContext, withQuestionContext } from '../context/QuestionContext';
|
5
|
+
import AnnotationList from './internal/AnnotationList';
|
6
|
+
import { ResultsContext } from '../context/ResultsContext';
|
7
|
+
function Question({ element, renderChildNodes }) {
|
8
|
+
const { answersByQuestionId } = useContext(ResultsContext);
|
9
|
+
const { displayNumber, level } = useContext(QuestionContext);
|
10
|
+
const hasAnswers = questionHasAnswers(element, answersByQuestionId);
|
11
|
+
return hasAnswers ? (React.createElement("div", { className: classNames('exam-question', {
|
12
|
+
'e-mrg-b-8 e-clearfix': level === 0,
|
13
|
+
'e-mrg-l-8 e-mrg-y-4': level > 0,
|
14
|
+
}), id: displayNumber },
|
15
|
+
renderChildNodes(element),
|
16
|
+
React.createElement(AnnotationList, null))) : null;
|
17
|
+
}
|
18
|
+
function questionHasAnswers(element, answers) {
|
19
|
+
const answerElems = findChildrenAnswers(element);
|
20
|
+
return answerElems.some((e) => answers[getNumericAttribute(e, 'question-id')]);
|
21
|
+
}
|
22
|
+
export default React.memo(withQuestionContext(Question));
|
23
|
+
//# sourceMappingURL=Question.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Question.js","sourceRoot":"","sources":["../../../src/components/grading/Question.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AAC1E,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACjF,OAAO,cAAc,MAAM,2BAA2B,CAAA;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAI1D,SAAS,QAAQ,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACjE,MAAM,EAAE,mBAAmB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAC1D,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC5D,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAA;IAEnE,OAAO,UAAU,CAAC,CAAC,CAAC,CAClB,6BACE,SAAS,EAAE,UAAU,CAAC,eAAe,EAAE;YACrC,sBAAsB,EAAE,KAAK,KAAK,CAAC;YACnC,qBAAqB,EAAE,KAAK,GAAG,CAAC;SACjC,CAAC,EACF,EAAE,EAAE,aAAa;QAEhB,gBAAgB,CAAC,OAAO,CAAC;QAC1B,oBAAC,cAAc,OAAG,CACd,CACP,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAgB,EAAE,OAAmC;IAC/E,MAAM,WAAW,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAA;IAChD,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,EAAE,aAAa,CAAE,CAAC,CAAC,CAAA;AACjF,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../../createRenderChildNodes';
|
3
|
+
declare function QuestionTitle({ element, renderChildNodes }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof QuestionTitle>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=QuestionTitle.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QuestionTitle.d.ts","sourceRoot":"","sources":["../../../src/components/grading/QuestionTitle.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGjE,iBAAS,aAAa,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,kBAAkB,eAwBvE;;AAED,wBAAwC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import classNames from 'classnames';
|
2
|
+
import React, { useContext } from 'react';
|
3
|
+
import AnsweringInstructions from '../AnsweringInstructions';
|
4
|
+
import NotificationIcon from '../NotificationIcon';
|
5
|
+
import { QuestionContext } from '../context/QuestionContext';
|
6
|
+
import { formatQuestionDisplayNumber } from '../../formatting';
|
7
|
+
function QuestionTitle({ element, renderChildNodes }) {
|
8
|
+
const { displayNumber, level, maxAnswers, childQuestions } = useContext(QuestionContext);
|
9
|
+
const Tag = `h${Math.min(3 + level, 6)}`;
|
10
|
+
return (React.createElement(React.Fragment, null,
|
11
|
+
React.createElement(Tag, { className: classNames('exam-question-title', { 'e-normal e-font-size-m': level > 0 }) },
|
12
|
+
React.createElement("strong", { className: classNames('exam-question-title__display-number', {
|
13
|
+
'exam-question-title__display-number--indented': level > 0,
|
14
|
+
}) }, formatQuestionDisplayNumber(displayNumber) + ' '),
|
15
|
+
renderChildNodes(element)),
|
16
|
+
maxAnswers != null && childQuestions.length > 0 && (React.createElement("p", { className: "e-italic" },
|
17
|
+
React.createElement(NotificationIcon, null),
|
18
|
+
React.createElement(AnsweringInstructions, { ...{ maxAnswers, childQuestions, elementType: 'question' } })))));
|
19
|
+
}
|
20
|
+
export default React.memo(QuestionTitle);
|
21
|
+
//# sourceMappingURL=QuestionTitle.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"QuestionTitle.js","sourceRoot":"","sources":["../../../src/components/grading/QuestionTitle.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,qBAAqB,MAAM,0BAA0B,CAAA;AAC5D,OAAO,gBAAgB,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAA;AAE9D,SAAS,aAAa,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IACtE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IACxF,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,CAAC,CAAC,EAA+B,CAAA;IAErE,OAAO,CACL;QACE,oBAAC,GAAG,IAAC,SAAS,EAAE,UAAU,CAAC,qBAAqB,EAAE,EAAE,wBAAwB,EAAE,KAAK,GAAG,CAAC,EAAE,CAAC;YACxF,gCACE,SAAS,EAAE,UAAU,CAAC,qCAAqC,EAAE;oBAC3D,+CAA+C,EAAE,KAAK,GAAG,CAAC;iBAC3D,CAAC,IAED,2BAA2B,CAAC,aAAa,CAAC,GAAG,GAAG,CAC1C;YACR,gBAAgB,CAAC,OAAO,CAAC,CACtB;QACL,UAAU,IAAI,IAAI,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,IAAI,CAClD,2BAAG,SAAS,EAAC,UAAU;YACrB,oBAAC,gBAAgB,OAAG;YACpB,oBAAC,qBAAqB,OAAK,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,GAAI,CACpF,CACL,CACA,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { GradingStructure, Score } from '../..';
|
3
|
+
import { CommonExamProps } from '../exam/Exam';
|
4
|
+
export interface ResultsProps extends CommonExamProps {
|
5
|
+
/** Contains grading structure for the exam, and in addition scores and metadata (comments and annotations) */
|
6
|
+
gradingStructure: GradingStructure;
|
7
|
+
/** Custom grading text to be displayed for the whole exam. For example total grade for the exam. */
|
8
|
+
gradingText?: string;
|
9
|
+
/** Scores for exam answers */
|
10
|
+
scores: Score[];
|
11
|
+
singleGrading?: boolean;
|
12
|
+
}
|
13
|
+
declare const _default: React.MemoExoticComponent<React.ComponentType<import("../results/Results").ResultsProps>>;
|
14
|
+
export default _default;
|
15
|
+
//# sourceMappingURL=Results.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Results.d.ts","sourceRoot":"","sources":["../../../src/components/grading/Results.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAEpD,OAAO,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAU/C,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAgB9C,MAAM,WAAW,YAAa,SAAQ,eAAe;IACnD,8GAA8G;IAC9G,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,oGAAoG;IACpG,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,8BAA8B;IAC9B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;;AA8ED,wBAA6E"}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import React, { useContext, useEffect } from 'react';
|
2
|
+
import { I18nextProvider } from 'react-i18next';
|
3
|
+
import { createRenderChildNodes } from '../../createRenderChildNodes';
|
4
|
+
import { findChildElement, queryAncestors } from '../../dom-utils';
|
5
|
+
import { changeLanguage, initI18n, useExamTranslation } from '../../i18n';
|
6
|
+
import { scrollToHash } from '../../scrollToHash';
|
7
|
+
import { useCached } from '../../useCached';
|
8
|
+
import mkAttachmentLink from '../shared/AttachmentLink';
|
9
|
+
import mkAttachmentLinks from '../shared/AttachmentLinks';
|
10
|
+
import { CommonExamContext, withCommonExamContext } from '../context/CommonExamContext';
|
11
|
+
import DocumentTitle from '../DocumentTitle';
|
12
|
+
import ExamQuestionInstruction from '../exam/QuestionInstruction';
|
13
|
+
import ExamSectionTitle from '../exam/SectionTitle';
|
14
|
+
import Formula from '../shared/Formula';
|
15
|
+
import Image from '../shared/Image';
|
16
|
+
import RenderChildNodes from '../RenderChildNodes';
|
17
|
+
import { renderIf } from '../RenderIf';
|
18
|
+
import ResultsChoiceAnswer from './ChoiceAnswer';
|
19
|
+
import { ResultsContext, withResultsContext } from '../context/ResultsContext';
|
20
|
+
import DropdownAnswer from './DropdownAnswer';
|
21
|
+
import Question from './Question';
|
22
|
+
import QuestionTitle from './QuestionTitle';
|
23
|
+
import Section from './Section';
|
24
|
+
import ScoredTextAnswer from './ScoredTextAnswer';
|
25
|
+
import TextAnswer from './TextAnswer';
|
26
|
+
const renderChildNodes = createRenderChildNodes({
|
27
|
+
attachment: RenderChildNodes,
|
28
|
+
'attachment-link': mkAttachmentLink('plain'),
|
29
|
+
'attachment-links': mkAttachmentLinks('plain'),
|
30
|
+
'audio-group': RenderChildNodes,
|
31
|
+
'choice-answer': ResultsChoiceAnswer,
|
32
|
+
'dropdown-answer': DropdownAnswer,
|
33
|
+
formula: Formula,
|
34
|
+
question: Question,
|
35
|
+
hints: RenderChildNodes,
|
36
|
+
image: renderIf(({ element }) => queryAncestors(element, 'choice-answer') != null)(Image),
|
37
|
+
'question-instruction': ExamQuestionInstruction,
|
38
|
+
'question-title': QuestionTitle,
|
39
|
+
section: Section,
|
40
|
+
'section-title': ExamSectionTitle,
|
41
|
+
'text-answer': TextAnswer,
|
42
|
+
'scored-text-answer': ScoredTextAnswer,
|
43
|
+
'scored-text-answers': RenderChildNodes,
|
44
|
+
});
|
45
|
+
const Results = () => {
|
46
|
+
const { date, dateTimeFormatter, dayCode, examCode, language, resolveAttachment, root, subjectLanguage } = useContext(CommonExamContext);
|
47
|
+
const examTitle = findChildElement(root, 'exam-title');
|
48
|
+
const examStylesheet = root.getAttribute('exam-stylesheet');
|
49
|
+
const i18n = useCached(() => initI18n(language, examCode, dayCode));
|
50
|
+
useEffect(changeLanguage(i18n, language));
|
51
|
+
useEffect(scrollToHash, []);
|
52
|
+
return (React.createElement(I18nextProvider, { i18n: i18n },
|
53
|
+
React.createElement("main", { className: "e-exam", lang: subjectLanguage },
|
54
|
+
React.createElement(React.StrictMode, null),
|
55
|
+
examStylesheet && React.createElement("link", { rel: "stylesheet", href: resolveAttachment(examStylesheet) }),
|
56
|
+
React.createElement("div", { className: "e-columns e-columns--bottom-v e-mrg-b-4" },
|
57
|
+
examTitle && (React.createElement(DocumentTitle, { id: "title", className: "e-column e-mrg-b-0" },
|
58
|
+
renderChildNodes(examTitle),
|
59
|
+
date && ', ' + dateTimeFormatter.format(date))),
|
60
|
+
React.createElement(ScoresAndFinalGrade, null)),
|
61
|
+
renderChildNodes(root))));
|
62
|
+
};
|
63
|
+
function ScoresAndFinalGrade() {
|
64
|
+
const { gradingText, totalScore } = useContext(ResultsContext);
|
65
|
+
const { t } = useExamTranslation();
|
66
|
+
return (React.createElement("div", { className: "e-column--narrow" },
|
67
|
+
React.createElement("table", { className: "e-table e-table--borderless e-mrg-b-0" },
|
68
|
+
React.createElement("tbody", null,
|
69
|
+
React.createElement("tr", null,
|
70
|
+
React.createElement("th", { className: "e-pad-y-0 e-normal" }, t('grading-total')),
|
71
|
+
React.createElement("td", { className: "e-pad-y-0 e-semibold e-text-right" }, t('points', { count: totalScore }))),
|
72
|
+
gradingText && (React.createElement("tr", null,
|
73
|
+
React.createElement("th", { className: "e-pad-y-0 e-normal" }, t('grade')),
|
74
|
+
React.createElement("td", { className: "e-pad-y-0 e-semibold e-text-right" }, gradingText)))))));
|
75
|
+
}
|
76
|
+
export default React.memo(withResultsContext(withCommonExamContext(Results)));
|
77
|
+
//# sourceMappingURL=Results.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Results.js","sourceRoot":"","sources":["../../../src/components/grading/Results.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,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B;oBACrD,gBAAgB,CAAC,SAAS,CAAC;oBAC3B,IAAI,IAAI,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAChC,CACjB;gBACD,oBAAC,mBAAmB,OAAG,CACnB;YACL,gBAAgB,CAAC,IAAI,CAAC,CAClB,CACS,CACnB,CAAA;AACH,CAAC,CAAA;AAED,SAAS,mBAAmB;IAC1B,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAC9D,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAElC,OAAO,CACL,6BAAK,SAAS,EAAC,kBAAkB;QAC/B,+BAAO,SAAS,EAAC,uCAAuC;YACtD;gBACE;oBACE,4BAAI,SAAS,EAAC,oBAAoB,IAAE,CAAC,CAAC,eAAe,CAAC,CAAM;oBAC5D,4BAAI,SAAS,EAAC,mCAAmC,IAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAM,CACxF;gBACJ,WAAW,IAAI,CACd;oBACE,4BAAI,SAAS,EAAC,oBAAoB,IAAE,CAAC,CAAC,OAAO,CAAC,CAAM;oBACpD,4BAAI,SAAS,EAAC,mCAAmC,IAAE,WAAW,CAAM,CACjE,CACN,CACK,CACF,CACJ,CACP,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { ExamComponentProps } from '../../createRenderChildNodes';
|
3
|
+
declare function ScoredTextAnswer({ element }: ExamComponentProps): JSX.Element;
|
4
|
+
declare const _default: React.MemoExoticComponent<typeof ScoredTextAnswer>;
|
5
|
+
export default _default;
|
6
|
+
//# sourceMappingURL=ScoredTextAnswer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ScoredTextAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/ScoredTextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAOzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAGjE,iBAAS,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,eAmBxD;;AAED,wBAA2C"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { getNumericAttribute } from '../../dom-utils';
|
3
|
+
import { shortDisplayNumber } from '../../shortDisplayNumber';
|
4
|
+
import { QuestionContext } from '../context/QuestionContext';
|
5
|
+
import { findScore, ResultsContext } from '../context/ResultsContext';
|
6
|
+
import ResultsExamQuestionAutoScore from './internal/QuestionAutoScore';
|
7
|
+
import ResultsSingleLineAnswer from './SingleLineAnswer';
|
8
|
+
function ScoredTextAnswer({ element }) {
|
9
|
+
var _a;
|
10
|
+
const { answers } = useContext(QuestionContext);
|
11
|
+
const { answersByQuestionId, scores } = useContext(ResultsContext);
|
12
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
13
|
+
const maxScore = getNumericAttribute(element, 'max-score');
|
14
|
+
const answer = answersByQuestionId[questionId];
|
15
|
+
const value = answer && answer.value;
|
16
|
+
const displayNumber = shortDisplayNumber(element.getAttribute('display-number'));
|
17
|
+
const autogradingScore = (_a = findScore(scores, questionId)) === null || _a === void 0 ? void 0 : _a.autograding;
|
18
|
+
return (React.createElement(ResultsSingleLineAnswer, { answers: answers, displayNumber: displayNumber, value: value },
|
19
|
+
React.createElement(ResultsExamQuestionAutoScore, { score: autogradingScore === null || autogradingScore === void 0 ? void 0 : autogradingScore.score, maxScore: maxScore, displayNumber: answers.length > 1 ? displayNumber : undefined })));
|
20
|
+
}
|
21
|
+
export default React.memo(ScoredTextAnswer);
|
22
|
+
//# sourceMappingURL=ScoredTextAnswer.js.map
|
@@ -0,0 +1 @@
|
|
1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AE,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,KAAK,EAC9B,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,GAC7D,CACsB,CAC3B,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../../src/components/grading/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAKzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;;AAkBjE,wBAAsD"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { query } from '../../dom-utils';
|
3
|
+
import SectionElement from '../SectionElement';
|
4
|
+
import { SectionContext, withSectionContext } from '../context/SectionContext';
|
5
|
+
import { ResultsContext } from '../context/ResultsContext';
|
6
|
+
import { sectionTitleId } from '../../ids';
|
7
|
+
function Section({ element, renderChildNodes }) {
|
8
|
+
const { displayNumber } = useContext(SectionContext);
|
9
|
+
const { answersByQuestionId } = useContext(ResultsContext);
|
10
|
+
const containsAnswers = query(element, (e) => {
|
11
|
+
const maybeQuestionId = e.getAttribute('question-id');
|
12
|
+
return maybeQuestionId != null && Object.prototype.hasOwnProperty.call(answersByQuestionId, maybeQuestionId);
|
13
|
+
});
|
14
|
+
return containsAnswers ? (React.createElement(SectionElement, { "aria-labelledby": sectionTitleId(displayNumber) },
|
15
|
+
React.createElement("div", { className: "e-results-section-wrapper" }, renderChildNodes(element)))) : null;
|
16
|
+
}
|
17
|
+
export default React.memo(withSectionContext(Section));
|
18
|
+
//# sourceMappingURL=Section.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Section.js","sourceRoot":"","sources":["../../../src/components/grading/Section.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,cAAc,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE1D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE1C,SAAS,OAAO,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB;IAChE,MAAM,EAAE,aAAa,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACpD,MAAM,EAAE,mBAAmB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAC1D,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;QAC3C,MAAM,eAAe,GAAG,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAAA;QACrD,OAAO,eAAe,IAAI,IAAI,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,mBAAmB,EAAE,eAAe,CAAC,CAAA;IAC9G,CAAC,CAAC,CAAA;IAEF,OAAO,eAAe,CAAC,CAAC,CAAC,CACvB,oBAAC,cAAc,uBAAkB,cAAc,CAAC,aAAa,CAAC;QAC5D,6BAAK,SAAS,EAAC,2BAA2B,IAAE,gBAAgB,CAAC,OAAO,CAAC,CAAO,CAC7D,CAClB,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Score } from '../..';
|
3
|
+
declare function SingleLineAnswer({ displayNumber, score, value, children, }: {
|
4
|
+
answers: Element[];
|
5
|
+
score?: Score;
|
6
|
+
displayNumber?: string;
|
7
|
+
value: string | undefined;
|
8
|
+
children: React.ReactNode;
|
9
|
+
}): JSX.Element;
|
10
|
+
declare const _default: React.MemoExoticComponent<typeof SingleLineAnswer>;
|
11
|
+
export default _default;
|
12
|
+
//# sourceMappingURL=SingleLineAnswer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SingleLineAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/SingleLineAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAK7B,iBAAS,gBAAgB,CAAC,EACxB,aAAa,EACb,KAAK,EACL,KAAK,EACL,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,EAAE,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B,eAuBA;;AAED,wBAA2C"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import React, { useLayoutEffect, useRef } from 'react';
|
2
|
+
import { useExamTranslation } from '../../i18n';
|
3
|
+
import { renderAnnotations } from '../../renderAnnotations';
|
4
|
+
import { ScreenReaderOnly } from '../ScreenReaderOnly';
|
5
|
+
function SingleLineAnswer({ displayNumber, score, value, children, }) {
|
6
|
+
const { t } = useExamTranslation();
|
7
|
+
const answerRef = useRef(null);
|
8
|
+
useLayoutEffect(() => {
|
9
|
+
var _a, _b, _c, _d;
|
10
|
+
if (answerRef.current) {
|
11
|
+
renderAnnotations(answerRef.current, (_b = (_a = score === null || score === void 0 ? void 0 : score.pregrading) === null || _a === void 0 ? void 0 : _a.annotations) !== null && _b !== void 0 ? _b : [], (_d = (_c = score === null || score === void 0 ? void 0 : score.censoring) === null || _c === void 0 ? void 0 : _c.annotations) !== null && _d !== void 0 ? _d : []);
|
12
|
+
}
|
13
|
+
});
|
14
|
+
return (React.createElement(React.Fragment, null,
|
15
|
+
displayNumber && React.createElement("sup", null, displayNumber),
|
16
|
+
React.createElement("span", { className: "text-answer text-answer--single-line" },
|
17
|
+
React.createElement(ScreenReaderOnly, null, t('screen-reader.answer-begin')),
|
18
|
+
React.createElement("span", { className: "e-inline-block", ref: answerRef }, value),
|
19
|
+
React.createElement(ScreenReaderOnly, null, t('screen-reader.answer-end'))),
|
20
|
+
children));
|
21
|
+
}
|
22
|
+
export default React.memo(SingleLineAnswer);
|
23
|
+
//# sourceMappingURL=SingleLineAnswer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SingleLineAnswer.js","sourceRoot":"","sources":["../../../src/components/grading/SingleLineAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAEtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAEtD,SAAS,gBAAgB,CAAC,EACxB,aAAa,EACb,KAAK,EACL,KAAK,EACL,QAAQ,GAOT;IACC,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,MAAM,SAAS,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAA;IAE/C,eAAe,CAAC,GAAG,EAAE;;QACnB,IAAI,SAAS,CAAC,OAAO,EAAE;YACrB,iBAAiB,CAAC,SAAS,CAAC,OAAO,EAAE,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,0CAAE,WAAW,mCAAI,EAAE,EAAE,MAAA,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,SAAS,0CAAE,WAAW,mCAAI,EAAE,CAAC,CAAA;SAChH;IACH,CAAC,CAAC,CAAA;IAEF,OAAO,CACL;QACG,aAAa,IAAI,iCAAM,aAAa,CAAO;QAC5C,8BAAM,SAAS,EAAC,sCAAsC;YACpD,oBAAC,gBAAgB,QAAE,CAAC,CAAC,4BAA4B,CAAC,CAAoB;YACtE,8BAAM,SAAS,EAAC,gBAAgB,EAAC,GAAG,EAAE,SAAS,IAC5C,KAAK,CACD;YACP,oBAAC,gBAAgB,QAAE,CAAC,CAAC,0BAA0B,CAAC,CAAoB,CAC/D;QACN,QAAQ,CACR,CACJ,CAAA;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { TextAnswer } from '../..';
|
3
|
+
import { ExamComponentProps } from '../../createRenderChildNodes';
|
4
|
+
declare function TextAnswer({ element }: ExamComponentProps): JSX.Element;
|
5
|
+
declare const _default: React.MemoExoticComponent<typeof TextAnswer>;
|
6
|
+
export default _default;
|
7
|
+
//# sourceMappingURL=TextAnswer.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TextAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/TextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAYjE,iBAAS,UAAU,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,eAoDlD;;AAED,wBAAqC"}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import React, { useContext } from 'react';
|
2
|
+
import { getNumericAttribute } from '../../dom-utils';
|
3
|
+
import { useExamTranslation } from '../../i18n';
|
4
|
+
import { shortDisplayNumber } from '../../shortDisplayNumber';
|
5
|
+
import AnswerToolbar from '../AnswerToolbar';
|
6
|
+
import { QuestionContext } from '../context/QuestionContext';
|
7
|
+
import { findScore, ResultsContext } from '../context/ResultsContext';
|
8
|
+
import AnswerLengthInfo from '../shared/AnswerLengthInfo';
|
9
|
+
import ResultsExamQuestionManualScore from './internal/QuestionManualScore';
|
10
|
+
import { MultiLineAnswer } from './MultiLineAnswer';
|
11
|
+
import ResultsSingleLineAnswer from './SingleLineAnswer';
|
12
|
+
function TextAnswer({ element }) {
|
13
|
+
var _a;
|
14
|
+
const { answers } = useContext(QuestionContext);
|
15
|
+
const { answersByQuestionId, scores } = useContext(ResultsContext);
|
16
|
+
const { t } = useExamTranslation();
|
17
|
+
const questionId = getNumericAttribute(element, 'question-id');
|
18
|
+
const maxScore = getNumericAttribute(element, 'max-score');
|
19
|
+
const answer = answersByQuestionId[questionId];
|
20
|
+
const value = answer && answer.value;
|
21
|
+
const displayNumber = answers.length > 1 ? shortDisplayNumber(element.getAttribute('display-number')) : undefined;
|
22
|
+
const score = findScore(scores, questionId);
|
23
|
+
const comment = (_a = score === null || score === void 0 ? void 0 : score.pregrading) === null || _a === void 0 ? void 0 : _a.comment;
|
24
|
+
const type = (element.getAttribute('type') || 'single-line');
|
25
|
+
const maxLength = getNumericAttribute(element, 'max-length');
|
26
|
+
switch (type) {
|
27
|
+
case 'rich-text':
|
28
|
+
case 'multi-line': {
|
29
|
+
return (React.createElement(React.Fragment, null,
|
30
|
+
maxLength != null && React.createElement(AnswerLengthInfo, { ...{ maxLength } }),
|
31
|
+
React.createElement(ResultsExamQuestionManualScore, { multilineAnswer: true, scores: score, maxScore: maxScore }),
|
32
|
+
React.createElement(MultiLineAnswer, { ...{ type, value, score } }),
|
33
|
+
React.createElement(AnswerToolbar, { ...{
|
34
|
+
answer,
|
35
|
+
element,
|
36
|
+
} }),
|
37
|
+
comment && (React.createElement(React.Fragment, null,
|
38
|
+
React.createElement("h5", null, t('comment')),
|
39
|
+
React.createElement("p", { className: "e-italic" }, comment)))));
|
40
|
+
}
|
41
|
+
case 'single-line':
|
42
|
+
default:
|
43
|
+
return (React.createElement(ResultsSingleLineAnswer, { ...{
|
44
|
+
answers,
|
45
|
+
score,
|
46
|
+
displayNumber,
|
47
|
+
value,
|
48
|
+
} },
|
49
|
+
React.createElement(ResultsExamQuestionManualScore, { ...{ scores: score, maxScore, displayNumber } })));
|
50
|
+
}
|
51
|
+
}
|
52
|
+
export default React.memo(TextAnswer);
|
53
|
+
//# sourceMappingURL=TextAnswer.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TextAnswer.js","sourceRoot":"","sources":["../../../src/components/grading/TextAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,gBAAgB,MAAM,4BAA4B,CAAA;AACzD,OAAO,8BAA8B,MAAM,gCAAgC,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,uBAAuB,MAAM,oBAAoB,CAAA;AAExD,SAAS,UAAU,CAAC,EAAE,OAAO,EAAsB;;IACjD,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAA;IAC/C,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAClE,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAClC,MAAM,UA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AC,UAAU,IAAE,OAAO,CAAK,CACpC,CACJ,CACA,CACJ,CAAA;SACF;QACD,KAAK,aAAa,CAAC;QACnB;YACE,OAAO,CACL,oBAAC,uBAAuB,OAClB;oBACF,OAAO;oBACP,KAAK;oBACL,aAAa;oBACb,KAAK;iBACN;gBAED,oBAAC,8BAA8B,OAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAI,CAC1D,CAC3B,CAAA;KACJ;AACH,CAAC;AAED,eAAe,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,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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