@elice/material-quiz 1.240718.0-trasncript.2 → 1.240718.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/cjs/components/eb-sortable/EbDraggable.js +33 -42
  2. package/cjs/components/eb-sortable/EbDroppable.js +20 -27
  3. package/cjs/components/markdown-editor/index.d.ts +2 -1
  4. package/cjs/components/markdown-editor/index.js +10 -19
  5. package/cjs/components/material-quiz/MaterialQuiz.js +83 -114
  6. package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.js +29 -36
  7. package/cjs/components/material-quiz/MaterialQuizInfo.js +149 -151
  8. package/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +127 -175
  9. package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.js +286 -360
  10. package/cjs/components/material-quiz/MaterialQuizSelectOne.js +126 -172
  11. package/cjs/components/material-quiz/MaterialQuizShimmer.js +39 -46
  12. package/cjs/components/material-quiz/MaterialQuizText.js +115 -163
  13. package/cjs/components/material-quiz/QuizResultBadge.js +22 -32
  14. package/cjs/components/material-quiz/QuizSubmitStatusText.js +16 -21
  15. package/cjs/components/material-quiz/constants/color.js +5 -5
  16. package/cjs/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
  17. package/cjs/components/material-quiz/context/MaterialQuizContext.js +93 -156
  18. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +161 -259
  19. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +100 -134
  20. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +101 -130
  21. package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +52 -64
  22. package/cjs/components/material-quiz/material-quiz-group/context/context.js +1 -5
  23. package/cjs/components/material-quiz-edit/MaterialQuizEdit.js +36 -47
  24. package/cjs/components/material-quiz-edit/MaterialQuizEditContent.js +232 -280
  25. package/cjs/components/material-quiz-edit/context.js +2 -8
  26. package/cjs/components/material-quiz-edit/options/OptionEditor.js +46 -70
  27. package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.js +148 -174
  28. package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +149 -175
  29. package/cjs/components/material-quiz-edit/options/OptionSelectOne.js +144 -164
  30. package/cjs/components/material-quiz-edit/options/OptionText.js +82 -90
  31. package/cjs/components/material-quiz-edit/options/options-group/OptionGroup.js +8 -9
  32. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +112 -156
  33. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +196 -288
  34. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +75 -88
  35. package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +92 -108
  36. package/cjs/components/material-quiz-edit/utils/checkTwoDimensionArray.js +1 -5
  37. package/cjs/components/material-quiz-edit/utils/editValue.js +12 -21
  38. package/cjs/components/shared/QuestionBox.js +165 -198
  39. package/cjs/components/shared/QuizDraggbleDroppedOption.js +12 -11
  40. package/cjs/components/shared/QuizDraggbleDummyOption.js +16 -23
  41. package/cjs/components/shared/QuizDraggbleOption.js +59 -65
  42. package/cjs/components/shared/StyledMarkdown.js +1 -5
  43. package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +7 -13
  44. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  45. package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +17 -24
  46. package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +68 -59
  47. package/cjs/components/shared/question-radio/QuestionRadio.js +7 -13
  48. package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  49. package/cjs/components/shared/question-radio/QuestionRadioContext.js +17 -24
  50. package/cjs/components/shared/question-radio/QuestionRadioOption.js +59 -52
  51. package/cjs/components/shared/utils/getQuestionStatusStyle.js +9 -7
  52. package/cjs/components/shared/utils/mergeRefs.js +6 -15
  53. package/cjs/constant/element.js +3 -3
  54. package/cjs/helpers/index.js +10 -8
  55. package/cjs/hooks/useCaculatePassage.js +20 -21
  56. package/es/components/eb-sortable/EbDraggable.js +33 -37
  57. package/es/components/eb-sortable/EbDroppable.js +20 -22
  58. package/es/components/markdown-editor/index.d.ts +2 -1
  59. package/es/components/markdown-editor/index.js +10 -15
  60. package/es/components/material-quiz/MaterialQuiz.js +83 -109
  61. package/es/components/material-quiz/MaterialQuizAnswerExplanation.js +29 -32
  62. package/es/components/material-quiz/MaterialQuizInfo.js +150 -148
  63. package/es/components/material-quiz/MaterialQuizSelectMultiple.js +127 -171
  64. package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.js +287 -356
  65. package/es/components/material-quiz/MaterialQuizSelectOne.js +126 -168
  66. package/es/components/material-quiz/MaterialQuizShimmer.js +39 -42
  67. package/es/components/material-quiz/MaterialQuizText.js +115 -158
  68. package/es/components/material-quiz/QuizResultBadge.js +22 -27
  69. package/es/components/material-quiz/QuizSubmitStatusText.js +16 -17
  70. package/es/components/material-quiz/constants/color.js +5 -5
  71. package/es/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
  72. package/es/components/material-quiz/context/MaterialQuizContext.js +94 -153
  73. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +161 -253
  74. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +100 -129
  75. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +101 -125
  76. package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +52 -60
  77. package/es/components/material-quiz/material-quiz-group/context/context.js +1 -1
  78. package/es/components/material-quiz-edit/MaterialQuizEdit.js +36 -43
  79. package/es/components/material-quiz-edit/MaterialQuizEditContent.js +229 -272
  80. package/es/components/material-quiz-edit/context.js +2 -4
  81. package/es/components/material-quiz-edit/options/OptionEditor.js +46 -64
  82. package/es/components/material-quiz-edit/options/OptionSelectMultiple.js +148 -170
  83. package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +149 -171
  84. package/es/components/material-quiz-edit/options/OptionSelectOne.js +144 -159
  85. package/es/components/material-quiz-edit/options/OptionText.js +82 -86
  86. package/es/components/material-quiz-edit/options/options-group/OptionGroup.js +8 -9
  87. package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +112 -151
  88. package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +197 -283
  89. package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +75 -83
  90. package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +92 -103
  91. package/es/components/material-quiz-edit/utils/checkTwoDimensionArray.js +1 -5
  92. package/es/components/material-quiz-edit/utils/editValue.js +12 -17
  93. package/es/components/shared/QuestionBox.js +165 -192
  94. package/es/components/shared/QuizDraggbleDroppedOption.js +12 -11
  95. package/es/components/shared/QuizDraggbleDummyOption.js +16 -19
  96. package/es/components/shared/QuizDraggbleOption.js +59 -61
  97. package/es/components/shared/StyledMarkdown.js +1 -1
  98. package/es/components/shared/question-checkbox/QuestionCheckbox.js +7 -9
  99. package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
  100. package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +17 -20
  101. package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +68 -54
  102. package/es/components/shared/question-radio/QuestionRadio.js +7 -9
  103. package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
  104. package/es/components/shared/question-radio/QuestionRadioContext.js +17 -20
  105. package/es/components/shared/question-radio/QuestionRadioOption.js +59 -47
  106. package/es/components/shared/utils/getQuestionStatusStyle.js +9 -7
  107. package/es/components/shared/utils/mergeRefs.js +6 -15
  108. package/es/constant/element.js +3 -3
  109. package/es/helpers/index.js +10 -8
  110. package/es/hooks/useCaculatePassage.js +20 -21
  111. package/package.json +15 -12
  112. package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -423
  113. package/cjs/components/material-quiz/index.js +0 -9
  114. package/cjs/components/material-quiz/locales/index.js +0 -13
  115. package/cjs/components/material-quiz-edit/index.js +0 -7
  116. package/cjs/components/material-quiz-edit/locales/index.js +0 -13
  117. package/cjs/components/shared/index.js +0 -19
  118. package/cjs/constant/index.js +0 -9
  119. package/cjs/hooks/index.js +0 -7
  120. package/es/_virtual/_rollupPluginBabelHelpers.js +0 -408
  121. package/es/components/material-quiz/index.js +0 -2
  122. package/es/components/material-quiz/locales/index.js +0 -4
  123. package/es/components/material-quiz-edit/index.js +0 -1
  124. package/es/components/material-quiz-edit/locales/index.js +0 -4
  125. package/es/components/shared/index.js +0 -7
  126. package/es/constant/index.js +0 -1
  127. package/es/hooks/index.js +0 -1
@@ -2,8 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
6
- var jsxRuntime = require('react/jsx-runtime');
7
5
  var React = require('react');
8
6
  var apiClient = require('@elice/api-client');
9
7
  var designTokens = require('@elice/design-tokens');
@@ -26,77 +24,62 @@ var MaterialQuizInfo = require('./MaterialQuizInfo.js');
26
24
  var QuizResultBadge = require('./QuizResultBadge.js');
27
25
  var QuizSubmitStatusText = require('./QuizSubmitStatusText.js');
28
26
 
29
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
30
-
31
- var React__default = /*#__PURE__*/_interopDefaultCompat(React);
32
-
33
- var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
34
- var hasInlinePassage = _ref.hasInlinePassage;
27
+ const MaterialQuizSelectMultiple = ({
28
+ hasInlinePassage
29
+ }) => {
35
30
  // context
36
- var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
37
- course = _useMaterialQuizState.course,
38
- lecture = _useMaterialQuizState.lecture,
39
- materialQuiz = _useMaterialQuizState.materialQuiz,
40
- userId = _useMaterialQuizState.userId;
41
- var _useMaterialQuizDispa = MaterialQuizContext.useMaterialQuizDispatch(),
42
- onSubmit = _useMaterialQuizDispa.onSubmit,
43
- onNext = _useMaterialQuizDispa.onNext,
44
- refreshOrgMaterialQuiz = _useMaterialQuizDispa.refreshOrgMaterialQuiz,
45
- onDirty = _useMaterialQuizDispa.onDirty;
46
- var theme = material.useTheme();
31
+ const {
32
+ course,
33
+ lecture,
34
+ materialQuiz,
35
+ userId
36
+ } = MaterialQuizContext.useMaterialQuizState();
37
+ const {
38
+ onSubmit,
39
+ onNext,
40
+ refreshOrgMaterialQuiz,
41
+ onDirty
42
+ } = MaterialQuizContext.useMaterialQuizDispatch();
43
+ const theme = material.useTheme();
47
44
  // state
48
- var intl$1 = intl.useRawEliceIntl();
49
- var _React$useState = React__default.default.useState([]),
50
- _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
51
- selectedAnswer = _React$useState2[0],
52
- setSelectedAnswer = _React$useState2[1];
53
- var _React$useState3 = React__default.default.useState(),
54
- _React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
55
- materialQuizResponse = _React$useState4[0],
56
- setMaterialQuizResponse = _React$useState4[1];
57
- var _React$useState5 = React__default.default.useState('idle'),
58
- _React$useState6 = _rollupPluginBabelHelpers.slicedToArray(_React$useState5, 2),
59
- submitStatus = _React$useState6[0],
60
- setSubmitStatus = _React$useState6[1];
61
- var _useCaculatePassage = useCaculatePassage.useCaculatePassage(),
62
- containerRef = _useCaculatePassage.containerRef,
63
- questionRef = _useCaculatePassage.questionRef;
45
+ const intl$1 = intl.useRawEliceIntl();
46
+ const [selectedAnswer, setSelectedAnswer] = React.useState([]);
47
+ const [materialQuizResponse, setMaterialQuizResponse] = React.useState();
48
+ const [submitStatus, setSubmitStatus] = React.useState('idle');
49
+ const {
50
+ containerRef,
51
+ questionRef
52
+ } = useCaculatePassage.useCaculatePassage();
64
53
  // Whether user has clicked any options
65
- var _React$useState7 = React__default.default.useState(false),
66
- _React$useState8 = _rollupPluginBabelHelpers.slicedToArray(_React$useState7, 2),
67
- isActive = _React$useState8[0],
68
- setIsActive = _React$useState8[1];
69
- var _React$useState9 = React__default.default.useState(false),
70
- _React$useState10 = _rollupPluginBabelHelpers.slicedToArray(_React$useState9, 2),
71
- hasSubmitted = _React$useState10[0],
72
- setHasSubmitted = _React$useState10[1];
73
- var isNextActive = hasSubmitted && typeof onNext === 'function';
74
- var isDisabled = selectedAnswer.length === 0 || index.checkUserLectureTestEnded(lecture) || !!userId;
54
+ const [isActive, setIsActive] = React.useState(false);
55
+ const [hasSubmitted, setHasSubmitted] = React.useState(false);
56
+ const isNextActive = hasSubmitted && typeof onNext === 'function';
57
+ const isDisabled = selectedAnswer.length === 0 || index.checkUserLectureTestEnded(lecture) || !!userId;
75
58
  // answer select handler
76
- var handleAnswerSelect = function handleAnswerSelect(index$1) {
59
+ const handleAnswerSelect = index$1 => {
77
60
  if (index.checkUserLectureTestEnded(lecture) || !!userId) {
78
61
  return;
79
62
  }
80
63
  onDirty(true);
81
64
  setHasSubmitted(false);
82
65
  setIsActive(true);
83
- setSelectedAnswer(function (prevState) {
84
- var newState = prevState.includes(index$1) ? prevState.filter(function (ident) {
85
- return ident !== index$1;
86
- }) : [].concat(_rollupPluginBabelHelpers.toConsumableArray(prevState), [index$1]);
66
+ setSelectedAnswer(prevState => {
67
+ const newState = prevState.includes(index$1) ? prevState.filter(ident => ident !== index$1) : [...prevState, index$1];
87
68
  return newState;
88
69
  });
89
70
  };
90
71
  // quiz response fetcher
91
- React__default.default.useEffect(function () {
72
+ React.useEffect(() => {
92
73
  if (!userId && (materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.lastQuizResponseId)) {
93
- var controller = new AbortController();
94
- var signal = controller.signal;
74
+ const controller = new AbortController();
75
+ const {
76
+ signal
77
+ } = controller;
95
78
  apiClient.getOrgMaterialQuizResponseGet({
96
79
  quizResponseId: materialQuiz.lastQuizResponseId
97
80
  }, {
98
- signal: signal
99
- }).then(function (response) {
81
+ signal
82
+ }).then(response => {
100
83
  setMaterialQuizResponse(response.quizResponse);
101
84
  // when user submitted answers and not get the result yet, update selected options (for example, test quiz)
102
85
  // when is is a survey type quiz
@@ -106,19 +89,19 @@ var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
106
89
  setSelectedAnswer(response.quizResponse.answer);
107
90
  }
108
91
  setSelectedAnswer(response.quizResponse.answer);
109
- }).catch(function (error) {
92
+ }).catch(error => {
110
93
  console.error(error);
111
94
  });
112
- return function () {
113
- return controller.abort();
114
- };
95
+ return () => controller.abort();
115
96
  }
116
97
  }, [materialQuiz, userId]);
117
98
  // quiz response fetcher
118
- React__default.default.useEffect(function () {
99
+ React.useEffect(() => {
119
100
  if (userId && materialQuiz) {
120
- var controller = new AbortController();
121
- var signal = controller.signal;
101
+ const controller = new AbortController();
102
+ const {
103
+ signal
104
+ } = controller;
122
105
  apiClient.getOrgMaterialQuizResponseList({
123
106
  materialQuizId: materialQuiz.id,
124
107
  filterUserIds: [userId],
@@ -127,84 +110,58 @@ var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
127
110
  offset: 0,
128
111
  count: 1
129
112
  }, {
130
- signal: signal
131
- }).then(function (response) {
132
- var quizResponse = response.quizResponses[0];
133
- var quizResponseAnswer = quizResponse === null || quizResponse === void 0 ? void 0 : quizResponse.answer;
113
+ signal
114
+ }).then(response => {
115
+ const quizResponse = response.quizResponses[0];
116
+ const quizResponseAnswer = quizResponse === null || quizResponse === void 0 ? void 0 : quizResponse.answer;
134
117
  setMaterialQuizResponse(quizResponse);
135
118
  setSelectedAnswer(Array.isArray(quizResponseAnswer) ? quizResponseAnswer : []);
136
- }).catch(function (error) {
119
+ }).catch(error => {
137
120
  console.error(error);
138
121
  });
139
- return function () {
140
- return controller.abort();
141
- };
122
+ return () => controller.abort();
142
123
  }
143
124
  }, [materialQuiz, userId]);
144
125
  // submit handler
145
- var handleSubmit = /*#__PURE__*/function () {
146
- var _ref2 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee() {
147
- var _yield$postOrgMateria, quizResponseId, _yield$getOrgMaterial, quizResponse;
148
- return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
149
- while (1) switch (_context.prev = _context.next) {
150
- case 0:
151
- if (materialQuiz) {
152
- _context.next = 2;
153
- break;
154
- }
155
- return _context.abrupt("return");
156
- case 2:
157
- setSubmitStatus('pending');
158
- _context.prev = 3;
159
- _context.next = 6;
160
- return apiClient.postOrgMaterialQuizResponseAdd({
161
- materialQuizId: materialQuiz.id,
162
- answer: selectedAnswer
163
- });
164
- case 6:
165
- _yield$postOrgMateria = _context.sent;
166
- quizResponseId = _yield$postOrgMateria.quizResponseId;
167
- _context.next = 10;
168
- return apiClient.getOrgMaterialQuizResponseGet({
169
- quizResponseId: quizResponseId
170
- });
171
- case 10:
172
- _yield$getOrgMaterial = _context.sent;
173
- quizResponse = _yield$getOrgMaterial.quizResponse;
174
- setIsActive(false);
175
- setMaterialQuizResponse(quizResponse);
176
- void refreshOrgMaterialQuiz();
177
- onSubmit(true, index.getQuizResult(quizResponse));
178
- setSubmitStatus('resolved');
179
- setHasSubmitted(true);
180
- onDirty(false);
181
- _context.next = 26;
182
- break;
183
- case 21:
184
- _context.prev = 21;
185
- _context.t0 = _context["catch"](3);
186
- console.error(_context.t0);
187
- onSubmit(false);
188
- setSubmitStatus('rejected');
189
- case 26:
190
- case "end":
191
- return _context.stop();
192
- }
193
- }, _callee, null, [[3, 21]]);
194
- }));
195
- return function handleSubmit() {
196
- return _ref2.apply(this, arguments);
197
- };
198
- }();
199
- return jsxRuntime.jsx(QuestionBox.default, {
126
+ const handleSubmit = async () => {
127
+ if (!materialQuiz) {
128
+ return;
129
+ }
130
+ setSubmitStatus('pending');
131
+ try {
132
+ const {
133
+ quizResponseId
134
+ } = await apiClient.postOrgMaterialQuizResponseAdd({
135
+ materialQuizId: materialQuiz.id,
136
+ answer: selectedAnswer
137
+ });
138
+ const {
139
+ quizResponse
140
+ } = await apiClient.getOrgMaterialQuizResponseGet({
141
+ quizResponseId
142
+ });
143
+ setIsActive(false);
144
+ setMaterialQuizResponse(quizResponse);
145
+ void refreshOrgMaterialQuiz();
146
+ onSubmit(true, index.getQuizResult(quizResponse));
147
+ setSubmitStatus('resolved');
148
+ setHasSubmitted(true);
149
+ onDirty(false);
150
+ } catch (error) {
151
+ console.error(error);
152
+ onSubmit(false);
153
+ setSubmitStatus('rejected');
154
+ }
155
+ };
156
+ return React.createElement(QuestionBox.default, {
200
157
  title: materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionTitle,
201
158
  titlePrefix: "Q.",
202
159
  onNext: onNext,
203
160
  isNextActive: isNextActive,
204
- submitResult: jsxRuntime.jsx(QuizResultBadge.default, {
161
+ submitResult: React.createElement(QuizResultBadge.default, {
205
162
  materialQuizResponse: materialQuizResponse
206
163
  }),
207
- submitStatus: jsxRuntime.jsx(QuizSubmitStatusText.default, {
164
+ submitStatus: React.createElement(QuizSubmitStatusText.default, {
208
165
  status: submitStatus
209
166
  }),
210
167
  bodyContainerRef: containerRef,
@@ -222,54 +179,49 @@ var MaterialQuizSelectMultiple = function MaterialQuizSelectMultiple(_ref) {
222
179
  backgroundColor: isNextActive ? theme.palette.secondary.main : isDisabled ? designTokens.base.color.gray6 : theme.palette.primary.main,
223
180
  color: isNextActive ? theme.palette.secondary.contrastText : isDisabled ? designTokens.base.color.gray3 : theme.palette.primary.contrastText
224
181
  }
225
- }],
226
- children: jsxRuntime.jsxs(material.Stack, {
227
- height: "100%",
228
- gap: "1rem",
229
- children: [hasInlinePassage && jsxRuntime.jsx("div", {
230
- id: element.MATERIAL_QUIZ_PASSIVE_ID,
231
- ref: questionRef,
232
- children: jsxRuntime.jsx(MaterialQuizInfo.default, {
233
- renderWithBox: false
234
- })
235
- }), jsxRuntime.jsxs("div", {
236
- id: element.MATERIAL_QUIZ_ANSWER_ID,
237
- children: [jsxRuntime.jsx(QuestionCheckbox.default, {
238
- onSelect: handleAnswerSelect,
239
- selectedOptions: selectedAnswer,
240
- disabled: submitStatus === 'pending' || index.checkUserLectureTestEnded(lecture) || !!userId,
241
- children: (materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.options) && course ? materialQuiz.options.map(function (option, index$1) {
242
- var _a;
243
- var getIsSelected = function getIsSelected(index, materialQuizResponse) {
244
- var _a;
245
- if (!materialQuizResponse) {
246
- return false;
247
- }
248
- var materialQuizResponseAnswer = materialQuizResponse.answer;
249
- return (_a = materialQuizResponseAnswer.includes(index)) !== null && _a !== void 0 ? _a : false;
250
- };
251
- var status = index.getOptionStatus({
252
- materialQuizResponse: materialQuizResponse,
253
- isSelected: getIsSelected(index$1, materialQuizResponse),
254
- isActive: isActive
255
- });
256
- var materialQuizAnswerInfo = materialQuiz.answerInfo;
257
- return jsxRuntime.jsx(QuestionCheckboxOption.default, {
258
- value: index$1,
259
- status: status,
260
- isAnswer: !!userId && Array.isArray(materialQuizAnswerInfo) && materialQuizAnswerInfo.includes(index$1),
261
- children: course.preference.renderMarkdownInQuizOptions ? jsxRuntime.jsx(StyledMarkdown.default, {
262
- children: (_a = option === null || option === void 0 ? void 0 : option.content) !== null && _a !== void 0 ? _a : '',
263
- paddingx: 0,
264
- paddingy: 0,
265
- dark: true
266
- }) : option === null || option === void 0 ? void 0 : option.content
267
- }, index$1);
268
- }) : null
269
- }), jsxRuntime.jsx(MaterialQuizAnswerExplanation.default, {})]
270
- })]
271
- })
272
- });
182
+ }]
183
+ }, React.createElement(material.Stack, {
184
+ height: "100%",
185
+ gap: "1rem"
186
+ }, hasInlinePassage && React.createElement("div", {
187
+ id: element.MATERIAL_QUIZ_PASSIVE_ID,
188
+ ref: questionRef
189
+ }, React.createElement(MaterialQuizInfo.default, {
190
+ renderWithBox: false
191
+ })), React.createElement("div", {
192
+ id: element.MATERIAL_QUIZ_ANSWER_ID
193
+ }, React.createElement(QuestionCheckbox.default, {
194
+ onSelect: handleAnswerSelect,
195
+ selectedOptions: selectedAnswer,
196
+ disabled: submitStatus === 'pending' || index.checkUserLectureTestEnded(lecture) || !!userId
197
+ }, (materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.options) && course ? materialQuiz.options.map((option, index$1) => {
198
+ var _a;
199
+ const getIsSelected = (index, materialQuizResponse) => {
200
+ var _a;
201
+ if (!materialQuizResponse) {
202
+ return false;
203
+ }
204
+ const materialQuizResponseAnswer = materialQuizResponse.answer;
205
+ return (_a = materialQuizResponseAnswer.includes(index)) !== null && _a !== void 0 ? _a : false;
206
+ };
207
+ const status = index.getOptionStatus({
208
+ materialQuizResponse,
209
+ isSelected: getIsSelected(index$1, materialQuizResponse),
210
+ isActive
211
+ });
212
+ const materialQuizAnswerInfo = materialQuiz.answerInfo;
213
+ return React.createElement(QuestionCheckboxOption.default, {
214
+ key: index$1,
215
+ value: index$1,
216
+ status: status,
217
+ isAnswer: !!userId && Array.isArray(materialQuizAnswerInfo) && materialQuizAnswerInfo.includes(index$1)
218
+ }, course.preference.renderMarkdownInQuizOptions ? React.createElement(StyledMarkdown.default, {
219
+ children: (_a = option === null || option === void 0 ? void 0 : option.content) !== null && _a !== void 0 ? _a : '',
220
+ paddingx: 0,
221
+ paddingy: 0,
222
+ dark: true
223
+ }) : option === null || option === void 0 ? void 0 : option.content);
224
+ }) : null), React.createElement(MaterialQuizAnswerExplanation.default, null))));
273
225
  };
274
226
 
275
227
  exports.default = MaterialQuizSelectMultiple;