@elice/material-survey 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 +399 -0
- package/cjs/components/markdown-editor/index.d.ts +1 -2
- package/cjs/components/markdown-editor/index.js +19 -10
- package/cjs/components/material-survey/MaterialSurvey.js +82 -57
- package/cjs/components/material-survey/MaterialSurveyInfo.js +69 -59
- package/cjs/components/material-survey/MaterialSurveySelectMultiple.js +131 -90
- package/cjs/components/material-survey/MaterialSurveySelectOne.js +125 -86
- package/cjs/components/material-survey/MaterialSurveyShimmer.js +47 -40
- package/cjs/components/material-survey/MaterialSurveyText.js +114 -75
- package/cjs/components/material-survey/SurveyResultBadge.js +17 -10
- package/cjs/components/material-survey/SurveySubmitStatusText.js +21 -16
- package/cjs/components/material-survey/context/MaterialSurveyContext.d.ts +1 -1
- package/cjs/components/material-survey/context/MaterialSurveyContext.js +115 -74
- package/cjs/components/material-survey/index.js +9 -0
- package/cjs/components/material-survey/locales/index.js +13 -0
- package/cjs/components/material-survey-edit/MaterialSurveyEdit.js +49 -36
- package/cjs/components/material-survey-edit/MaterialSurveyEditContent.js +113 -91
- package/cjs/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +100 -87
- package/cjs/components/material-survey-edit/context.js +8 -2
- package/cjs/components/material-survey-edit/index.js +7 -0
- package/cjs/components/material-survey-edit/locales/index.js +13 -0
- package/cjs/components/material-survey-edit/utils/editValue.js +17 -11
- package/cjs/components/shared/StyledMarkdown.js +5 -1
- package/cjs/components/shared/SurveyContentBox.js +85 -74
- package/cjs/components/shared/index.js +13 -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 +66 -89
- 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 +59 -80
- package/es/_virtual/_rollupPluginBabelHelpers.js +386 -0
- package/es/components/markdown-editor/index.d.ts +1 -2
- package/es/components/markdown-editor/index.js +15 -10
- package/es/components/material-survey/MaterialSurvey.js +77 -57
- package/es/components/material-survey/MaterialSurveyInfo.js +65 -59
- package/es/components/material-survey/MaterialSurveySelectMultiple.js +127 -90
- package/es/components/material-survey/MaterialSurveySelectOne.js +121 -86
- package/es/components/material-survey/MaterialSurveyShimmer.js +43 -40
- package/es/components/material-survey/MaterialSurveyText.js +109 -75
- package/es/components/material-survey/SurveyResultBadge.js +13 -10
- package/es/components/material-survey/SurveySubmitStatusText.js +17 -16
- package/es/components/material-survey/context/MaterialSurveyContext.d.ts +1 -1
- package/es/components/material-survey/context/MaterialSurveyContext.js +112 -75
- package/es/components/material-survey/index.js +2 -0
- package/es/components/material-survey/locales/index.js +4 -0
- package/es/components/material-survey-edit/MaterialSurveyEdit.js +45 -36
- package/es/components/material-survey-edit/MaterialSurveyEditContent.js +107 -90
- package/es/components/material-survey-edit/MaterialSurveyEditOptionSelect.js +96 -87
- package/es/components/material-survey-edit/context.js +4 -2
- package/es/components/material-survey-edit/index.js +1 -0
- package/es/components/material-survey-edit/locales/index.js +4 -0
- package/es/components/material-survey-edit/utils/editValue.js +17 -11
- package/es/components/shared/StyledMarkdown.js +1 -1
- package/es/components/shared/SurveyContentBox.js +81 -74
- package/es/components/shared/index.js +4 -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 +61 -89
- 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 +54 -80
- package/package.json +9 -12
|
@@ -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 markdown = require('@elice/markdown');
|
|
@@ -11,66 +11,76 @@ var styled = require('styled-components');
|
|
|
11
11
|
var SurveyContentBox = require('../shared/SurveyContentBox.js');
|
|
12
12
|
var MaterialSurveyContext = require('./context/MaterialSurveyContext.js');
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
15
|
+
|
|
16
|
+
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
17
|
+
|
|
18
|
+
var StyledMarkdownSSR = styled__default.default(markdown.MarkdownSSR).withConfig({
|
|
15
19
|
componentId: "sc-1b9l43w-0"
|
|
16
20
|
})(["", ""], wysiwyg.EliceWysiwygEditorTheme.resetMarkdownSSR);
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
materialSurvey
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
21
|
+
var MaterialSurveyInfo = function MaterialSurveyInfo() {
|
|
22
|
+
var _useMaterialSurveySta = MaterialSurveyContext.useMaterialSurveyState(),
|
|
23
|
+
materialSurvey = _useMaterialSurveySta.materialSurvey;
|
|
24
|
+
return jsxRuntime.jsxs(SurveyContentBox.default, {
|
|
25
|
+
title: materialSurvey === null || materialSurvey === void 0 ? void 0 : materialSurvey.title,
|
|
26
|
+
children: [materialSurvey ? jsxRuntime.jsxs(blocks.Flex, {
|
|
27
|
+
children: [jsxRuntime.jsx(blocks.Text, {
|
|
28
|
+
bold: true,
|
|
29
|
+
size: "large",
|
|
30
|
+
customStyles: {
|
|
31
|
+
color: designTokens.base.color.primary3,
|
|
32
|
+
marginRight: '0.5rem'
|
|
33
|
+
},
|
|
34
|
+
children: 'Q.'
|
|
35
|
+
}), jsxRuntime.jsx(blocks.Text, {
|
|
36
|
+
bold: true,
|
|
37
|
+
role: "white",
|
|
38
|
+
size: "large",
|
|
39
|
+
wordBreak: "break-word",
|
|
40
|
+
children: materialSurvey.questionInfoList[0].questionTitle
|
|
41
|
+
})]
|
|
42
|
+
}) : jsxRuntime.jsx(blocks.Shimmer, {
|
|
43
|
+
dark: true,
|
|
44
|
+
borderRadius: '4px',
|
|
45
|
+
width: "80%",
|
|
46
|
+
height: '40px'
|
|
47
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
48
|
+
height: 1
|
|
49
|
+
}), materialSurvey ? jsxRuntime.jsx(StyledMarkdownSSR, {
|
|
50
|
+
children: materialSurvey.questionInfoList[0].questionDescription,
|
|
51
|
+
dark: true,
|
|
52
|
+
paddingx: 0,
|
|
53
|
+
paddingy: 0
|
|
54
|
+
}) : jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
55
|
+
children: [jsxRuntime.jsx(blocks.Shimmer, {
|
|
56
|
+
dark: true,
|
|
57
|
+
borderRadius: '4px',
|
|
58
|
+
width: "80%",
|
|
59
|
+
height: '40px'
|
|
60
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
61
|
+
height: 1
|
|
62
|
+
}), jsxRuntime.jsx(blocks.Shimmer, {
|
|
63
|
+
dark: true,
|
|
64
|
+
borderRadius: '4px',
|
|
65
|
+
width: "100%",
|
|
66
|
+
height: '40px'
|
|
67
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
68
|
+
height: 1
|
|
69
|
+
}), jsxRuntime.jsx(blocks.Shimmer, {
|
|
70
|
+
dark: true,
|
|
71
|
+
borderRadius: '4px',
|
|
72
|
+
width: "100%",
|
|
73
|
+
height: '40px'
|
|
74
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
75
|
+
height: 1
|
|
76
|
+
}), jsxRuntime.jsx(blocks.Shimmer, {
|
|
77
|
+
dark: true,
|
|
78
|
+
borderRadius: '4px',
|
|
79
|
+
width: "100%",
|
|
80
|
+
height: '40px'
|
|
81
|
+
})]
|
|
82
|
+
})]
|
|
83
|
+
});
|
|
74
84
|
};
|
|
75
85
|
|
|
76
86
|
exports.default = MaterialSurveyInfo;
|
|
@@ -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 intl = require('@elice/intl');
|
|
@@ -16,52 +18,61 @@ var MaterialSurveyContext = require('./context/MaterialSurveyContext.js');
|
|
|
16
18
|
var SurveyResultBadge = require('./SurveyResultBadge.js');
|
|
17
19
|
var SurveySubmitStatusText = require('./SurveySubmitStatusText.js');
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
22
|
+
|
|
23
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
24
|
+
|
|
25
|
+
var MaterialSurveySelectMultiple = function MaterialSurveySelectMultiple() {
|
|
20
26
|
var _a;
|
|
21
27
|
// context
|
|
22
|
-
|
|
23
|
-
course,
|
|
24
|
-
lecture,
|
|
25
|
-
materialSurvey,
|
|
26
|
-
userId
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
refreshOrgMaterialSurvey
|
|
32
|
-
} = MaterialSurveyContext.useMaterialSurveyDispatch();
|
|
28
|
+
var _useMaterialSurveySta = MaterialSurveyContext.useMaterialSurveyState(),
|
|
29
|
+
course = _useMaterialSurveySta.course,
|
|
30
|
+
lecture = _useMaterialSurveySta.lecture,
|
|
31
|
+
materialSurvey = _useMaterialSurveySta.materialSurvey,
|
|
32
|
+
userId = _useMaterialSurveySta.userId;
|
|
33
|
+
var _useMaterialSurveyDis = MaterialSurveyContext.useMaterialSurveyDispatch(),
|
|
34
|
+
onSubmit = _useMaterialSurveyDis.onSubmit,
|
|
35
|
+
onNext = _useMaterialSurveyDis.onNext,
|
|
36
|
+
refreshOrgMaterialSurvey = _useMaterialSurveyDis.refreshOrgMaterialSurvey;
|
|
33
37
|
// state
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
39
|
+
var _React$useState = React__default.default.useState([]),
|
|
40
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
41
|
+
selectedAnswer = _React$useState2[0],
|
|
42
|
+
setSelectedAnswer = _React$useState2[1];
|
|
43
|
+
var _React$useState3 = React__default.default.useState(),
|
|
44
|
+
_React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
|
|
45
|
+
materialSurveyResponse = _React$useState4[0],
|
|
46
|
+
setMaterialSurveyResponse = _React$useState4[1];
|
|
47
|
+
var _React$useState5 = React__default.default.useState('idle'),
|
|
48
|
+
_React$useState6 = _rollupPluginBabelHelpers.slicedToArray(_React$useState5, 2),
|
|
49
|
+
submitStatus = _React$useState6[0],
|
|
50
|
+
setSubmitStatus = _React$useState6[1];
|
|
38
51
|
// survey response fetcher
|
|
39
|
-
|
|
52
|
+
React__default.default.useEffect(function () {
|
|
40
53
|
if (!userId && (materialSurvey === null || materialSurvey === void 0 ? void 0 : materialSurvey.lastSurveyResponseId)) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
signal
|
|
44
|
-
} = controller;
|
|
54
|
+
var controller = new AbortController();
|
|
55
|
+
var signal = controller.signal;
|
|
45
56
|
apiClient.getOrgMaterialSurveyResponseGet({
|
|
46
57
|
surveyResponseId: materialSurvey.lastSurveyResponseId
|
|
47
58
|
}, {
|
|
48
|
-
signal
|
|
49
|
-
}).then(response
|
|
59
|
+
signal: signal
|
|
60
|
+
}).then(function (response) {
|
|
50
61
|
setMaterialSurveyResponse(response.surveyResponse);
|
|
51
62
|
setSelectedAnswer(response.surveyResponse.answers[0]);
|
|
52
|
-
}).catch(error
|
|
63
|
+
}).catch(function (error) {
|
|
53
64
|
console.error(error);
|
|
54
65
|
});
|
|
55
|
-
return ()
|
|
66
|
+
return function () {
|
|
67
|
+
return controller.abort();
|
|
68
|
+
};
|
|
56
69
|
}
|
|
57
70
|
}, [materialSurvey, userId]);
|
|
58
71
|
// survey response fetcher
|
|
59
|
-
|
|
72
|
+
React__default.default.useEffect(function () {
|
|
60
73
|
if (userId && materialSurvey) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
signal
|
|
64
|
-
} = controller;
|
|
74
|
+
var controller = new AbortController();
|
|
75
|
+
var signal = controller.signal;
|
|
65
76
|
apiClient.getOrgMaterialSurveyResponseList({
|
|
66
77
|
materialSurveyId: materialSurvey.id,
|
|
67
78
|
filterUserIds: [userId],
|
|
@@ -70,10 +81,10 @@ const MaterialSurveySelectMultiple = () => {
|
|
|
70
81
|
offset: 0,
|
|
71
82
|
count: 1
|
|
72
83
|
}, {
|
|
73
|
-
signal
|
|
74
|
-
}).then(response
|
|
75
|
-
|
|
76
|
-
|
|
84
|
+
signal: signal
|
|
85
|
+
}).then(function (response) {
|
|
86
|
+
var surveyResponse = response.surveyResponses[0];
|
|
87
|
+
var getAnswer = function getAnswer() {
|
|
77
88
|
if (!surveyResponse) {
|
|
78
89
|
return [];
|
|
79
90
|
}
|
|
@@ -87,49 +98,75 @@ const MaterialSurveySelectMultiple = () => {
|
|
|
87
98
|
};
|
|
88
99
|
setMaterialSurveyResponse(surveyResponse);
|
|
89
100
|
setSelectedAnswer(getAnswer());
|
|
90
|
-
}).catch(error
|
|
101
|
+
}).catch(function (error) {
|
|
91
102
|
console.error(error);
|
|
92
103
|
});
|
|
93
|
-
return ()
|
|
104
|
+
return function () {
|
|
105
|
+
return controller.abort();
|
|
106
|
+
};
|
|
94
107
|
}
|
|
95
108
|
}, [materialSurvey, userId]);
|
|
96
109
|
// submit handler
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
110
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
111
|
+
var _ref = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee() {
|
|
112
|
+
var _yield$postOrgMateria, surveyResponseId, _yield$getOrgMaterial, surveyResponse;
|
|
113
|
+
return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
|
|
114
|
+
while (1) switch (_context.prev = _context.next) {
|
|
115
|
+
case 0:
|
|
116
|
+
if (materialSurvey) {
|
|
117
|
+
_context.next = 2;
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
return _context.abrupt("return");
|
|
121
|
+
case 2:
|
|
122
|
+
setSubmitStatus('pending');
|
|
123
|
+
_context.prev = 3;
|
|
124
|
+
_context.next = 6;
|
|
125
|
+
return apiClient.postOrgMaterialSurveyResponseAdd({
|
|
126
|
+
materialSurveyId: materialSurvey.id,
|
|
127
|
+
answers: [selectedAnswer]
|
|
128
|
+
});
|
|
129
|
+
case 6:
|
|
130
|
+
_yield$postOrgMateria = _context.sent;
|
|
131
|
+
surveyResponseId = _yield$postOrgMateria.surveyResponseId;
|
|
132
|
+
_context.next = 10;
|
|
133
|
+
return apiClient.getOrgMaterialSurveyResponseGet({
|
|
134
|
+
surveyResponseId: surveyResponseId
|
|
135
|
+
});
|
|
136
|
+
case 10:
|
|
137
|
+
_yield$getOrgMaterial = _context.sent;
|
|
138
|
+
surveyResponse = _yield$getOrgMaterial.surveyResponse;
|
|
139
|
+
setMaterialSurveyResponse(surveyResponse);
|
|
140
|
+
void refreshOrgMaterialSurvey();
|
|
141
|
+
onSubmit(true);
|
|
142
|
+
setSubmitStatus('resolved');
|
|
143
|
+
_context.next = 23;
|
|
144
|
+
break;
|
|
145
|
+
case 18:
|
|
146
|
+
_context.prev = 18;
|
|
147
|
+
_context.t0 = _context["catch"](3);
|
|
148
|
+
console.error(_context.t0);
|
|
149
|
+
onSubmit(false);
|
|
150
|
+
setSubmitStatus('rejected');
|
|
151
|
+
case 23:
|
|
152
|
+
case "end":
|
|
153
|
+
return _context.stop();
|
|
154
|
+
}
|
|
155
|
+
}, _callee, null, [[3, 18]]);
|
|
156
|
+
}));
|
|
157
|
+
return function handleSubmit() {
|
|
158
|
+
return _ref.apply(this, arguments);
|
|
159
|
+
};
|
|
160
|
+
}();
|
|
161
|
+
return jsxRuntime.jsx(SurveyContentBox.default, {
|
|
125
162
|
title: intl$1.formatMessage({
|
|
126
163
|
id: 'materialSurvey.myAnswer'
|
|
127
164
|
}),
|
|
128
165
|
onNext: onNext,
|
|
129
|
-
submitResult:
|
|
166
|
+
submitResult: jsxRuntime.jsx(SurveyResultBadge.default, {
|
|
130
167
|
materialSurveyResponse: materialSurveyResponse
|
|
131
168
|
}),
|
|
132
|
-
submitStatus:
|
|
169
|
+
submitStatus: jsxRuntime.jsx(SurveySubmitStatusText.default, {
|
|
133
170
|
status: submitStatus
|
|
134
171
|
}),
|
|
135
172
|
footerActions: [{
|
|
@@ -143,30 +180,34 @@ const MaterialSurveySelectMultiple = () => {
|
|
|
143
180
|
children: intl$1.formatMessage({
|
|
144
181
|
id: 'materialSurvey.submit'
|
|
145
182
|
})
|
|
146
|
-
}]
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
183
|
+
}],
|
|
184
|
+
children: jsxRuntime.jsx(QuestionCheckbox.default, {
|
|
185
|
+
onSelect: function onSelect(index$1) {
|
|
186
|
+
if (index.checkUserLectureTestEnded(lecture) || !!userId) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
setSelectedAnswer(function (prevState) {
|
|
190
|
+
var newState = prevState.includes(index$1) ? prevState.filter(function (ident) {
|
|
191
|
+
return ident !== index$1;
|
|
192
|
+
}) : [].concat(_rollupPluginBabelHelpers.toConsumableArray(prevState), [index$1]);
|
|
193
|
+
return newState;
|
|
194
|
+
});
|
|
195
|
+
},
|
|
196
|
+
selectedOptions: selectedAnswer,
|
|
197
|
+
disabled: submitStatus === 'pending' || index.checkUserLectureTestEnded(lecture) || !!userId,
|
|
198
|
+
children: (materialSurvey === null || materialSurvey === void 0 ? void 0 : materialSurvey.questionInfoList[0]) ? (_a = materialSurvey.questionInfoList[0].optionInfo) === null || _a === void 0 ? void 0 : _a.map(function (option, index) {
|
|
199
|
+
return jsxRuntime.jsx(QuestionCheckboxOption.default, {
|
|
200
|
+
value: index,
|
|
201
|
+
children: (course === null || course === void 0 ? void 0 : course.preference.renderMarkdownInSurveyOptions) ? jsxRuntime.jsx(StyledMarkdown.default, {
|
|
202
|
+
dark: false,
|
|
203
|
+
children: option,
|
|
204
|
+
paddingx: 0,
|
|
205
|
+
paddingy: 0
|
|
206
|
+
}) : option
|
|
207
|
+
}, index);
|
|
208
|
+
}) : null
|
|
209
|
+
})
|
|
210
|
+
});
|
|
170
211
|
};
|
|
171
212
|
|
|
172
213
|
exports.default = MaterialSurveySelectMultiple;
|