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