@elice/material-assignment 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 +383 -0
- package/cjs/components/index.js +9 -0
- package/cjs/components/material-assignment/MaterialAssignment.js +23 -17
- package/cjs/components/material-assignment/MaterialAssignmentContent.js +281 -194
- package/cjs/components/material-assignment/MaterialAssignmentUploadModal.js +181 -138
- package/cjs/components/material-assignment/constants/color.js +1 -1
- package/cjs/components/material-assignment/index.js +7 -0
- package/cjs/components/material-assignment/locales/index.js +13 -0
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.js +32 -24
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +19 -9
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContent.js +774 -548
- package/cjs/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +436 -303
- package/cjs/components/material-assignment-admin/index.js +7 -0
- package/cjs/components/shared/MaterialAssignmentContainer.js +23 -13
- package/es/_virtual/_rollupPluginBabelHelpers.js +374 -0
- package/es/components/index.js +2 -0
- package/es/components/material-assignment/MaterialAssignment.js +18 -17
- package/es/components/material-assignment/MaterialAssignmentContent.js +276 -194
- package/es/components/material-assignment/MaterialAssignmentUploadModal.js +177 -139
- package/es/components/material-assignment/constants/color.js +1 -1
- package/es/components/material-assignment/index.js +1 -0
- package/es/components/material-assignment/locales/index.js +4 -0
- package/es/components/material-assignment-admin/MaterialAssignmentAdmin.js +29 -25
- package/es/components/material-assignment-admin/MaterialAssignmentAdmin.styled.js +15 -9
- package/es/components/material-assignment-admin/MaterialAssignmentAdminContent.js +770 -549
- package/es/components/material-assignment-admin/MaterialAssignmentAdminContentTa.js +432 -304
- package/es/components/material-assignment-admin/index.js +1 -0
- package/es/components/shared/MaterialAssignmentContainer.js +19 -13
- package/package.json +9 -12
|
@@ -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 reactHookForm = require('react-hook-form');
|
|
7
9
|
var apiClient = require('@elice/api-client');
|
|
@@ -14,14 +16,18 @@ var dayjs = require('dayjs');
|
|
|
14
16
|
var MaterialAssignmentContainer = require('../shared/MaterialAssignmentContainer.js');
|
|
15
17
|
var MaterialAssignmentAdmin_styled = require('./MaterialAssignmentAdmin.styled.js');
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
20
|
+
|
|
21
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
22
|
+
var dayjs__default = /*#__PURE__*/_interopDefaultCompat(dayjs);
|
|
23
|
+
|
|
24
|
+
var MaterialAssignmentAdminContentTa = function MaterialAssignmentAdminContentTa(_ref) {
|
|
25
|
+
var materialAssignmentId = _ref.materialAssignmentId,
|
|
26
|
+
userId = _ref.userId,
|
|
27
|
+
adminUserId = _ref.adminUserId;
|
|
22
28
|
var _a;
|
|
23
29
|
// Form
|
|
24
|
-
|
|
30
|
+
var gradeEditFormMethods = reactHookForm.useForm({
|
|
25
31
|
defaultValues: {
|
|
26
32
|
score: 0,
|
|
27
33
|
comment: ''
|
|
@@ -29,67 +35,100 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
29
35
|
mode: 'onChange'
|
|
30
36
|
});
|
|
31
37
|
// State related with component
|
|
32
|
-
|
|
38
|
+
var _React$useState = React__default.default.useState(false),
|
|
39
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
40
|
+
showGradeEditModal = _React$useState2[0],
|
|
41
|
+
setShowGradeEditModal = _React$useState2[1];
|
|
33
42
|
// State related with api
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
var _React$useState3 = React__default.default.useState(null),
|
|
44
|
+
_React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
|
|
45
|
+
user = _React$useState4[0],
|
|
46
|
+
setUser = _React$useState4[1];
|
|
47
|
+
var _React$useState5 = React__default.default.useState(null),
|
|
48
|
+
_React$useState6 = _rollupPluginBabelHelpers.slicedToArray(_React$useState5, 2),
|
|
49
|
+
materialAssignment = _React$useState6[0],
|
|
50
|
+
setMaterialAssignment = _React$useState6[1];
|
|
51
|
+
var _React$useState7 = React__default.default.useState(null),
|
|
52
|
+
_React$useState8 = _rollupPluginBabelHelpers.slicedToArray(_React$useState7, 2),
|
|
53
|
+
userSubmission = _React$useState8[0],
|
|
54
|
+
setUserSubmission = _React$useState8[1];
|
|
55
|
+
var _React$useState9 = React__default.default.useState(null),
|
|
56
|
+
_React$useState10 = _rollupPluginBabelHelpers.slicedToArray(_React$useState9, 2),
|
|
57
|
+
gradeResult = _React$useState10[0],
|
|
58
|
+
setGradeResult = _React$useState10[1];
|
|
59
|
+
var _React$useState11 = React__default.default.useState(null),
|
|
60
|
+
_React$useState12 = _rollupPluginBabelHelpers.slicedToArray(_React$useState11, 2),
|
|
61
|
+
myGrade = _React$useState12[0],
|
|
62
|
+
setMyGrade = _React$useState12[1];
|
|
63
|
+
var isAssignmentClosed = dayjs__default.default().isAfter(dayjs__default.default(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime));
|
|
64
|
+
var isScoreFinalized = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
|
|
65
|
+
var isUserSubmitted = Boolean(userSubmission);
|
|
42
66
|
// API Status
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
67
|
+
var isReady = materialSharedUtils.useMaterialConfigApiClientUpdate(apiClient.config.init);
|
|
68
|
+
var _React$useState13 = React__default.default.useState('idle'),
|
|
69
|
+
_React$useState14 = _rollupPluginBabelHelpers.slicedToArray(_React$useState13, 2),
|
|
70
|
+
submissionListGetStatus = _React$useState14[0],
|
|
71
|
+
setSubmissionListGetStatus = _React$useState14[1];
|
|
72
|
+
var fetchUserGet = React__default.default.useCallback(function () {
|
|
46
73
|
void apiClient.getOrgUserGet({
|
|
47
|
-
userId
|
|
48
|
-
}).then(
|
|
74
|
+
userId: userId
|
|
75
|
+
}).then(function (res) {
|
|
76
|
+
return res.user;
|
|
77
|
+
}).then(setUser);
|
|
49
78
|
}, [userId]);
|
|
50
|
-
|
|
79
|
+
var fetchMaterialAssignmentGet = React__default.default.useCallback(function () {
|
|
51
80
|
void apiClient.getOrgMaterialAssignmentGet({
|
|
52
|
-
materialAssignmentId
|
|
53
|
-
}).then(
|
|
81
|
+
materialAssignmentId: materialAssignmentId
|
|
82
|
+
}).then(function (res) {
|
|
83
|
+
return res.materialAssignment;
|
|
84
|
+
}).then(setMaterialAssignment);
|
|
54
85
|
}, [materialAssignmentId]);
|
|
55
|
-
|
|
86
|
+
var fetchSubmissionList = React__default.default.useCallback(function () {
|
|
56
87
|
setSubmissionListGetStatus('pending');
|
|
57
88
|
void apiClient.getOrgMaterialAssignmentSubmissionList({
|
|
58
|
-
materialAssignmentId,
|
|
89
|
+
materialAssignmentId: materialAssignmentId,
|
|
59
90
|
offset: 0,
|
|
60
91
|
count: 1,
|
|
61
92
|
filterConditions: {
|
|
62
93
|
isLast: true,
|
|
63
94
|
userIds: [userId]
|
|
64
95
|
}
|
|
65
|
-
}).then(
|
|
96
|
+
}).then(function (res) {
|
|
97
|
+
return res.materialAssignmentSubmissions[0];
|
|
98
|
+
}).then(function (submission) {
|
|
66
99
|
setUserSubmission(submission !== null && submission !== void 0 ? submission : null);
|
|
67
100
|
setSubmissionListGetStatus('resolved');
|
|
68
|
-
}).catch(err
|
|
101
|
+
}).catch(function (err) {
|
|
69
102
|
console.error(err);
|
|
70
103
|
setSubmissionListGetStatus('rejected');
|
|
71
104
|
});
|
|
72
105
|
}, [materialAssignmentId, userId]);
|
|
73
|
-
|
|
106
|
+
var fetchGradeResult = React__default.default.useCallback(function () {
|
|
74
107
|
void apiClient.getOrgMaterialAssignmentGradeResultGet({
|
|
75
|
-
materialAssignmentId,
|
|
76
|
-
userId
|
|
77
|
-
}).then(
|
|
108
|
+
materialAssignmentId: materialAssignmentId,
|
|
109
|
+
userId: userId
|
|
110
|
+
}).then(function (res) {
|
|
111
|
+
return res.materialAssignmentGradeResult;
|
|
112
|
+
}).then(setGradeResult).catch(function () {
|
|
78
113
|
setGradeResult(null);
|
|
79
114
|
});
|
|
80
115
|
}, [materialAssignmentId, userId]);
|
|
81
|
-
|
|
116
|
+
var fetchMyGrade = React__default.default.useCallback(function () {
|
|
82
117
|
void apiClient.getOrgMaterialAssignmentGradeList({
|
|
83
|
-
materialAssignmentId,
|
|
118
|
+
materialAssignmentId: materialAssignmentId,
|
|
84
119
|
offset: 0,
|
|
85
120
|
count: 1,
|
|
86
121
|
filterConditions: {
|
|
87
|
-
userId,
|
|
122
|
+
userId: userId,
|
|
88
123
|
gradeUserId: adminUserId
|
|
89
124
|
}
|
|
90
|
-
}).then(
|
|
125
|
+
}).then(function (res) {
|
|
126
|
+
return res.materialAssignmentGrades[0];
|
|
127
|
+
}).then(function (grade) {
|
|
128
|
+
return setMyGrade(grade !== null && grade !== void 0 ? grade : null);
|
|
129
|
+
});
|
|
91
130
|
}, [adminUserId, materialAssignmentId, userId]);
|
|
92
|
-
|
|
131
|
+
var handleGradeEditClick = function handleGradeEditClick() {
|
|
93
132
|
var _a, _b;
|
|
94
133
|
setShowGradeEditModal(true);
|
|
95
134
|
gradeEditFormMethods.reset({
|
|
@@ -97,28 +136,47 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
97
136
|
comment: (_b = myGrade === null || myGrade === void 0 ? void 0 : myGrade.comment) !== null && _b !== void 0 ? _b : ''
|
|
98
137
|
});
|
|
99
138
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
139
|
+
var handleGradeEditSubmit = gradeEditFormMethods.handleSubmit( /*#__PURE__*/function () {
|
|
140
|
+
var _ref3 = _rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee(_ref2) {
|
|
141
|
+
var score, comment;
|
|
142
|
+
return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
|
|
143
|
+
while (1) switch (_context.prev = _context.next) {
|
|
144
|
+
case 0:
|
|
145
|
+
score = _ref2.score, comment = _ref2.comment;
|
|
146
|
+
_context.prev = 1;
|
|
147
|
+
_context.next = 4;
|
|
148
|
+
return apiClient.postOrgMaterialAssignmentGradeEdit({
|
|
149
|
+
materialAssignmentGradeId: myGrade === null || myGrade === void 0 ? void 0 : myGrade.id,
|
|
150
|
+
materialAssignmentId: materialAssignmentId,
|
|
151
|
+
userId: userId,
|
|
152
|
+
score: score,
|
|
153
|
+
comment: comment
|
|
154
|
+
});
|
|
155
|
+
case 4:
|
|
156
|
+
fetchMyGrade();
|
|
157
|
+
blocks.Notification.success('저장되었습니다');
|
|
158
|
+
_context.next = 12;
|
|
159
|
+
break;
|
|
160
|
+
case 8:
|
|
161
|
+
_context.prev = 8;
|
|
162
|
+
_context.t0 = _context["catch"](1);
|
|
163
|
+
console.error(_context.t0);
|
|
164
|
+
blocks.Notification.error('오류가 발생했습니다.');
|
|
165
|
+
case 12:
|
|
166
|
+
_context.prev = 12;
|
|
167
|
+
setShowGradeEditModal(false);
|
|
168
|
+
return _context.finish(12);
|
|
169
|
+
case 15:
|
|
170
|
+
case "end":
|
|
171
|
+
return _context.stop();
|
|
172
|
+
}
|
|
173
|
+
}, _callee, null, [[1, 8, 12, 15]]);
|
|
174
|
+
}));
|
|
175
|
+
return function (_x) {
|
|
176
|
+
return _ref3.apply(this, arguments);
|
|
177
|
+
};
|
|
178
|
+
}());
|
|
179
|
+
React__default.default.useEffect(function () {
|
|
122
180
|
if (!isReady) {
|
|
123
181
|
return;
|
|
124
182
|
}
|
|
@@ -128,148 +186,199 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
128
186
|
fetchSubmissionList();
|
|
129
187
|
fetchMaterialAssignmentGet();
|
|
130
188
|
}, [isReady, fetchUserGet, fetchMyGrade, fetchGradeResult, fetchSubmissionList, fetchMaterialAssignmentGet]);
|
|
131
|
-
|
|
189
|
+
var renderHeader = function renderHeader() {
|
|
132
190
|
var _a;
|
|
133
|
-
return
|
|
191
|
+
return jsxRuntime.jsxs(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeader, {
|
|
134
192
|
align: "center",
|
|
135
193
|
padding: "1rem",
|
|
136
|
-
width: "100%"
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
194
|
+
width: "100%",
|
|
195
|
+
children: [jsxRuntime.jsxs(blocks.Flex, {
|
|
196
|
+
auto: true,
|
|
197
|
+
align: "center",
|
|
198
|
+
children: [jsxRuntime.jsx(blocks.ProfileImage, {
|
|
199
|
+
src: (_a = user === null || user === void 0 ? void 0 : user.profileUrl) !== null && _a !== void 0 ? _a : '',
|
|
200
|
+
width: "2.5rem",
|
|
201
|
+
height: "2.5rem"
|
|
202
|
+
}), jsxRuntime.jsx(blocks.Hspace, {
|
|
203
|
+
width: 1
|
|
204
|
+
}), jsxRuntime.jsx(blocks.Text, {
|
|
205
|
+
size: "small",
|
|
206
|
+
role: "warmwhite",
|
|
207
|
+
children: user === null || user === void 0 ? void 0 : user.fullname
|
|
208
|
+
})]
|
|
209
|
+
}), jsxRuntime.jsxs(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeaderCell, {
|
|
210
|
+
children: [jsxRuntime.jsx(blocks.Text, {
|
|
211
|
+
size: "tiny",
|
|
212
|
+
role: "gray4",
|
|
213
|
+
children: "\uC810\uC218"
|
|
214
|
+
}), jsxRuntime.jsx(blocks.Text, {
|
|
215
|
+
size: "small",
|
|
216
|
+
role: "white",
|
|
217
|
+
children: (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ? "".concat(gradeResult.score, "\uC810(\uACF5\uAC1C\uB428)") : '--'
|
|
218
|
+
})]
|
|
219
|
+
}), jsxRuntime.jsxs(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminHeaderCell, {
|
|
220
|
+
children: [jsxRuntime.jsx(blocks.Text, {
|
|
221
|
+
size: "tiny",
|
|
222
|
+
role: "gray4",
|
|
223
|
+
children: "\uC81C\uCD9C \uC77C\uC2DC"
|
|
224
|
+
}), jsxRuntime.jsx(blocks.Text, {
|
|
225
|
+
size: "small",
|
|
226
|
+
role: "white",
|
|
227
|
+
children: userSubmission ? jsxRuntime.jsx(intl.FormattedDate, {
|
|
228
|
+
value: userSubmission.createdDatetime,
|
|
229
|
+
dateStyle: "medium",
|
|
230
|
+
timeStyle: "short"
|
|
231
|
+
}) : '--'
|
|
232
|
+
})]
|
|
233
|
+
})]
|
|
234
|
+
});
|
|
166
235
|
};
|
|
167
|
-
|
|
168
|
-
return
|
|
236
|
+
var renderGradeResult = function renderGradeResult() {
|
|
237
|
+
return jsxRuntime.jsx(MaterialAssignmentAdmin_styled.StyledMaterialAssignmentAdminGradeWrapper, {
|
|
169
238
|
wrap: true,
|
|
170
239
|
width: "100%",
|
|
171
|
-
align: "center"
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
240
|
+
align: "center",
|
|
241
|
+
children: jsxRuntime.jsxs(blocks.Flex, {
|
|
242
|
+
auto: true,
|
|
243
|
+
align: "center",
|
|
244
|
+
children: [jsxRuntime.jsx(blocks.Text, {
|
|
245
|
+
role: "navy1",
|
|
246
|
+
size: "small",
|
|
247
|
+
lineHeight: "1.375rem",
|
|
248
|
+
children: user ? "".concat(user.fullname, " \uB2D8\uC758 \uC810\uC218") : null
|
|
249
|
+
}), jsxRuntime.jsx(blocks.Hspace, {
|
|
250
|
+
width: 0.25
|
|
251
|
+
}), jsxRuntime.jsx(blocks.Tooltip, {
|
|
252
|
+
useMaxWidth: true,
|
|
253
|
+
placement: "top",
|
|
254
|
+
title: '최종 점수는 관리자가 모든 채점자의 점수를 고려하여 반영한 후 공개됩니다.',
|
|
255
|
+
children: jsxRuntime.jsx(blocks.Icon, {
|
|
256
|
+
icon: icons.eilStatusInfo,
|
|
257
|
+
color: designTokens.base.color.navy1
|
|
258
|
+
})
|
|
259
|
+
}), jsxRuntime.jsx(blocks.Hspace, {
|
|
260
|
+
width: 0.75
|
|
261
|
+
}), jsxRuntime.jsx(blocks.Text, {
|
|
262
|
+
bold: true,
|
|
263
|
+
role: "white",
|
|
264
|
+
children: (gradeResult === null || gradeResult === void 0 ? void 0 : gradeResult.score) && isScoreFinalized ? "".concat(gradeResult.score, "\uC810(\uACF5\uAC1C\uB428)") : '--'
|
|
265
|
+
})]
|
|
266
|
+
})
|
|
267
|
+
});
|
|
194
268
|
};
|
|
195
|
-
|
|
196
|
-
|
|
269
|
+
var renderSubmissionInfo = function renderSubmissionInfo() {
|
|
270
|
+
var statusText = function () {
|
|
197
271
|
if (submissionListGetStatus === 'pending') {
|
|
198
272
|
return null;
|
|
199
273
|
}
|
|
200
274
|
switch (true) {
|
|
201
275
|
case !isUserSubmitted && isAssignmentClosed:
|
|
202
|
-
return
|
|
276
|
+
return jsxRuntime.jsx(blocks.Text, {
|
|
203
277
|
bold: true,
|
|
204
278
|
role: "danger",
|
|
205
|
-
size: "small"
|
|
206
|
-
|
|
279
|
+
size: "small",
|
|
280
|
+
children: "\uC81C\uCD9C \uAE30\uD55C \uB9CC\uB8CC"
|
|
281
|
+
});
|
|
207
282
|
case isScoreFinalized:
|
|
208
|
-
return
|
|
283
|
+
return jsxRuntime.jsx(blocks.Text, {
|
|
209
284
|
bold: true,
|
|
210
285
|
role: "lightpurple",
|
|
211
|
-
size: "small"
|
|
212
|
-
|
|
286
|
+
size: "small",
|
|
287
|
+
children: "\uCC44\uC810 \uC644\uB8CC"
|
|
288
|
+
});
|
|
213
289
|
case isUserSubmitted:
|
|
214
|
-
return
|
|
290
|
+
return jsxRuntime.jsx(blocks.Text, {
|
|
215
291
|
bold: true,
|
|
216
292
|
role: "success",
|
|
217
|
-
size: "small"
|
|
218
|
-
|
|
293
|
+
size: "small",
|
|
294
|
+
children: "\uC81C\uCD9C\uB428"
|
|
295
|
+
});
|
|
219
296
|
case !isUserSubmitted:
|
|
220
|
-
return
|
|
297
|
+
return jsxRuntime.jsx(blocks.Text, {
|
|
221
298
|
bold: true,
|
|
222
299
|
role: "warning",
|
|
223
|
-
size: "small"
|
|
224
|
-
|
|
300
|
+
size: "small",
|
|
301
|
+
children: "\uBBF8\uC81C\uCD9C"
|
|
302
|
+
});
|
|
225
303
|
}
|
|
226
|
-
}
|
|
227
|
-
|
|
304
|
+
}();
|
|
305
|
+
var submissionAttachment = function () {
|
|
228
306
|
if (!userSubmission) {
|
|
229
307
|
return '--';
|
|
230
308
|
}
|
|
231
309
|
if (userSubmission.assignmentFileUrl) {
|
|
232
|
-
|
|
233
|
-
return
|
|
310
|
+
var assignmentFilename = decodeURIComponent(userSubmission.assignmentFileUrl && new URL(userSubmission.assignmentFileUrl).pathname.split('/').pop() || '');
|
|
311
|
+
return jsxRuntime.jsx("a", {
|
|
234
312
|
href: userSubmission.assignmentFileUrl,
|
|
235
313
|
download: assignmentFilename,
|
|
236
314
|
target: "_blank",
|
|
237
|
-
rel: "noopener noreferrer"
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
315
|
+
rel: "noopener noreferrer",
|
|
316
|
+
children: jsxRuntime.jsx(blocks.Text, {
|
|
317
|
+
hoverable: true,
|
|
318
|
+
underline: true,
|
|
319
|
+
role: "white",
|
|
320
|
+
size: "small",
|
|
321
|
+
children: assignmentFilename
|
|
322
|
+
})
|
|
323
|
+
});
|
|
244
324
|
}
|
|
245
325
|
if (userSubmission === null || userSubmission === void 0 ? void 0 : userSubmission.assignmentUrl) {
|
|
246
|
-
return
|
|
326
|
+
return jsxRuntime.jsx("a", {
|
|
247
327
|
href: userSubmission.assignmentUrl,
|
|
248
328
|
target: "_blank",
|
|
249
|
-
rel: "noopener noreferrer"
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
329
|
+
rel: "noopener noreferrer",
|
|
330
|
+
children: jsxRuntime.jsx(blocks.Text, {
|
|
331
|
+
hoverable: true,
|
|
332
|
+
underline: true,
|
|
333
|
+
role: "white",
|
|
334
|
+
size: "small",
|
|
335
|
+
children: userSubmission.assignmentUrl
|
|
336
|
+
})
|
|
337
|
+
});
|
|
256
338
|
}
|
|
257
|
-
}
|
|
258
|
-
return
|
|
259
|
-
dark: true
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
339
|
+
}();
|
|
340
|
+
return jsxRuntime.jsx(blocks.InfoTable, {
|
|
341
|
+
dark: true,
|
|
342
|
+
children: jsxRuntime.jsxs("tbody", {
|
|
343
|
+
children: [jsxRuntime.jsxs("tr", {
|
|
344
|
+
children: [jsxRuntime.jsx("td", {
|
|
345
|
+
children: "\uC0C1\uD0DC"
|
|
346
|
+
}), jsxRuntime.jsx("td", {
|
|
347
|
+
children: statusText
|
|
348
|
+
})]
|
|
349
|
+
}), jsxRuntime.jsxs("tr", {
|
|
350
|
+
children: [jsxRuntime.jsx("td", {
|
|
351
|
+
children: "\uACFC\uC81C \uC81C\uCD9C \uAE30\uD55C"
|
|
352
|
+
}), jsxRuntime.jsx("td", {
|
|
353
|
+
children: jsxRuntime.jsx(intl.FormattedDate, {
|
|
354
|
+
value: materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.closeDatetime,
|
|
355
|
+
dateStyle: "medium",
|
|
356
|
+
timeStyle: "short"
|
|
357
|
+
})
|
|
358
|
+
})]
|
|
359
|
+
}), jsxRuntime.jsxs("tr", {
|
|
360
|
+
children: [jsxRuntime.jsx("td", {
|
|
361
|
+
children: "\uC81C\uCD9C \uC77C\uC2DC"
|
|
362
|
+
}), jsxRuntime.jsx("td", {
|
|
363
|
+
children: userSubmission ? jsxRuntime.jsx(intl.FormattedDate, {
|
|
364
|
+
value: userSubmission.createdDatetime,
|
|
365
|
+
dateStyle: "medium",
|
|
366
|
+
timeStyle: "short"
|
|
367
|
+
}) : '--'
|
|
368
|
+
})]
|
|
369
|
+
}), jsxRuntime.jsxs("tr", {
|
|
370
|
+
children: [jsxRuntime.jsx("td", {
|
|
371
|
+
children: "\uC5C5\uB85C\uB4DC\uB41C \uACFC\uC81C"
|
|
372
|
+
}), jsxRuntime.jsx("td", {
|
|
373
|
+
children: submissionAttachment
|
|
374
|
+
})]
|
|
375
|
+
})]
|
|
376
|
+
})
|
|
377
|
+
});
|
|
269
378
|
};
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
379
|
+
var renderGrade = function renderGrade() {
|
|
380
|
+
var isGradeEditDisabled = !isAssignmentClosed || !isUserSubmitted || isScoreFinalized;
|
|
381
|
+
var tooltipTitle = function () {
|
|
273
382
|
switch (true) {
|
|
274
383
|
case isScoreFinalized:
|
|
275
384
|
return '공개 이후 채점이 불가합니다.';
|
|
@@ -278,79 +387,91 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
278
387
|
case !isUserSubmitted:
|
|
279
388
|
return '미제출인 경우 채점할 수 없습니다.';
|
|
280
389
|
}
|
|
281
|
-
}
|
|
282
|
-
return
|
|
390
|
+
}();
|
|
391
|
+
return jsxRuntime.jsxs(blocks.Flex, {
|
|
283
392
|
column: true,
|
|
284
|
-
align: "center"
|
|
285
|
-
}, React.createElement(blocks.Flex, {
|
|
286
393
|
align: "center",
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
394
|
+
children: [jsxRuntime.jsxs(blocks.Flex, {
|
|
395
|
+
align: "center",
|
|
396
|
+
width: "100%",
|
|
397
|
+
children: [jsxRuntime.jsxs(blocks.Flex, {
|
|
398
|
+
column: true,
|
|
399
|
+
auto: true,
|
|
400
|
+
children: [jsxRuntime.jsx(blocks.Text, {
|
|
401
|
+
block: true,
|
|
402
|
+
bold: true,
|
|
403
|
+
role: "white",
|
|
404
|
+
lineHeight: 1.375,
|
|
405
|
+
children: "\uB0B4 \uCC44\uC810"
|
|
406
|
+
}), jsxRuntime.jsx(blocks.Text, {
|
|
407
|
+
block: true,
|
|
408
|
+
size: "tiny",
|
|
409
|
+
role: "navy3",
|
|
410
|
+
lineHeight: 1.6,
|
|
411
|
+
children: "\uB0B4\uAC00 \uB9E4\uAE34 \uD3C9\uAC00\uC640 \uAD00\uB828\uB41C \uC815\uBCF4\uB97C \uBCFC \uC218 \uC788\uC2B5\uB2C8\uB2E4."
|
|
412
|
+
})]
|
|
413
|
+
}), jsxRuntime.jsx(blocks.Tooltip, {
|
|
414
|
+
placement: "top",
|
|
415
|
+
title: tooltipTitle,
|
|
416
|
+
visible: isGradeEditDisabled ? undefined : false,
|
|
417
|
+
children: jsxRuntime.jsx("span", {
|
|
418
|
+
children: jsxRuntime.jsx(blocks.Button, {
|
|
419
|
+
size: "small",
|
|
420
|
+
role: "lightpurple",
|
|
421
|
+
disabled: isGradeEditDisabled,
|
|
422
|
+
onClick: handleGradeEditClick,
|
|
423
|
+
children: Boolean(myGrade) ? '내 채점 수정' : '내 채점 시작'
|
|
424
|
+
})
|
|
425
|
+
})
|
|
426
|
+
})]
|
|
427
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
428
|
+
height: 0.75
|
|
429
|
+
}), jsxRuntime.jsx(blocks.TableNext, {
|
|
430
|
+
dark: true,
|
|
431
|
+
emptyMessage: "\uC544\uC9C1 \uCC44\uC810\uC744 \uC2DC\uC791\uD558\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4.",
|
|
432
|
+
columns: [{
|
|
433
|
+
Header: '채점자명',
|
|
434
|
+
accessor: 'fullname'
|
|
435
|
+
}, {
|
|
436
|
+
Header: '과제 점수',
|
|
437
|
+
accessor: 'grade'
|
|
438
|
+
}, {
|
|
439
|
+
Header: '채점 일시',
|
|
440
|
+
accessor: 'created',
|
|
441
|
+
textAlign: 'left'
|
|
442
|
+
}],
|
|
443
|
+
data: myGrade ? [{
|
|
444
|
+
fullname: jsxRuntime.jsxs(blocks.Flex, {
|
|
445
|
+
paddingy: "0.25rem",
|
|
446
|
+
children: [jsxRuntime.jsx(blocks.Text, {
|
|
447
|
+
noWrap: true,
|
|
448
|
+
role: "navy0",
|
|
449
|
+
size: "small",
|
|
450
|
+
children: myGrade.gradeUser.fullname
|
|
451
|
+
}), jsxRuntime.jsx(blocks.Hspace, {
|
|
452
|
+
width: 0.25
|
|
453
|
+
}), jsxRuntime.jsx(blocks.Text, {
|
|
454
|
+
ellipsis: true,
|
|
455
|
+
role: "navy3",
|
|
456
|
+
size: "small",
|
|
457
|
+
children: myGrade.gradeUser.email
|
|
458
|
+
})]
|
|
459
|
+
}),
|
|
460
|
+
grade: myGrade.score,
|
|
461
|
+
created: jsxRuntime.jsx(intl.FormattedDate, {
|
|
462
|
+
value: myGrade.createdDatetime,
|
|
463
|
+
dateStyle: "medium",
|
|
464
|
+
timeStyle: "short"
|
|
465
|
+
})
|
|
466
|
+
}] : []
|
|
467
|
+
})]
|
|
468
|
+
});
|
|
348
469
|
};
|
|
349
|
-
|
|
470
|
+
var renderGradeEditModal = function renderGradeEditModal() {
|
|
350
471
|
if (!showGradeEditModal) {
|
|
351
472
|
return null;
|
|
352
473
|
}
|
|
353
|
-
return
|
|
474
|
+
return jsxRuntime.jsxs(blocks.Modal, {
|
|
354
475
|
title: Boolean(myGrade) ? '내 채점 수정' : '과제 채점',
|
|
355
476
|
footerButtons: [{
|
|
356
477
|
label: '확인',
|
|
@@ -363,85 +484,97 @@ const MaterialAssignmentAdminContentTa = ({
|
|
|
363
484
|
label: '취소',
|
|
364
485
|
size: 'small',
|
|
365
486
|
role: 'gray1',
|
|
366
|
-
onClick: ()
|
|
487
|
+
onClick: function onClick() {
|
|
367
488
|
setShowGradeEditModal(false);
|
|
368
489
|
}
|
|
369
490
|
}],
|
|
370
|
-
onHide: ()
|
|
491
|
+
onHide: function onHide() {
|
|
371
492
|
setShowGradeEditModal(false);
|
|
372
|
-
}
|
|
373
|
-
}, React.createElement(blocks.Label, {
|
|
374
|
-
bold: true,
|
|
375
|
-
block: true,
|
|
376
|
-
required: true
|
|
377
|
-
}, "\uC810\uC218"), React.createElement(blocks.Vspace, {
|
|
378
|
-
height: 0.5
|
|
379
|
-
}), React.createElement(blocks.Flex, {
|
|
380
|
-
align: "center"
|
|
381
|
-
}, React.createElement(reactHookForm.Controller, {
|
|
382
|
-
control: gradeEditFormMethods.control,
|
|
383
|
-
name: "score",
|
|
384
|
-
rules: {
|
|
385
|
-
required: true,
|
|
386
|
-
min: 0,
|
|
387
|
-
max: 100
|
|
388
|
-
},
|
|
389
|
-
render: ({
|
|
390
|
-
field,
|
|
391
|
-
fieldState
|
|
392
|
-
}) => React.createElement(blocks.Input, Object.assign({}, field, {
|
|
393
|
-
invalid: fieldState.invalid,
|
|
394
|
-
size: "small",
|
|
395
|
-
width: "xsmall",
|
|
396
|
-
type: "number"
|
|
397
|
-
}))
|
|
398
|
-
}), React.createElement(blocks.Hspace, {
|
|
399
|
-
width: 0.5
|
|
400
|
-
}), React.createElement(blocks.Text, {
|
|
401
|
-
bold: true,
|
|
402
|
-
role: "gray9",
|
|
403
|
-
size: "small"
|
|
404
|
-
}, "\uC810"), React.createElement(blocks.Text, {
|
|
405
|
-
role: "gray6",
|
|
406
|
-
size: "small"
|
|
407
|
-
}, ' / 100점 만점')), React.createElement(blocks.Vspace, {
|
|
408
|
-
height: 1.25
|
|
409
|
-
}), React.createElement(blocks.Label, {
|
|
410
|
-
bold: true,
|
|
411
|
-
block: true
|
|
412
|
-
}, "\uD53C\uB4DC\uBC31"), React.createElement(blocks.Vspace, {
|
|
413
|
-
height: 0.5
|
|
414
|
-
}), React.createElement(reactHookForm.Controller, {
|
|
415
|
-
control: gradeEditFormMethods.control,
|
|
416
|
-
name: "comment",
|
|
417
|
-
rules: {
|
|
418
|
-
maxLength: 1000
|
|
419
493
|
},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
})
|
|
428
|
-
|
|
494
|
+
children: [jsxRuntime.jsx(blocks.Label, {
|
|
495
|
+
bold: true,
|
|
496
|
+
block: true,
|
|
497
|
+
required: true,
|
|
498
|
+
children: "\uC810\uC218"
|
|
499
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
500
|
+
height: 0.5
|
|
501
|
+
}), jsxRuntime.jsxs(blocks.Flex, {
|
|
502
|
+
align: "center",
|
|
503
|
+
children: [jsxRuntime.jsx(reactHookForm.Controller, {
|
|
504
|
+
control: gradeEditFormMethods.control,
|
|
505
|
+
name: "score",
|
|
506
|
+
rules: {
|
|
507
|
+
required: true,
|
|
508
|
+
min: 0,
|
|
509
|
+
max: 100
|
|
510
|
+
},
|
|
511
|
+
render: function render(_ref4) {
|
|
512
|
+
var field = _ref4.field,
|
|
513
|
+
fieldState = _ref4.fieldState;
|
|
514
|
+
return jsxRuntime.jsx(blocks.Input, Object.assign({}, field, {
|
|
515
|
+
invalid: fieldState.invalid,
|
|
516
|
+
size: "small",
|
|
517
|
+
width: "xsmall",
|
|
518
|
+
type: "number"
|
|
519
|
+
}));
|
|
520
|
+
}
|
|
521
|
+
}), jsxRuntime.jsx(blocks.Hspace, {
|
|
522
|
+
width: 0.5
|
|
523
|
+
}), jsxRuntime.jsx(blocks.Text, {
|
|
524
|
+
bold: true,
|
|
525
|
+
role: "gray9",
|
|
526
|
+
size: "small",
|
|
527
|
+
children: "\uC810"
|
|
528
|
+
}), jsxRuntime.jsx(blocks.Text, {
|
|
529
|
+
role: "gray6",
|
|
530
|
+
size: "small",
|
|
531
|
+
children: ' / 100점 만점'
|
|
532
|
+
})]
|
|
533
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
534
|
+
height: 1.25
|
|
535
|
+
}), jsxRuntime.jsx(blocks.Label, {
|
|
536
|
+
bold: true,
|
|
537
|
+
block: true,
|
|
538
|
+
children: "\uD53C\uB4DC\uBC31"
|
|
539
|
+
}), jsxRuntime.jsx(blocks.Vspace, {
|
|
540
|
+
height: 0.5
|
|
541
|
+
}), jsxRuntime.jsx(reactHookForm.Controller, {
|
|
542
|
+
control: gradeEditFormMethods.control,
|
|
543
|
+
name: "comment",
|
|
544
|
+
rules: {
|
|
545
|
+
maxLength: 1000
|
|
546
|
+
},
|
|
547
|
+
render: function render(_ref5) {
|
|
548
|
+
var field = _ref5.field;
|
|
549
|
+
return jsxRuntime.jsx(blocks.Textarea, {
|
|
550
|
+
value: field.value,
|
|
551
|
+
wordLimit: 1000,
|
|
552
|
+
rows: 8,
|
|
553
|
+
onChange: field.onChange
|
|
554
|
+
});
|
|
555
|
+
}
|
|
556
|
+
})]
|
|
557
|
+
});
|
|
429
558
|
};
|
|
430
|
-
return
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
559
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
560
|
+
children: [renderHeader(), jsxRuntime.jsx(blocks.Flex, {
|
|
561
|
+
column: true,
|
|
562
|
+
auto: true,
|
|
563
|
+
padding: "3.625rem",
|
|
564
|
+
width: "100%",
|
|
565
|
+
height: "100%",
|
|
566
|
+
overflow: "hidden",
|
|
567
|
+
align: "center",
|
|
568
|
+
children: jsxRuntime.jsxs(MaterialAssignmentContainer.default, {
|
|
569
|
+
title: (_a = materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.title) !== null && _a !== void 0 ? _a : '',
|
|
570
|
+
children: [renderGradeResult(), jsxRuntime.jsx(blocks.Vspace, {
|
|
571
|
+
height: 1.25
|
|
572
|
+
}), renderSubmissionInfo(), jsxRuntime.jsx(blocks.Vspace, {
|
|
573
|
+
height: 1.5
|
|
574
|
+
}), renderGrade()]
|
|
575
|
+
})
|
|
576
|
+
}), renderGradeEditModal()]
|
|
577
|
+
});
|
|
445
578
|
};
|
|
446
579
|
|
|
447
580
|
exports.default = MaterialAssignmentAdminContentTa;
|