@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,5 +1,3 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
1
|
import React from 'react';
|
|
4
2
|
import { config, getOrgMaterialAssignmentGet, getOrgMaterialAssignmentGradeList, getOrgMaterialAssignmentGradeResultGet, getOrgMaterialAssignmentSubmissionGet } from '@elice/api-client';
|
|
5
3
|
import { Text, Button, Spinner, Vspace, InfoTable, TableNext, Hspace } from '@elice/blocks';
|
|
@@ -13,77 +11,56 @@ import MaterialAssignmentContainer from '../shared/MaterialAssignmentContainer.j
|
|
|
13
11
|
import { DARK_TEXT_TERTIARY_COLOR } from './constants/color.js';
|
|
14
12
|
import MaterialAssignmentUploadModal from './MaterialAssignmentUploadModal.js';
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const GRADE_LIST_COUNT = 20;
|
|
15
|
+
const StyledSubmittedText = styled(Text).withConfig({
|
|
18
16
|
componentId: "sc-1panlbq-0"
|
|
19
17
|
})(["color:", ";"], colors.green[400]);
|
|
20
|
-
|
|
18
|
+
const StyledNoSubmittedText = styled(Text).withConfig({
|
|
21
19
|
componentId: "sc-1panlbq-1"
|
|
22
20
|
})(["color:", ";"], colors.orange[400]);
|
|
23
|
-
|
|
21
|
+
const StyledTableHeaderCell = styled.td.withConfig({
|
|
24
22
|
componentId: "sc-1panlbq-2"
|
|
25
23
|
})(["color:", " !important;"], DARK_TEXT_TERTIARY_COLOR);
|
|
26
|
-
|
|
24
|
+
const StyledTotalPointText = styled(Text).withConfig({
|
|
27
25
|
componentId: "sc-1panlbq-3"
|
|
28
26
|
})(["color:", ";"], DARK_TEXT_TERTIARY_COLOR);
|
|
29
|
-
|
|
27
|
+
const StyledUploadButton = styled(Button).withConfig({
|
|
30
28
|
componentId: "sc-1panlbq-4"
|
|
31
29
|
})(["background-color:", ";border-color:", ";"], base.color.primary6, base.color.primary6);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
assignmentGradeResultGetStatus = _React$useState4[0],
|
|
55
|
-
setAssignmentGradeResultGetStatus = _React$useState4[1];
|
|
56
|
-
var _React$useState5 = React.useState('idle'),
|
|
57
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
58
|
-
assignmentSubmissionGetStatus = _React$useState6[0],
|
|
59
|
-
setAssignmentSubmissionGetStatus = _React$useState6[1];
|
|
60
|
-
var _React$useState7 = React.useState(),
|
|
61
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
62
|
-
materialAssignmentSubmission = _React$useState8[0],
|
|
63
|
-
setMaterialAssignmentSubmission = _React$useState8[1];
|
|
64
|
-
var _React$useState9 = React.useState(),
|
|
65
|
-
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
66
|
-
materialAssignmentGradeResult = _React$useState10[0],
|
|
67
|
-
setMaterialAssignmentGradeResult = _React$useState10[1];
|
|
68
|
-
var _React$useState11 = React.useState(),
|
|
69
|
-
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
|
70
|
-
materialAssignmentGradeList = _React$useState12[0],
|
|
71
|
-
setMaterialAssignmentGradeList = _React$useState12[1];
|
|
30
|
+
const MaterialAssignmentContent = ({
|
|
31
|
+
materialAssignmentId,
|
|
32
|
+
userId
|
|
33
|
+
}) => {
|
|
34
|
+
const isReady = useMaterialConfigApiClientUpdate(config.init);
|
|
35
|
+
const intl = useRawEliceIntl();
|
|
36
|
+
const {
|
|
37
|
+
materialAssignment,
|
|
38
|
+
materialLecturePage,
|
|
39
|
+
status: assignmentGetStatus,
|
|
40
|
+
refetch: doGetOrgMaterialAssignmentGet
|
|
41
|
+
} = useMaterialFetchRaw(enums.LectureMaterialType.Assignment, React.useCallback(signal => getOrgMaterialAssignmentGet({
|
|
42
|
+
materialAssignmentId
|
|
43
|
+
}, {
|
|
44
|
+
signal
|
|
45
|
+
}), [materialAssignmentId]), isReady);
|
|
46
|
+
const [assignmentGradeListGetStatus, setAssignmentGradeListGetStatus] = React.useState('idle');
|
|
47
|
+
const [assignmentGradeResultGetStatus, setAssignmentGradeResultGetStatus] = React.useState('idle');
|
|
48
|
+
const [assignmentSubmissionGetStatus, setAssignmentSubmissionGetStatus] = React.useState('idle');
|
|
49
|
+
const [materialAssignmentSubmission, setMaterialAssignmentSubmission] = React.useState();
|
|
50
|
+
const [materialAssignmentGradeResult, setMaterialAssignmentGradeResult] = React.useState();
|
|
51
|
+
const [materialAssignmentGradeList, setMaterialAssignmentGradeList] = React.useState();
|
|
72
52
|
/** Is confirm modal visible? */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
var isAssignmentSubmitted = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.lastAssignmentSubmissionId);
|
|
78
|
-
var isAssignmentClosed = materialAssignment && Boolean(materialAssignment.closeDatetime < Date.now());
|
|
79
|
-
var isAssignmentResultVisible = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
|
|
53
|
+
const [showAssignmentSubmitModal, setShowAssignmentSubmitModal] = React.useState(false);
|
|
54
|
+
const isAssignmentSubmitted = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.lastAssignmentSubmissionId);
|
|
55
|
+
const isAssignmentClosed = materialAssignment && Boolean(materialAssignment.closeDatetime < Date.now());
|
|
56
|
+
const isAssignmentResultVisible = Boolean(materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.scoreFinalizedDatetime);
|
|
80
57
|
//
|
|
81
58
|
//
|
|
82
59
|
//
|
|
83
60
|
/**
|
|
84
61
|
* When Grade_result exist, a comment list is called.
|
|
85
62
|
*/
|
|
86
|
-
React.useEffect(
|
|
63
|
+
React.useEffect(() => {
|
|
87
64
|
if (!isReady) {
|
|
88
65
|
return;
|
|
89
66
|
}
|
|
@@ -94,16 +71,17 @@ var MaterialAssignmentContent = function MaterialAssignmentContent(_ref) {
|
|
|
94
71
|
getOrgMaterialAssignmentGradeList({
|
|
95
72
|
offset: 0,
|
|
96
73
|
count: GRADE_LIST_COUNT,
|
|
97
|
-
materialAssignmentId
|
|
74
|
+
materialAssignmentId,
|
|
98
75
|
filterConditions: {
|
|
99
|
-
userId
|
|
76
|
+
userId
|
|
100
77
|
}
|
|
101
|
-
}).then(
|
|
102
|
-
|
|
103
|
-
|
|
78
|
+
}).then(({
|
|
79
|
+
materialAssignmentGrades,
|
|
80
|
+
materialAssignmentGradeCount
|
|
81
|
+
}) => {
|
|
104
82
|
setAssignmentGradeListGetStatus('resolved');
|
|
105
83
|
setMaterialAssignmentGradeList(materialAssignmentGrades);
|
|
106
|
-
}).catch(
|
|
84
|
+
}).catch(error => {
|
|
107
85
|
console.error(error);
|
|
108
86
|
setAssignmentGradeListGetStatus('rejected');
|
|
109
87
|
});
|
|
@@ -111,7 +89,7 @@ var MaterialAssignmentContent = function MaterialAssignmentContent(_ref) {
|
|
|
111
89
|
/**
|
|
112
90
|
* When Grade_result exist, a score is called.
|
|
113
91
|
*/
|
|
114
|
-
React.useEffect(
|
|
92
|
+
React.useEffect(() => {
|
|
115
93
|
if (!isReady) {
|
|
116
94
|
return;
|
|
117
95
|
}
|
|
@@ -120,13 +98,14 @@ var MaterialAssignmentContent = function MaterialAssignmentContent(_ref) {
|
|
|
120
98
|
}
|
|
121
99
|
setAssignmentGradeResultGetStatus('pending');
|
|
122
100
|
getOrgMaterialAssignmentGradeResultGet({
|
|
123
|
-
materialAssignmentId
|
|
124
|
-
userId
|
|
125
|
-
}).then(
|
|
126
|
-
|
|
101
|
+
materialAssignmentId,
|
|
102
|
+
userId
|
|
103
|
+
}).then(({
|
|
104
|
+
materialAssignmentGradeResult
|
|
105
|
+
}) => {
|
|
127
106
|
setAssignmentGradeResultGetStatus('resolved');
|
|
128
107
|
setMaterialAssignmentGradeResult(materialAssignmentGradeResult);
|
|
129
|
-
}).catch(
|
|
108
|
+
}).catch(error => {
|
|
130
109
|
console.error(error);
|
|
131
110
|
setAssignmentGradeResultGetStatus('rejected');
|
|
132
111
|
});
|
|
@@ -134,7 +113,7 @@ var MaterialAssignmentContent = function MaterialAssignmentContent(_ref) {
|
|
|
134
113
|
/**
|
|
135
114
|
* Get information on the assignment submitted
|
|
136
115
|
*/
|
|
137
|
-
React.useEffect(
|
|
116
|
+
React.useEffect(() => {
|
|
138
117
|
var _a;
|
|
139
118
|
if (!isReady) {
|
|
140
119
|
return;
|
|
@@ -147,206 +126,157 @@ var MaterialAssignmentContent = function MaterialAssignmentContent(_ref) {
|
|
|
147
126
|
setAssignmentSubmissionGetStatus('pending');
|
|
148
127
|
getOrgMaterialAssignmentSubmissionGet({
|
|
149
128
|
materialAssignmentSubmissionId: (_a = materialAssignment === null || materialAssignment === void 0 ? void 0 : materialAssignment.lastAssignmentSubmissionId) !== null && _a !== void 0 ? _a : 0
|
|
150
|
-
}).then(
|
|
151
|
-
|
|
129
|
+
}).then(({
|
|
130
|
+
materialAssignmentSubmission
|
|
131
|
+
}) => {
|
|
152
132
|
setAssignmentSubmissionGetStatus('resolved');
|
|
153
133
|
setMaterialAssignmentSubmission(materialAssignmentSubmission);
|
|
154
|
-
}).catch(
|
|
134
|
+
}).catch(error => {
|
|
155
135
|
console.error(error);
|
|
156
136
|
setAssignmentSubmissionGetStatus('rejected');
|
|
157
137
|
setMaterialAssignmentSubmission(undefined);
|
|
158
138
|
});
|
|
159
139
|
}, [isAssignmentSubmitted, isReady, materialAssignment]);
|
|
160
140
|
if (assignmentGetStatus === 'pending' || assignmentGradeListGetStatus === 'pending' || assignmentGradeResultGetStatus === 'pending' || assignmentSubmissionGetStatus === 'pending') {
|
|
161
|
-
return
|
|
141
|
+
return React.createElement(Spinner, null);
|
|
162
142
|
}
|
|
163
143
|
if (!materialAssignment || assignmentGetStatus === 'rejected') {
|
|
164
|
-
return
|
|
165
|
-
role: "white"
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
});
|
|
144
|
+
return React.createElement(Text, {
|
|
145
|
+
role: "white"
|
|
146
|
+
}, intl.formatMessage({
|
|
147
|
+
id: 'materialAssignment.error'
|
|
148
|
+
}));
|
|
170
149
|
}
|
|
171
150
|
/**
|
|
172
151
|
*
|
|
173
152
|
*/
|
|
174
|
-
|
|
153
|
+
const renderAssignmentInfo = () => {
|
|
175
154
|
var _a;
|
|
176
|
-
|
|
177
|
-
|
|
155
|
+
const assignmentFilename = decodeURIComponent((materialAssignmentSubmission === null || materialAssignmentSubmission === void 0 ? void 0 : materialAssignmentSubmission.assignmentFileUrl) && new URL(materialAssignmentSubmission.assignmentFileUrl).pathname.split('/').pop() || '');
|
|
156
|
+
const renderAssignmentStatus = () => {
|
|
178
157
|
if (!isAssignmentSubmitted && isAssignmentClosed) {
|
|
179
|
-
return
|
|
158
|
+
return React.createElement(Text, {
|
|
180
159
|
bold: true,
|
|
181
160
|
role: "danger",
|
|
182
|
-
size: "small"
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
});
|
|
161
|
+
size: "small"
|
|
162
|
+
}, intl.formatMessage({
|
|
163
|
+
id: 'materialAssignment.status.deadlineExpired'
|
|
164
|
+
}));
|
|
187
165
|
}
|
|
188
166
|
if (isAssignmentResultVisible) {
|
|
189
|
-
return
|
|
167
|
+
return React.createElement(Text, {
|
|
190
168
|
bold: true,
|
|
191
169
|
role: "lightpurple",
|
|
192
|
-
size: "small"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
});
|
|
170
|
+
size: "small"
|
|
171
|
+
}, intl.formatMessage({
|
|
172
|
+
id: 'materialAssignment.status.graded'
|
|
173
|
+
}));
|
|
197
174
|
}
|
|
198
175
|
if (isAssignmentSubmitted) {
|
|
199
|
-
return
|
|
176
|
+
return React.createElement(StyledSubmittedText, {
|
|
200
177
|
bold: true,
|
|
201
178
|
role: "success",
|
|
202
|
-
size: "small"
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
});
|
|
179
|
+
size: "small"
|
|
180
|
+
}, intl.formatMessage({
|
|
181
|
+
id: 'materialAssignment.status.submitted'
|
|
182
|
+
}));
|
|
207
183
|
}
|
|
208
|
-
return
|
|
184
|
+
return React.createElement(StyledNoSubmittedText, {
|
|
209
185
|
bold: true,
|
|
210
186
|
role: "warning",
|
|
211
|
-
size: "small"
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
});
|
|
187
|
+
size: "small"
|
|
188
|
+
}, intl.formatMessage({
|
|
189
|
+
id: 'materialAssignment.status.noSubmitted'
|
|
190
|
+
}));
|
|
216
191
|
};
|
|
217
|
-
|
|
192
|
+
const renderAssignmentScore = () => {
|
|
218
193
|
var _a;
|
|
219
|
-
return
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
width: 0.25
|
|
231
|
-
})]
|
|
232
|
-
});
|
|
194
|
+
return React.createElement(React.Fragment, null, React.createElement(Text, {
|
|
195
|
+
bold: true,
|
|
196
|
+
role: "white",
|
|
197
|
+
size: "small"
|
|
198
|
+
}, intl.formatMessage({
|
|
199
|
+
id: 'materialAssignment.table.column.score'
|
|
200
|
+
}, {
|
|
201
|
+
score: (_a = materialAssignmentGradeResult === null || materialAssignmentGradeResult === void 0 ? void 0 : materialAssignmentGradeResult.score) !== null && _a !== void 0 ? _a : '--'
|
|
202
|
+
})), React.createElement(Hspace, {
|
|
203
|
+
width: 0.25
|
|
204
|
+
}));
|
|
233
205
|
};
|
|
234
|
-
|
|
206
|
+
const renderAssignmentAttachment = () => {
|
|
235
207
|
if (materialAssignmentSubmission === null || materialAssignmentSubmission === void 0 ? void 0 : materialAssignmentSubmission.assignmentFileUrl) {
|
|
236
|
-
return
|
|
208
|
+
return React.createElement("a", {
|
|
237
209
|
href: materialAssignmentSubmission.assignmentFileUrl,
|
|
238
210
|
download: assignmentFilename,
|
|
239
211
|
target: "_blank",
|
|
240
|
-
rel: "noopener noreferrer"
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
})
|
|
248
|
-
});
|
|
212
|
+
rel: "noopener noreferrer"
|
|
213
|
+
}, React.createElement(Text, {
|
|
214
|
+
hoverable: true,
|
|
215
|
+
underline: true,
|
|
216
|
+
role: "white",
|
|
217
|
+
size: "small"
|
|
218
|
+
}, assignmentFilename));
|
|
249
219
|
}
|
|
250
220
|
if (materialAssignmentSubmission === null || materialAssignmentSubmission === void 0 ? void 0 : materialAssignmentSubmission.assignmentUrl) {
|
|
251
|
-
return
|
|
221
|
+
return React.createElement("a", {
|
|
252
222
|
href: materialAssignmentSubmission.assignmentUrl,
|
|
253
223
|
target: "_blank",
|
|
254
|
-
rel: "noopener noreferrer"
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
})
|
|
262
|
-
});
|
|
224
|
+
rel: "noopener noreferrer"
|
|
225
|
+
}, React.createElement(Text, {
|
|
226
|
+
hoverable: true,
|
|
227
|
+
underline: true,
|
|
228
|
+
role: "white",
|
|
229
|
+
size: "small"
|
|
230
|
+
}, materialAssignmentSubmission.assignmentUrl));
|
|
263
231
|
}
|
|
264
232
|
return '--';
|
|
265
233
|
};
|
|
266
|
-
return
|
|
267
|
-
dark: true
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
id: 'materialAssignment.table.column.uploadedFile'
|
|
306
|
-
})
|
|
307
|
-
}), jsx("td", {
|
|
308
|
-
children: jsxs("div", {
|
|
309
|
-
children: [renderAssignmentAttachment(), jsx(Vspace, {
|
|
310
|
-
height: 0.75
|
|
311
|
-
}), jsx(StyledUploadButton, {
|
|
312
|
-
size: "tiny",
|
|
313
|
-
role: "lightpurple",
|
|
314
|
-
disabled: [isAssignmentResultVisible, !materialAssignment.isResubmitEnabled && isAssignmentSubmitted, isAssignmentClosed].some(Boolean),
|
|
315
|
-
onClick: function onClick() {
|
|
316
|
-
return setShowAssignmentSubmitModal(true);
|
|
317
|
-
},
|
|
318
|
-
children: intl.formatMessage({
|
|
319
|
-
id: 'materialAssignment.button.upload'
|
|
320
|
-
})
|
|
321
|
-
})]
|
|
322
|
-
})
|
|
323
|
-
})]
|
|
324
|
-
}), jsxs("tr", {
|
|
325
|
-
children: [jsx(StyledTableHeaderCell, {
|
|
326
|
-
children: intl.formatMessage({
|
|
327
|
-
id: 'materialAssignment.table.column.assignmentScore'
|
|
328
|
-
})
|
|
329
|
-
}), jsxs("td", {
|
|
330
|
-
children: [renderAssignmentScore(), jsx(StyledTotalPointText, {
|
|
331
|
-
role: "navy4",
|
|
332
|
-
size: "small",
|
|
333
|
-
children: intl.formatMessage({
|
|
334
|
-
id: 'materialAssignment.table.column.totalPoint'
|
|
335
|
-
}, {
|
|
336
|
-
point: (_a = materialLecturePage === null || materialLecturePage === void 0 ? void 0 : materialLecturePage.point) !== null && _a !== void 0 ? _a : '--'
|
|
337
|
-
})
|
|
338
|
-
})]
|
|
339
|
-
})]
|
|
340
|
-
})]
|
|
341
|
-
})
|
|
342
|
-
});
|
|
234
|
+
return React.createElement(InfoTable, {
|
|
235
|
+
dark: true
|
|
236
|
+
}, React.createElement("tbody", null, React.createElement("tr", null, React.createElement(StyledTableHeaderCell, {
|
|
237
|
+
style: {
|
|
238
|
+
width: '19%'
|
|
239
|
+
}
|
|
240
|
+
}, intl.formatMessage({
|
|
241
|
+
id: 'materialAssignment.table.column.status'
|
|
242
|
+
})), React.createElement("td", null, renderAssignmentStatus())), React.createElement("tr", null, React.createElement(StyledTableHeaderCell, null, intl.formatMessage({
|
|
243
|
+
id: 'materialAssignment.table.column.deadlineDatetime'
|
|
244
|
+
})), React.createElement("td", null, intl.formatDate(materialAssignment.closeDatetime, {
|
|
245
|
+
dateStyle: 'medium',
|
|
246
|
+
timeStyle: 'short'
|
|
247
|
+
}))), React.createElement("tr", null, React.createElement(StyledTableHeaderCell, null, intl.formatMessage({
|
|
248
|
+
id: 'materialAssignment.table.column.lastSubmitDatetime'
|
|
249
|
+
})), React.createElement("td", null, (materialAssignmentSubmission === null || materialAssignmentSubmission === void 0 ? void 0 : materialAssignmentSubmission.createdDatetime) ? intl.formatDate(materialAssignmentSubmission.createdDatetime, {
|
|
250
|
+
dateStyle: 'medium',
|
|
251
|
+
timeStyle: 'short'
|
|
252
|
+
}) : '--')), React.createElement("tr", null, React.createElement(StyledTableHeaderCell, null, intl.formatMessage({
|
|
253
|
+
id: 'materialAssignment.table.column.uploadedFile'
|
|
254
|
+
})), React.createElement("td", null, React.createElement("div", null, renderAssignmentAttachment(), React.createElement(Vspace, {
|
|
255
|
+
height: 0.75
|
|
256
|
+
}), React.createElement(StyledUploadButton, {
|
|
257
|
+
size: "tiny",
|
|
258
|
+
role: "lightpurple",
|
|
259
|
+
disabled: [isAssignmentResultVisible, !materialAssignment.isResubmitEnabled && isAssignmentSubmitted, isAssignmentClosed].some(Boolean),
|
|
260
|
+
onClick: () => setShowAssignmentSubmitModal(true)
|
|
261
|
+
}, intl.formatMessage({
|
|
262
|
+
id: 'materialAssignment.button.upload'
|
|
263
|
+
}))))), React.createElement("tr", null, React.createElement(StyledTableHeaderCell, null, intl.formatMessage({
|
|
264
|
+
id: 'materialAssignment.table.column.assignmentScore'
|
|
265
|
+
})), React.createElement("td", null, renderAssignmentScore(), React.createElement(StyledTotalPointText, {
|
|
266
|
+
role: "navy4",
|
|
267
|
+
size: "small"
|
|
268
|
+
}, intl.formatMessage({
|
|
269
|
+
id: 'materialAssignment.table.column.totalPoint'
|
|
270
|
+
}, {
|
|
271
|
+
point: (_a = materialLecturePage === null || materialLecturePage === void 0 ? void 0 : materialLecturePage.point) !== null && _a !== void 0 ? _a : '--'
|
|
272
|
+
}))))));
|
|
343
273
|
};
|
|
344
274
|
/**
|
|
345
275
|
*
|
|
346
276
|
*/
|
|
347
|
-
|
|
277
|
+
const renderAssignmentFeedback = () => {
|
|
348
278
|
var _a;
|
|
349
|
-
|
|
279
|
+
const tableColumns = [{
|
|
350
280
|
Header: intl.formatMessage({
|
|
351
281
|
id: 'materialAssignment.table.header.index'
|
|
352
282
|
}),
|
|
@@ -358,20 +288,15 @@ var MaterialAssignmentContent = function MaterialAssignmentContent(_ref) {
|
|
|
358
288
|
}),
|
|
359
289
|
accessor: 'feedback'
|
|
360
290
|
}];
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
children: grade.comment
|
|
371
|
-
})
|
|
372
|
-
};
|
|
373
|
-
})) !== null && _a !== void 0 ? _a : [];
|
|
374
|
-
return jsx(TableNext, {
|
|
291
|
+
const tableData = (_a = materialAssignmentGradeList === null || materialAssignmentGradeList === void 0 ? void 0 : materialAssignmentGradeList.filter(grade => grade.comment.length).map((grade, index) => ({
|
|
292
|
+
index: index + 1,
|
|
293
|
+
feedback: React.createElement(Text, {
|
|
294
|
+
preWrap: true,
|
|
295
|
+
size: "small",
|
|
296
|
+
role: "navy1"
|
|
297
|
+
}, grade.comment)
|
|
298
|
+
}))) !== null && _a !== void 0 ? _a : [];
|
|
299
|
+
return React.createElement(TableNext, {
|
|
375
300
|
dark: true,
|
|
376
301
|
columns: tableColumns,
|
|
377
302
|
data: tableData,
|
|
@@ -383,54 +308,47 @@ var MaterialAssignmentContent = function MaterialAssignmentContent(_ref) {
|
|
|
383
308
|
/**
|
|
384
309
|
*
|
|
385
310
|
*/
|
|
386
|
-
|
|
311
|
+
const renderAssignmentUploadModal = () => {
|
|
387
312
|
if (!showAssignmentSubmitModal) {
|
|
388
313
|
return null;
|
|
389
314
|
}
|
|
390
|
-
return
|
|
315
|
+
return React.createElement(MaterialAssignmentUploadModal, {
|
|
391
316
|
materialAssignment: materialAssignment,
|
|
392
|
-
onClose:
|
|
393
|
-
return setShowAssignmentSubmitModal(false);
|
|
394
|
-
},
|
|
317
|
+
onClose: () => setShowAssignmentSubmitModal(false),
|
|
395
318
|
onSubmitCallback: doGetOrgMaterialAssignmentGet
|
|
396
319
|
});
|
|
397
320
|
};
|
|
398
|
-
return
|
|
399
|
-
title: materialAssignment.title
|
|
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
|
-
}), jsx(Vspace, {
|
|
431
|
-
height: 0.75
|
|
432
|
-
}), renderAssignmentFeedback(), renderAssignmentUploadModal()]
|
|
433
|
-
});
|
|
321
|
+
return React.createElement(MaterialAssignmentContainer, {
|
|
322
|
+
title: materialAssignment.title
|
|
323
|
+
}, React.createElement(Text, {
|
|
324
|
+
bold: true,
|
|
325
|
+
block: true,
|
|
326
|
+
role: "white"
|
|
327
|
+
}, intl.formatMessage({
|
|
328
|
+
id: 'materialAssignment.label.general'
|
|
329
|
+
})), React.createElement(Text, {
|
|
330
|
+
role: "navy3",
|
|
331
|
+
size: "tiny"
|
|
332
|
+
}, intl.formatMessage({
|
|
333
|
+
id: 'materialAssignment.description.general'
|
|
334
|
+
})), React.createElement(Vspace, {
|
|
335
|
+
height: 0.75
|
|
336
|
+
}), renderAssignmentInfo(), React.createElement(Vspace, {
|
|
337
|
+
height: 1.5
|
|
338
|
+
}), React.createElement(Text, {
|
|
339
|
+
bold: true,
|
|
340
|
+
block: true,
|
|
341
|
+
role: "white"
|
|
342
|
+
}, intl.formatMessage({
|
|
343
|
+
id: 'materialAssignment.label.feedback'
|
|
344
|
+
})), React.createElement(Text, {
|
|
345
|
+
role: "navy3",
|
|
346
|
+
size: "tiny"
|
|
347
|
+
}, intl.formatMessage({
|
|
348
|
+
id: 'materialAssignment.description.feedback'
|
|
349
|
+
})), React.createElement(Vspace, {
|
|
350
|
+
height: 0.75
|
|
351
|
+
}), renderAssignmentFeedback(), renderAssignmentUploadModal());
|
|
434
352
|
};
|
|
435
353
|
|
|
436
354
|
export { MaterialAssignmentContent as default };
|