@elice/material-quiz 1.240718.0-trasncript.1 → 1.240718.0-trasncript.2
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.
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +423 -0
- package/cjs/components/eb-sortable/EbDraggable.js +42 -33
- package/cjs/components/eb-sortable/EbDroppable.js +27 -20
- package/cjs/components/markdown-editor/index.d.ts +1 -2
- package/cjs/components/markdown-editor/index.js +19 -10
- package/cjs/components/material-quiz/MaterialQuiz.js +114 -83
- package/cjs/components/material-quiz/MaterialQuizAnswerExplanation.js +36 -29
- package/cjs/components/material-quiz/MaterialQuizInfo.js +151 -149
- package/cjs/components/material-quiz/MaterialQuizSelectMultiple.js +175 -127
- package/cjs/components/material-quiz/MaterialQuizSelectMultipleOrder.js +360 -286
- package/cjs/components/material-quiz/MaterialQuizSelectOne.js +172 -126
- package/cjs/components/material-quiz/MaterialQuizShimmer.js +46 -39
- package/cjs/components/material-quiz/MaterialQuizText.js +163 -115
- package/cjs/components/material-quiz/QuizResultBadge.js +32 -22
- package/cjs/components/material-quiz/QuizSubmitStatusText.js +21 -16
- package/cjs/components/material-quiz/constants/color.js +5 -5
- package/cjs/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
- package/cjs/components/material-quiz/context/MaterialQuizContext.js +156 -93
- package/cjs/components/material-quiz/index.js +9 -0
- package/cjs/components/material-quiz/locales/index.js +13 -0
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +259 -161
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +134 -100
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +130 -101
- package/cjs/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +64 -52
- package/cjs/components/material-quiz/material-quiz-group/context/context.js +5 -1
- package/cjs/components/material-quiz-edit/MaterialQuizEdit.js +47 -36
- package/cjs/components/material-quiz-edit/MaterialQuizEditContent.js +280 -232
- package/cjs/components/material-quiz-edit/context.js +8 -2
- package/cjs/components/material-quiz-edit/index.js +7 -0
- package/cjs/components/material-quiz-edit/locales/index.js +13 -0
- package/cjs/components/material-quiz-edit/options/OptionEditor.js +70 -46
- package/cjs/components/material-quiz-edit/options/OptionSelectMultiple.js +174 -148
- package/cjs/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +175 -149
- package/cjs/components/material-quiz-edit/options/OptionSelectOne.js +164 -144
- package/cjs/components/material-quiz-edit/options/OptionText.js +90 -82
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +156 -112
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +288 -196
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +88 -75
- package/cjs/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +108 -92
- package/cjs/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
- package/cjs/components/material-quiz-edit/utils/editValue.js +21 -12
- package/cjs/components/shared/QuestionBox.js +198 -165
- package/cjs/components/shared/QuizDraggbleDroppedOption.js +11 -12
- package/cjs/components/shared/QuizDraggbleDummyOption.js +23 -16
- package/cjs/components/shared/QuizDraggbleOption.js +65 -59
- package/cjs/components/shared/StyledMarkdown.js +5 -1
- package/cjs/components/shared/index.js +19 -0
- package/cjs/components/shared/question-checkbox/QuestionCheckbox.js +13 -7
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
- package/cjs/components/shared/question-checkbox/QuestionCheckboxContext.js +24 -17
- package/cjs/components/shared/question-checkbox/QuestionCheckboxOption.js +59 -68
- package/cjs/components/shared/question-radio/QuestionRadio.js +13 -7
- package/cjs/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
- package/cjs/components/shared/question-radio/QuestionRadioContext.js +24 -17
- package/cjs/components/shared/question-radio/QuestionRadioOption.js +52 -59
- package/cjs/components/shared/utils/getQuestionStatusStyle.js +7 -9
- package/cjs/components/shared/utils/mergeRefs.js +15 -6
- package/cjs/constant/element.js +3 -3
- package/cjs/constant/index.js +9 -0
- package/cjs/helpers/index.js +8 -10
- package/cjs/hooks/index.js +7 -0
- package/cjs/hooks/useCaculatePassage.js +21 -20
- package/es/_virtual/_rollupPluginBabelHelpers.js +408 -0
- package/es/components/eb-sortable/EbDraggable.js +37 -33
- package/es/components/eb-sortable/EbDroppable.js +22 -20
- package/es/components/markdown-editor/index.d.ts +1 -2
- package/es/components/markdown-editor/index.js +15 -10
- package/es/components/material-quiz/MaterialQuiz.js +109 -83
- package/es/components/material-quiz/MaterialQuizAnswerExplanation.js +32 -29
- package/es/components/material-quiz/MaterialQuizInfo.js +148 -150
- package/es/components/material-quiz/MaterialQuizSelectMultiple.js +171 -127
- package/es/components/material-quiz/MaterialQuizSelectMultipleOrder.js +356 -287
- package/es/components/material-quiz/MaterialQuizSelectOne.js +168 -126
- package/es/components/material-quiz/MaterialQuizShimmer.js +42 -39
- package/es/components/material-quiz/MaterialQuizText.js +158 -115
- package/es/components/material-quiz/QuizResultBadge.js +27 -22
- package/es/components/material-quiz/QuizSubmitStatusText.js +17 -16
- package/es/components/material-quiz/constants/color.js +5 -5
- package/es/components/material-quiz/context/MaterialQuizContext.d.ts +1 -1
- package/es/components/material-quiz/context/MaterialQuizContext.js +153 -94
- package/es/components/material-quiz/index.js +2 -0
- package/es/components/material-quiz/locales/index.js +4 -0
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroup.js +253 -161
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupDesktop.js +129 -100
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupMobile.js +125 -101
- package/es/components/material-quiz/material-quiz-group/MaterialQuizGroupOptionItem.js +60 -52
- package/es/components/material-quiz/material-quiz-group/context/context.js +1 -1
- package/es/components/material-quiz-edit/MaterialQuizEdit.js +43 -36
- package/es/components/material-quiz-edit/MaterialQuizEditContent.js +272 -229
- package/es/components/material-quiz-edit/context.js +4 -2
- package/es/components/material-quiz-edit/index.js +1 -0
- package/es/components/material-quiz-edit/locales/index.js +4 -0
- package/es/components/material-quiz-edit/options/OptionEditor.js +64 -46
- package/es/components/material-quiz-edit/options/OptionSelectMultiple.js +170 -148
- package/es/components/material-quiz-edit/options/OptionSelectMultipleOrder.js +171 -149
- package/es/components/material-quiz-edit/options/OptionSelectOne.js +159 -144
- package/es/components/material-quiz-edit/options/OptionText.js +86 -82
- package/es/components/material-quiz-edit/options/options-group/OptionGroup.js +9 -8
- package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerInfo.js +151 -112
- package/es/components/material-quiz-edit/options/options-group/OptionGroupAnswerListItem.js +283 -197
- package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupInfo.js +83 -75
- package/es/components/material-quiz-edit/options/options-group/OptionGroupGroupListItem.js +103 -92
- package/es/components/material-quiz-edit/utils/checkTwoDimensionArray.js +5 -1
- package/es/components/material-quiz-edit/utils/editValue.js +17 -12
- package/es/components/shared/QuestionBox.js +192 -165
- package/es/components/shared/QuizDraggbleDroppedOption.js +11 -12
- package/es/components/shared/QuizDraggbleDummyOption.js +19 -16
- package/es/components/shared/QuizDraggbleOption.js +61 -59
- package/es/components/shared/StyledMarkdown.js +1 -1
- package/es/components/shared/index.js +7 -0
- package/es/components/shared/question-checkbox/QuestionCheckbox.js +9 -7
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.d.ts +1 -1
- package/es/components/shared/question-checkbox/QuestionCheckboxContext.js +20 -17
- package/es/components/shared/question-checkbox/QuestionCheckboxOption.js +54 -68
- package/es/components/shared/question-radio/QuestionRadio.js +9 -7
- package/es/components/shared/question-radio/QuestionRadioContext.d.ts +1 -1
- package/es/components/shared/question-radio/QuestionRadioContext.js +20 -17
- package/es/components/shared/question-radio/QuestionRadioOption.js +47 -59
- package/es/components/shared/utils/getQuestionStatusStyle.js +7 -9
- package/es/components/shared/utils/mergeRefs.js +15 -6
- package/es/constant/element.js +3 -3
- package/es/constant/index.js +1 -0
- package/es/helpers/index.js +8 -10
- package/es/hooks/index.js +1 -0
- package/es/hooks/useCaculatePassage.js +21 -20
- package/package.json +12 -15
|
@@ -2,6 +2,8 @@
|
|
|
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');
|
|
5
7
|
var React = require('react');
|
|
6
8
|
var apiClient = require('@elice/api-client');
|
|
7
9
|
var blocks = require('@elice/blocks');
|
|
@@ -24,80 +26,92 @@ var MaterialQuizInfo = require('./MaterialQuizInfo.js');
|
|
|
24
26
|
var QuizResultBadge = require('./QuizResultBadge.js');
|
|
25
27
|
var QuizSubmitStatusText = require('./QuizSubmitStatusText.js');
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
30
|
+
|
|
31
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
32
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
33
|
+
|
|
34
|
+
var StyledVerticalDivider = styled__default.default.div.withConfig({
|
|
28
35
|
componentId: "sc-10067nt-0"
|
|
29
|
-
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none !important;padding:1rem;", ""], ({
|
|
30
|
-
vertical
|
|
31
|
-
|
|
32
|
-
return vertical ? `
|
|
33
|
-
display: none;
|
|
34
|
-
` : '';
|
|
36
|
+
})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex:none !important;padding:1rem;", ""], function (_ref) {
|
|
37
|
+
var vertical = _ref.vertical;
|
|
38
|
+
return vertical ? "\n display: none;\n " : '';
|
|
35
39
|
});
|
|
36
|
-
|
|
40
|
+
var StyledHorizontalDivider = styled__default.default.hr.withConfig({
|
|
37
41
|
componentId: "sc-10067nt-1"
|
|
38
|
-
})(["display:none;", ""], ({
|
|
39
|
-
vertical
|
|
40
|
-
|
|
41
|
-
return vertical ? `
|
|
42
|
-
display: block;
|
|
43
|
-
margin: 1rem 0;
|
|
44
|
-
width: 100%;
|
|
45
|
-
border: solid 1px ${designTokens.base.color.navy5};
|
|
46
|
-
` : '';
|
|
42
|
+
})(["display:none;", ""], function (_ref2) {
|
|
43
|
+
var vertical = _ref2.vertical;
|
|
44
|
+
return vertical ? "\n display: block;\n margin: 1rem 0;\n width: 100%;\n border: solid 1px ".concat(designTokens.base.color.navy5, ";\n ") : '';
|
|
47
45
|
});
|
|
48
|
-
|
|
46
|
+
var StyledQuizOptionsDropZone = styled__default.default(EbDroppable.default).withConfig({
|
|
49
47
|
componentId: "sc-10067nt-2"
|
|
50
48
|
})(["display:flex;flex-direction:column;flex:1 1 50%;padding:1rem;border-radius:8px;background-color:", ";&.ui-droppable-hover{outline:1px dashed ", ";margin:1px 0;}"], designTokens.base.color.navy7, designTokens.base.color.gray4);
|
|
51
|
-
|
|
49
|
+
var StyledQuizAnswersDropZone = styled__default.default.div.withConfig({
|
|
52
50
|
componentId: "sc-10067nt-3"
|
|
53
51
|
})(["position:relative;display:flex;flex-direction:column;flex:1 1 50%;padding:1rem;border-radius:8px;background-color:", ";"], designTokens.base.color.navy6);
|
|
54
|
-
|
|
52
|
+
var StyledOptionBox = styled__default.default.div.withConfig({
|
|
55
53
|
componentId: "sc-10067nt-4"
|
|
56
|
-
})(["display:flex;", ""], ({
|
|
57
|
-
vertical
|
|
58
|
-
|
|
59
|
-
return vertical ? `
|
|
60
|
-
flex-direction: column;
|
|
61
|
-
` : '';
|
|
54
|
+
})(["display:flex;", ""], function (_ref3) {
|
|
55
|
+
var vertical = _ref3.vertical;
|
|
56
|
+
return vertical ? "\n flex-direction: column;\n " : '';
|
|
62
57
|
});
|
|
63
|
-
|
|
64
|
-
hasInlinePassage
|
|
65
|
-
}) => {
|
|
58
|
+
var MaterialQuizSelectMultipleOrder = function MaterialQuizSelectMultipleOrder(_ref4) {
|
|
59
|
+
var hasInlinePassage = _ref4.hasInlinePassage;
|
|
66
60
|
// context
|
|
67
|
-
|
|
68
|
-
lecture,
|
|
69
|
-
materialQuiz,
|
|
70
|
-
userId,
|
|
71
|
-
vertical,
|
|
72
|
-
course
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
} = MaterialQuizContext.useMaterialQuizDispatch();
|
|
80
|
-
const theme = material.useTheme();
|
|
61
|
+
var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
|
|
62
|
+
lecture = _useMaterialQuizState.lecture,
|
|
63
|
+
materialQuiz = _useMaterialQuizState.materialQuiz,
|
|
64
|
+
userId = _useMaterialQuizState.userId,
|
|
65
|
+
vertical = _useMaterialQuizState.vertical,
|
|
66
|
+
course = _useMaterialQuizState.course;
|
|
67
|
+
var _useMaterialQuizDispa = MaterialQuizContext.useMaterialQuizDispatch(),
|
|
68
|
+
onSubmit = _useMaterialQuizDispa.onSubmit,
|
|
69
|
+
onNext = _useMaterialQuizDispa.onNext,
|
|
70
|
+
refreshOrgMaterialQuiz = _useMaterialQuizDispa.refreshOrgMaterialQuiz,
|
|
71
|
+
onDirty = _useMaterialQuizDispa.onDirty;
|
|
72
|
+
var theme = material.useTheme();
|
|
81
73
|
// state
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
74
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
75
|
+
var _React$useState = React__default.default.useState(),
|
|
76
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
77
|
+
materialQuizResponse = _React$useState2[0],
|
|
78
|
+
setMaterialQuizResponse = _React$useState2[1];
|
|
79
|
+
var _React$useState3 = React__default.default.useState('idle'),
|
|
80
|
+
_React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
|
|
81
|
+
submitStatus = _React$useState4[0],
|
|
82
|
+
setSubmitStatus = _React$useState4[1];
|
|
83
|
+
var _React$useState5 = React__default.default.useState(false),
|
|
84
|
+
_React$useState6 = _rollupPluginBabelHelpers.slicedToArray(_React$useState5, 2),
|
|
85
|
+
isActive = _React$useState6[0],
|
|
86
|
+
setIsActive = _React$useState6[1];
|
|
87
|
+
var _useCaculatePassage = useCaculatePassage.useCaculatePassage(),
|
|
88
|
+
containerRef = _useCaculatePassage.containerRef,
|
|
89
|
+
questionRef = _useCaculatePassage.questionRef;
|
|
90
|
+
var _React$useState7 = React__default.default.useState([]),
|
|
91
|
+
_React$useState8 = _rollupPluginBabelHelpers.slicedToArray(_React$useState7, 2),
|
|
92
|
+
optionList = _React$useState8[0],
|
|
93
|
+
setOptionList = _React$useState8[1];
|
|
94
|
+
var _React$useState9 = React__default.default.useState([]),
|
|
95
|
+
_React$useState10 = _rollupPluginBabelHelpers.slicedToArray(_React$useState9, 2),
|
|
96
|
+
answerList = _React$useState10[0],
|
|
97
|
+
setAnswerList = _React$useState10[1];
|
|
98
|
+
var _React$useState11 = React__default.default.useState([]),
|
|
99
|
+
_React$useState12 = _rollupPluginBabelHelpers.slicedToArray(_React$useState11, 2),
|
|
100
|
+
correctAnswerList = _React$useState12[0],
|
|
101
|
+
setCorrectAnswerList = _React$useState12[1];
|
|
102
|
+
var _React$useState13 = React__default.default.useState(false),
|
|
103
|
+
_React$useState14 = _rollupPluginBabelHelpers.slicedToArray(_React$useState13, 2),
|
|
104
|
+
hasSubmitted = _React$useState14[0],
|
|
105
|
+
setHasSubmitted = _React$useState14[1];
|
|
106
|
+
var isNextActive = hasSubmitted && typeof onNext === 'function';
|
|
107
|
+
var isDisabled = (materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.correctOptionCount) !== answerList.filter(function (answer) {
|
|
108
|
+
return answer.order !== null;
|
|
109
|
+
}).length || !!userId;
|
|
96
110
|
// ref
|
|
97
|
-
|
|
111
|
+
var optionBoxRef = React__default.default.useRef(null);
|
|
98
112
|
// to make jquery touchable
|
|
99
|
-
|
|
100
|
-
|
|
113
|
+
React__default.default.useEffect(function () {
|
|
114
|
+
var optionBoxElement = optionBoxRef.current;
|
|
101
115
|
if (!optionBoxElement) {
|
|
102
116
|
return;
|
|
103
117
|
}
|
|
@@ -106,9 +120,9 @@ const MaterialQuizSelectMultipleOrder = ({
|
|
|
106
120
|
* credit: http://stackoverflow.com/a/6141093
|
|
107
121
|
*/
|
|
108
122
|
function touchHandler(event) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
123
|
+
var touches = event.changedTouches;
|
|
124
|
+
var first = touches[0];
|
|
125
|
+
var type = '';
|
|
112
126
|
switch (event.type) {
|
|
113
127
|
case 'touchstart':
|
|
114
128
|
type = 'mousedown';
|
|
@@ -125,7 +139,7 @@ const MaterialQuizSelectMultipleOrder = ({
|
|
|
125
139
|
// initMouseEvent(type, canBubble, cancelable, view, clickCount,
|
|
126
140
|
// screenX, screenY, clientX, clientY, ctrlKey,
|
|
127
141
|
// altKey, shiftKey, metaKey, button, relatedTarget);
|
|
128
|
-
|
|
142
|
+
var simulatedEvent = document.createEvent('MouseEvent');
|
|
129
143
|
simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0 /*left*/, null);
|
|
130
144
|
first.target.dispatchEvent(simulatedEvent);
|
|
131
145
|
event.preventDefault();
|
|
@@ -134,7 +148,7 @@ const MaterialQuizSelectMultipleOrder = ({
|
|
|
134
148
|
optionBoxElement.addEventListener('touchmove', touchHandler, true);
|
|
135
149
|
optionBoxElement.addEventListener('touchend', touchHandler, true);
|
|
136
150
|
optionBoxElement.addEventListener('touchcancel', touchHandler, true);
|
|
137
|
-
return ()
|
|
151
|
+
return function () {
|
|
138
152
|
optionBoxElement.removeEventListener('touchstart', touchHandler, true);
|
|
139
153
|
optionBoxElement.removeEventListener('touchmove', touchHandler, true);
|
|
140
154
|
optionBoxElement.removeEventListener('touchend', touchHandler, true);
|
|
@@ -142,44 +156,48 @@ const MaterialQuizSelectMultipleOrder = ({
|
|
|
142
156
|
};
|
|
143
157
|
}, []);
|
|
144
158
|
// quiz response fetcher
|
|
145
|
-
|
|
159
|
+
React__default.default.useEffect(function () {
|
|
146
160
|
var _a, _b;
|
|
147
161
|
if (!userId && (materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.lastQuizResponseId)) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
signal
|
|
151
|
-
} = controller;
|
|
162
|
+
var controller = new AbortController();
|
|
163
|
+
var signal = controller.signal;
|
|
152
164
|
apiClient.getOrgMaterialQuizResponseGet({
|
|
153
165
|
quizResponseId: materialQuiz.lastQuizResponseId
|
|
154
166
|
}, {
|
|
155
|
-
signal
|
|
156
|
-
}).then(response
|
|
167
|
+
signal: signal
|
|
168
|
+
}).then(function (response) {
|
|
157
169
|
var _a;
|
|
158
170
|
setMaterialQuizResponse(response.quizResponse);
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
171
|
+
var answer = response.quizResponse.answer; // user submitted
|
|
172
|
+
var options = (_a = materialQuiz.options) !== null && _a !== void 0 ? _a : []; // options
|
|
173
|
+
var answerList = answer.map(function (answer) {
|
|
162
174
|
var _a, _b;
|
|
163
175
|
return {
|
|
164
176
|
order: answer,
|
|
165
177
|
value: (_b = (_a = options[answer]) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : ''
|
|
166
178
|
};
|
|
167
179
|
}, []);
|
|
168
|
-
|
|
180
|
+
var optionList = options.filter(function (item, index) {
|
|
181
|
+
return !answer.includes(index);
|
|
182
|
+
}).map(function (option) {
|
|
169
183
|
var _a;
|
|
170
184
|
return {
|
|
171
|
-
order: options.findIndex(
|
|
185
|
+
order: options.findIndex(function (optionInfo) {
|
|
186
|
+
return optionInfo === option;
|
|
187
|
+
}),
|
|
172
188
|
value: (_a = option === null || option === void 0 ? void 0 : option.content) !== null && _a !== void 0 ? _a : ''
|
|
173
189
|
};
|
|
174
190
|
});
|
|
175
191
|
setAnswerList(answerList);
|
|
176
192
|
setOptionList(optionList);
|
|
177
|
-
}).catch(error
|
|
193
|
+
}).catch(function (error) {
|
|
178
194
|
console.error(error);
|
|
179
195
|
});
|
|
180
|
-
return ()
|
|
196
|
+
return function () {
|
|
197
|
+
return controller.abort();
|
|
198
|
+
};
|
|
181
199
|
} else {
|
|
182
|
-
setOptionList(((_a = materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.options) === null || _a === void 0 ? void 0 : _a.map((option, index)
|
|
200
|
+
setOptionList(((_a = materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.options) === null || _a === void 0 ? void 0 : _a.map(function (option, index) {
|
|
183
201
|
var _a;
|
|
184
202
|
return {
|
|
185
203
|
order: index,
|
|
@@ -188,19 +206,19 @@ const MaterialQuizSelectMultipleOrder = ({
|
|
|
188
206
|
})) || []);
|
|
189
207
|
setAnswerList(Array.from({
|
|
190
208
|
length: (_b = materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.correctOptionCount) !== null && _b !== void 0 ? _b : 0
|
|
191
|
-
}, ()
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
209
|
+
}, function () {
|
|
210
|
+
return {
|
|
211
|
+
order: null,
|
|
212
|
+
value: null
|
|
213
|
+
};
|
|
214
|
+
}));
|
|
195
215
|
}
|
|
196
216
|
}, [materialQuiz, userId]);
|
|
197
217
|
// quiz response fetcher
|
|
198
|
-
|
|
218
|
+
React__default.default.useEffect(function () {
|
|
199
219
|
if (userId && materialQuiz) {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
signal
|
|
203
|
-
} = controller;
|
|
220
|
+
var controller = new AbortController();
|
|
221
|
+
var signal = controller.signal;
|
|
204
222
|
apiClient.getOrgMaterialQuizResponseList({
|
|
205
223
|
materialQuizId: materialQuiz.id,
|
|
206
224
|
filterUserIds: [userId],
|
|
@@ -209,93 +227,130 @@ const MaterialQuizSelectMultipleOrder = ({
|
|
|
209
227
|
offset: 0,
|
|
210
228
|
count: 1
|
|
211
229
|
}, {
|
|
212
|
-
signal
|
|
213
|
-
}).then(response
|
|
230
|
+
signal: signal
|
|
231
|
+
}).then(function (response) {
|
|
214
232
|
var _a, _b, _c;
|
|
215
|
-
|
|
233
|
+
var quizResponse = response.quizResponses[0];
|
|
216
234
|
setMaterialQuizResponse(quizResponse);
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
235
|
+
var answer = (_a = quizResponse === null || quizResponse === void 0 ? void 0 : quizResponse.answer) !== null && _a !== void 0 ? _a : []; // user submitted
|
|
236
|
+
var options = (_b = materialQuiz.options) !== null && _b !== void 0 ? _b : []; // options
|
|
237
|
+
var materialQuizAnswerInfo = materialQuiz.answerInfo;
|
|
238
|
+
var correctAnswerList = Array.isArray(materialQuizAnswerInfo) ? (_c = materialQuizAnswerInfo === null || materialQuizAnswerInfo === void 0 ? void 0 : materialQuizAnswerInfo.map(function (answerInfo) {
|
|
221
239
|
var _a, _b, _c;
|
|
222
240
|
return {
|
|
223
241
|
order: answerInfo,
|
|
224
242
|
value: (_c = (_b = (_a = materialQuiz.options) === null || _a === void 0 ? void 0 : _a[answerInfo]) === null || _b === void 0 ? void 0 : _b.content) !== null && _c !== void 0 ? _c : ''
|
|
225
243
|
};
|
|
226
244
|
})) !== null && _c !== void 0 ? _c : [] : [];
|
|
227
|
-
|
|
245
|
+
var answerList = answer.map(function (answer) {
|
|
228
246
|
var _a, _b;
|
|
229
247
|
return {
|
|
230
248
|
order: answer,
|
|
231
249
|
value: (_b = (_a = options[answer]) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : ''
|
|
232
250
|
};
|
|
233
251
|
}, []);
|
|
234
|
-
|
|
252
|
+
var optionList = options.filter(function (item, index) {
|
|
253
|
+
return !answer.includes(index);
|
|
254
|
+
}).map(function (option) {
|
|
235
255
|
var _a;
|
|
236
256
|
return {
|
|
237
|
-
order: options.findIndex(
|
|
257
|
+
order: options.findIndex(function (optionInfo) {
|
|
258
|
+
return optionInfo === option;
|
|
259
|
+
}),
|
|
238
260
|
value: (_a = option === null || option === void 0 ? void 0 : option.content) !== null && _a !== void 0 ? _a : ''
|
|
239
261
|
};
|
|
240
262
|
});
|
|
241
263
|
setCorrectAnswerList(correctAnswerList);
|
|
242
264
|
setAnswerList(answerList);
|
|
243
265
|
setOptionList(optionList);
|
|
244
|
-
}).catch(error
|
|
266
|
+
}).catch(function (error) {
|
|
245
267
|
console.error(error);
|
|
246
268
|
});
|
|
247
|
-
return ()
|
|
269
|
+
return function () {
|
|
270
|
+
return controller.abort();
|
|
271
|
+
};
|
|
248
272
|
}
|
|
249
273
|
}, [materialQuiz, userId]);
|
|
250
274
|
// submit handler
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
275
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
276
|
+
var _ref5 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee() {
|
|
277
|
+
var _yield$postOrgMateria, quizResponseId, _yield$getOrgMaterial, quizResponse;
|
|
278
|
+
return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
|
|
279
|
+
while (1) switch (_context.prev = _context.next) {
|
|
280
|
+
case 0:
|
|
281
|
+
if (materialQuiz) {
|
|
282
|
+
_context.next = 2;
|
|
283
|
+
break;
|
|
284
|
+
}
|
|
285
|
+
return _context.abrupt("return");
|
|
286
|
+
case 2:
|
|
287
|
+
setSubmitStatus('pending');
|
|
288
|
+
_context.prev = 3;
|
|
289
|
+
_context.next = 6;
|
|
290
|
+
return apiClient.postOrgMaterialQuizResponseAdd({
|
|
291
|
+
materialQuizId: materialQuiz.id,
|
|
292
|
+
answer: answerList.map(function (answer) {
|
|
293
|
+
return answer.order;
|
|
294
|
+
}) // FIXME: Type mismatch
|
|
295
|
+
});
|
|
296
|
+
case 6:
|
|
297
|
+
_yield$postOrgMateria = _context.sent;
|
|
298
|
+
quizResponseId = _yield$postOrgMateria.quizResponseId;
|
|
299
|
+
_context.next = 10;
|
|
300
|
+
return apiClient.getOrgMaterialQuizResponseGet({
|
|
301
|
+
quizResponseId: quizResponseId
|
|
302
|
+
});
|
|
303
|
+
case 10:
|
|
304
|
+
_yield$getOrgMaterial = _context.sent;
|
|
305
|
+
quizResponse = _yield$getOrgMaterial.quizResponse;
|
|
306
|
+
setIsActive(false);
|
|
307
|
+
setHasSubmitted(true);
|
|
308
|
+
setMaterialQuizResponse(quizResponse);
|
|
309
|
+
void refreshOrgMaterialQuiz();
|
|
310
|
+
onSubmit(true, index.getQuizResult(quizResponse));
|
|
311
|
+
setSubmitStatus('resolved');
|
|
312
|
+
onDirty(false);
|
|
313
|
+
_context.next = 26;
|
|
314
|
+
break;
|
|
315
|
+
case 21:
|
|
316
|
+
_context.prev = 21;
|
|
317
|
+
_context.t0 = _context["catch"](3);
|
|
318
|
+
console.error(_context.t0);
|
|
319
|
+
onSubmit(false);
|
|
320
|
+
setSubmitStatus('rejected');
|
|
321
|
+
case 26:
|
|
322
|
+
case "end":
|
|
323
|
+
return _context.stop();
|
|
324
|
+
}
|
|
325
|
+
}, _callee, null, [[3, 21]]);
|
|
326
|
+
}));
|
|
327
|
+
return function handleSubmit() {
|
|
328
|
+
return _ref5.apply(this, arguments);
|
|
329
|
+
};
|
|
330
|
+
}();
|
|
331
|
+
var renderQuizDragOption = function renderQuizDragOption() {
|
|
332
|
+
return jsxRuntime.jsxs(StyledQuizOptionsDropZone, {
|
|
284
333
|
disabled: !!userId,
|
|
285
334
|
accept: ".quiz-answer",
|
|
286
|
-
onDrop: (event, ui)
|
|
335
|
+
onDrop: function onDrop(event, ui) {
|
|
287
336
|
if (index.checkUserLectureTestEnded(lecture)) {
|
|
288
337
|
return;
|
|
289
338
|
}
|
|
290
339
|
setIsActive(true);
|
|
291
340
|
setHasSubmitted(false);
|
|
292
|
-
|
|
293
|
-
setOptionList(prevOptionList
|
|
294
|
-
return [
|
|
341
|
+
var targetId = Number(ui.draggable[0].id);
|
|
342
|
+
setOptionList(function (prevOptionList) {
|
|
343
|
+
return [].concat(_rollupPluginBabelHelpers.toConsumableArray(prevOptionList), [answerList.find(function (answer) {
|
|
344
|
+
return answer.order === targetId;
|
|
345
|
+
})]).sort(function (a, b) {
|
|
346
|
+
return a.order - b.order;
|
|
347
|
+
});
|
|
295
348
|
});
|
|
296
|
-
setAnswerList(prevAnswerList
|
|
297
|
-
|
|
298
|
-
|
|
349
|
+
setAnswerList(function (prevAnswerList) {
|
|
350
|
+
var removingIndex = prevAnswerList.findIndex(function (answer) {
|
|
351
|
+
return answer.order === targetId;
|
|
352
|
+
});
|
|
353
|
+
return prevAnswerList.map(function (answer, answerIndex) {
|
|
299
354
|
if (answerIndex === removingIndex) {
|
|
300
355
|
return {
|
|
301
356
|
order: null,
|
|
@@ -306,117 +361,127 @@ const MaterialQuizSelectMultipleOrder = ({
|
|
|
306
361
|
}
|
|
307
362
|
});
|
|
308
363
|
});
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
})
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
364
|
+
},
|
|
365
|
+
children: [optionList.map(function (option, index) {
|
|
366
|
+
return jsxRuntime.jsx(QuizDraggbleOption.default, {
|
|
367
|
+
disabled: !!userId,
|
|
368
|
+
id: option.order.toString(),
|
|
369
|
+
className: "quiz-option",
|
|
370
|
+
content: option.value,
|
|
371
|
+
isMarkdown: !!(course === null || course === void 0 ? void 0 : course.preference.renderMarkdownInQuizOptions)
|
|
372
|
+
}, option.order);
|
|
373
|
+
}), optionList.length === 0 && !userId ? jsxRuntime.jsx(blocks.Flex, {
|
|
374
|
+
align: "center",
|
|
375
|
+
justify: "center",
|
|
376
|
+
style: {
|
|
377
|
+
minWidth: '200px',
|
|
378
|
+
height: '100%'
|
|
379
|
+
},
|
|
380
|
+
children: jsxRuntime.jsx(blocks.Text, {
|
|
381
|
+
size: "tiny",
|
|
382
|
+
role: "white",
|
|
383
|
+
children: intl$1.formatMessage({
|
|
384
|
+
id: 'materialQuiz.order.answerEmpty'
|
|
385
|
+
})
|
|
386
|
+
})
|
|
387
|
+
}) : null]
|
|
388
|
+
});
|
|
332
389
|
};
|
|
333
|
-
|
|
334
|
-
return
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
339
|
-
const status = index.getQuizResultStatus(materialQuizResponse);
|
|
340
|
-
switch (status) {
|
|
341
|
-
case index.QuizResultStatus.Correct:
|
|
342
|
-
return 'correct';
|
|
343
|
-
case index.QuizResultStatus.Wrong:
|
|
344
|
-
return 'wrong';
|
|
345
|
-
default:
|
|
390
|
+
var renderQuizDragAnswers = function renderQuizDragAnswers() {
|
|
391
|
+
return jsxRuntime.jsx(StyledQuizAnswersDropZone, {
|
|
392
|
+
children: answerList.map(function (option, index$1) {
|
|
393
|
+
var getRole = function getRole() {
|
|
394
|
+
if (isActive) {
|
|
346
395
|
return 'default';
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
396
|
+
}
|
|
397
|
+
var status = index.getQuizResultStatus(materialQuizResponse);
|
|
398
|
+
switch (status) {
|
|
399
|
+
case index.QuizResultStatus.Correct:
|
|
400
|
+
return 'correct';
|
|
401
|
+
case index.QuizResultStatus.Wrong:
|
|
402
|
+
return 'wrong';
|
|
403
|
+
default:
|
|
404
|
+
return 'default';
|
|
405
|
+
}
|
|
406
|
+
};
|
|
407
|
+
if (option.value === null) {
|
|
408
|
+
return jsxRuntime.jsx(QuizDraggbleDummyOption.default, {
|
|
409
|
+
children: intl$1.formatMessage({
|
|
410
|
+
id: 'materialQuiz.selectMultipleOrder.answer.title'
|
|
411
|
+
}),
|
|
412
|
+
indexOrder: index$1 + 1,
|
|
413
|
+
onDrop: function onDrop(event, ui) {
|
|
414
|
+
if (index.checkUserLectureTestEnded(lecture)) {
|
|
415
|
+
return;
|
|
416
|
+
}
|
|
417
|
+
setIsActive(true);
|
|
418
|
+
setHasSubmitted(false);
|
|
419
|
+
onDirty(true);
|
|
420
|
+
// from answerList to answerList
|
|
421
|
+
if (ui.draggable[0].classList.contains('quiz-answer')) {
|
|
422
|
+
var targetOptionId = Number(ui.draggable[0].id);
|
|
423
|
+
setAnswerList(function (prevAnswerList) {
|
|
424
|
+
var newState = _rollupPluginBabelHelpers.toConsumableArray(prevAnswerList);
|
|
425
|
+
var from = newState.find(function (prevAnswer) {
|
|
426
|
+
return prevAnswer.order === targetOptionId;
|
|
427
|
+
});
|
|
428
|
+
var fromIndex = newState.findIndex(function (prevAnswer) {
|
|
429
|
+
return prevAnswer.order === targetOptionId;
|
|
430
|
+
});
|
|
431
|
+
var to = newState[index$1];
|
|
432
|
+
newState[index$1] = from;
|
|
433
|
+
newState[fromIndex] = to;
|
|
434
|
+
return newState;
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
// from option-list to answerList-list
|
|
438
|
+
else {
|
|
439
|
+
var _targetOptionId = Number(ui.draggable[0].id);
|
|
440
|
+
setOptionList(function (prevOptions) {
|
|
441
|
+
return prevOptions.filter(function (prevOption) {
|
|
442
|
+
return prevOption.order !== _targetOptionId;
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
setAnswerList(function (prevAnswerList) {
|
|
446
|
+
return prevAnswerList.map(function (prevAnswer, prevAnswerIndex) {
|
|
447
|
+
var _a, _b;
|
|
448
|
+
if (index$1 === prevAnswerIndex) {
|
|
449
|
+
return {
|
|
450
|
+
order: _targetOptionId,
|
|
451
|
+
value: (_b = (_a = optionList.find(function (option) {
|
|
452
|
+
return option.order === _targetOptionId;
|
|
453
|
+
})) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : ''
|
|
454
|
+
};
|
|
455
|
+
} else {
|
|
456
|
+
return prevAnswer;
|
|
457
|
+
}
|
|
458
|
+
});
|
|
393
459
|
});
|
|
394
|
-
}
|
|
460
|
+
}
|
|
395
461
|
}
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}));
|
|
462
|
+
}, index$1);
|
|
463
|
+
} else {
|
|
464
|
+
return jsxRuntime.jsx(QuizDraggbleDroppedOption.default, {
|
|
465
|
+
id: option.order.toString(),
|
|
466
|
+
content: option.value,
|
|
467
|
+
role: getRole(),
|
|
468
|
+
disabled: !!userId,
|
|
469
|
+
indexOrder: index$1 + 1,
|
|
470
|
+
isMarkdown: !!(course === null || course === void 0 ? void 0 : course.preference.renderMarkdownInQuizOptions)
|
|
471
|
+
}, index$1);
|
|
472
|
+
}
|
|
473
|
+
})
|
|
474
|
+
});
|
|
410
475
|
};
|
|
411
|
-
return
|
|
476
|
+
return jsxRuntime.jsx(QuestionBox.default, {
|
|
412
477
|
title: materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.questionTitle,
|
|
413
478
|
titlePrefix: "Q.",
|
|
414
479
|
onNext: onNext,
|
|
415
480
|
isNextActive: isNextActive,
|
|
416
|
-
submitStatus:
|
|
481
|
+
submitStatus: jsxRuntime.jsx(QuizSubmitStatusText.default, {
|
|
417
482
|
status: submitStatus
|
|
418
483
|
}),
|
|
419
|
-
submitResult:
|
|
484
|
+
submitResult: jsxRuntime.jsx(QuizResultBadge.default, {
|
|
420
485
|
materialQuizResponse: materialQuizResponse
|
|
421
486
|
}),
|
|
422
487
|
bodyContainerRef: containerRef,
|
|
@@ -434,51 +499,60 @@ const MaterialQuizSelectMultipleOrder = ({
|
|
|
434
499
|
backgroundColor: isNextActive ? theme.palette.secondary.main : isDisabled ? designTokens.base.color.gray6 : theme.palette.primary.main,
|
|
435
500
|
color: isNextActive ? theme.palette.secondary.contrastText : isDisabled ? designTokens.base.color.gray3 : theme.palette.primary.contrastText
|
|
436
501
|
}
|
|
437
|
-
}]
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
502
|
+
}],
|
|
503
|
+
children: jsxRuntime.jsxs(material.Stack, {
|
|
504
|
+
height: "100%",
|
|
505
|
+
gap: "1rem",
|
|
506
|
+
children: [hasInlinePassage && jsxRuntime.jsx("div", {
|
|
507
|
+
id: element.MATERIAL_QUIZ_PASSIVE_ID,
|
|
508
|
+
ref: questionRef,
|
|
509
|
+
children: jsxRuntime.jsx(MaterialQuizInfo.default, {
|
|
510
|
+
renderWithBox: false
|
|
511
|
+
})
|
|
512
|
+
}), jsxRuntime.jsxs("div", {
|
|
513
|
+
id: element.MATERIAL_QUIZ_ANSWER_ID,
|
|
514
|
+
children: [jsxRuntime.jsxs(StyledOptionBox, {
|
|
515
|
+
ref: optionBoxRef,
|
|
516
|
+
vertical: vertical,
|
|
517
|
+
children: [renderQuizDragOption(), jsxRuntime.jsx(StyledVerticalDivider, {
|
|
518
|
+
vertical: vertical,
|
|
519
|
+
children: jsxRuntime.jsx(blocks.Icon, {
|
|
520
|
+
size: "elephant",
|
|
521
|
+
icon: icons.eilSortItem,
|
|
522
|
+
rotate: 90,
|
|
523
|
+
style: {
|
|
524
|
+
color: designTokens.base.color.navy3
|
|
525
|
+
}
|
|
526
|
+
})
|
|
527
|
+
}), jsxRuntime.jsx(StyledHorizontalDivider, {
|
|
528
|
+
vertical: vertical
|
|
529
|
+
}), renderQuizDragAnswers()]
|
|
530
|
+
}), !!userId ? jsxRuntime.jsx(blocks.Flex, {
|
|
531
|
+
margintop: "1rem",
|
|
532
|
+
column: true,
|
|
533
|
+
children: jsxRuntime.jsxs(StyledQuizOptionsDropZone, {
|
|
534
|
+
children: [jsxRuntime.jsx(blocks.Text, {
|
|
535
|
+
role: "white",
|
|
536
|
+
size: "small",
|
|
537
|
+
children: intl$1.formatMessage({
|
|
538
|
+
id: 'materialQuiz.answer'
|
|
539
|
+
})
|
|
540
|
+
}), correctAnswerList.map(function (correctAnswer, index) {
|
|
541
|
+
var _a;
|
|
542
|
+
return jsxRuntime.jsx(QuizDraggbleDroppedOption.default, {
|
|
543
|
+
id: (_a = correctAnswer.order) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
544
|
+
content: correctAnswer.value,
|
|
545
|
+
disabled: true,
|
|
546
|
+
role: "correct",
|
|
547
|
+
indexOrder: index + 1,
|
|
548
|
+
isMarkdown: !!(course === null || course === void 0 ? void 0 : course.preference.renderMarkdownInQuizOptions)
|
|
549
|
+
}, correctAnswer.order);
|
|
550
|
+
})]
|
|
551
|
+
})
|
|
552
|
+
}) : null, jsxRuntime.jsx(MaterialQuizAnswerExplanation.default, {})]
|
|
553
|
+
})]
|
|
554
|
+
})
|
|
555
|
+
});
|
|
482
556
|
};
|
|
483
557
|
|
|
484
558
|
exports.default = MaterialQuizSelectMultipleOrder;
|