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