@digabi/exam-engine-core 23.1.0-alpha.0 → 23.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. package/dist/__tests__/results/ResultsContext.test.js +1 -1
  2. package/dist/__tests__/results/ResultsContext.test.js.map +1 -1
  3. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  4. package/dist/components/context/QuestionContext.js +1 -1
  5. package/dist/components/context/QuestionContext.js.map +1 -1
  6. package/dist/components/exam/Exam.d.ts.map +1 -1
  7. package/dist/components/exam/Exam.js +0 -2
  8. package/dist/components/exam/Exam.js.map +1 -1
  9. package/dist/components/results/Results.d.ts.map +1 -1
  10. package/dist/components/results/Results.js +1 -3
  11. package/dist/components/results/Results.js.map +1 -1
  12. package/dist/components/results/internal/QuestionScoresContainer.d.ts.map +1 -1
  13. package/dist/components/results/internal/QuestionScoresContainer.js +2 -4
  14. package/dist/components/results/internal/QuestionScoresContainer.js.map +1 -1
  15. package/dist/dom-utils.d.ts.map +1 -1
  16. package/dist/dom-utils.js +1 -1
  17. package/dist/dom-utils.js.map +1 -1
  18. package/dist/i18n/fi-FI.d.ts +0 -8
  19. package/dist/i18n/fi-FI.d.ts.map +1 -1
  20. package/dist/i18n/fi-FI.js +0 -8
  21. package/dist/i18n/fi-FI.js.map +1 -1
  22. package/dist/i18n/sv-FI.d.ts.map +1 -1
  23. package/dist/i18n/sv-FI.js +0 -8
  24. package/dist/i18n/sv-FI.js.map +1 -1
  25. package/dist/main-bundle.js +10 -10
  26. package/dist/main.css +1 -1
  27. package/dist/parser/parseExam.js +1 -1
  28. package/dist/parser/parseExam.js.map +1 -1
  29. package/dist/parser/parseExamStructure.d.ts +1 -8
  30. package/dist/parser/parseExamStructure.d.ts.map +1 -1
  31. package/dist/parser/parseExamStructure.js +1 -1
  32. package/dist/parser/parseExamStructure.js.map +1 -1
  33. package/dist/validateAnswers.js +0 -1
  34. package/dist/validateAnswers.js.map +1 -1
  35. package/package.json +3 -3
  36. package/dist/__tests__/playwright/DNDAnswerContainer.test.d.ts +0 -2
  37. package/dist/__tests__/playwright/DNDAnswerContainer.test.d.ts.map +0 -1
  38. package/dist/__tests__/playwright/DNDAnswerContainer.test.js +0 -77
  39. package/dist/__tests__/playwright/DNDAnswerContainer.test.js.map +0 -1
  40. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.d.ts +0 -1
  41. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.d.ts.map +0 -1
  42. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js +0 -17
  43. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js.map +0 -1
  44. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.d.ts +0 -10
  45. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.d.ts.map +0 -1
  46. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.js +0 -21
  47. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.js.map +0 -1
  48. package/dist/__tests__/playwright/utils/ComponentWrapper.d.ts +0 -9
  49. package/dist/__tests__/playwright/utils/ComponentWrapper.d.ts.map +0 -1
  50. package/dist/__tests__/playwright/utils/ComponentWrapper.js +0 -26
  51. package/dist/__tests__/playwright/utils/ComponentWrapper.js.map +0 -1
  52. package/dist/components/exam/AllDNDOptions.d.ts +0 -9
  53. package/dist/components/exam/AllDNDOptions.d.ts.map +0 -1
  54. package/dist/components/exam/AllDNDOptions.js +0 -12
  55. package/dist/components/exam/AllDNDOptions.js.map +0 -1
  56. package/dist/components/exam/DNDAllOptions.d.ts +0 -9
  57. package/dist/components/exam/DNDAllOptions.d.ts.map +0 -1
  58. package/dist/components/exam/DNDAllOptions.js +0 -14
  59. package/dist/components/exam/DNDAllOptions.js.map +0 -1
  60. package/dist/components/exam/DNDAnswer.d.ts +0 -20
  61. package/dist/components/exam/DNDAnswer.d.ts.map +0 -1
  62. package/dist/components/exam/DNDAnswer.js +0 -7
  63. package/dist/components/exam/DNDAnswer.js.map +0 -1
  64. package/dist/components/exam/DNDAnswerContainer.d.ts +0 -9
  65. package/dist/components/exam/DNDAnswerContainer.d.ts.map +0 -1
  66. package/dist/components/exam/DNDAnswerContainer.js +0 -128
  67. package/dist/components/exam/DNDAnswerContainer.js.map +0 -1
  68. package/dist/components/exam/DNDAnswerOption.d.ts +0 -4
  69. package/dist/components/exam/DNDAnswerOption.d.ts.map +0 -1
  70. package/dist/components/exam/DNDAnswerOption.js +0 -18
  71. package/dist/components/exam/DNDAnswerOption.js.map +0 -1
  72. package/dist/components/exam/DNDAnswerOptionDraggable.d.ts +0 -4
  73. package/dist/components/exam/DNDAnswerOptionDraggable.d.ts.map +0 -1
  74. package/dist/components/exam/DNDAnswerOptionDraggable.js +0 -18
  75. package/dist/components/exam/DNDAnswerOptionDraggable.js.map +0 -1
  76. package/dist/components/results/CorrectDNDAnswers.d.ts +0 -7
  77. package/dist/components/results/CorrectDNDAnswers.d.ts.map +0 -1
  78. package/dist/components/results/CorrectDNDAnswers.js +0 -19
  79. package/dist/components/results/CorrectDNDAnswers.js.map +0 -1
  80. package/dist/components/results/DNDAnswer.d.ts +0 -12
  81. package/dist/components/results/DNDAnswer.d.ts.map +0 -1
  82. package/dist/components/results/DNDAnswer.js +0 -21
  83. package/dist/components/results/DNDAnswer.js.map +0 -1
  84. package/dist/components/results/DNDAnswerContainer.d.ts +0 -4
  85. package/dist/components/results/DNDAnswerContainer.d.ts.map +0 -1
  86. package/dist/components/results/DNDAnswerContainer.js +0 -35
  87. package/dist/components/results/DNDAnswerContainer.js.map +0 -1
  88. package/dist/components/results/DNDAnswerOption.d.ts +0 -7
  89. package/dist/components/results/DNDAnswerOption.d.ts.map +0 -1
  90. package/dist/components/results/DNDAnswerOption.js +0 -9
  91. package/dist/components/results/DNDAnswerOption.js.map +0 -1
  92. package/dist/components/shared/DNDAnswerCommon.d.ts +0 -13
  93. package/dist/components/shared/DNDAnswerCommon.d.ts.map +0 -1
  94. package/dist/components/shared/DNDAnswerCommon.js +0 -30
  95. package/dist/components/shared/DNDAnswerCommon.js.map +0 -1
  96. package/dist/components/shared/DNDAnswerDroppable.d.ts +0 -13
  97. package/dist/components/shared/DNDAnswerDroppable.d.ts.map +0 -1
  98. package/dist/components/shared/DNDAnswerDroppable.js +0 -30
  99. package/dist/components/shared/DNDAnswerDroppable.js.map +0 -1
  100. package/dist/components/shared/DNDAnswerOptionCommon.d.ts +0 -7
  101. package/dist/components/shared/DNDAnswerOptionCommon.d.ts.map +0 -1
  102. package/dist/components/shared/DNDAnswerOptionCommon.js +0 -14
  103. package/dist/components/shared/DNDAnswerOptionCommon.js.map +0 -1
  104. package/dist/components/shared/DNDDroppable.d.ts +0 -12
  105. package/dist/components/shared/DNDDroppable.d.ts.map +0 -1
  106. package/dist/components/shared/DNDDroppable.js +0 -27
  107. package/dist/components/shared/DNDDroppable.js.map +0 -1
  108. package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts +0 -13
  109. package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts.map +0 -1
  110. package/dist/components/shared/DNDTitleAndAnswerCommon.js +0 -27
  111. package/dist/components/shared/DNDTitleAndAnswerCommon.js.map +0 -1
  112. package/dist/components/shared/DNDTitleAndDroppable.d.ts +0 -11
  113. package/dist/components/shared/DNDTitleAndDroppable.d.ts.map +0 -1
  114. package/dist/components/shared/DNDTitleAndDroppable.js +0 -53
  115. package/dist/components/shared/DNDTitleAndDroppable.js.map +0 -1
@@ -1,17 +0,0 @@
1
- "use strict";
2
- // import { test, expect } from '@playwright/experimental-ct-react'
3
- // import React from 'react'
4
- // import { DNDAnswerContainer } from '../../../src/components/exam/DNDAnswerContainer'
5
- // import { renderChildNodes } from '../../../src/components/exam/Exam'
6
- // test.describe('SectionElement', () => {
7
- // test('renders SectionElement correctly', async ({ mount }) => {
8
- // const element = document.createElement('div')
9
- // const component = await mount(
10
- // <div>
11
- // <DNDAnswerContainer element={element} renderChildNodes={renderChildNodes}></DNDAnswerContainer>
12
- // </div>
13
- // )
14
- // await expect(component).toBeVisible()
15
- // })
16
- // })
17
- //# sourceMappingURL=DNDAnswerContainer.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswerContainer.test.js","sourceRoot":"","sources":["../../../../__tests__/playwright/exam/DNDAnswerContainer.test.tsx"],"names":[],"mappings":";AAAA,mEAAmE;AACnE,4BAA4B;AAC5B,uFAAuF;AACvF,uEAAuE;AAEvE,0CAA0C;AAC1C,oEAAoE;AACpE,oDAAoD;AACpD,qCAAqC;AACrC,cAAc;AACd,0GAA0G;AAC1G,eAAe;AACf,QAAQ;AACR,4CAA4C;AAC5C,OAAO;AACP,KAAK"}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { MasteringResult } from '@digabi/exam-engine-mastering';
3
- export type answerMediaType = 'text' | 'image';
4
- interface DNDAnswerContainerStoryProps {
5
- masteredExam: MasteringResult;
6
- answerMediaType: answerMediaType;
7
- }
8
- export declare const DNDAnswerContainerStory: React.FC<DNDAnswerContainerStoryProps>;
9
- export {};
10
- //# sourceMappingURL=DNDAnswerContainer.story.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswerContainer.story.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/stories/DNDAnswerContainer.story.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAO/D,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,CAAA;AAE9C,UAAU,4BAA4B;IACpC,YAAY,EAAE,eAAe,CAAA;IAC7B,eAAe,EAAE,eAAe,CAAA;CACjC;AAED,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAc1E,CAAA"}
@@ -1,21 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DNDAnswerContainerStory = void 0;
7
- /* eslint-disable @typescript-eslint/no-unsafe-assignment */
8
- const react_1 = __importDefault(require("react"));
9
- const Exam_1 = require("../../../src/components/exam/Exam");
10
- const DNDAnswerContainer_1 = require("../../../src/components/exam/DNDAnswerContainer");
11
- const ComponentWrapper_1 = require("../utils/ComponentWrapper");
12
- const parseExam_1 = __importDefault(require("../../../src/parser/parseExam"));
13
- const dom_utils_1 = require("../../../src/dom-utils");
14
- const DNDAnswerContainerStory = ({ masteredExam, answerMediaType }) => {
15
- const doc = (0, parseExam_1.default)(masteredExam.xml, true);
16
- const [textAnswers, imageAnswers] = (0, dom_utils_1.queryAll)(doc.documentElement, 'dnd-answer-container');
17
- return (react_1.default.createElement(ComponentWrapper_1.ComponentWrapper, { doc: doc, resolveAttachment: (filename) => `/${masteredExam.examCode}/attachments/${filename}` },
18
- react_1.default.createElement(DNDAnswerContainer_1.DNDAnswerContainer, { element: answerMediaType === 'text' ? textAnswers : imageAnswers, renderChildNodes: Exam_1.renderChildNodes })));
19
- };
20
- exports.DNDAnswerContainerStory = DNDAnswerContainerStory;
21
- //# sourceMappingURL=DNDAnswerContainer.story.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswerContainer.story.js","sourceRoot":"","sources":["../../../../__tests__/playwright/stories/DNDAnswerContainer.story.tsx"],"names":[],"mappings":";;;;;;AAAA,4DAA4D;AAC5D,kDAAyB;AAEzB,4DAAoE;AACpE,wFAAoF;AACpF,gEAA4D;AAC5D,8EAAqD;AACrD,sDAAiD;AAS1C,MAAM,uBAAuB,GAA2C,CAAC,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,EAAE;IACnH,MAAM,GAAG,GAAG,IAAA,mBAAS,EAAC,YAAY,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAC7C,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,IAAA,oBAAQ,EAAC,GAAG,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAA;IACzF,OAAO,CACL,8BAAC,mCAAgB,IACf,GAAG,EAAE,GAAG,EACR,iBAAiB,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,YAAY,CAAC,QAAQ,gBAAgB,QAAQ,EAAE;QAE5F,8BAAC,uCAAkB,IACjB,OAAO,EAAE,eAAe,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,EAChE,gBAAgB,EAAE,uBAAgB,GACd,CACL,CACpB,CAAA;AACH,CAAC,CAAA;AAdY,QAAA,uBAAuB,2BAcnC"}
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { CommonExamProps } from '../../../src/components/exam/Exam';
3
- import '../../../src/css/main.less';
4
- export interface ComponentWrapperProps extends CommonExamProps {
5
- doc: XMLDocument;
6
- children: React.ReactElement;
7
- }
8
- export declare const ComponentWrapper: React.ComponentType<any>;
9
- //# sourceMappingURL=ComponentWrapper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentWrapper.d.ts","sourceRoot":"","sources":["../../../../__tests__/playwright/utils/ComponentWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAUzB,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AACnE,OAAO,4BAA4B,CAAA;AAEnC,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,GAAG,EAAE,WAAW,CAAA;IAChB,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAA;CAC7B;AAeD,eAAO,MAAM,gBAAgB,0BAA2D,CAAA"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ComponentWrapper = void 0;
7
- const react_1 = __importDefault(require("react"));
8
- const react_redux_1 = require("react-redux");
9
- const react_i18next_1 = require("react-i18next");
10
- const store_1 = require("../../../src/store");
11
- const parseExamStructure_1 = require("../../../src/parser/parseExamStructure");
12
- const useCached_1 = require("../../../src/useCached");
13
- const examServerApi_1 = require("../../examServerApi");
14
- const i18n_1 = require("../../../src/i18n");
15
- const CommonExamContext_1 = require("../../../src/components/context/CommonExamContext");
16
- const ExamContext_1 = require("../../../src/components/context/ExamContext");
17
- require("../../../src/css/main.less");
18
- const WrappedComponent = ({ doc, children }) => {
19
- const i18n = (0, useCached_1.useCached)(() => (0, i18n_1.initI18n)('fi-FI'));
20
- const store = (0, useCached_1.useCached)(() => (0, store_1.initializeExamStore)((0, parseExamStructure_1.parseExamStructure)(doc), 'allowed', [], [], examServerApi_1.examServerApi));
21
- return (react_1.default.createElement(react_redux_1.Provider, { store: store },
22
- react_1.default.createElement(react_i18next_1.I18nextProvider, { i18n: i18n },
23
- react_1.default.createElement("div", { className: "e-exam" }, children))));
24
- };
25
- exports.ComponentWrapper = (0, ExamContext_1.withExamContext)((0, CommonExamContext_1.withCommonExamContext)(WrappedComponent));
26
- //# sourceMappingURL=ComponentWrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentWrapper.js","sourceRoot":"","sources":["../../../../__tests__/playwright/utils/ComponentWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAAyB;AACzB,6CAAsC;AACtC,iDAA+C;AAC/C,8CAAwD;AACxD,+EAA2E;AAC3E,sDAAkD;AAClD,uDAAmD;AACnD,4CAA4C;AAC5C,yFAAyF;AACzF,6EAA6E;AAE7E,sCAAmC;AAOnC,MAAM,gBAAgB,GAAoC,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9E,MAAM,IAAI,GAAG,IAAA,qBAAS,EAAC,GAAG,EAAE,CAAC,IAAA,eAAQ,EAAC,OAAO,CAAC,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAG,IAAA,qBAAS,EAAC,GAAG,EAAE,CAAC,IAAA,2BAAmB,EAAC,IAAA,uCAAkB,EAAC,GAAG,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE,EAAE,6BAAa,CAAC,CAAC,CAAA;IAE7G,OAAO,CACL,8BAAC,sBAAQ,IAAC,KAAK,EAAE,KAAK;QACpB,8BAAC,+BAAe,IAAC,IAAI,EAAE,IAAI;YACzB,uCAAK,SAAS,EAAC,QAAQ,IAAE,QAAQ,CAAO,CACxB,CACT,CACZ,CAAA;AACH,CAAC,CAAA;AAEY,QAAA,gBAAgB,GAAG,IAAA,6BAAe,EAAC,IAAA,yCAAqB,EAAC,gBAAgB,CAAC,CAAC,CAAA"}
@@ -1,9 +0,0 @@
1
- import { UniqueIdentifier } from '@dnd-kit/core';
2
- import React from 'react';
3
- import { RenderChildNodes } from '../../createRenderChildNodes';
4
- export declare const AllDNDOptions: ({ items, renderChildNodes, answerOptionsByOptionId }: {
5
- items: UniqueIdentifier[];
6
- renderChildNodes: RenderChildNodes;
7
- answerOptionsByOptionId: Record<UniqueIdentifier, Element>;
8
- }) => React.JSX.Element;
9
- //# sourceMappingURL=AllDNDOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AllDNDOptions.d.ts","sourceRoot":"","sources":["../../../src/components/exam/AllDNDOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAE/D,eAAO,MAAM,aAAa,yDAIvB;IACD,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,uBAAuB,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;CAC3D,sBAgBA,CAAA"}
@@ -1,12 +0,0 @@
1
- import { useDroppable } from '@dnd-kit/core';
2
- import { SortableContext } from '@dnd-kit/sortable';
3
- import React from 'react';
4
- import { DNDAnswer } from './DNDAnswer';
5
- export const AllDNDOptions = ({ items, renderChildNodes, answerOptionsByOptionId }) => {
6
- const { setNodeRef } = useDroppable({ id: 'root' });
7
- return (React.createElement(SortableContext, { items: items },
8
- React.createElement("span", { className: "droppable-title" }, "Vastausvaihtoehdot:"),
9
- React.createElement("span", { ref: setNodeRef },
10
- React.createElement(DNDAnswer, { renderChildNodes: renderChildNodes, questionId: "root", items: items, answerOptionsByQuestionId: answerOptionsByOptionId }))));
11
- };
12
- //# sourceMappingURL=AllDNDOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AllDNDOptions.js","sourceRoot":"","sources":["../../../src/components/exam/AllDNDOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,gBAAgB,EAChB,uBAAuB,EAKxB,EAAE,EAAE;IACH,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;IAEnD,OAAO,CACL,oBAAC,eAAe,IAAC,KAAK,EAAE,KAAK;QAC3B,8BAAM,SAAS,EAAC,iBAAiB,0BAA2B;QAC5D,8BAAM,GAAG,EAAE,UAAU;YACnB,oBAAC,SAAS,IACR,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAC,MAAM,EACjB,KAAK,EAAE,KAAK,EACZ,yBAAyB,EAAE,uBAAuB,GAClD,CACG,CACS,CACnB,CAAA;AACH,CAAC,CAAA"}
@@ -1,9 +0,0 @@
1
- import { UniqueIdentifier } from '@dnd-kit/core';
2
- import React from 'react';
3
- import { RenderChildNodes } from '../../createRenderChildNodes';
4
- export declare const AllDNDOptions: ({ items, renderChildNodes, answerOptionElements }: {
5
- items: UniqueIdentifier[];
6
- renderChildNodes: RenderChildNodes;
7
- answerOptionElements: Element[];
8
- }) => React.JSX.Element;
9
- //# sourceMappingURL=DNDAllOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAllOptions.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DNDAllOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAI/D,eAAO,MAAM,aAAa,sDAIvB;IACD,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,oBAAoB,EAAE,OAAO,EAAE,CAAA;CAChC,sBAkBA,CAAA"}
@@ -1,14 +0,0 @@
1
- import { useDroppable } from '@dnd-kit/core';
2
- import { SortableContext } from '@dnd-kit/sortable';
3
- import React from 'react';
4
- import { DNDDroppable } from '../shared/DNDDroppable';
5
- import { useExamTranslation } from '../../i18n';
6
- export const AllDNDOptions = ({ items, renderChildNodes, answerOptionElements }) => {
7
- const { setNodeRef } = useDroppable({ id: 'root' });
8
- const { t } = useExamTranslation();
9
- return (React.createElement(SortableContext, { items: items },
10
- React.createElement("span", { className: "droppable-title" }, t('dnd-answers.all-answer-options')),
11
- React.createElement("span", { ref: setNodeRef },
12
- React.createElement(DNDDroppable, { renderChildNodes: renderChildNodes, questionId: "root", page: "exam", classes: ['root'], answerOptionElements: answerOptionElements }))));
13
- };
14
- //# sourceMappingURL=DNDAllOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAllOptions.js","sourceRoot":"","sources":["../../../src/components/exam/DNDAllOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,KAAK,EACL,gBAAgB,EAChB,oBAAoB,EAKrB,EAAE,EAAE;IACH,MAAM,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;IACnD,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAElC,OAAO,CACL,oBAAC,eAAe,IAAC,KAAK,EAAE,KAAK;QAC3B,8BAAM,SAAS,EAAC,iBAAiB,IAAE,CAAC,CAAC,gCAAgC,CAAC,CAAQ;QAC9E,8BAAM,GAAG,EAAE,UAAU;YACnB,oBAAC,YAAY,IACX,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAC,MAAM,EACjB,IAAI,EAAC,MAAM,EACX,OAAO,EAAE,CAAC,MAAM,CAAC,EACjB,oBAAoB,EAAE,oBAAoB,GAC1C,CACG,CACS,CACnB,CAAA;AACH,CAAC,CAAA"}
@@ -1,20 +0,0 @@
1
- import { UniqueIdentifier } from '@dnd-kit/core';
2
- import React from 'react';
3
- import { ExamComponentProps } from '../..';
4
- export type ItemsState = {
5
- root: UniqueIdentifier[];
6
- [key: UniqueIdentifier]: UniqueIdentifier[];
7
- };
8
- export type PartialItemsState = {
9
- [key: UniqueIdentifier]: UniqueIdentifier[];
10
- };
11
- export declare const DNDAnswer: ({ renderChildNodes, items, answerOptionsByQuestionId, questionId, maxScore }: {
12
- items: UniqueIdentifier[];
13
- answerOptionsByQuestionId: Record<UniqueIdentifier, Element>;
14
- questionId: UniqueIdentifier;
15
- renderChildNodes: ExamComponentProps["renderChildNodes"];
16
- titleElement?: Element;
17
- displayNumber?: string;
18
- maxScore?: number;
19
- }) => React.JSX.Element;
20
- //# sourceMappingURL=DNDAnswer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAI1C,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,gBAAgB,EAAE,CAAA;IACxB,CAAC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAA;CAC5C,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,SAAS,iFAMnB;IACD,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;IAC5D,UAAU,EAAE,gBAAgB,CAAA;IAC5B,gBAAgB,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IACxD,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,sBAaA,CAAA"}
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { DNDAnswerCommon } from '../shared/DNDAnswerCommon';
3
- import { Score } from '../shared/Score';
4
- export const DNDAnswer = ({ renderChildNodes, items, answerOptionsByQuestionId, questionId, maxScore }) => (React.createElement(React.Fragment, null,
5
- React.createElement(DNDAnswerCommon, { renderChildNodes: renderChildNodes, items: items, answerOptionsByQuestionId: answerOptionsByQuestionId, classes: { root: questionId === 'root' }, isInExam: true, questionId: questionId }),
6
- maxScore ? React.createElement(Score, { score: maxScore, size: "small" }) : null));
7
- //# sourceMappingURL=DNDAnswer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswer.js","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAWvC,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,gBAAgB,EAChB,KAAK,EACL,yBAAyB,EACzB,UAAU,EACV,QAAQ,EAST,EAAE,EAAE,CAAC,CACJ;IACE,oBAAC,eAAe,IACd,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,KAAK,EACZ,yBAAyB,EAAE,yBAAyB,EACpD,OAAO,EAAE,EAAE,IAAI,EAAE,UAAU,KAAK,MAAM,EAAE,EACxC,QAAQ,EAAE,IAAI,EACd,UAAU,EAAE,UAAU,GACtB;IAED,QAAQ,CAAC,CAAC,CAAC,oBAAC,KAAK,IAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CACzD,CACJ,CAAA"}
@@ -1,9 +0,0 @@
1
- import { UniqueIdentifier } from '@dnd-kit/core';
2
- import React from 'react';
3
- import { ExamComponentProps } from '../..';
4
- export type ItemsState = {
5
- root: UniqueIdentifier[];
6
- [key: UniqueIdentifier]: UniqueIdentifier[];
7
- };
8
- export declare const DNDAnswerContainer: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
9
- //# sourceMappingURL=DNDAnswerContainer.d.ts.map
@@ -1 +0,0 @@
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,sBA+JnF,CAAA"}
@@ -1,128 +0,0 @@
1
- import { DndContext, DragOverlay, KeyboardSensor, PointerSensor, useSensor, useSensors } from '@dnd-kit/core';
2
- import { sortableKeyboardCoordinates } from '@dnd-kit/sortable';
3
- import React, { useEffect, useState } from 'react';
4
- import { useDispatch, useSelector } from 'react-redux';
5
- import { query, queryAll } from '../../dom-utils';
6
- import { saveAnswer } from '../../store/answers/actions';
7
- import { DNDTitleAndDroppable } from '../shared/DNDTitleAndDroppable';
8
- import { AllDNDOptions } from './DNDAllOptions';
9
- import { DNDAnswerOptionDraggable } from './DNDAnswerOptionDraggable';
10
- export const DNDAnswerContainer = ({ element, renderChildNodes }) => {
11
- var _a;
12
- const [activeId, setActiveId] = useState();
13
- const [optionIdsByQuestionId, setOptionIdsByQuestionId] = useState({});
14
- const [answerOptionsById, setAnswerOptionsById] = useState({});
15
- const [displayNumbersById, setDisplayNumbersById] = useState({});
16
- const dispatch = useDispatch();
17
- const answers = useSelector((state) => state.answers);
18
- useEffect(() => {
19
- 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
- }, {});
35
- const displayNumbersById = dndAnswers.reduce((acc, el) => {
36
- const questionId = el.getAttribute('question-id');
37
- const displayNumber = el.getAttribute('display-number');
38
- return { ...acc, [questionId]: displayNumber };
39
- }, {});
40
- setOptionIdsByQuestionId(answerOptionIdsByQuestionId);
41
- setAnswerOptionsById(answerOptionsByOptionId);
42
- setDisplayNumbersById(displayNumbersById);
43
- }, [element]);
44
- const sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
45
- coordinateGetter: sortableKeyboardCoordinates
46
- }));
47
- function findContainer(id) {
48
- if (id in optionIdsByQuestionId) {
49
- return id;
50
- }
51
- return Object.keys(optionIdsByQuestionId).find(key => optionIdsByQuestionId[key].includes(id));
52
- }
53
- function handleDragStart(event) {
54
- setActiveId(event.active.id);
55
- }
56
- function getContainers(event) {
57
- const { active, over } = event;
58
- const activeId = active.id;
59
- const overId = over === null || over === void 0 ? void 0 : over.id;
60
- const activeContainer = findContainer(activeId);
61
- const overContainer = overId ? findContainer(overId) : null;
62
- return { activeId, activeContainer, overContainer };
63
- }
64
- function handleDragOver(event) {
65
- const { activeContainer, overContainer } = getContainers(event);
66
- if (!activeContainer || !overContainer || activeContainer === overContainer) {
67
- return;
68
- }
69
- }
70
- function handleDragEnd(event) {
71
- const { activeId, activeContainer, overContainer } = getContainers(event);
72
- if (!activeContainer || !overContainer || activeContainer === overContainer) {
73
- return;
74
- }
75
- setOptionIdsByQuestionId(optionIdsByQuestionId => moveValue(optionIdsByQuestionId, activeContainer, overContainer, activeId));
76
- setActiveId(null);
77
- }
78
- useEffect(() => {
79
- Object.entries(optionIdsByQuestionId).forEach(([questionId, answerValue]) => {
80
- if (questionId !== 'root') {
81
- saveAnswerToStore(questionId, answerValue === null || answerValue === void 0 ? void 0 : answerValue.toString());
82
- }
83
- });
84
- }, [optionIdsByQuestionId]);
85
- function saveAnswerToStore(overContainer, activeId) {
86
- const questionId = Number(overContainer);
87
- const value = (activeId === null || activeId === void 0 ? void 0 : activeId.toString()) || '';
88
- const displayNumber = displayNumbersById[questionId];
89
- dispatch(saveAnswer({ type: 'choice', questionId, value, displayNumber }));
90
- }
91
- const dndAnswersWithQuestion = queryAll(element, 'dnd-answer').filter(e => !!query(e, 'dnd-answer-title'));
92
- const allAnswerOptionElements = (_a = optionIdsByQuestionId.root) === null || _a === void 0 ? void 0 : _a.map(id => answerOptionsById[id] || null).filter(Boolean);
93
- // We can not render the prop 'element' (XML) here, because we will change the DOM structure when items are dragged around¯, but the XML can not be changed
94
- return (React.createElement("div", { className: "e-dnd-answer-container" },
95
- React.createElement(DndContext, { sensors: sensors, onDragStart: handleDragStart, onDragOver: handleDragOver, onDragEnd: handleDragEnd },
96
- dndAnswersWithQuestion.map(element => {
97
- var _a;
98
- const questionId = element.getAttribute('question-id');
99
- const dndAnswerOptions = (_a = (optionIdsByQuestionId[questionId] || [])) === null || _a === void 0 ? void 0 : _a.map(id => (answerOptionsById === null || answerOptionsById === void 0 ? void 0 : answerOptionsById[id]) || null).filter(Boolean);
100
- const itemIds = optionIdsByQuestionId[questionId] || [];
101
- return (React.createElement(DNDTitleAndDroppable, { key: questionId, element: element, renderChildNodes: renderChildNodes, itemIds: itemIds, answerOptionElements: dndAnswerOptions, page: "exam" }));
102
- }),
103
- React.createElement(AllDNDOptions, { items: optionIdsByQuestionId.root || [], renderChildNodes: renderChildNodes, answerOptionElements: allAnswerOptionElements }),
104
- React.createElement(DragOverlay, { className: "e-dnd-answer-drag-overlay", dropAnimation: {
105
- duration: 250,
106
- easing: 'ease-in-out'
107
- } }, activeId ? (React.createElement(DNDAnswerOptionDraggable, { element: answerOptionsById[activeId], renderChildNodes: renderChildNodes })) : null))));
108
- };
109
- function moveValue(state, from, to, value) {
110
- const newState = { ...state };
111
- // Remove the value from its current container
112
- newState[from] = newState[from].filter(item => item !== value);
113
- if (to === 'root') {
114
- // add the value to root
115
- newState.root = [value, ...newState.root];
116
- }
117
- else {
118
- // If the target container is not empty, move the existing value back to root
119
- if (newState[to].length > 0) {
120
- const existingValue = newState[to][0];
121
- newState.root = [...newState.root, existingValue];
122
- }
123
- // Move the new value to the target container
124
- newState[to] = [value];
125
- }
126
- return newState;
127
- }
128
- //# sourceMappingURL=DNDAnswerContainer.js.map
@@ -1 +0,0 @@
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,EAAE,MAAM,aAAa,CAAA;AAEtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAExD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAA;AAOrE,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB,EAAE,EAAE;;IACtF,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,EAA2B,CAAA;IACnE,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,QAAQ,CAAa,EAAgB,CAAC,CAAA;IAChG,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAoC,EAAE,CAAC,CAAA;IACj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CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAA;IAE9D,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;QAClB,wBAAwB;QACxB,QAAQ,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC3C,CAAC;SAAM,CAAC;QACN,6EAA6E;QAC7E,IAAI,QAAQ,CAAC,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM,aAAa,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;YACrC,QAAQ,CAAC,IAAI,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;QACnD,CAAC;QACD,6CAA6C;QAC7C,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IACxB,CAAC;IACD,OAAO,QAAQ,CAAA;AACjB,CAAC"}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { ExamComponentProps } from '../..';
3
- export declare const DNDAnswerOption: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
4
- //# sourceMappingURL=DNDAnswerOption.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswerOption.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerOption.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAI1C,eAAO,MAAM,eAAe,kCAAmC,kBAAkB,sBAkBhF,CAAA"}
@@ -1,18 +0,0 @@
1
- import { useDraggable } from '@dnd-kit/core';
2
- import { faUpDownLeftRight } from '@fortawesome/free-solid-svg-icons';
3
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
- import React from 'react';
5
- import { getNumericAttribute } from '../../dom-utils';
6
- import { DNDAnswerOptionCommon } from '../shared/DNDAnswerOptionCommon';
7
- export const DNDAnswerOption = ({ element, renderChildNodes }) => {
8
- const optionId = getNumericAttribute(element, 'option-id');
9
- const { attributes, listeners, setNodeRef, isDragging, setActivatorNodeRef } = useDraggable({
10
- id: optionId
11
- });
12
- const style = { opacity: isDragging ? 0.3 : 1 };
13
- return (React.createElement("div", { ref: setNodeRef, className: "e-dnd-answer-option" },
14
- React.createElement(DNDAnswerOptionCommon, { element: element, renderChildNodes: renderChildNodes, style: style }),
15
- React.createElement("div", { ...listeners, ...attributes, ref: setActivatorNodeRef, className: "drag-handle" },
16
- React.createElement(FontAwesomeIcon, { size: "1x", icon: faUpDownLeftRight }))));
17
- };
18
- //# sourceMappingURL=DNDAnswerOption.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswerOption.js","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerOption.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAEvE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB,EAAE,EAAE;IACnF,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAE,CAAA;IAE3D,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,GAAG,YAAY,CAAC;QAC1F,EAAE,EAAE,QAAQ;KACb,CAAC,CAAA;IAEF,MAAM,KAAK,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAE/C,OAAO,CACL,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAC,qBAAqB;QACnD,oBAAC,qBAAqB,IAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,GAAI;QAE7F,gCAAS,SAAS,KAAM,UAAU,EAAE,GAAG,EAAE,mBAAmB,EAAE,SAAS,EAAC,aAAa;YACnF,oBAAC,eAAe,IAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAE,iBAAiB,GAAI,CAClD,CACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { ExamComponentProps } from '../..';
3
- export declare const DNDAnswerOptionDraggable: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
4
- //# sourceMappingURL=DNDAnswerOptionDraggable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswerOptionDraggable.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerOptionDraggable.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAI1C,eAAO,MAAM,wBAAwB,kCAAmC,kBAAkB,sBAkBzF,CAAA"}
@@ -1,18 +0,0 @@
1
- import { useDraggable } from '@dnd-kit/core';
2
- import { faUpDownLeftRight } from '@fortawesome/free-solid-svg-icons';
3
- import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
- import React from 'react';
5
- import { getNumericAttribute } from '../../dom-utils';
6
- import { DNDAnswerOption } from '../results/DNDAnswerOption';
7
- export const DNDAnswerOptionDraggable = ({ element, renderChildNodes }) => {
8
- const optionId = getNumericAttribute(element, 'option-id');
9
- const { attributes, listeners, setNodeRef, isDragging, setActivatorNodeRef } = useDraggable({
10
- id: optionId
11
- });
12
- const style = { opacity: isDragging ? 0.3 : 1 };
13
- return (React.createElement("div", { ref: setNodeRef, className: "e-dnd-answer-option" },
14
- React.createElement(DNDAnswerOption, { element: element, renderChildNodes: renderChildNodes, style: style }),
15
- React.createElement("div", { ...listeners, ...attributes, ref: setActivatorNodeRef, className: "drag-handle" },
16
- React.createElement(FontAwesomeIcon, { size: "1x", icon: faUpDownLeftRight }))));
17
- };
18
- //# sourceMappingURL=DNDAnswerOptionDraggable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswerOptionDraggable.js","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerOptionDraggable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB,EAAE,EAAE;IAC5F,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,WAAW,CAAE,CAAA;IAE3D,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,mBAAmB,EAAE,GAAG,YAAY,CAAC;QAC1F,EAAE,EAAE,QAAQ;KACb,CAAC,CAAA;IAEF,MAAM,KAAK,GAAG,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAE/C,OAAO,CACL,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAC,qBAAqB;QACnD,oBAAC,eAAe,IAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,EAAE,KAAK,GAAI;QAEvF,gCAAS,SAAS,KAAM,UAAU,EAAE,GAAG,EAAE,mBAAmB,EAAE,SAAS,EAAC,aAAa;YACnF,oBAAC,eAAe,IAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAE,iBAAiB,GAAI,CAClD,CACF,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1,7 +0,0 @@
1
- import { UniqueIdentifier } from '@dnd-kit/core';
2
- import React from 'react';
3
- import { ExamComponentProps } from '../..';
4
- export declare const CorrectDNDAnswers: ({ element, renderChildNodes, answerOptionsById }: ExamComponentProps & {
5
- answerOptionsById: Record<UniqueIdentifier, Element>;
6
- }) => React.JSX.Element;
7
- //# sourceMappingURL=CorrectDNDAnswers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CorrectDNDAnswers.d.ts","sourceRoot":"","sources":["../../../src/components/results/CorrectDNDAnswers.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAuB,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAK/D,eAAO,MAAM,iBAAiB,qDAI3B,kBAAkB,GAAG;IACtB,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;CACrD,sBAwBA,CAAA"}
@@ -1,19 +0,0 @@
1
- import React, { useContext } from 'react';
2
- import { ResultsContext } from '../context/ResultsContext';
3
- import { DNDDroppable } from '../shared/DNDDroppable';
4
- import { useExamTranslation } from '../../i18n';
5
- export const CorrectDNDAnswers = ({ element, renderChildNodes, answerOptionsById }) => {
6
- var _a;
7
- const { gradingStructure } = useContext(ResultsContext);
8
- const displayNumber = element.getAttribute('display-number');
9
- const questionId = Number(element.getAttribute('question-id'));
10
- const thisQuestion = gradingStructure === null || gradingStructure === void 0 ? void 0 : gradingStructure.questions.find(q => q.displayNumber === displayNumber);
11
- const options = ((_a = thisQuestion === null || thisQuestion === void 0 ? void 0 : thisQuestion.choices.find(c => c.id === questionId)) === null || _a === void 0 ? void 0 : _a.options) || [];
12
- const correctOptionIds = options === null || options === void 0 ? void 0 : options.filter(o => o.correct).map(o => o.id);
13
- const correctDNDAnswerOptions = correctOptionIds === null || correctOptionIds === void 0 ? void 0 : correctOptionIds.map(id => (answerOptionsById === null || answerOptionsById === void 0 ? void 0 : answerOptionsById[id]) || null).filter(Boolean);
14
- const { t } = useExamTranslation();
15
- return (React.createElement(React.Fragment, null,
16
- React.createElement("span", { className: "droppable-title align-right" }, t('dnd-answers.correct-answers')),
17
- React.createElement(DNDDroppable, { renderChildNodes: renderChildNodes, answerOptionElements: correctDNDAnswerOptions, correctIds: correctOptionIds, questionId: questionId, page: "results", classes: ['correct-answers'] })));
18
- };
19
- //# sourceMappingURL=CorrectDNDAnswers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CorrectDNDAnswers.js","sourceRoot":"","sources":["../../../src/components/results/CorrectDNDAnswers.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE/C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EAGlB,EAAE,EAAE;;IACH,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAEvD,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAE,CAAA;IAC7D,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,aAAa,CAAE,CAAC,CAAA;IAC/D,MAAM,YAAY,GAAG,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,aAAa,CAAwB,CAAA;IACpH,MAAM,OAAO,GAAG,CAAA,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,UAAU,CAAC,0CAAE,OAAO,KAAI,EAAE,CAAA;IACnF,MAAM,gBAAgB,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IACvE,MAAM,uBAAuB,GAAG,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,EAAE,CAAC,KAAI,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAC5G,MAAM,EAAE,CAAC,EAAE,GAAG,kBAAkB,EAAE,CAAA;IAElC,OAAO,CACL;QACE,8BAAM,SAAS,EAAC,6BAA6B,IAAE,CAAC,CAAC,6BAA6B,CAAC,CAAQ;QACvF,oBAAC,YAAY,IACX,gBAAgB,EAAE,gBAAgB,EAClC,oBAAoB,EAAE,uBAAuB,EAC7C,UAAU,EAAE,gBAAgB,EAC5B,UAAU,EAAE,UAAU,EACtB,IAAI,EAAC,SAAS,EACd,OAAO,EAAE,CAAC,iBAAiB,CAAC,GAC5B,CACD,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -1,12 +0,0 @@
1
- import { UniqueIdentifier } from '@dnd-kit/core';
2
- import React from 'react';
3
- import { ExamComponentProps } from '../..';
4
- export declare const DNDAnswer: ({ renderChildNodes, items, answerOptionsByQuestionId, questionId, displayNumber, maxScore }: {
5
- renderChildNodes: ExamComponentProps["renderChildNodes"];
6
- items: UniqueIdentifier[];
7
- answerOptionsByQuestionId: Record<UniqueIdentifier, Element>;
8
- questionId: UniqueIdentifier;
9
- displayNumber: string;
10
- maxScore?: number;
11
- }) => React.JSX.Element;
12
- //# sourceMappingURL=DNDAnswer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/results/DNDAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAuB,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAK/D,eAAO,MAAM,SAAS,gGAOnB;IACD,gBAAgB,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IACxD,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;IAC5D,UAAU,EAAE,gBAAgB,CAAA;IAC5B,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,sBAgCA,CAAA"}
@@ -1,21 +0,0 @@
1
- import React, { useContext } from 'react';
2
- import { findMultiChoiceFromGradingStructure, ResultsContext } from '../context/ResultsContext';
3
- import { DNDAnswerCommon } from '../shared/DNDAnswerCommon';
4
- import ResultsExamQuestionAutoScore from './internal/QuestionAutoScore';
5
- export const DNDAnswer = ({ renderChildNodes, items, answerOptionsByQuestionId, questionId, displayNumber, maxScore }) => {
6
- var _a, _b, _c;
7
- const questionIdNumber = Number(questionId);
8
- const { answersByQuestionId, gradingStructure } = useContext(ResultsContext);
9
- const answer = answersByQuestionId[questionIdNumber];
10
- const choice = findMultiChoiceFromGradingStructure(gradingStructure, questionIdNumber);
11
- const scoreValue = (answer === null || answer === void 0 ? void 0 : answer.value)
12
- ? undefined
13
- : ((_b = (_a = choice === null || choice === void 0 ? void 0 : choice.options.find(option => option.id === Number(answer.value) && option.correct)) === null || _a === void 0 ? void 0 : _a.score) !== null && _b !== void 0 ? _b : 0);
14
- const thisQuestion = gradingStructure.questions.find(q => q.displayNumber === displayNumber);
15
- const options = ((_c = thisQuestion.choices.find(c => c.id === questionIdNumber)) === null || _c === void 0 ? void 0 : _c.options) || [];
16
- const correctOptionIds = options.filter(o => o.correct).map(o => o.id);
17
- return (React.createElement(React.Fragment, null,
18
- React.createElement(DNDAnswerCommon, { renderChildNodes: renderChildNodes, items: items, answerOptionsByQuestionId: answerOptionsByQuestionId, correctIds: correctOptionIds, questionId: questionId }),
19
- React.createElement(ResultsExamQuestionAutoScore, { score: scoreValue, maxScore: maxScore, displayNumber: displayNumber, questionId: questionIdNumber })));
20
- };
21
- //# sourceMappingURL=DNDAnswer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswer.js","sourceRoot":"","sources":["../../../src/components/results/DNDAnswer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,mCAAmC,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,4BAA4B,MAAM,8BAA8B,CAAA;AAEvE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EACxB,gBAAgB,EAChB,KAAK,EACL,yBAAyB,EACzB,UAAU,EACV,aAAa,EACb,QAAQ,EAQT,EAAE,EAAE;;IACH,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAAA;IAE3C,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAC5E,MAAM,MAAM,GAAG,mBAAmB,CAAC,gBAAg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CAAC,CAAA"}
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { ExamComponentProps } from '../..';
3
- export declare const DNDAnswerContainer: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
4
- //# sourceMappingURL=DNDAnswerContainer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DNDAnswerContainer.d.ts","sourceRoot":"","sources":["../../../src/components/results/DNDAnswerContainer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAO1C,eAAO,MAAM,kBAAkB,kCAAmC,kBAAkB,sBA8DnF,CAAA"}
@@ -1,35 +0,0 @@
1
- import React, { useContext } from 'react';
2
- import { query, queryAll } from '../../dom-utils';
3
- import { ResultsContext } from '../context/ResultsContext';
4
- import { DNDTitleAndDroppable } from '../shared/DNDTitleAndDroppable';
5
- import { CorrectDNDAnswers } from './CorrectDNDAnswers';
6
- export const DNDAnswerContainer = ({ element, renderChildNodes }) => {
7
- 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
- }, {});
24
- const dndAnswersWithQuestion = queryAll(element, 'dnd-answer').filter(e => !!query(e, 'dnd-answer-title'));
25
- return (React.createElement("div", { className: "e-dnd-answer-container" }, dndAnswersWithQuestion.map(element => {
26
- var _a;
27
- 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
- const itemIds = answerOptionIdsByQuestionId[questionId] || [];
30
- return (React.createElement(React.Fragment, { key: questionId },
31
- 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 }))));
33
- })));
34
- };
35
- //# sourceMappingURL=DNDAnswerContainer.js.map
@@ -1 +0,0 @@
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,qBAAqB,CAAA;AAGvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB,EAAE,EAAE;IACtF,MAAM,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IAC5E,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,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