@digabi/exam-engine-core 23.1.3-alpha.0 → 23.1.5-alpha.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/context/ResultsContext.d.ts.map +1 -1
- package/dist/components/context/ResultsContext.js +3 -1
- package/dist/components/context/ResultsContext.js.map +1 -1
- package/dist/components/exam/DNDAnswerContainer.d.ts +3 -1
- package/dist/components/exam/DNDAnswerContainer.d.ts.map +1 -1
- package/dist/components/exam/DNDAnswerContainer.js +26 -16
- package/dist/components/exam/DNDAnswerContainer.js.map +1 -1
- package/dist/components/results/DNDAnswerContainer.d.ts.map +1 -1
- package/dist/components/results/DNDAnswerContainer.js +5 -18
- package/dist/components/results/DNDAnswerContainer.js.map +1 -1
- package/dist/components/shared/DNDTitleAndDroppable.js +2 -2
- package/dist/components/shared/DNDTitleAndDroppable.js.map +1 -1
- package/dist/main-bundle.js +1 -1
- package/dist/main.css +1 -1
- package/dist/parser/parseExam.js +1 -1
- package/dist/parser/parseExam.js.map +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ResultsContext.d.ts","sourceRoot":"","sources":["../../../src/components/context/ResultsContext.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAgB,iBAAiB,EAAE,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAI9G,MAAM,WAAW,cAAc;IAC7B,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;IACnD,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB;AAED,eAAO,MAAM,cAAc,+BAA4D,CAAA;AAEvF,eAAO,MAAM,kBA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A+BpE,CAAA;AAED,wBAAgB,mCAAmC,CACjD,gBAAgB,EAAE,gBAAgB,EAClC,EAAE,EAAE,MAAM,GACT,iBAAiB,GAAG,SAAS,CAY/B;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAEhF;AAED,wBAAgB,+BAA+B,CAC7C,iBAAiB,EAAE,OAAO,EAAE,EAC5B,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,KAAK,EAAE,EACf,mBAAmB,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAClD,MAAM,CAMR;AAED,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,OAAO,EACxB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,KAAK,EAAE,EACf,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,GAC1C,MAAM,CAkCR"}
|
@@ -38,7 +38,9 @@ export function calculateQuestionSumScore(questionElement, gradingStructure, sco
|
|
38
38
|
const choiceQuestionScore = (questionId, scoredAnswer) => {
|
39
39
|
var _a;
|
40
40
|
const choice = findMultiChoiceFromGradingStructure(gradingStructure, questionId);
|
41
|
-
|
41
|
+
const option = choice === null || choice === void 0 ? void 0 : choice.options.find(o => o.id === Number(scoredAnswer.value));
|
42
|
+
const score = (_a = option === null || option === void 0 ? void 0 : option.score) !== null && _a !== void 0 ? _a : 0;
|
43
|
+
return (option === null || option === void 0 ? void 0 : option.correct) || score < 0 ? score : 0;
|
42
44
|
};
|
43
45
|
const textQuestionScore = (questionId) => {
|
44
46
|
var _a, _b;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ResultsContext.js","sourceRoot":"","sources":["../../../src/components/context/ResultsContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAA;AAC9B,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,mBAAm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
2
|
import React from 'react';
|
3
|
-
import { ExamComponentProps } from '../..';
|
3
|
+
import { ExamAnswer, ExamComponentProps, QuestionId } from '../..';
|
4
4
|
export type ItemsState = {
|
5
5
|
root: UniqueIdentifier[];
|
6
6
|
[key: UniqueIdentifier]: UniqueIdentifier[];
|
7
7
|
};
|
8
|
+
export declare const getAnswerOptionIdsByQuestionId: (element: Element, answersById: Record<QuestionId, ExamAnswer>) => ItemsState;
|
9
|
+
export declare const getAnswerOptionsByOptionId: (element: Element) => Record<UniqueIdentifier, Element>;
|
8
10
|
export declare const DNDAnswerContainer: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
|
9
11
|
//# sourceMappingURL=DNDAnswerContainer.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,gBAAgB,EAGjB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"DNDAnswerContainer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,gBAAgB,EAGjB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAQlE,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,gBAAgB,EAAE,CAAA;IACxB,CAAC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,8BAA8B,YAAa,OAAO,eAAe,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,eAiB3G,CAAA;AAED,eAAO,MAAM,0BAA0B,YAAa,OAAO,sCAO1D,CAAA;AAED,eAAO,MAAM,kBAAkB,kCAAmC,kBAAkB,sBAuInF,CAAA"}
|
@@ -7,31 +7,41 @@ import { saveAnswer } from '../../store/answers/actions';
|
|
7
7
|
import { DNDTitleAndDroppable } from '../shared/DNDTitleAndDroppable';
|
8
8
|
import { AllDNDOptions } from './DNDAllOptions';
|
9
9
|
import { DNDAnswerOptionDraggable } from './DNDAnswerOptionDraggable';
|
10
|
+
export const getAnswerOptionIdsByQuestionId = (element, answersById) => {
|
11
|
+
const dndAnswers = queryAll(element, 'dnd-answer');
|
12
|
+
const dndAnswerOptions = queryAll(element, 'dnd-answer-option');
|
13
|
+
const answerOptionIdsByQuestionId = dndAnswers.reduce((acc, group) => {
|
14
|
+
var _a;
|
15
|
+
const questionId = group.getAttribute('question-id');
|
16
|
+
const answer = (_a = answersById[Number(questionId)]) === null || _a === void 0 ? void 0 : _a.value;
|
17
|
+
return {
|
18
|
+
...acc,
|
19
|
+
[questionId]: answer ? [Number(answer)] : [],
|
20
|
+
root: acc.root.filter(e => e !== Number(answer))
|
21
|
+
};
|
22
|
+
}, { root: dndAnswerOptions.map(e => Number(e.getAttribute('option-id'))) });
|
23
|
+
return answerOptionIdsByQuestionId;
|
24
|
+
};
|
25
|
+
export const getAnswerOptionsByOptionId = (element) => {
|
26
|
+
const dndAnswerOptions = queryAll(element, 'dnd-answer-option');
|
27
|
+
const answerOptionsByOptionId = dndAnswerOptions.reduce((acc, el) => {
|
28
|
+
const optionId = el.getAttribute('option-id');
|
29
|
+
return { ...acc, [optionId]: el };
|
30
|
+
}, {});
|
31
|
+
return answerOptionsByOptionId;
|
32
|
+
};
|
10
33
|
export const DNDAnswerContainer = ({ element, renderChildNodes }) => {
|
11
34
|
var _a;
|
35
|
+
const dispatch = useDispatch();
|
12
36
|
const [activeId, setActiveId] = useState();
|
13
37
|
const [optionIdsByQuestionId, setOptionIdsByQuestionId] = useState({});
|
14
38
|
const [answerOptionsById, setAnswerOptionsById] = useState({});
|
15
39
|
const [displayNumbersById, setDisplayNumbersById] = useState({});
|
16
|
-
const dispatch = useDispatch();
|
17
40
|
const answers = useSelector((state) => state.answers);
|
18
41
|
useEffect(() => {
|
19
42
|
const dndAnswers = queryAll(element, 'dnd-answer').filter(e => !!query(e, 'dnd-answer-title'));
|
20
|
-
const
|
21
|
-
const
|
22
|
-
var _a;
|
23
|
-
const questionId = group.getAttribute('question-id');
|
24
|
-
const answer = (_a = answers.answersById[Number(questionId)]) === null || _a === void 0 ? void 0 : _a.value;
|
25
|
-
return {
|
26
|
-
...acc,
|
27
|
-
[questionId]: answer ? [Number(answer)] : [],
|
28
|
-
root: acc.root.filter(e => e !== Number(answer))
|
29
|
-
};
|
30
|
-
}, { root: dndAnswerOptions.map(e => Number(e.getAttribute('option-id'))) });
|
31
|
-
const answerOptionsByOptionId = dndAnswerOptions.reduce((acc, el) => {
|
32
|
-
const optionId = el.getAttribute('option-id');
|
33
|
-
return { ...acc, [optionId]: el };
|
34
|
-
}, {});
|
43
|
+
const answerOptionIdsByQuestionId = getAnswerOptionIdsByQuestionId(element, answers.answersById);
|
44
|
+
const answerOptionsByOptionId = getAnswerOptionsByOptionId(element);
|
35
45
|
const displayNumbersById = dndAnswers.reduce((acc, el) => {
|
36
46
|
const questionId = el.getAttribute('question-id');
|
37
47
|
const displayNumber = el.getAttribute('display-number');
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.js","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAGV,WAAW,EAEX,cAAc,EACd,aAAa,EAEb,SAAS,EACT,UAAU,EACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,WAAW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 +1 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.d.ts","sourceRoot":"","sources":["../../../src/components/results/DNDAnswerContainer.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"DNDAnswerContainer.d.ts","sourceRoot":"","sources":["../../../src/components/results/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAO1C,eAAO,MAAM,kBAAkB,kCAAmC,kBAAkB,sBAuCnF,CAAA"}
|
@@ -1,35 +1,22 @@
|
|
1
1
|
import React, { useContext } from 'react';
|
2
2
|
import { query, queryAll } from '../../dom-utils';
|
3
3
|
import { ResultsContext } from '../context/ResultsContext';
|
4
|
+
import { getAnswerOptionIdsByQuestionId, getAnswerOptionsByOptionId } from '../exam/DNDAnswerContainer';
|
4
5
|
import { DNDTitleAndDroppable } from '../shared/DNDTitleAndDroppable';
|
5
6
|
import { CorrectDNDAnswers } from './CorrectDNDAnswers';
|
6
7
|
export const DNDAnswerContainer = ({ element, renderChildNodes }) => {
|
7
8
|
const { answersByQuestionId, gradingStructure } = useContext(ResultsContext);
|
8
|
-
const
|
9
|
-
const
|
10
|
-
const answerOptionIdsByQuestionId = dndAnswers.reduce((acc, group) => {
|
11
|
-
var _a;
|
12
|
-
const questionId = group.getAttribute('question-id');
|
13
|
-
const answer = (_a = answersByQuestionId[Number(questionId)]) === null || _a === void 0 ? void 0 : _a.value;
|
14
|
-
return {
|
15
|
-
...acc,
|
16
|
-
[questionId]: answer ? [Number(answer)] : [],
|
17
|
-
root: acc.root.filter(e => e !== Number(answer))
|
18
|
-
};
|
19
|
-
}, { root: dndAnswerOptions.map(e => Number(e.getAttribute('option-id'))) });
|
20
|
-
const answerOptionsById = dndAnswerOptions.reduce((acc, el) => {
|
21
|
-
const optionId = el.getAttribute('option-id');
|
22
|
-
return { ...acc, [optionId]: el };
|
23
|
-
}, {});
|
9
|
+
const answerOptionIdsByQuestionId = getAnswerOptionIdsByQuestionId(element, answersByQuestionId);
|
10
|
+
const answerOptionsByOptionId = getAnswerOptionsByOptionId(element);
|
24
11
|
const dndAnswersWithQuestion = queryAll(element, 'dnd-answer').filter(e => !!query(e, 'dnd-answer-title'));
|
25
12
|
return (React.createElement("div", { className: "e-dnd-answer-container" }, dndAnswersWithQuestion.map(element => {
|
26
13
|
var _a;
|
27
14
|
const questionId = element.getAttribute('question-id');
|
28
|
-
const answerOptionElements = (_a = (answerOptionIdsByQuestionId[questionId] || [])) === null || _a === void 0 ? void 0 : _a.map(id => (answerOptionsById === null || answerOptionsById === void 0 ? void 0 : answerOptionsById[id]) || null).filter(Boolean);
|
29
15
|
const itemIds = answerOptionIdsByQuestionId[questionId] || [];
|
16
|
+
const answerOptionElements = (_a = (answerOptionIdsByQuestionId[questionId] || [])) === null || _a === void 0 ? void 0 : _a.map(id => (answerOptionsByOptionId === null || answerOptionsByOptionId === void 0 ? void 0 : answerOptionsByOptionId[id]) || null).filter(Boolean);
|
30
17
|
return (React.createElement(React.Fragment, { key: questionId },
|
31
18
|
React.createElement(DNDTitleAndDroppable, { key: questionId, element: element, answerOptionElements: answerOptionElements, renderChildNodes: renderChildNodes, itemIds: itemIds, page: "results" }),
|
32
|
-
gradingStructure && (React.createElement(CorrectDNDAnswers, { key: `${questionId}-correct`, element: element, renderChildNodes: renderChildNodes, answerOptionsById:
|
19
|
+
gradingStructure && (React.createElement(CorrectDNDAnswers, { key: `${questionId}-correct`, element: element, renderChildNodes: renderChildNodes, answerOptionsById: answerOptionsByOptionId }))));
|
33
20
|
})));
|
34
21
|
};
|
35
22
|
//# sourceMappingURL=DNDAnswerContainer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DNDAnswerContainer.js","sourceRoot":"","sources":["../../../src/components/results/DNDAnswerContainer.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"DNDAnswerContainer.js","sourceRoot":"","sources":["../../../src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BAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAG,EAAE,CAAC,KAAI,IAAI,EAChD,MAAM,CAAC,OAAO,CAAC,CAAA;QAElB,OAAO,CACL,oBAAC,KAAK,CAAC,QAAQ,IAAC,GAAG,EAAE,UAAU;YAC7B,oBAAC,oBAAoB,IACnB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,OAAO,EAChB,oBAAoB,EAAE,oBAAoB,EAC1C,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAC,SAAS,GACd;YAED,gBAAgB,IAAI,CACnB,oBAAC,iBAAiB,IAChB,GAAG,EAAE,GAAG,UAAU,UAAU,EAC5B,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,EAAE,uBAAuB,GAC1C,CACH,CACc,CAClB,CAAA;IACH,CAAC,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
@@ -24,12 +24,12 @@ export const DNDTitleAndDroppable = ({ element, renderChildNodes, itemIds, page,
|
|
24
24
|
const choice = findMultiChoiceFromGradingStructure(gradingStructure, questionIdNumber);
|
25
25
|
const correctOptionIds = (_a = choice === null || choice === void 0 ? void 0 : choice.options) === null || _a === void 0 ? void 0 : _a.filter(o => o.correct).map(o => o.id);
|
26
26
|
const answer = (_b = answersByQuestionId === null || answersByQuestionId === void 0 ? void 0 : answersByQuestionId[questionIdNumber]) !== null && _b !== void 0 ? _b : undefined;
|
27
|
-
const scoreValue = (answer && ((_d = (_c = choice === null || choice === void 0 ? void 0 : choice.options) === null || _c === void 0 ? void 0 : _c.find(option => option.id === Number(answer.value) && option.correct)) === null || _d === void 0 ? void 0 : _d.score)) || 0;
|
27
|
+
const scoreValue = (answer && ((_d = (_c = choice === null || choice === void 0 ? void 0 : choice.options) === null || _c === void 0 ? void 0 : _c.find(option => option.id === Number(answer === null || answer === void 0 ? void 0 : answer.value) && option.correct)) === null || _d === void 0 ? void 0 : _d.score)) || 0;
|
28
28
|
const lastLevelOfDisplayNumber = shortDisplayNumber(displayNumber);
|
29
29
|
const { setNodeRef, isOver } = useDroppable({ id: questionId });
|
30
30
|
return (React.createElement(SortableContext, { id: questionId, items: itemIds },
|
31
31
|
React.createElement("span", { ref: setNodeRef },
|
32
|
-
React.createElement("div", { className: classNames('e-dnd-answer', { 'no-answer': page === 'results' && !answer.value }), "data-question-id": questionId, key: questionId },
|
32
|
+
React.createElement("div", { className: classNames('e-dnd-answer', { 'no-answer': page === 'results' && !(answer === null || answer === void 0 ? void 0 : answer.value) }), "data-question-id": questionId, key: questionId },
|
33
33
|
React.createElement("div", { className: "anchor", id: `question-nr-${displayNumber}` }),
|
34
34
|
titleElement &&
|
35
35
|
(!hasTitle ? (React.createElement("i", { style: { color: 'grey' } }, t('dnd-answers.question-missing'))) : (React.createElement("span", { className: classNames('e-dnd-answer-title', { 'has-images': hasImages, hovered: isOver }) }, renderChildNodes(titleElement)))),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DNDTitleAndDroppable.js","sourceRoot":"","sources":["../../../src/components/shared/DNDTitleAndDroppable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,mCAAmC,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/F,OAAO,4BAA4B,MAAM,uCAAuC,CAAA;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,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