@digabi/exam-engine-core 23.2.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 (107) hide show
  1. package/dist/__tests__/tsconfig.tsbuildinfo +1 -1
  2. package/dist/components/exam/AllDNDOptions.d.ts.map +1 -1
  3. package/dist/components/exam/AllDNDOptions.js +2 -2
  4. package/dist/components/exam/AllDNDOptions.js.map +1 -1
  5. package/dist/components/exam/DNDAnswer.d.ts.map +1 -1
  6. package/dist/components/exam/DNDAnswer.js +1 -1
  7. package/dist/components/exam/DNDAnswer.js.map +1 -1
  8. package/dist/components/exam/DNDAnswerContainer.d.ts.map +1 -1
  9. package/dist/components/exam/DNDAnswerContainer.js +17 -19
  10. package/dist/components/exam/DNDAnswerContainer.js.map +1 -1
  11. package/dist/components/exam/DNDAnswerOption.d.ts +1 -1
  12. package/dist/components/exam/DNDAnswerOption.d.ts.map +1 -1
  13. package/dist/components/exam/DNDAnswerOption.js +1 -1
  14. package/dist/components/exam/DNDAnswerOption.js.map +1 -1
  15. package/dist/components/exam/DNDAnswerTitleCommon.d.ts +4 -0
  16. package/dist/components/exam/DNDAnswerTitleCommon.d.ts.map +1 -0
  17. package/dist/components/exam/DNDAnswerTitleCommon.js +14 -0
  18. package/dist/components/exam/DNDAnswerTitleCommon.js.map +1 -0
  19. package/dist/components/exam/DragAndDrop.d.ts +3 -0
  20. package/dist/components/exam/DragAndDrop.d.ts.map +1 -0
  21. package/dist/components/exam/DragAndDrop.js +7 -0
  22. package/dist/components/exam/DragAndDrop.js.map +1 -0
  23. package/dist/components/exam/NativeDND.d.ts +3 -0
  24. package/dist/components/exam/NativeDND.d.ts.map +1 -0
  25. package/dist/components/exam/NativeDND.js +75 -0
  26. package/dist/components/exam/NativeDND.js.map +1 -0
  27. package/dist/components/exam/getter.d.ts +3 -0
  28. package/dist/components/exam/getter.d.ts.map +1 -0
  29. package/dist/components/exam/getter.js +86 -0
  30. package/dist/components/exam/getter.js.map +1 -0
  31. package/dist/components/grading/AnnotatableGradingAnswer.d.ts +4 -0
  32. package/dist/components/grading/AnnotatableGradingAnswer.d.ts.map +1 -0
  33. package/dist/components/grading/AnnotatableGradingAnswer.js +24 -0
  34. package/dist/components/grading/AnnotatableGradingAnswer.js.map +1 -0
  35. package/dist/components/results/CorrectDNDAnswer.d.ts +4 -0
  36. package/dist/components/results/CorrectDNDAnswer.d.ts.map +1 -0
  37. package/dist/components/results/CorrectDNDAnswer.js +22 -0
  38. package/dist/components/results/CorrectDNDAnswer.js.map +1 -0
  39. package/dist/components/results/DNDAnswer.d.ts.map +1 -1
  40. package/dist/components/results/DNDAnswer.js +11 -9
  41. package/dist/components/results/DNDAnswer.js.map +1 -1
  42. package/dist/components/results/DNDAnswerOptionResults.d.ts +4 -0
  43. package/dist/components/results/DNDAnswerOptionResults.d.ts.map +1 -0
  44. package/dist/components/results/DNDAnswerOptionResults.js +4 -0
  45. package/dist/components/results/DNDAnswerOptionResults.js.map +1 -0
  46. package/dist/components/shared/AnnotationWrapper.d.ts +5 -0
  47. package/dist/components/shared/AnnotationWrapper.d.ts.map +1 -0
  48. package/dist/components/shared/AnnotationWrapper.js +24 -0
  49. package/dist/components/shared/AnnotationWrapper.js.map +1 -0
  50. package/dist/components/shared/DNDAnswerCommon.d.ts +1 -2
  51. package/dist/components/shared/DNDAnswerCommon.d.ts.map +1 -1
  52. package/dist/components/shared/DNDAnswerCommon.js +5 -2
  53. package/dist/components/shared/DNDAnswerCommon.js.map +1 -1
  54. package/dist/components/shared/DNDAnswerDroppable.d.ts +2 -3
  55. package/dist/components/shared/DNDAnswerDroppable.d.ts.map +1 -1
  56. package/dist/components/shared/DNDAnswerDroppable.js +7 -8
  57. package/dist/components/shared/DNDAnswerDroppable.js.map +1 -1
  58. package/dist/components/shared/DNDAnswerDroppableCommon.d.ts +13 -0
  59. package/dist/components/shared/DNDAnswerDroppableCommon.d.ts.map +1 -0
  60. package/dist/components/shared/DNDAnswerDroppableCommon.js +30 -0
  61. package/dist/components/shared/DNDAnswerDroppableCommon.js.map +1 -0
  62. package/dist/components/shared/DNDAnswerOption.d.ts +7 -0
  63. package/dist/components/shared/DNDAnswerOption.d.ts.map +1 -0
  64. package/dist/components/shared/DNDAnswerOption.js +14 -0
  65. package/dist/components/shared/DNDAnswerOption.js.map +1 -0
  66. package/dist/components/shared/DNDAnswerOptionCommon.d.ts +1 -1
  67. package/dist/components/shared/DNDAnswerOptionCommon.d.ts.map +1 -1
  68. package/dist/components/shared/DNDAnswerOptionCommon.js +1 -1
  69. package/dist/components/shared/DNDAnswerOptionCommon.js.map +1 -1
  70. package/dist/components/shared/DNDAnswerTitleCommon.d.ts +4 -0
  71. package/dist/components/shared/DNDAnswerTitleCommon.d.ts.map +1 -0
  72. package/dist/components/shared/DNDAnswerTitleCommon.js +14 -0
  73. package/dist/components/shared/DNDAnswerTitleCommon.js.map +1 -0
  74. package/dist/components/shared/DNDTitleAndAnswer.d.ts +12 -0
  75. package/dist/components/shared/DNDTitleAndAnswer.d.ts.map +1 -0
  76. package/dist/components/shared/DNDTitleAndAnswer.js +48 -0
  77. package/dist/components/shared/DNDTitleAndAnswer.js.map +1 -0
  78. package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts +3 -4
  79. package/dist/components/shared/DNDTitleAndAnswerCommon.d.ts.map +1 -1
  80. package/dist/components/shared/DNDTitleAndAnswerCommon.js +30 -9
  81. package/dist/components/shared/DNDTitleAndAnswerCommon.js.map +1 -1
  82. package/dist/components/shared/Mark.d.ts +9 -0
  83. package/dist/components/shared/Mark.d.ts.map +1 -0
  84. package/dist/components/shared/Mark.js +14 -0
  85. package/dist/components/shared/Mark.js.map +1 -0
  86. package/dist/components/shared/internal/RestrictedAudioPlayerCommon.d.ts +12 -0
  87. package/dist/components/shared/internal/RestrictedAudioPlayerCommon.d.ts.map +1 -0
  88. package/dist/components/shared/internal/RestrictedAudioPlayerCommon.js +29 -0
  89. package/dist/components/shared/internal/RestrictedAudioPlayerCommon.js.map +1 -0
  90. package/dist/components/shared/internal/RestrictedAudioPlayerExam.d.ts +13 -0
  91. package/dist/components/shared/internal/RestrictedAudioPlayerExam.d.ts.map +1 -0
  92. package/dist/components/shared/internal/RestrictedAudioPlayerExam.js +33 -0
  93. package/dist/components/shared/internal/RestrictedAudioPlayerExam.js.map +1 -0
  94. package/dist/main-bundle.js +5 -5
  95. package/package.json +2 -2
  96. package/dist/__tests__/playwright/DNDAnswerContainer.test.d.ts +0 -2
  97. package/dist/__tests__/playwright/DNDAnswerContainer.test.d.ts.map +0 -1
  98. package/dist/__tests__/playwright/DNDAnswerContainer.test.js +0 -77
  99. package/dist/__tests__/playwright/DNDAnswerContainer.test.js.map +0 -1
  100. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.d.ts +0 -10
  101. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.d.ts.map +0 -1
  102. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.js +0 -21
  103. package/dist/__tests__/playwright/stories/DNDAnswerContainer.story.js.map +0 -1
  104. package/dist/__tests__/playwright/utils/ComponentWrapper.d.ts +0 -9
  105. package/dist/__tests__/playwright/utils/ComponentWrapper.d.ts.map +0 -1
  106. package/dist/__tests__/playwright/utils/ComponentWrapper.js +0 -26
  107. package/dist/__tests__/playwright/utils/ComponentWrapper.js.map +0 -1
@@ -1 +1 @@
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
+ {"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;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAG/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,sBAkBA,CAAA"}
@@ -1,12 +1,12 @@
1
1
  import { useDroppable } from '@dnd-kit/core';
2
2
  import { SortableContext } from '@dnd-kit/sortable';
3
3
  import React from 'react';
4
- import { DNDAnswer } from './DNDAnswer';
4
+ import { DNDAnswerDroppableCommon } from '../shared/DNDAnswerDroppableCommon';
5
5
  export const AllDNDOptions = ({ items, renderChildNodes, answerOptionsByOptionId }) => {
6
6
  const { setNodeRef } = useDroppable({ id: 'root' });
7
7
  return (React.createElement(SortableContext, { items: items },
8
8
  React.createElement("span", { className: "droppable-title" }, "Vastausvaihtoehdot:"),
9
9
  React.createElement("span", { ref: setNodeRef },
10
- React.createElement(DNDAnswer, { renderChildNodes: renderChildNodes, questionId: "root", items: items, answerOptionsByQuestionId: answerOptionsByOptionId }))));
10
+ React.createElement(DNDAnswerDroppableCommon, { renderChildNodes: renderChildNodes, questionId: "root", items: items, answerOptionsByQuestionId: answerOptionsByOptionId, page: "exam", classes: { root: true } }))));
11
11
  };
12
12
  //# sourceMappingURL=AllDNDOptions.js.map
@@ -1 +1 @@
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,EA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,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAC,MAAM,EACjB,KAAK,EAAE,KAAK,EACZ,yBAAyB,EAAE,uBAAuB,EAClD,IAAI,EAAC,MAAM,EACX,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,GACvB,CACG,CACS,CACnB,CAAA;AACH,CAAC,CAAA"}
@@ -1 +1 @@
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
+ {"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,sBAYA,CAAA"}
@@ -2,6 +2,6 @@ import React from 'react';
2
2
  import { DNDAnswerCommon } from '../shared/DNDAnswerCommon';
3
3
  import { Score } from '../shared/Score';
4
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 }),
5
+ React.createElement(DNDAnswerCommon, { renderChildNodes: renderChildNodes, items: items, answerOptionsByQuestionId: answerOptionsByQuestionId, classes: { root: questionId === 'root' }, questionId: questionId }),
6
6
  maxScore ? React.createElement(Score, { score: maxScore, size: "small" }) : null));
7
7
  //# sourceMappingURL=DNDAnswer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DNDAnswer.js","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswer.tsx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KAAK,IAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,CACzD,CACJ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"DNDAnswerContainer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,gBAAgB,EAGjB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAQlE,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,gBAAgB,EAAE,CAAA;IACxB,CAAC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,8BAA8B,YAAa,OAAO,eAAe,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,eAiB3G,CAAA;AAED,eAAO,MAAM,0BAA0B,YAAa,OAAO,sCAO1D,CAAA;AAED,eAAO,MAAM,kBAAkB,kCAAmC,kBAAkB,sBA+HnF,CAAA"}
1
+ {"version":3,"file":"DNDAnswerContainer.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,gBAAgB,EAGjB,MAAM,eAAe,CAAA;AAEtB,OAAO,KAA8B,MAAM,OAAO,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAQlE,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,gBAAgB,EAAE,CAAA;IACxB,CAAC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,EAAE,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,8BAA8B,YAAa,OAAO,eAAe,MAAM,CAAC,UAAU,EAAE,UAAU,CAAC,eAiB3G,CAAA;AAED,eAAO,MAAM,0BAA0B,YAAa,OAAO,sCAO1D,CAAA;AAED,eAAO,MAAM,kBAAkB,kCAAmC,kBAAkB,sBA6HnF,CAAA"}
@@ -62,35 +62,33 @@ export const DNDAnswerContainer = ({ element, renderChildNodes }) => {
62
62
  }
63
63
  function getContainers(event) {
64
64
  const { active, over } = event;
65
- const activeId = active.id;
66
- const overId = over === null || over === void 0 ? void 0 : over.id;
67
- const activeContainer = findContainer(activeId);
68
- const overContainer = overId ? findContainer(overId) : null;
69
- return { activeId, activeContainer, overContainer };
65
+ const optionId = active.id;
66
+ const questionIdFrom = findContainer(optionId);
67
+ const questionIdTo = over === null || over === void 0 ? void 0 : over.id;
68
+ return { optionId, questionIdFrom, questionIdTo };
70
69
  }
71
70
  function handleDragStart(event) {
72
71
  setActiveId(event.active.id);
73
72
  }
74
73
  function handleDragEnd(event) {
75
- const { activeId, activeContainer, overContainer } = getContainers(event);
76
- if (!activeContainer || !overContainer || activeContainer === overContainer) {
74
+ const { optionId, questionIdFrom, questionIdTo } = getContainers(event);
75
+ if (!questionIdFrom || !questionIdTo || questionIdFrom === questionIdTo) {
77
76
  return;
78
77
  }
79
- setOptionIdsByQuestionId(optionIdsByQuestionId => moveValue(optionIdsByQuestionId, activeContainer, overContainer, activeId));
78
+ setOptionIdsByQuestionId(optionIdsByQuestionId => moveValue(optionIdsByQuestionId, questionIdFrom, questionIdTo, optionId));
79
+ if (questionIdFrom !== 'root') {
80
+ saveAnswerToStore(questionIdFrom, '');
81
+ }
82
+ if (questionIdTo !== 'root') {
83
+ saveAnswerToStore(questionIdTo, optionId);
84
+ }
80
85
  setActiveId(null);
81
86
  }
82
- useEffect(() => {
83
- Object.entries(optionIdsByQuestionId).forEach(([questionId, answerValue]) => {
84
- if (questionId !== 'root') {
85
- saveAnswerToStore(questionId, answerValue === null || answerValue === void 0 ? void 0 : answerValue.toString());
86
- }
87
- });
88
- }, [optionIdsByQuestionId]);
89
- function saveAnswerToStore(overContainer, activeId) {
90
- const questionId = Number(overContainer);
91
- const value = (activeId === null || activeId === void 0 ? void 0 : activeId.toString()) || '';
87
+ function saveAnswerToStore(questionId, optionId) {
88
+ const questionIdNumber = Number(questionId);
89
+ const value = (optionId === null || optionId === void 0 ? void 0 : optionId.toString()) || '';
92
90
  const displayNumber = displayNumbersById[questionId];
93
- dispatch(saveAnswer({ type: 'choice', questionId, value, displayNumber }));
91
+ dispatch(saveAnswer({ type: 'choice', questionId: questionIdNumber, value, displayNumber }));
94
92
  }
95
93
  const dndAnswersWithQuestion = queryAll(element, 'dnd-answer').filter(e => !!query(e, 'dnd-answer-title'));
96
94
  const allAnswerOptionElements = (_a = optionIdsByQuestionId.root) === null || _a === void 0 ? void 0 : _a.map(id => answerOptionsById[id] || null).filter(Boolean);
@@ -1 +1 @@
1
- {"version":3,"file":"DNDAnswerContainer.js","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAGV,WAAW,EAEX,cAAc,EACd,aAAa,EAEb,SAAS,EACT,UAAU,EACX,MAAM,eAAe,CAAA;AACtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,WAAW,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,8BAA8B,GAAG,CAAC,OAAgB,EAAE,WAA2C,EAAE,EAAE;IAC9G,MAAM,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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 +1,4 @@
1
1
  import React from 'react';
2
2
  import { ExamComponentProps } from '../..';
3
- export declare const DNDAnswerOption: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
3
+ export declare const DNDAnswerOptionDraggable: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
4
4
  //# sourceMappingURL=DNDAnswerOption.d.ts.map
@@ -1 +1 @@
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
+ {"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,wBAAwB,kCAAmC,kBAAkB,sBAkBzF,CAAA"}
@@ -4,7 +4,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
4
4
  import React from 'react';
5
5
  import { getNumericAttribute } from '../../dom-utils';
6
6
  import { DNDAnswerOptionCommon } from '../shared/DNDAnswerOptionCommon';
7
- export const DNDAnswerOption = ({ element, renderChildNodes }) => {
7
+ export const DNDAnswerOptionDraggable = ({ element, renderChildNodes }) => {
8
8
  const optionId = getNumericAttribute(element, 'option-id');
9
9
  const { attributes, listeners, setNodeRef, isDragging, setActivatorNodeRef } = useDraggable({
10
10
  id: optionId
@@ -1 +1 @@
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,IA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,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ExamComponentProps } from '../..';
3
+ export declare const DNDAnswerTitle: ({ element, renderChildNodes }: ExamComponentProps) => React.JSX.Element;
4
+ //# sourceMappingURL=DNDAnswerTitleCommon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DNDAnswerTitleCommon.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerTitleCommon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAA;AAI1C,eAAO,MAAM,cAAc,kCAAmC,kBAAkB,sBAe/E,CAAA"}
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import classNames from 'classnames';
3
+ import { query } from '../../dom-utils';
4
+ export const DNDAnswerTitle = ({ element, renderChildNodes }) => {
5
+ const hasImages = !!query(element, 'image');
6
+ if (!renderChildNodes(element).length) {
7
+ return React.createElement("i", { style: { color: 'grey' } }, "T\u00E4h\u00E4n tulee kysymys...");
8
+ }
9
+ else
10
+ return (React.createElement("span", { className: classNames('e-dnd-answer-title', {
11
+ 'has-images': hasImages
12
+ }) }, renderChildNodes(element)));
13
+ };
14
+ //# sourceMappingURL=DNDAnswerTitleCommon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DNDAnswerTitleCommon.js","sourceRoot":"","sources":["../../../src/components/exam/DNDAnswerTitleCommon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB,EAAE,EAAE;IAClF,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAE3C,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC;QACtC,OAAO,2BAAG,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,uCAA4B,CAAA;IAChE,CAAC;;QACC,OAAO,CACL,8BACE,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE;gBAC1C,YAAY,EAAE,SAAS;aACxB,CAAC,IAED,gBAAgB,CAAC,OAAO,CAAC,CACrB,CACR,CAAA;AACL,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const DragAndDrop: () => React.JSX.Element;
3
+ //# sourceMappingURL=DragAndDrop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DragAndDrop.d.ts","sourceRoot":"","sources":["../../../src/components/exam/DragAndDrop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,WAAW,yBAOvB,CAAA"}
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export const DragAndDrop = () => {
3
+ console.log('DD');
4
+ return (React.createElement("div", null,
5
+ React.createElement("h1", null, "DragAndDrop")));
6
+ };
7
+ //# sourceMappingURL=DragAndDrop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DragAndDrop.js","sourceRoot":"","sources":["../../../src/components/exam/DragAndDrop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,MAAM,WAAW,GAAG,GAAG,EAAE;IAC9B,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;IACjB,OAAO,CACL;QACE,8CAAoB,CAChB,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const NativeDND: () => React.JSX.Element;
3
+ //# sourceMappingURL=NativeDND.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeDND.d.ts","sourceRoot":"","sources":["../../../src/components/exam/NativeDND.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,eAAO,MAAM,SAAS,yBAoHrB,CAAA"}
@@ -0,0 +1,75 @@
1
+ import React from 'react';
2
+ export const NativeDND = () => {
3
+ let dragSrcEl;
4
+ function handleDragOver(e) {
5
+ if (e.preventDefault) {
6
+ e.preventDefault();
7
+ }
8
+ if (e.dataTransfer) {
9
+ e.dataTransfer.dropEffect = 'move';
10
+ }
11
+ return false;
12
+ }
13
+ function handleDragEnter(e) {
14
+ const target = e.target;
15
+ target.classList.add('over');
16
+ target.style.borderColor = 'red';
17
+ }
18
+ function handleDragLeave(e) {
19
+ const target = e.target;
20
+ target.classList.add('over');
21
+ target.style.borderColor = 'black';
22
+ }
23
+ function handleDrop(e) {
24
+ var _a;
25
+ if (e.stopPropagation) {
26
+ e.stopPropagation(); // stops the browser from redirecting.
27
+ }
28
+ if (dragSrcEl !== e.target) {
29
+ dragSrcEl.innerHTML = e.target.innerHTML;
30
+ const target = e.target;
31
+ const data = (_a = e.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData('text/html');
32
+ console.log(data);
33
+ target.innerHTML = e.dataTransfer.getData('text/html');
34
+ }
35
+ return false;
36
+ }
37
+ function handleDragEnd(e) {
38
+ const target = e.target;
39
+ target.style.opacity = '1';
40
+ target.style.borderColor = 'black';
41
+ items.forEach(item => {
42
+ item.classList.remove('over');
43
+ });
44
+ }
45
+ function handleDragStart(e) {
46
+ const target = e.target;
47
+ target.style.opacity = '0.4';
48
+ dragSrcEl = e.target;
49
+ if (e.dataTransfer) {
50
+ e.dataTransfer.effectAllowed = 'move';
51
+ e.dataTransfer.setData('text/html', e.target.innerHTML);
52
+ }
53
+ }
54
+ const items = document.querySelectorAll('.container .box');
55
+ const data = [
56
+ React.createElement("div", { key: 1 }, "A"),
57
+ React.createElement("div", { key: 2 }, "B"),
58
+ React.createElement("div", { key: 3 },
59
+ React.createElement("img", { style: { pointerEvents: 'none' }, src: "https://its-finland.fi/wp-content/uploads/2023/06/ytl-toimiliitto-1-uai-780x438-1.jpg", width: "50" }))
60
+ ];
61
+ return (React.createElement("div", null,
62
+ React.createElement("div", { className: "container", style: { minWidth: '100px', minHeight: '200px', background: '#fcf' } }, data.map((item, index) => (React.createElement("div", { key: index, draggable: "true", className: "box", onDragStart: handleDragStart, onDragEnd: handleDragEnd, onDragOver: handleDragOver, onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDrop: handleDrop, style: {
63
+ width: '50px',
64
+ height: '50px',
65
+ padding: '0 50px',
66
+ border: '2px solid black',
67
+ display: 'grid',
68
+ placeContent: 'center',
69
+ marginBottom: '10px',
70
+ transition: 'all 0.3s',
71
+ background: 'lightblue'
72
+ } }, item)))),
73
+ React.createElement("div", { className: "container", style: { minWidth: '100px', minHeight: '200px', background: '#ffc' }, onDragOver: e => e.preventDefault(), onDrop: handleDrop })));
74
+ };
75
+ //# sourceMappingURL=NativeDND.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeDND.js","sourceRoot":"","sources":["../../../src/components/exam/NativeDND.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,IAAI,SAAsB,CAAA;IAE1B,SAAS,cAAc,CAAC,CAAkC;QACxD,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC;YACrB,CAAC,CAAC,cAAc,EAAE,CAAA;QACpB,CAAC;QAED,IAAI,CAAC,CAAC,YAAY,EAAE,CAAC;YACnB,CAAC,CAAC,YAAY,CAAC,UAAU,GAAG,MAAM,CAAA;QACpC,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,SAAS,eAAe,CAAC,CAAkC;QACzD,MAAM,MAAM,GAAG,CAAC,CAAC,MAAqB,CAAA;QACtC,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,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AAiB;gBACzB,OAAO,EAAE,MAAM;gBACf,YAAY,EAAE,QAAQ;gBACtB,YAAY,EAAE,MAAM;gBACpB,UAAU,EAAE,UAAU;gBACtB,UAAU,EAAE,WAAW;aACxB,IAEA,IAAI,CACD,CACP,CAAC,CACE;QACN,6BACE,SAAS,EAAC,WAAW,EACrB,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,EACpE,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,EAAE,EACnC,MAAM,EAAE,UAAU,GACb,CACH,CACP,CAAA;AACH,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { KeyboardCoordinateGetter } from '@dnd-kit/core';
2
+ export declare const coordinateGetter: KeyboardCoordinateGetter;
3
+ //# sourceMappingURL=getter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getter.d.ts","sourceRoot":"","sources":["../../../src/components/exam/getter.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,wBAAwB,EACzB,MAAM,eAAe,CAAA;AAItB,eAAO,MAAM,gBAAgB,EAAE,wBAiG9B,CAAA"}
@@ -0,0 +1,86 @@
1
+ import { closestCorners, getFirstCollision, KeyboardCode } from '@dnd-kit/core';
2
+ const directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
3
+ export const coordinateGetter = (event, { context: { active, droppableRects, droppableContainers, collisionRect } }) => {
4
+ var _a;
5
+ if (directions.includes(event.code)) {
6
+ event.preventDefault();
7
+ if (!active || !collisionRect) {
8
+ return;
9
+ }
10
+ const filteredContainers = [];
11
+ droppableContainers.getEnabled().forEach(entry => {
12
+ var _a;
13
+ if (!entry || (entry === null || entry === void 0 ? void 0 : entry.disabled)) {
14
+ return;
15
+ }
16
+ const rect = droppableRects.get(entry.id);
17
+ if (!rect) {
18
+ return;
19
+ }
20
+ const data = entry.data.current;
21
+ if (data) {
22
+ const { type, children } = data;
23
+ if (type === 'container' && Array.isArray(children) && (children === null || children === void 0 ? void 0 : children.length) > 0) {
24
+ if (((_a = active.data.current) === null || _a === void 0 ? void 0 : _a.type) !== 'container') {
25
+ return;
26
+ }
27
+ }
28
+ }
29
+ switch (event.code) {
30
+ case KeyboardCode.Down:
31
+ if (collisionRect.top < rect.top) {
32
+ filteredContainers.push(entry);
33
+ }
34
+ break;
35
+ case KeyboardCode.Up:
36
+ if (collisionRect.top > rect.top) {
37
+ filteredContainers.push(entry);
38
+ }
39
+ break;
40
+ case KeyboardCode.Left:
41
+ if (collisionRect.left >= rect.left + rect.width) {
42
+ filteredContainers.push(entry);
43
+ }
44
+ break;
45
+ case KeyboardCode.Right:
46
+ if (collisionRect.left + collisionRect.width <= rect.left) {
47
+ filteredContainers.push(entry);
48
+ }
49
+ break;
50
+ }
51
+ });
52
+ const collisions = closestCorners({
53
+ active,
54
+ collisionRect: collisionRect,
55
+ droppableRects,
56
+ droppableContainers: filteredContainers,
57
+ pointerCoordinates: null
58
+ });
59
+ const closestId = getFirstCollision(collisions, 'id');
60
+ if (closestId != null) {
61
+ const newDroppable = droppableContainers.get(closestId);
62
+ const newNode = newDroppable === null || newDroppable === void 0 ? void 0 : newDroppable.node.current;
63
+ const newRect = newDroppable === null || newDroppable === void 0 ? void 0 : newDroppable.rect.current;
64
+ if (newNode && newRect) {
65
+ if (newDroppable.id === 'placeholder') {
66
+ return {
67
+ x: newRect.left + (newRect.width - collisionRect.width) / 2,
68
+ y: newRect.top + (newRect.height - collisionRect.height) / 2
69
+ };
70
+ }
71
+ if (((_a = newDroppable.data.current) === null || _a === void 0 ? void 0 : _a.type) === 'container') {
72
+ return {
73
+ x: newRect.left + 20,
74
+ y: newRect.top + 74
75
+ };
76
+ }
77
+ return {
78
+ x: newRect.left,
79
+ y: newRect.top
80
+ };
81
+ }
82
+ }
83
+ }
84
+ return undefined;
85
+ };
86
+ //# sourceMappingURL=getter.js.map
@@ -0,0 +1 @@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U,EAAE,IAAI,CAAC,CAAA;QAErD,IAAI,SAAS,IAAI,IAAI,EAAE,CAAC;YACtB,MAAM,YAAY,GAAG,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;YACvD,MAAM,OAAO,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAC,OAAO,CAAA;YAC1C,MAAM,OAAO,GAAG,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,IAAI,CAAC,OAAO,CAAA;YAE1C,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;gBACvB,IAAI,YAAY,CAAC,EAAE,KAAK,aAAa,EAAE,CAAC;oBACtC,OAAO;wBACL,CAAC,EAAE,OAAO,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC;wBAC3D,CAAC,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC;qBAC7D,CAAA;gBACH,CAAC;gBAED,IAAI,CAAA,MAAA,YAAY,CAAC,IAAI,CAAC,OAAO,0CAAE,IAAI,MAAK,WAAW,EAAE,CAAC;oBACpD,OAAO;wBACL,CAAC,EAAE,OAAO,CAAC,IAAI,GAAG,EAAE;wBACpB,CAAC,EAAE,OAAO,CAAC,GAAG,GAAG,EAAE;qBACpB,CAAA;gBACH,CAAC;gBAED,OAAO;oBACL,CAAC,EAAE,OAAO,CAAC,IAAI;oBACf,CAAC,EAAE,OAAO,CAAC,GAAG;iBACf,CAAA;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { GradingAnswerProps } from './GradingAnswer';
3
+ export declare function AnnotatableGradingAnswer(props: GradingAnswerProps): string | React.JSX.Element;
4
+ //# sourceMappingURL=AnnotatableGradingAnswer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotatableGradingAnswer.d.ts","sourceRoot":"","sources":["../../../src/components/grading/AnnotatableGradingAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,kBAAkB,8BAoCjE"}
@@ -0,0 +1,24 @@
1
+ import React, { useContext } from 'react';
2
+ import { AnnotationContext } from '../context/AnnotationProvider';
3
+ export function AnnotatableGradingAnswer(props) {
4
+ const path = 'pregrading';
5
+ const answer = props.answer.value;
6
+ console.log(props.answer);
7
+ const annotationContextData = useContext(AnnotationContext);
8
+ const { newAnnotation, annotations, } = annotationContextData;
9
+ const canNotBeAnnotated = (annotationContextData === null || annotationContextData === void 0 ? void 0 : annotationContextData.annotations) === undefined || answer.length === 0;
10
+ if (canNotBeAnnotated) {
11
+ return answer;
12
+ }
13
+ const newAnnotationForThisNode = (newAnnotation === null || newAnnotation === void 0 ? void 0 : newAnnotation.annotationParts.some(p => p.annotationAnchor === path))
14
+ ? newAnnotation
15
+ : null;
16
+ const thisNodeAnnotations = [
17
+ ...((annotations === null || annotations === void 0 ? void 0 : annotations[path]) || []),
18
+ ...(newAnnotationForThisNode ? [newAnnotationForThisNode] : [])
19
+ ];
20
+ console.log(answer);
21
+ console.log(thisNodeAnnotations);
22
+ return (React.createElement("span", { className: "e-annotatable", "data-annotation-path": path, "data-testid": "123" }));
23
+ }
24
+ //# sourceMappingURL=AnnotatableGradingAnswer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnnotatableGradingAnswer.js","sourceRoot":"","sources":["../../../src/components/grading/AnnotatableGradingAnswer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAA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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":"CorrectDNDAnswer.js","sourceRoot":"","sources":["../../../src/components/results/CorrectDNDAnswer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAsB,EAAE,EAAE;;IACrF,MAAM,EAAE,gBAAgB,EAAE,GAAG,UAAU,CAAC,cAAc,CAAC,CAAA;IACvD,MAAM,gBAAgB,GAAG,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC,CAAA;IAE/D,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,MAAM,CACrD,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QACV,MAAM,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,CAAE,CAAA;QAC9C,OAAO,EAAE,GAAG,GAAG,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAA;IACnC,CAAC,EACD,EAAuC,CACxC,CAAA;IAED,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,OAA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 {"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,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AE,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"}
@@ -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"}
@@ -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"}