@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,25 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
3
4
|
var tslib = require('tslib');
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
6
|
var React = require('react');
|
|
5
7
|
var reactUse = require('react-use');
|
|
6
8
|
var wysiwyg = require('@elice/wysiwyg');
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
13
|
+
|
|
14
|
+
var STATE_SYNC_DEBOUNCE_TIME = 50;
|
|
15
|
+
var MarkdownEditor = function MarkdownEditor(_a) {
|
|
16
|
+
var value = _a.value,
|
|
17
|
+
onChange = _a.onChange,
|
|
14
18
|
props = tslib.__rest(_a, ["value", "onChange"]);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
var _React$useState = React__default.default.useState(value),
|
|
20
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
21
|
+
__value = _React$useState2[0],
|
|
22
|
+
__setValue = _React$useState2[1];
|
|
23
|
+
reactUse.useDebounce(function () {
|
|
24
|
+
return __setValue(value);
|
|
25
|
+
}, STATE_SYNC_DEBOUNCE_TIME, [value]);
|
|
26
|
+
reactUse.useDebounce(function () {
|
|
18
27
|
if (__value !== value && typeof onChange === 'function') {
|
|
19
28
|
onChange(__value !== null && __value !== void 0 ? __value : '');
|
|
20
29
|
}
|
|
21
30
|
}, STATE_SYNC_DEBOUNCE_TIME, [__value]);
|
|
22
|
-
return
|
|
31
|
+
return jsxRuntime.jsx(wysiwyg.EliceWysiwygEditor, Object.assign({
|
|
23
32
|
value: value,
|
|
24
33
|
onChange: __setValue
|
|
25
34
|
}, props));
|
|
@@ -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 reactUse = require('react-use');
|
|
7
9
|
var designTokens = require('@elice/design-tokens');
|
|
@@ -17,123 +19,152 @@ var ko = require('./locales/ko.json.js');
|
|
|
17
19
|
var MaterialQuizShimmer = require('./MaterialQuizShimmer.js');
|
|
18
20
|
var MaterialQuizInfo = require('./MaterialQuizInfo.js');
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
23
|
+
|
|
24
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
25
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
26
|
+
|
|
27
|
+
var eliceTheme = muiSystem.createEliceTheme({
|
|
21
28
|
paletteMode: 'dark',
|
|
22
29
|
paletteName: 'purple'
|
|
23
30
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
var AsyncMaterialQuizSelectMultiple = React__default.default.lazy(function () {
|
|
32
|
+
return Promise.resolve().then(function () { return require('./MaterialQuizSelectMultiple.js'); });
|
|
33
|
+
});
|
|
34
|
+
var AsyncMaterialQuizSelectMultipleOrder = React__default.default.lazy(function () {
|
|
35
|
+
return Promise.resolve().then(function () { return require('./MaterialQuizSelectMultipleOrder.js'); });
|
|
36
|
+
});
|
|
37
|
+
var AsyncMaterialQuizText = React__default.default.lazy(function () {
|
|
38
|
+
return Promise.resolve().then(function () { return require('./MaterialQuizText.js'); });
|
|
39
|
+
});
|
|
40
|
+
var AsyncMaterialQuizSelectOne = React__default.default.lazy(function () {
|
|
41
|
+
return Promise.resolve().then(function () { return require('./MaterialQuizSelectOne.js'); });
|
|
42
|
+
});
|
|
43
|
+
var AsyncMaterialQuizGroup = React__default.default.lazy(function () {
|
|
44
|
+
return Promise.resolve().then(function () { return require('./material-quiz-group/index.js'); });
|
|
45
|
+
});
|
|
29
46
|
// 746px
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
var MAX_CONTENT_WIDTH = '46.625rem';
|
|
48
|
+
var StyledMaterialQuizInfo = styled__default.default.div.withConfig({
|
|
32
49
|
componentId: "sc-1eyn8fb-0"
|
|
33
50
|
})([""]);
|
|
34
|
-
|
|
51
|
+
var StyledMaterialQuizContent = styled__default.default.div.withConfig({
|
|
35
52
|
componentId: "sc-1eyn8fb-1"
|
|
36
|
-
})(["position:relative;z-index:0;min-width:0;margin:", ";height:100%;"], ({
|
|
37
|
-
vertical
|
|
38
|
-
|
|
39
|
-
|
|
53
|
+
})(["position:relative;z-index:0;min-width:0;margin:", ";height:100%;"], function (_ref) {
|
|
54
|
+
var vertical = _ref.vertical;
|
|
55
|
+
return vertical ? 'unset' : 'auto';
|
|
56
|
+
});
|
|
57
|
+
var LoadingContainer = styled__default.default.div.withConfig({
|
|
40
58
|
componentId: "sc-1eyn8fb-2"
|
|
41
59
|
})(["position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;max-width:none !important;background-color:", ";"], designTokens.base.color.navy8);
|
|
42
|
-
|
|
60
|
+
var StyledMaterialQuizWrapper = styled__default.default.div.withConfig({
|
|
43
61
|
componentId: "sc-1eyn8fb-3"
|
|
44
|
-
})(["-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;width:100%;height:100%;flex-direction:", ";position:relative;& > *{flex:", ";max-width:", ";}gap:1rem;", "{height:", ";overflow-y:", ";& > div{max-height:unset;}}"], ({
|
|
45
|
-
vertical
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
vertical
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
})(["-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:flex;width:100%;height:100%;flex-direction:", ";position:relative;& > *{flex:", ";max-width:", ";}gap:1rem;", "{height:", ";overflow-y:", ";& > div{max-height:unset;}}"], function (_ref2) {
|
|
63
|
+
var vertical = _ref2.vertical;
|
|
64
|
+
return vertical ? 'column' : 'row';
|
|
65
|
+
}, function (_ref3) {
|
|
66
|
+
var vertical = _ref3.vertical;
|
|
67
|
+
return vertical ? 'auto' : '1';
|
|
68
|
+
}, function (_ref4) {
|
|
69
|
+
var vertical = _ref4.vertical,
|
|
70
|
+
isQuizGroupType = _ref4.isQuizGroupType,
|
|
71
|
+
isLongPassage = _ref4.isLongPassage;
|
|
72
|
+
return !isLongPassage && !vertical && !isQuizGroupType ? "".concat(MAX_CONTENT_WIDTH) : 'unset';
|
|
73
|
+
}, StyledMaterialQuizInfo, function (_ref5) {
|
|
74
|
+
var vertical = _ref5.vertical;
|
|
75
|
+
return vertical ? 'auto' : '100%';
|
|
76
|
+
}, function (_ref6) {
|
|
77
|
+
var vertical = _ref6.vertical;
|
|
78
|
+
return vertical ? 'intial' : 'auto';
|
|
79
|
+
});
|
|
80
|
+
var MaterialQuiz = function MaterialQuiz() {
|
|
81
|
+
var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
|
|
82
|
+
materialQuiz = _useMaterialQuizState.materialQuiz,
|
|
83
|
+
vertical = _useMaterialQuizState.vertical,
|
|
84
|
+
course = _useMaterialQuizState.course,
|
|
85
|
+
isLongPassage = _useMaterialQuizState.isLongPassage,
|
|
86
|
+
isInitialLoading = _useMaterialQuizState.isInitialLoading;
|
|
87
|
+
var _useMaterialQuizDispa = MaterialQuizContext.useMaterialQuizDispatch(),
|
|
88
|
+
setVertical = _useMaterialQuizDispa.setVertical;
|
|
89
|
+
var _useMeasure = reactUse.useMeasure(),
|
|
90
|
+
_useMeasure2 = _rollupPluginBabelHelpers.slicedToArray(_useMeasure, 2),
|
|
91
|
+
ref = _useMeasure2[0],
|
|
92
|
+
width = _useMeasure2[1].width;
|
|
93
|
+
var isQuizGroupType = Boolean((materialQuiz === null || materialQuiz === void 0 ? void 0 : materialQuiz.optionType) === types.enums.QuizOptionType.Group);
|
|
94
|
+
var isFetchingData = !materialQuiz || !course;
|
|
95
|
+
var isLoadingLayout = isFetchingData || isInitialLoading;
|
|
96
|
+
var isVisibleSideBySide = !vertical && isLongPassage;
|
|
97
|
+
var isRenderQuestionWithPassage = (vertical || !isLongPassage || isQuizGroupType) && !!materialQuiz;
|
|
98
|
+
React__default.default.useEffect(function () {
|
|
77
99
|
if (width > 0) {
|
|
78
100
|
setVertical(width <= designTokens.base.screen.medium);
|
|
79
101
|
}
|
|
80
102
|
}, [width, setVertical]);
|
|
81
|
-
|
|
103
|
+
var renderQuestionOption = function renderQuestionOption() {
|
|
82
104
|
if (isFetchingData) {
|
|
83
105
|
return null;
|
|
84
106
|
}
|
|
85
107
|
switch (materialQuiz.optionType) {
|
|
86
108
|
case types.enums.QuizOptionType.SelectOne:
|
|
87
|
-
return
|
|
109
|
+
return jsxRuntime.jsx(AsyncMaterialQuizSelectOne, {
|
|
88
110
|
hasInlinePassage: isRenderQuestionWithPassage
|
|
89
111
|
});
|
|
90
112
|
case types.enums.QuizOptionType.SelectMultiple:
|
|
91
|
-
return
|
|
113
|
+
return jsxRuntime.jsx(AsyncMaterialQuizSelectMultiple, {
|
|
92
114
|
hasInlinePassage: isRenderQuestionWithPassage
|
|
93
115
|
});
|
|
94
116
|
case types.enums.QuizOptionType.Text:
|
|
95
|
-
return
|
|
117
|
+
return jsxRuntime.jsx(AsyncMaterialQuizText, {
|
|
96
118
|
hasInlinePassage: isRenderQuestionWithPassage
|
|
97
119
|
});
|
|
98
120
|
case types.enums.QuizOptionType.SelectMultipleOrder:
|
|
99
|
-
return
|
|
121
|
+
return jsxRuntime.jsx(AsyncMaterialQuizSelectMultipleOrder, {
|
|
100
122
|
hasInlinePassage: isRenderQuestionWithPassage
|
|
101
123
|
});
|
|
102
124
|
case types.enums.QuizOptionType.Group:
|
|
103
|
-
return
|
|
125
|
+
return jsxRuntime.jsx(AsyncMaterialQuizGroup, {});
|
|
104
126
|
}
|
|
105
127
|
};
|
|
106
|
-
return
|
|
107
|
-
fallback: null
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
128
|
+
return jsxRuntime.jsx(React__default.default.Suspense, {
|
|
129
|
+
fallback: null,
|
|
130
|
+
children: jsxRuntime.jsxs(StyledMaterialQuizWrapper, {
|
|
131
|
+
ref: ref,
|
|
132
|
+
vertical: vertical,
|
|
133
|
+
isQuizGroupType: isQuizGroupType,
|
|
134
|
+
isLongPassage: isLongPassage,
|
|
135
|
+
children: [isLoadingLayout && jsxRuntime.jsx(LoadingContainer, {
|
|
136
|
+
children: jsxRuntime.jsx(MaterialQuizShimmer.default, {})
|
|
137
|
+
}), isVisibleSideBySide && jsxRuntime.jsx(StyledMaterialQuizInfo, {
|
|
138
|
+
children: jsxRuntime.jsx(MaterialQuizInfo.default, {})
|
|
139
|
+
}), jsxRuntime.jsx(StyledMaterialQuizContent, {
|
|
140
|
+
id: element.MATERIAL_QUIZ_CONTAINER_ID,
|
|
141
|
+
vertical: vertical,
|
|
142
|
+
children: renderQuestionOption()
|
|
143
|
+
})]
|
|
144
|
+
})
|
|
145
|
+
});
|
|
117
146
|
};
|
|
118
|
-
|
|
119
|
-
materialQuizId,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
var MaterialQuizContainer = function MaterialQuizContainer(_ref7) {
|
|
148
|
+
var materialQuizId = _ref7.materialQuizId,
|
|
149
|
+
userId = _ref7.userId,
|
|
150
|
+
onDirty = _ref7.onDirty,
|
|
151
|
+
onSubmit = _ref7.onSubmit,
|
|
152
|
+
onNext = _ref7.onNext,
|
|
153
|
+
__intl = _ref7.__intl;
|
|
154
|
+
return jsxRuntime.jsx(intl.RawEliceIntlProvider, {
|
|
155
|
+
value: __intl,
|
|
156
|
+
children: jsxRuntime.jsx(material.ThemeProvider, {
|
|
157
|
+
theme: eliceTheme,
|
|
158
|
+
children: jsxRuntime.jsx(MaterialQuizContext.MaterialQuizProvider, {
|
|
159
|
+
materialQuizId: materialQuizId,
|
|
160
|
+
userId: userId,
|
|
161
|
+
onDirty: onDirty,
|
|
162
|
+
onSubmit: onSubmit,
|
|
163
|
+
onNext: onNext,
|
|
164
|
+
children: jsxRuntime.jsx(MaterialQuiz, {})
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
});
|
|
137
168
|
};
|
|
138
169
|
var MaterialQuiz$1 = new intl.IntlComponentBuilder(MaterialQuizContainer).add('en', en.default).add('ko', ko.default).addAsync('th', Promise.resolve().then(function () { return require('./locales/th.json.js'); })).addAsync('ja', Promise.resolve().then(function () { return require('./locales/ja.json.js'); })).build();
|
|
139
170
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var blocks = require('@elice/blocks');
|
|
7
7
|
var designTokens = require('@elice/design-tokens');
|
|
8
8
|
var intl = require('@elice/intl');
|
|
@@ -12,42 +12,49 @@ var wysiwyg = require('@elice/wysiwyg');
|
|
|
12
12
|
var styled = require('styled-components');
|
|
13
13
|
var MaterialQuizContext = require('./context/MaterialQuizContext.js');
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
16
|
+
|
|
17
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
18
|
+
|
|
19
|
+
var StyledMarkdownSSR = styled__default.default(markdown.MarkdownSSR).withConfig({
|
|
16
20
|
componentId: "sc-18kg5i5-0"
|
|
17
21
|
})(["p{margin:0 !important;}", ""], wysiwyg.EliceWysiwygEditorTheme.resetMarkdownSSR);
|
|
18
|
-
|
|
22
|
+
var StyledAccordion = styled__default.default(blocks.Accordion).withConfig({
|
|
19
23
|
componentId: "sc-18kg5i5-1"
|
|
20
24
|
})(["border-radius:8px;overflow:hidden;background-color:", " !important;border-radius:8px;overflow:hidden;& > *:first-child{background-color:", " !important;}& > *:last-child{background-color:", " !important;}"], designTokens.base.color.navy5, designTokens.base.color.navy7, designTokens.base.color.navy7);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
lecture,
|
|
24
|
-
materialQuiz
|
|
25
|
-
|
|
26
|
-
const intl$1 = intl.useRawEliceIntl();
|
|
25
|
+
var MaterialQuizAnswerExplanation = function MaterialQuizAnswerExplanation() {
|
|
26
|
+
var _useMaterialQuizState = MaterialQuizContext.useMaterialQuizState(),
|
|
27
|
+
lecture = _useMaterialQuizState.lecture,
|
|
28
|
+
materialQuiz = _useMaterialQuizState.materialQuiz;
|
|
29
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
27
30
|
if (!materialQuiz || !materialQuiz.explanationInfo.isEnabled || !materialQuiz.isResponded || (lecture === null || lecture === void 0 ? void 0 : lecture.lectureType) === types.enums.LectureType.Test && (lecture === null || lecture === void 0 ? void 0 : lecture.testUserStatus) !== types.enums.LectureTestUserStatus.Completed) {
|
|
28
31
|
return null;
|
|
29
32
|
}
|
|
30
|
-
return
|
|
33
|
+
return jsxRuntime.jsx(blocks.Flex, {
|
|
31
34
|
column: true,
|
|
32
|
-
margintop: "1rem"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
margintop: "1rem",
|
|
36
|
+
children: jsxRuntime.jsx(StyledAccordion, {
|
|
37
|
+
dark: true,
|
|
38
|
+
header: jsxRuntime.jsx(blocks.Text, {
|
|
39
|
+
bold: true,
|
|
40
|
+
role: "navy0",
|
|
41
|
+
children: intl$1.formatMessage({
|
|
42
|
+
id: 'materialQuiz.explanation.show'
|
|
43
|
+
})
|
|
44
|
+
}),
|
|
45
|
+
children: materialQuiz.explanationInfo.isEnabled ? jsxRuntime.jsx(StyledMarkdownSSR, {
|
|
46
|
+
dark: true,
|
|
47
|
+
children: materialQuiz.explanationInfo.value
|
|
48
|
+
}) : jsxRuntime.jsx(blocks.Text, {
|
|
49
|
+
role: "info",
|
|
50
|
+
lineHeight: 1.4,
|
|
51
|
+
userSelect: "none",
|
|
52
|
+
children: intl$1.formatMessage({
|
|
53
|
+
id: 'materialQuiz.explanation.empty'
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
});
|
|
51
58
|
};
|
|
52
59
|
|
|
53
60
|
exports.default = MaterialQuizAnswerExplanation;
|