@digabi/exam-engine-core 23.1.3-alpha.0 → 23.1.4-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,11 @@
1
1
  import { UniqueIdentifier } from '@dnd-kit/core';
2
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;AAQ1C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,gBAAgB,EAAE,CAAA;IACxB,CAAC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,kBAAkB,kCAAmC,kBAAkB,sBAyJnF,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 dndAnswerOptions = queryAll(element, 'dnd-answer-option');
21
- const answerOptionIdsByQuestionId = dndAnswers.reduce((acc, group) => {
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,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BA2DnF,CAAA"}
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 dndAnswers = queryAll(element, 'dnd-answer').filter(e => !!query(e, 'dnd-answer-title'));
9
- const dndAnswerOptions = queryAll(element, 'dnd-answer-option');
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: 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":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM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B,GAAG,MAAA,CAAC,2BAA2B,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,0CACxE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA,uBAAuB,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,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