@digabi/exam-engine-core 23.2.0-alpha.0 → 23.2.1-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js +10 -6
  2. package/dist/__tests__/playwright/exam/DNDAnswerContainer.test.js.map +1 -1
  3. package/dist/__tests__/playwright/stories/exam/DNDAnswerContainer.story.d.ts.map +1 -1
  4. package/dist/__tests__/playwright/stories/exam/DNDAnswerContainer.story.js +0 -1
  5. package/dist/__tests__/playwright/stories/exam/DNDAnswerContainer.story.js.map +1 -1
  6. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  7. package/dist/components/context/ResultsContext.d.ts.map +1 -1
  8. package/dist/components/context/ResultsContext.js +3 -1
  9. package/dist/components/context/ResultsContext.js.map +1 -1
  10. package/dist/components/exam/AllDNDOptions.d.ts.map +1 -1
  11. package/dist/components/exam/AllDNDOptions.js +2 -2
  12. package/dist/components/exam/AllDNDOptions.js.map +1 -1
  13. package/dist/components/exam/DNDAnswer.d.ts.map +1 -1
  14. package/dist/components/exam/DNDAnswer.js +1 -1
  15. package/dist/components/exam/DNDAnswer.js.map +1 -1
  16. package/dist/components/exam/DNDAnswerContainer.d.ts +3 -1
  17. package/dist/components/exam/DNDAnswerContainer.d.ts.map +1 -1
  18. package/dist/components/exam/DNDAnswerContainer.js +46 -44
  19. package/dist/components/exam/DNDAnswerContainer.js.map +1 -1
  20. package/dist/components/exam/DNDAnswerOption.d.ts +1 -1
  21. package/dist/components/exam/DNDAnswerOption.d.ts.map +1 -1
  22. package/dist/components/exam/DNDAnswerOption.js +1 -1
  23. package/dist/components/exam/DNDAnswerOption.js.map +1 -1
  24. package/dist/components/exam/DNDAnswerTitleCommon.d.ts +4 -0
  25. package/dist/components/exam/DNDAnswerTitleCommon.d.ts.map +1 -0
  26. package/dist/components/exam/DNDAnswerTitleCommon.js +14 -0
  27. package/dist/components/exam/DNDAnswerTitleCommon.js.map +1 -0
  28. package/dist/components/exam/DragAndDrop.d.ts +3 -0
  29. package/dist/components/exam/DragAndDrop.d.ts.map +1 -0
  30. package/dist/components/exam/DragAndDrop.js +7 -0
  31. package/dist/components/exam/DragAndDrop.js.map +1 -0
  32. package/dist/components/exam/NativeDND.d.ts +3 -0
  33. package/dist/components/exam/NativeDND.d.ts.map +1 -0
  34. package/dist/components/exam/NativeDND.js +75 -0
  35. package/dist/components/exam/NativeDND.js.map +1 -0
  36. package/dist/components/exam/getter.d.ts +3 -0
  37. package/dist/components/exam/getter.d.ts.map +1 -0
  38. package/dist/components/exam/getter.js +86 -0
  39. package/dist/components/exam/getter.js.map +1 -0
  40. package/dist/components/grading/AnnotatableGradingAnswer.d.ts +4 -0
  41. package/dist/components/grading/AnnotatableGradingAnswer.d.ts.map +1 -0
  42. package/dist/components/grading/AnnotatableGradingAnswer.js +24 -0
  43. package/dist/components/grading/AnnotatableGradingAnswer.js.map +1 -0
  44. package/dist/components/results/AudioContainer.d.ts +4 -0
  45. package/dist/components/results/AudioContainer.d.ts.map +1 -0
  46. package/dist/components/results/AudioContainer.js +26 -0
  47. package/dist/components/results/AudioContainer.js.map +1 -0
  48. package/dist/components/results/CorrectDNDAnswer.d.ts +4 -0
  49. package/dist/components/results/CorrectDNDAnswer.d.ts.map +1 -0
  50. package/dist/components/results/CorrectDNDAnswer.js +22 -0
  51. package/dist/components/results/CorrectDNDAnswer.js.map +1 -0
  52. package/dist/components/results/CorrectDNDAnswers.d.ts.map +1 -1
  53. package/dist/components/results/CorrectDNDAnswers.js +6 -8
  54. package/dist/components/results/CorrectDNDAnswers.js.map +1 -1
  55. package/dist/components/results/DNDAnswer.d.ts.map +1 -1
  56. package/dist/components/results/DNDAnswer.js +11 -9
  57. package/dist/components/results/DNDAnswer.js.map +1 -1
  58. package/dist/components/results/DNDAnswerContainer.d.ts.map +1 -1
  59. package/dist/components/results/DNDAnswerContainer.js +5 -18
  60. package/dist/components/results/DNDAnswerContainer.js.map +1 -1
  61. package/dist/components/results/DNDAnswerOptionResults.d.ts +4 -0
  62. package/dist/components/results/DNDAnswerOptionResults.d.ts.map +1 -0
  63. package/dist/components/results/DNDAnswerOptionResults.js +4 -0
  64. package/dist/components/results/DNDAnswerOptionResults.js.map +1 -0
  65. package/dist/components/results/Results.js +2 -2
  66. package/dist/components/results/Results.js.map +1 -1
  67. package/dist/components/shared/AnnotationWrapper.d.ts +5 -0
  68. package/dist/components/shared/AnnotationWrapper.d.ts.map +1 -0
  69. package/dist/components/shared/AnnotationWrapper.js +24 -0
  70. package/dist/components/shared/AnnotationWrapper.js.map +1 -0
  71. package/dist/components/shared/DNDAnswerCommon.d.ts +1 -2
  72. package/dist/components/shared/DNDAnswerCommon.d.ts.map +1 -1
  73. package/dist/components/shared/DNDAnswerCommon.js +5 -2
  74. package/dist/components/shared/DNDAnswerCommon.js.map +1 -1
  75. package/dist/components/shared/DNDAnswerDroppable.d.ts +2 -3
  76. package/dist/components/shared/DNDAnswerDroppable.d.ts.map +1 -1
  77. package/dist/components/shared/DNDAnswerDroppable.js +7 -8
  78. package/dist/components/shared/DNDAnswerDroppable.js.map +1 -1
  79. package/dist/components/shared/DNDAnswerDroppableCommon.d.ts +13 -0
  80. package/dist/components/shared/DNDAnswerDroppableCommon.d.ts.map +1 -0
  81. package/dist/components/shared/DNDAnswerDroppableCommon.js +30 -0
  82. package/dist/components/shared/DNDAnswerDroppableCommon.js.map +1 -0
  83. package/dist/components/shared/DNDAnswerOption.d.ts +7 -0
  84. package/dist/components/shared/DNDAnswerOption.d.ts.map +1 -0
  85. package/dist/components/shared/DNDAnswerOption.js +14 -0
  86. package/dist/components/shared/DNDAnswerOption.js.map +1 -0
  87. package/dist/components/shared/DNDAnswerOptionCommon.d.ts +1 -1
  88. package/dist/components/shared/DNDAnswerOptionCommon.d.ts.map +1 -1
  89. package/dist/components/shared/DNDAnswerOptionCommon.js +1 -1
  90. package/dist/components/shared/DNDAnswerOptionCommon.js.map +1 -1
  91. package/dist/components/shared/DNDAnswerTitleCommon.d.ts +4 -0
  92. package/dist/components/shared/DNDAnswerTitleCommon.d.ts.map +1 -0
  93. package/dist/components/shared/DNDAnswerTitleCommon.js +14 -0
  94. package/dist/components/shared/DNDAnswerTitleCommon.js.map +1 -0
  95. package/dist/components/shared/DNDTitleAndAnswer.d.ts +12 -0
  96. package/dist/components/shared/DNDTitleAndAnswer.d.ts.map +1 -0
  97. package/dist/components/shared/DNDTitleAndAnswer.js +48 -0
  98. package/dist/components/shared/DNDTitleAndAnswer.js.map +1 -0
  99. package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts +3 -4
  100. package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts.map +1 -1
  101. package/dist/components/shared/DNDTitleAndAnswerCommon.js +30 -9
  102. package/dist/components/shared/DNDTitleAndAnswerCommon.js.map +1 -1
  103. package/dist/components/shared/DNDTitleAndDroppable.d.ts.map +1 -1
  104. package/dist/components/shared/DNDTitleAndDroppable.js +10 -25
  105. package/dist/components/shared/DNDTitleAndDroppable.js.map +1 -1
  106. package/dist/components/shared/Mark.d.ts +9 -0
  107. package/dist/components/shared/Mark.d.ts.map +1 -0
  108. package/dist/components/shared/Mark.js +14 -0
  109. package/dist/components/shared/Mark.js.map +1 -0
  110. package/dist/components/shared/internal/RestrictedAudioPlayerCommon.d.ts +12 -0
  111. package/dist/components/shared/internal/RestrictedAudioPlayerCommon.d.ts.map +1 -0
  112. package/dist/components/shared/internal/RestrictedAudioPlayerCommon.js +29 -0
  113. package/dist/components/shared/internal/RestrictedAudioPlayerCommon.js.map +1 -0
  114. package/dist/components/shared/internal/RestrictedAudioPlayerExam.d.ts +13 -0
  115. package/dist/components/shared/internal/RestrictedAudioPlayerExam.d.ts.map +1 -0
  116. package/dist/components/shared/internal/RestrictedAudioPlayerExam.js +33 -0
  117. package/dist/components/shared/internal/RestrictedAudioPlayerExam.js.map +1 -0
  118. package/dist/i18n/fi-FI.js +1 -1
  119. package/dist/i18n/fi-FI.js.map +1 -1
  120. package/dist/i18n/sv-FI.js +6 -6
  121. package/dist/i18n/sv-FI.js.map +1 -1
  122. package/dist/main-bundle.js +3 -3
  123. package/dist/main.css +1 -1
  124. package/dist/parser/parseExam.js +1 -1
  125. package/dist/parser/parseExam.js.map +1 -1
  126. package/package.json +3 -3
  127. package/dist/__tests__/playwright/DNDAnswerContainer.test.d.ts +0 -2
  128. package/dist/__tests__/playwright/DNDAnswerContainer.test.d.ts.map +0 -1
  129. package/dist/__tests__/playwright/DNDAnswerContainer.test.js +0 -77
  130. package/dist/__tests__/playwright/DNDAnswerContainer.test.js.map +0 -1
  131. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.d.ts +0 -10
  132. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.d.ts.map +0 -1
  133. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.js +0 -21
  134. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.js.map +0 -1
  135. package/dist/__tests__/playwright/utils/ComponentWrapper.d.ts +0 -9
  136. package/dist/__tests__/playwright/utils/ComponentWrapper.d.ts.map +0 -1
  137. package/dist/__tests__/playwright/utils/ComponentWrapper.js +0 -26
  138. package/dist/__tests__/playwright/utils/ComponentWrapper.js.map +0 -1
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../../createRenderChildNodes';
3
+ export declare const AudioContainer: React.FC<ExamComponentProps>;
4
+ //# sourceMappingURL=AudioContainer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioContainer.d.ts","sourceRoot":"","sources":["../../../src/components/results/AudioContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAQjE,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAUvD,CAAA"}
@@ -0,0 +1,26 @@
1
+ import React from 'react';
2
+ import { getNumericAttribute } from '../../dom-utils';
3
+ import { audioLabelId } from '../../ids';
4
+ import Audio from '../shared/Audio';
5
+ import { faPlay } from '@fortawesome/free-solid-svg-icons';
6
+ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
7
+ import { formatDuration } from '../shared/internal/RestrictedAudioPlayer';
8
+ export const AudioContainer = ({ element, renderChildNodes }) => {
9
+ const restricted = !!getNumericAttribute(element, 'times');
10
+ const duration = getNumericAttribute(element, 'duration');
11
+ const labelId = audioLabelId(element);
12
+ if (restricted) {
13
+ return React.createElement(AudioPlaceholder, { duration: duration, labelId: labelId });
14
+ }
15
+ else {
16
+ return React.createElement(Audio, { element: element, renderChildNodes: renderChildNodes });
17
+ }
18
+ };
19
+ const AudioPlaceholder = ({ duration, labelId }) => (React.createElement("div", { className: "audio e-columns e-columns--center-v e-mrg-b-2" },
20
+ React.createElement("div", { className: "e-pad-1 restricted-audio-player restricted-audio-player--disabled e-columns e-columns--center-v" },
21
+ React.createElement("button", { className: "restricted-audio-player__play e-column e-column--narrow", disabled: true, onClick: () => undefined },
22
+ React.createElement(FontAwesomeIcon, { icon: faPlay, fixedWidth: true })),
23
+ React.createElement("span", { className: "e-column e-text-right e-column" }, formatDuration(duration))),
24
+ React.createElement("span", { className: "e-pad-l-2", id: labelId },
25
+ React.createElement("em", null, "Ei kuunneltavissa"))));
26
+ //# sourceMappingURL=AudioContainer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioContainer.js","sourceRoot":"","sources":["../../../src/components/results/AudioContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,KAAK,MAAM,iBAAiB,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAA;AAEzE,MAAM,CAAC,MAAM,cAAc,GAAiC,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE;IAC5F,MAAM,UAAU,GAAG,CAAC,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC1D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,UAAU,CAAE,CAAA;IAC1D,MAAM,OAAO,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;IAErC,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,oBAAC,gBAAgB,IAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAI,CAAA;IACnE,CAAC;SAAM,CAAC;QACN,OAAO,oBAAC,KAAK,IAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,GAAI,CAAA;IACxE,CAAC;AACH,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAoD,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CACnG,6BAAK,SAAS,EAAC,+CAA+C;IAC5D,6BAAK,SAAS,EAAC,iGAAiG;QAC9G,gCACE,SAAS,EAAC,yDAAyD,EACnE,QAAQ,EAAE,IAAI,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS;YAExB,oBAAC,eAAe,IAAC,IAAI,EAAE,MAAM,EAAE,UAAU,SAAG,CACrC;QACT,8BAAM,SAAS,EAAC,gCAAgC,IAAE,cAAc,CAAC,QAAQ,CAAC,CAAQ,CAC9E;IAEN,8BAAM,SAAS,EAAC,WAAW,EAAC,EAAE,EAAE,OAAO;QACrC,oDAA0B,CACrB,CACH,CACP,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../..';
3
+ export declare const CorrectDNDAnswers: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
4
+ //# sourceMappingURL=CorrectDNDAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CorrectDNDAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/results/CorrectDNDAnswer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAuB,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAK/D,eAAO,MAAM,iBAAiB,kCAAmC,kBAAkB,sBA+BlF,CAAA"}
@@ -0,0 +1,22 @@
1
+ import React, { useContext } from 'react';
2
+ import { queryAll } from '../../dom-utils';
3
+ import { ResultsContext } from '../context/ResultsContext';
4
+ import { DNDAnswerCommon } from '../shared/DNDAnswerCommon';
5
+ export const CorrectDNDAnswers = ({ element, renderChildNodes }) => {
6
+ var _a;
7
+ const { gradingStructure } = useContext(ResultsContext);
8
+ const dndAnswerOptions = queryAll(element, 'dnd-answer-option');
9
+ const answerOptionsByOptionId = dndAnswerOptions.reduce((acc, el) => {
10
+ const optionId = el.getAttribute('option-id');
11
+ return { ...acc, [optionId]: el };
12
+ }, {});
13
+ const displayNumber = element.getAttribute('display-number');
14
+ const questionId = Number(element.getAttribute('question-id'));
15
+ const thisQuestion = gradingStructure === null || gradingStructure === void 0 ? void 0 : gradingStructure.questions.find(q => q.displayNumber === displayNumber);
16
+ 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) || [];
17
+ const correctOptionIds = options === null || options === void 0 ? void 0 : options.filter(o => o.correct).map(o => o.id);
18
+ return (React.createElement(React.Fragment, null,
19
+ React.createElement("span", { className: "droppable-title align-right" }, "Oikeat vastaukset"),
20
+ React.createElement(DNDAnswerCommon, { renderChildNodes: renderChildNodes, items: correctOptionIds, answerOptionsByQuestionId: answerOptionsByOptionId, correctIds: correctOptionIds, questionId: questionId, classes: { 'correct-answers': true } })));
21
+ };
22
+ //# sourceMappingURL=CorrectDNDAnswer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"C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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;IAEvE,OAAO,CACL;QACE,8BAAM,SAAS,EAAC,6BAA6B,wBAAyB;QACtE,oBAAC,eAAe,IACd,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,gBAAgB,EACvB,yBAAyB,EAAE,uBAAuB,EAClD,UAAU,EAAE,gBAAgB,EAC5B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,EAAE,iBAAiB,EAAE,IAAI,EAAE,GACpC,CACD,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -1 +1 @@
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
+ {"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,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAK1C,eAAO,MAAM,iBAAiB,qDAI3B,kBAAkB,GAAG;IACtB,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;CACrD,sBAsBA,CAAA"}
@@ -1,17 +1,15 @@
1
1
  import React, { useContext } from 'react';
2
- import { ResultsContext } from '../context/ResultsContext';
3
- import { DNDDroppable } from '../shared/DNDDroppable';
4
2
  import { useExamTranslation } from '../../i18n';
3
+ import { findMultiChoiceFromGradingStructure, ResultsContext } from '../context/ResultsContext';
4
+ import { DNDDroppable } from '../shared/DNDDroppable';
5
5
  export const CorrectDNDAnswers = ({ element, renderChildNodes, answerOptionsById }) => {
6
6
  var _a;
7
- const { gradingStructure } = useContext(ResultsContext);
8
- const displayNumber = element.getAttribute('display-number');
9
7
  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
8
  const { t } = useExamTranslation();
9
+ const { gradingStructure } = useContext(ResultsContext);
10
+ const choice = findMultiChoiceFromGradingStructure(gradingStructure, questionId);
11
+ 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);
12
+ const correctDNDAnswerOptions = correctOptionIds === null || correctOptionIds === void 0 ? void 0 : correctOptionIds.map(id => (answerOptionsById === null || answerOptionsById === void 0 ? void 0 : answerOptionsById[id]) || null).filter(Boolean);
15
13
  return (React.createElement(React.Fragment, null,
16
14
  React.createElement("span", { className: "droppable-title align-right" }, t('dnd-answers.correct-answers')),
17
15
  React.createElement(DNDDroppable, { renderChildNodes: renderChildNodes, answerOptionElements: correctDNDAnswerOptions, correctIds: correctOptionIds, questionId: questionId, page: "results", classes: ['correct-answers'] })));
@@ -1 +1 @@
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,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AgB,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
+ {"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,sBAiCA,CAAA"}
@@ -1,21 +1,23 @@
1
1
  import React, { useContext } from 'react';
2
2
  import { findMultiChoiceFromGradingStructure, ResultsContext } from '../context/ResultsContext';
3
- import { DNDAnswerCommon } from '../shared/DNDAnswerCommon';
3
+ import { DNDAnswerDroppableCommon } from '../shared/DNDAnswerDroppableCommon';
4
4
  import ResultsExamQuestionAutoScore from './internal/QuestionAutoScore';
5
5
  export const DNDAnswer = ({ renderChildNodes, items, answerOptionsByQuestionId, questionId, displayNumber, maxScore }) => {
6
- var _a, _b, _c;
6
+ var _a, _b, _c, _d;
7
7
  const questionIdNumber = Number(questionId);
8
8
  const { answersByQuestionId, gradingStructure } = useContext(ResultsContext);
9
- const answer = answersByQuestionId[questionIdNumber];
9
+ console.log(gradingStructure);
10
+ const hasAnswer = !!answersByQuestionId && ((_a = answersByQuestionId[questionIdNumber]) === null || _a === void 0 ? void 0 : _a.value);
11
+ const answer = hasAnswer ? answersByQuestionId[questionIdNumber] : undefined;
10
12
  const choice = findMultiChoiceFromGradingStructure(gradingStructure, questionIdNumber);
11
- const scoreValue = (answer === null || answer === void 0 ? void 0 : answer.value)
13
+ const scoreValue = !(answer === null || answer === void 0 ? void 0 : answer.value)
12
14
  ? 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);
15
+ : ((_c = (_b = choice === null || choice === void 0 ? void 0 : choice.options.find(option => option.id === Number(answer.value) && option.correct)) === null || _b === void 0 ? void 0 : _b.score) !== null && _c !== void 0 ? _c : 0);
16
+ const thisQuestion = gradingStructure === null || gradingStructure === void 0 ? void 0 : gradingStructure.questions.find(q => q.displayNumber === displayNumber);
17
+ const options = ((_d = thisQuestion === null || thisQuestion === void 0 ? void 0 : thisQuestion.choices.find(c => c.id === questionIdNumber)) === null || _d === void 0 ? void 0 : _d.options) || [];
18
+ const correctOptionIds = options === null || options === void 0 ? void 0 : options.filter(o => o.correct).map(o => o.id);
17
19
  return (React.createElement(React.Fragment, null,
18
- React.createElement(DNDAnswerCommon, { renderChildNodes: renderChildNodes, items: items, answerOptionsByQuestionId: answerOptionsByQuestionId, correctIds: correctOptionIds, questionId: questionId }),
20
+ React.createElement(DNDAnswerDroppableCommon, { renderChildNodes: renderChildNodes, items: items, answerOptionsByQuestionId: answerOptionsByQuestionId, questionId: questionId, correctIds: correctOptionIds }),
19
21
  React.createElement(ResultsExamQuestionAutoScore, { score: scoreValue, maxScore: maxScore, displayNumber: displayNumber, questionId: questionIdNumber })));
20
22
  };
21
23
  //# sourceMappingURL=DNDAnswer.js.map
@@ -1 +1 @@
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,gBAAgB,CAAC,CAAA;IACpD,MAAM,MAAM,GAAG,mCAAmC,CAAC,gBAAgB,EAAE,gBAAgB,CAAE,CAAA;IACvF,MAAM,UAAU,GAAG,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK;QAC9B,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,CAAC,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,0CAAE,KAAK,mCAAI,CAAC,CAAC,CAAA;IAEtG,MAAM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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;IAEvE,OAAO,CACL;QACE,oBAAC,wBAAwB,IACvB,gBAAgB,EAAE,gBAAgB,EAClC,KAAK,EAAE,KAAK,EACZ,yBAAyB,EAAE,yBAAyB,EACpD,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,gBAAgB,GAC5B;QAEF,oBAAC,4BAA4B,IAC3B,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,QAAQ,EAClB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,gBAAgB,GAC5B,CACD,CACJ,CAAA;AACH,CAAC,CAAA"}
@@ -1 +1 @@
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
+ {"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,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,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAA;IAC9F,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAA;IAE/D,MAAM,2BAA2B,GAAe,UAAU,CAAC,MAAM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Aa,CAAE,CAAA;QAEvD,MAAM,oBAAoB,GAAG,MAAA,CAAC,2BAA2B,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,0CACxE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,EAAE,CAAC,KAAI,IAAI,EAC1C,MAAM,CAAC,OAAO,CAAC,CAAA;QAClB,MAAM,OAAO,GAAG,2BAA2B,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;QAE7D,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,iBAAiB,GACpC,CACH,CACc,CAClB,CAAA;IACH,CAAC,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
1
+ {"version":3,"file":"DNDAnswerContainer.js","sourceRoot":"","sources":["../../../src/components/results/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,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,8BAA8B,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AACvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAA;AACrE,OAAO,EAAE,iBAAiB,E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AgB,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"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../..';
3
+ export declare const DNDAnswerOption: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
4
+ //# sourceMappingURL=DNDAnswerOptionResults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DNDAnswerOptionResults.d.ts","sourceRoot":"","sources":["../../../src/components/results/DNDAnswerOptionResults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAG1C,eAAO,MAAM,eAAe,kCAAmC,kBAAkB,sBAEhF,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { DNDAnswerOptionCommon } from '../shared/DNDAnswerOptionCommon';
3
+ export const DNDAnswerOption = ({ element, renderChildNodes }) => (React.createElement(DNDAnswerOptionCommon, { element: element, renderChildNodes: renderChildNodes }));
4
+ //# sourceMappingURL=DNDAnswerOptionResults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DNDAnswerOptionResults.js","sourceRoot":"","sources":["../../../src/components/results/DNDAnswerOptionResults.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAA;AAEvE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB,EAAE,EAAE,CAAC,CACpF,oBAAC,qBAAqB,IAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,GAAI,CAChF,CAAA"}
@@ -33,13 +33,13 @@ import classNames from 'classnames';
33
33
  import { EndExamSession } from './EndExamSession';
34
34
  import { Footer } from '../shared/Footer';
35
35
  import { DNDAnswerContainer } from './DNDAnswerContainer';
36
- import { AudioPlaceholder } from './AudioPlaceholder';
36
+ import { AudioContainer } from './AudioContainer';
37
37
  const renderChildNodes = createRenderChildNodes({
38
38
  attachment: RenderChildNodes,
39
39
  'attachment-link': mkAttachmentLink('plain'),
40
40
  'attachment-links': mkAttachmentLinks('plain'),
41
41
  'audio-group': RenderChildNodes,
42
- audio: AudioPlaceholder,
42
+ audio: renderIf(({ element }) => queryAncestors(element, 'dnd-answer-container') != null)(AudioContainer),
43
43
  'choice-answer': ResultsChoiceAnswer,
44
44
  'dnd-answer-container': DNDAnswerContainer,
45
45
  'dropdown-answer': DropdownAnswer,
@@ -1 +1 @@
1
- {"version":3,"file":"Results.js","sourceRoot":"","sources":["../../../src/components/results/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,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,gBAAgB,MAAM,0BAA0B,CAAA;AACvD,OAAO,iBAAiB,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACvF,OAAO,aAAa,MAAM,kBAAkB,CAAA;AAE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9D,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,5 @@
1
+ import React from 'react';
2
+ export declare const AnnotationWrapper: React.FunctionComponent<{
3
+ children: React.ReactNode;
4
+ }>;
5
+ //# sourceMappingURL=AnnotationWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationWrapper.d.ts","sourceRoot":"","sources":["../../../src/components/shared/AnnotationWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAMzC,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAyBpF,CAAA"}
@@ -0,0 +1,24 @@
1
+ import React, { useContext } from 'react';
2
+ import { AnnotationContext } from '../context/AnnotationProvider';
3
+ import { onMouseDownForAnnotation } from '../grading/examAnnotationUtils';
4
+ import { AnnotationPopup } from './AnnotationPopup';
5
+ export const AnnotationWrapper = ({ children }) => {
6
+ const { setNewAnnotation } = useContext(AnnotationContext);
7
+ const mouseUpCallback = (annotation) => {
8
+ console.log('UP');
9
+ setNewAnnotation(annotation);
10
+ };
11
+ function onMouseDown(e) {
12
+ console.log('DOWN');
13
+ const target = e.target;
14
+ const clickIsInPopup = target.closest('.annotation-popup');
15
+ if (!clickIsInPopup) {
16
+ setNewAnnotation(null);
17
+ }
18
+ onMouseDownForAnnotation(e, mouseUpCallback);
19
+ }
20
+ return (React.createElement("span", { onMouseDown: onMouseDown },
21
+ React.createElement(AnnotationPopup, null),
22
+ children));
23
+ };
24
+ //# sourceMappingURL=AnnotationWrapper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotationWrapper.js","sourceRoot":"","sources":["../../../src/components/shared/AnnotationWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,CAAC,MAAM,iBAAiB,GAA2D,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IACxG,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAE1D,MAAM,eAAe,GAAG,CAAC,UAA6B,EAAE,EAAE;QACxD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACjB,gBAAgB,CAAC,UAAU,CAAC,CAAA;IAC9B,CAAC,CAAA;IAED,SAAS,WAAW,CAAC,CAAmB;QACtC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACnB,MAAM,MAAM,GAAG,CAAC,CAAC,MAAiB,CAAA;QAClC,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAA;QAC1D,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,gBAAgB,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC;QAED,wBAAwB,CAAC,CAAC,EAAE,eAAe,CAAC,CAAA;IAC9C,CAAC;IAED,OAAO,CACL,8BAAM,WAAW,EAAE,WAAW;QAC5B,oBAAC,eAAe,OAAG;QAClB,QAAQ,CACJ,CACR,CAAA;AACH,CAAC,CAAA"}
@@ -1,11 +1,10 @@
1
1
  import { UniqueIdentifier } from '@dnd-kit/core';
2
2
  import React from 'react';
3
3
  import { ExamComponentProps } from '../..';
4
- export declare const DNDAnswerCommon: ({ renderChildNodes, items, answerOptionsByQuestionId, isInExam, correctIds, classes, questionId }: {
4
+ export declare const DNDAnswerDroppableCommon: ({ renderChildNodes, items, answerOptionsByQuestionId, correctIds, classes, questionId }: {
5
5
  items: UniqueIdentifier[];
6
6
  answerOptionsByQuestionId: Record<UniqueIdentifier, Element>;
7
7
  renderChildNodes: ExamComponentProps["renderChildNodes"];
8
- isInExam?: boolean;
9
8
  correctIds?: UniqueIdentifier[];
10
9
  classes?: Record<string, boolean>;
11
10
  questionId: UniqueIdentifier;
@@ -1 +1 @@
1
- {"version":3,"file":"DNDAnswerCommon.d.ts","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerCommon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAK1C,eAAO,MAAM,eAAe,sGAQzB;IACD,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;IAC5D,gBAAgB,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,UAAU,EAAE,gBAAgB,CAAA;CAC7B,sBA8CA,CAAA"}
1
+ {"version":3,"file":"DNDAnswerCommon.d.ts","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerCommon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAqB,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAM1C,eAAO,MAAM,wBAAwB,4FAOlC;IACD,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;IAC5D,gBAAgB,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IACxD,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,UAAU,EAAE,gBAAgB,CAAA;CAC7B,sBAkDA,CAAA"}
@@ -1,15 +1,18 @@
1
1
  import { useDroppable } from '@dnd-kit/core';
2
2
  import classNames from 'classnames';
3
- import React from 'react';
3
+ import React, { useContext } from 'react';
4
4
  import { query } from '../../dom-utils';
5
5
  import { DNDAnswerOption as DNDAnswerOptionExam } from '../exam/DNDAnswerOption';
6
6
  import { DNDAnswerOptionCommon } from './DNDAnswerOptionCommon';
7
- export const DNDAnswerCommon = ({ renderChildNodes, items, answerOptionsByQuestionId, isInExam, correctIds, classes, questionId }) => {
7
+ import { ResultsContext } from '../context/ResultsContext';
8
+ export const DNDAnswerDroppableCommon = ({ renderChildNodes, items, answerOptionsByQuestionId, correctIds, classes, questionId }) => {
8
9
  const dndAnswerOptions = (items === null || items === void 0 ? void 0 : items.map(id => answerOptionsByQuestionId[id])) || [];
9
10
  const hasImages = dndAnswerOptions.some(option => query(option, 'image'));
10
11
  const hasAudio = dndAnswerOptions.some(option => query(option, 'audio'));
11
12
  const hasFormula = dndAnswerOptions.some(option => query(option, 'formula'));
12
13
  const { active, isOver } = useDroppable({ id: questionId });
14
+ const { gradingStructure } = useContext(ResultsContext);
15
+ const isInExam = !gradingStructure;
13
16
  return (React.createElement("div", { className: classNames('e-dnd-answer-droppable', {
14
17
  'has-images': hasImages,
15
18
  'has-audio': hasAudio,
@@ -1 +1 @@
1
- {"version":3,"file":"DNDAnswerCommon.js","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerCommon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AAE/D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,gBAAgB,EAChB,KAAK,EACL,yBAAyB,EACzB,QAAQ,EACR,UAAU,EACV,OAAO,EACP,UAAU,EASX,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,yBAAyB,CAAC,EAAE,CAAC,CAAC,KAAI,EAAE,CAAA;IAC9E,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACzE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACxE,MAAM,UAAU,GAAG,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qBAAqB;gBAClC,oBAAC,qBAAqB,IACpB,OAAO,EAAE,OAAO,EAChB,gBAAgB,EAAE,gBAAgB,EAClC,GAAG,EAAE,QAAQ,EACb,OAAO,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,cAAc,CAAC,GACxD,CACE,CACP,CACG,CACP,CAAA;QACH,CAAC,CAAC;QAED,CAAC,gBAAgB,CAAC,MAAM;YACvB,CAAC,MAAM,CAAC,CAAC,CAAC,CACR,2BAAG,SAAS,EAAC,qBAAqB,wBAAiB,CACpD,CAAC,CAAC,CAAC,CACF,2BAAG,SAAS,EAAC,qBAAqB,qBAAmB,CACtD,CAAC,CACA,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -1,13 +1,12 @@
1
1
  import { UniqueIdentifier } from '@dnd-kit/core';
2
2
  import React from 'react';
3
3
  import { ExamComponentProps } from '../..';
4
- export declare const DNDAnswerDroppable: ({ renderChildNodes, items, answerOptionsByQuestionId, correctIds, classes, questionId, page }: {
5
- items: UniqueIdentifier[];
6
- answerOptionsByQuestionId: Record<UniqueIdentifier, Element>;
4
+ export declare const DNDDroppable: ({ renderChildNodes, correctIds, classes, questionId, page, answerOptionElements }: {
7
5
  renderChildNodes: ExamComponentProps["renderChildNodes"];
8
6
  correctIds?: UniqueIdentifier[];
9
7
  classes?: Record<string, boolean>;
10
8
  questionId: UniqueIdentifier;
11
9
  page: "exam" | "results";
10
+ answerOptionElements: Element[];
12
11
  }) => React.JSX.Element;
13
12
  //# sourceMappingURL=DNDAnswerDroppable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DNDAnswerDroppable.d.ts","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerDroppable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAK1C,eAAO,MAAM,kBAAkB,kGAQ5B;IACD,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;IAC5D,gBAAgB,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IACxD,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,UAAU,EAAE,gBAAgB,CAAA;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CACzB,sBAgDA,CAAA"}
1
+ {"version":3,"file":"DNDAnswerDroppable.d.ts","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerDroppable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAK1C,eAAO,MAAM,YAAY,sFAOtB;IACD,gBAAgB,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IACxD,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,UAAU,EAAE,gBAAgB,CAAA;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,oBAAoB,EAAE,OAAO,EAAE,CAAA;CAChC,sBA+CA,CAAA"}
@@ -4,11 +4,10 @@ import React from 'react';
4
4
  import { query } from '../../dom-utils';
5
5
  import { DNDAnswerOptionDraggable } from '../exam/DNDAnswerOptionDraggable';
6
6
  import { DNDAnswerOption } from '../results/DNDAnswerOption';
7
- export const DNDAnswerDroppable = ({ renderChildNodes, items, answerOptionsByQuestionId, correctIds, classes, questionId, page }) => {
8
- const dndAnswerOptions = items === null || items === void 0 ? void 0 : items.map(id => (answerOptionsByQuestionId === null || answerOptionsByQuestionId === void 0 ? void 0 : answerOptionsByQuestionId[id]) || null).filter(Boolean);
9
- const hasImages = dndAnswerOptions.some(option => query(option, 'image'));
10
- const hasAudio = dndAnswerOptions.some(option => query(option, 'audio'));
11
- const hasFormula = dndAnswerOptions.some(option => query(option, 'formula'));
7
+ export const DNDDroppable = ({ renderChildNodes, correctIds, classes, questionId, page, answerOptionElements }) => {
8
+ const hasImages = answerOptionElements.some(option => query(option, 'image'));
9
+ const hasAudio = answerOptionElements.some(option => query(option, 'audio'));
10
+ const hasFormula = answerOptionElements.some(option => query(option, 'formula'));
12
11
  const { active, isOver } = useDroppable({ id: questionId });
13
12
  return (React.createElement("div", { className: classNames('e-dnd-answer-droppable', {
14
13
  'has-images': hasImages,
@@ -16,15 +15,15 @@ export const DNDAnswerDroppable = ({ renderChildNodes, items, answerOptionsByQue
16
15
  'has-formula': hasFormula,
17
16
  hovered: isOver,
18
17
  ...classes
19
- }) }, dndAnswerOptions === null || dndAnswerOptions === void 0 ? void 0 :
20
- dndAnswerOptions.map(element => {
18
+ }) }, answerOptionElements === null || answerOptionElements === void 0 ? void 0 :
19
+ answerOptionElements.map(element => {
21
20
  const optionId = Number(element.getAttribute('option-id'));
22
21
  const hasImage = query(element, 'image');
23
22
  const isCorrect = correctIds === null || correctIds === void 0 ? void 0 : correctIds.includes(optionId);
24
23
  return (React.createElement("div", { className: classNames({ 'has-image': hasImage }), key: element.getAttribute('option-id') }, page === 'exam' ? (React.createElement(DNDAnswerOptionDraggable, { element: element, renderChildNodes: renderChildNodes, key: optionId })) : (React.createElement("div", { className: "e-dnd-answer-option" },
25
24
  React.createElement(DNDAnswerOption, { element: element, renderChildNodes: renderChildNodes, key: optionId, className: !correctIds ? undefined : isCorrect ? 'correct-answer' : 'wrong-answer' })))));
26
25
  }),
27
- !dndAnswerOptions.length &&
26
+ !answerOptionElements.length &&
28
27
  (active ? (React.createElement("i", { className: "droppable-drop-here" }, "Pudota t\u00E4nne")) : (React.createElement("i", { className: "droppable-no-answer" }, "(Ei vastausta)")))));
29
28
  };
30
29
  //# sourceMappingURL=DNDAnswerDroppable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DNDAnswerDroppable.js","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerDroppable.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EACjC,gBAAgB,EAChB,KAAK,EACL,yBAAyB,EACzB,UAAU,EACV,OAAO,EACP,UAAU,EACV,IAAI,EASL,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAG,EAAE,CAAC,KAAI,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAClG,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACzE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACxE,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;IAE5E,MA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,CAAC,CACF,2BAAG,SAAS,EAAC,qBAAqB,qBAAmB,CACtD,CAAC,CACA,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { UniqueIdentifier } from '@dnd-kit/core';
2
+ import React from 'react';
3
+ import { ExamComponentProps } from '../..';
4
+ export declare const DNDAnswerDroppableCommon: ({ renderChildNodes, items, answerOptionsByQuestionId, correctIds, classes, questionId, page }: {
5
+ items: UniqueIdentifier[];
6
+ answerOptionsByQuestionId: Record<UniqueIdentifier, Element>;
7
+ renderChildNodes: ExamComponentProps["renderChildNodes"];
8
+ correctIds?: UniqueIdentifier[];
9
+ classes?: Record<string, boolean>;
10
+ questionId: UniqueIdentifier;
11
+ page: "exam" | "results";
12
+ }) => React.JSX.Element;
13
+ //# sourceMappingURL=DNDAnswerDroppableCommon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DNDAnswerDroppableCommon.d.ts","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerDroppableCommon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAgB,MAAM,eAAe,CAAA;AAE9D,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAK1C,eAAO,MAAM,wBAAwB,kGAQlC;IACD,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAA;IAC5D,gBAAgB,EAAE,kBAAkB,CAAC,kBAAkB,CAAC,CAAA;IACxD,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,UAAU,EAAE,gBAAgB,CAAA;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CACzB,sBAgDA,CAAA"}
@@ -0,0 +1,30 @@
1
+ import { useDroppable } from '@dnd-kit/core';
2
+ import classNames from 'classnames';
3
+ import React from 'react';
4
+ import { query } from '../../dom-utils';
5
+ import { DNDAnswerOptionDraggable } from '../exam/DNDAnswerOptionDraggable';
6
+ import { DNDAnswerOption } from '../results/DNDAnswerOption';
7
+ export const DNDAnswerDroppableCommon = ({ renderChildNodes, items, answerOptionsByQuestionId, correctIds, classes, questionId, page }) => {
8
+ const dndAnswerOptions = items === null || items === void 0 ? void 0 : items.map(id => (answerOptionsByQuestionId === null || answerOptionsByQuestionId === void 0 ? void 0 : answerOptionsByQuestionId[id]) || null).filter(Boolean);
9
+ const hasImages = dndAnswerOptions.some(option => query(option, 'image'));
10
+ const hasAudio = dndAnswerOptions.some(option => query(option, 'audio'));
11
+ const hasFormula = dndAnswerOptions.some(option => query(option, 'formula'));
12
+ const { active, isOver } = useDroppable({ id: questionId });
13
+ return (React.createElement("div", { className: classNames('e-dnd-answer-droppable', {
14
+ 'has-images': hasImages,
15
+ 'has-audio': hasAudio,
16
+ 'has-formula': hasFormula,
17
+ hovered: isOver,
18
+ ...classes
19
+ }) }, dndAnswerOptions === null || dndAnswerOptions === void 0 ? void 0 :
20
+ dndAnswerOptions.map(element => {
21
+ const optionId = Number(element.getAttribute('option-id'));
22
+ const hasImage = query(element, 'image');
23
+ const isCorrect = correctIds === null || correctIds === void 0 ? void 0 : correctIds.includes(optionId);
24
+ return (React.createElement("div", { className: classNames({ 'has-image': hasImage }), key: element.getAttribute('option-id') }, page === 'exam' ? (React.createElement(DNDAnswerOptionDraggable, { element: element, renderChildNodes: renderChildNodes, key: optionId })) : (React.createElement("div", { className: "e-dnd-answer-option" },
25
+ React.createElement(DNDAnswerOption, { element: element, renderChildNodes: renderChildNodes, key: optionId, classes: [isCorrect ? 'correct-answer' : 'wrong-answer'] })))));
26
+ }),
27
+ !dndAnswerOptions.length &&
28
+ (active ? (React.createElement("i", { className: "droppable-drop-here" }, "Pudota t\u00E4nne")) : (React.createElement("i", { className: "droppable-no-answer" }, "(Ei vastausta)")))));
29
+ };
30
+ //# sourceMappingURL=DNDAnswerDroppableCommon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DNDAnswerDroppableCommon.js","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerDroppableCommon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,eAAe,CAAA;AAC9D,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAA;AAC3E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE5D,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,EACvC,gBAAgB,EAChB,KAAK,EACL,yBAAyB,EACzB,UAAU,EACV,OAAO,EACP,UAAU,EACV,IAAI,EASL,EAAE,EAAE;IACH,MAAM,gBAAgB,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAA,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAG,EAAE,CAAC,KAAI,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;IAClG,MAAM,SAAS,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACzE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;IACxE,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;IAE5E,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY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AC,qBAAqB,wBAAiB,CACpD,CAAC,CAAC,CAAC,CACF,2BAAG,SAAS,EAAC,qBAAqB,qBAAmB,CACtD,CAAC,CACA,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../..';
3
+ export declare const DNDAnswerOption: ({ element, renderChildNodes, style, classes }: ExamComponentProps & {
4
+ style?: React.CSSProperties;
5
+ classes?: string[];
6
+ }) => React.JSX.Element;
7
+ //# sourceMappingURL=DNDAnswerOption.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DNDAnswerOption.d.ts","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerOption.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAG1C,eAAO,MAAM,eAAe,kDAKzB,kBAAkB,GAAG;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;CACnB,sBAmBA,CAAA"}
@@ -0,0 +1,14 @@
1
+ import classNames from 'classnames';
2
+ import React from 'react';
3
+ import { query } from '../../dom-utils';
4
+ export const DNDAnswerOption = ({ element, renderChildNodes, style, classes = [] }) => {
5
+ const hasImages = !!query(element, 'image');
6
+ const hasFormula = !!query(element, 'formula');
7
+ const hasTitle = renderChildNodes(element).length > 0;
8
+ return (React.createElement("div", { className: classNames([...classes], {
9
+ 'has-images': hasImages,
10
+ 'has-formula': hasFormula
11
+ }), style: style },
12
+ React.createElement("div", { className: "option-content" }, !hasTitle ? React.createElement("i", { style: { color: 'grey' } }, "T\u00E4h\u00E4n tulee vastaus...") : renderChildNodes(element))));
13
+ };
14
+ //# sourceMappingURL=DNDAnswerOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DNDAnswerOption.js","sourceRoot":"","sources":["../../../src/components/shared/DNDAnswerOption.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,OAAO,EACP,gBAAgB,EAChB,KAAK,EACL,OAAO,GAAG,EAAE,EAIb,EAAE,EAAE;IACH,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC3C,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;IAE9C,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;IAErD,OAAO,CACL,6BACE,SAAS,EAAE,UAAU,CAAC,CAAC,GAAG,OAAO,CAAC,EAAE;YAClC,YAAY,EAAE,SAAS;YACvB,aAAa,EAAE,UAAU;SAC1B,CAAC,EACF,KAAK,EAAE,KAAK;QAEZ,6BAAK,SAAS,EAAC,gBAAgB,IAC5B,CAAC,QAAQ,CAAC,CAAC,CAAC,2BAAG,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,uCAA4B,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAC5F,CACF,CACP,CAAA;AACH,CAAC,CAAA"}