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