touchstudy-core 0.1.73 → 0.1.74
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/dist/components/Loading/LoadingComponent.d.ts +4 -2
- package/dist/containers/ExamResult/components/Charts/TimeOrderChart.d.ts +10 -0
- package/dist/containers/ExamResult/components/CompareGrass/index.d.ts +0 -1
- package/dist/containers/ExamResult/components/Dialog/PrintDialog.d.ts +6 -0
- package/dist/containers/ExamResult/components/GradesByTerritory/index.d.ts +3 -5
- package/dist/containers/ExamResult/components/LoadingDots.d.ts +6 -0
- package/dist/containers/ExamResult/components/MyAnswer/index.d.ts +1 -2
- package/dist/containers/ExamResult/components/ProtractedProblem/index.d.ts +4 -5
- package/dist/containers/ExamResult/components/TrickyProblem/index.d.ts +4 -5
- package/dist/containers/ExamResult/components/Vulnerable/index.d.ts +4 -5
- package/dist/containers/ExamResult/configs/functions.d.ts +1 -0
- package/dist/containers/ExamResult/configs/types.d.ts +13 -0
- package/dist/containers/ExamResult/hooks/useExamResult.d.ts +16 -6
- package/dist/containers/ExamResult/hooks/usePrintExamResult.d.ts +10 -0
- package/dist/containers/ExamResult/hooks/usePrintView.d.ts +8 -0
- package/dist/containers/ExamResult/views/ExamResultView.d.ts +11 -0
- package/dist/containers/ExamResult/views/PrintExamResult.d.ts +19 -0
- package/dist/containers/ExamResult/views/PrintExamResultView.d.ts +12 -0
- package/dist/containers/ExamResult/views/PrintPdfExamResult.d.ts +12 -0
- package/dist/containers/Exams/components/ArticleGroupView.d.ts +2 -0
- package/dist/containers/Exams/hooks/useExamDetailView.d.ts +2 -2
- package/dist/containers/Select/Category/hook/useCategorySelect.d.ts +2 -1
- package/dist/containers/Select/Subject/hook/useSubjectSelect.d.ts +6 -2
- package/dist/index.css +33 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +811 -923
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +808 -922
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/LayoutContext.d.ts +1 -0
- package/dist/utils/hooks/useLayoutContext.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
@@ -15,7 +15,7 @@ import 'moment/locale/ko.js';
|
|
15
15
|
import 'moment/locale/en-au.js';
|
16
16
|
import Pusher from 'pusher-js';
|
17
17
|
import { IoClose, IoCloseCircle, IoLogOut, IoCloseOutline, IoSearch, IoChevronUp, IoChevronDown } from 'react-icons/io5';
|
18
|
-
import i18n from 'i18next';
|
18
|
+
import i18n, { t as t$1 } from 'i18next';
|
19
19
|
import Box$1 from '@mui/material/Box';
|
20
20
|
import Popover from '@mui/material/Popover';
|
21
21
|
import MenuItem from '@mui/material/MenuItem';
|
@@ -30,13 +30,12 @@ import { IoMdArrowBack } from 'react-icons/io';
|
|
30
30
|
import _ from 'lodash';
|
31
31
|
import { FaPencil } from 'react-icons/fa6';
|
32
32
|
import CreatableSelect from 'react-select/creatable';
|
33
|
-
import html2canvas from 'html2canvas';
|
34
|
-
import { jsPDF } from 'jspdf';
|
35
33
|
import Button$1 from '@mui/material/Button';
|
36
34
|
import DialogTitle$1 from '@mui/material/DialogTitle';
|
37
35
|
import DialogContent$1 from '@mui/material/DialogContent';
|
38
36
|
import DialogActions$1 from '@mui/material/DialogActions';
|
39
37
|
import Typography$1 from '@mui/material/Typography';
|
38
|
+
import html2pdf from 'html2pdf.js';
|
40
39
|
import Avatar from '@mui/material/Avatar';
|
41
40
|
import TextField$1 from '@mui/material/TextField';
|
42
41
|
import Paper$1 from '@mui/material/Paper';
|
@@ -123,10 +122,6 @@ var RecentUserAction = {
|
|
123
122
|
AddedStudentToClass: "added_student_to_class",
|
124
123
|
RemovedStudentFromClass: "removed_student_from_class"
|
125
124
|
};
|
126
|
-
var PrintHeaderClassName = "print-header";
|
127
|
-
var PrintTitleClassName = "print-title";
|
128
|
-
var PrintContentClassName = "print-content";
|
129
|
-
var PrintContainerClassName = "print-container";
|
130
125
|
|
131
126
|
var utcToLocalTime = (function (time, FORMAT) {
|
132
127
|
if (time === DATE_MIN_VALUE || time === DATE_TIME_MIN_VALUE) return "";
|
@@ -176,194 +171,11 @@ function _taggedTemplateLiteralLoose(strings, raw) {
|
|
176
171
|
var styles = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","btn-login-google":"_2HqmH","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","academy-btn":"_1JMRU","switch-icon":"_N4FNf","dropdown-content-academy":"_31Dr0","dropdown-academy-item":"_3bjcz","noGutters":"_31ZQk","custom-col-2":"_3yXyK","custom-col-3":"_1RsJQ","custom-col-5":"_L42CP","custom-col-10":"_2u6eL","custom-row":"_8x7OP","custom-col":"_1JmTh","custom-col-4":"_3HO1e","custom-col-8":"_Oy31M","custom-col-12":"_3aUKo","custom-container":"_39LRs","form-label":"__Ut-u","form-control":"_2k4dX","btn-outline-primary":"_2PWdX","sort-icons":"_mQvLF","active":"_3oAH-","form-select":"_3W3aw","truncate":"_3NJzN","headers":"_3xnI5","logo-container":"_3YG70","tabBox":"_1CQPn","routerBox":"_3hx2T","tabText":"_3UyhW","router-link-active":"_1TGKA","router-link":"_1AqMh","userImg":"_2RI6G","disabled-link":"_3aVHg","line-clamp":"_3fpky"};
|
177
172
|
|
178
173
|
// A type of promise-like that resolves synchronously and supports only one observer
|
179
|
-
const _Pact = /*#__PURE__*/(function() {
|
180
|
-
function _Pact() {}
|
181
|
-
_Pact.prototype.then = function(onFulfilled, onRejected) {
|
182
|
-
const result = new _Pact();
|
183
|
-
const state = this.s;
|
184
|
-
if (state) {
|
185
|
-
const callback = state & 1 ? onFulfilled : onRejected;
|
186
|
-
if (callback) {
|
187
|
-
try {
|
188
|
-
_settle(result, 1, callback(this.v));
|
189
|
-
} catch (e) {
|
190
|
-
_settle(result, 2, e);
|
191
|
-
}
|
192
|
-
return result;
|
193
|
-
} else {
|
194
|
-
return this;
|
195
|
-
}
|
196
|
-
}
|
197
|
-
this.o = function(_this) {
|
198
|
-
try {
|
199
|
-
const value = _this.v;
|
200
|
-
if (_this.s & 1) {
|
201
|
-
_settle(result, 1, onFulfilled ? onFulfilled(value) : value);
|
202
|
-
} else if (onRejected) {
|
203
|
-
_settle(result, 1, onRejected(value));
|
204
|
-
} else {
|
205
|
-
_settle(result, 2, value);
|
206
|
-
}
|
207
|
-
} catch (e) {
|
208
|
-
_settle(result, 2, e);
|
209
|
-
}
|
210
|
-
};
|
211
|
-
return result;
|
212
|
-
};
|
213
|
-
return _Pact;
|
214
|
-
})();
|
215
|
-
|
216
|
-
// Settles a pact synchronously
|
217
|
-
function _settle(pact, state, value) {
|
218
|
-
if (!pact.s) {
|
219
|
-
if (value instanceof _Pact) {
|
220
|
-
if (value.s) {
|
221
|
-
if (state & 1) {
|
222
|
-
state = value.s;
|
223
|
-
}
|
224
|
-
value = value.v;
|
225
|
-
} else {
|
226
|
-
value.o = _settle.bind(null, pact, state);
|
227
|
-
return;
|
228
|
-
}
|
229
|
-
}
|
230
|
-
if (value && value.then) {
|
231
|
-
value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
|
232
|
-
return;
|
233
|
-
}
|
234
|
-
pact.s = state;
|
235
|
-
pact.v = value;
|
236
|
-
const observer = pact.o;
|
237
|
-
if (observer) {
|
238
|
-
observer(pact);
|
239
|
-
}
|
240
|
-
}
|
241
|
-
}
|
242
|
-
|
243
|
-
function _isSettledPact(thenable) {
|
244
|
-
return thenable instanceof _Pact && thenable.s & 1;
|
245
|
-
}
|
246
|
-
|
247
|
-
// Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)
|
248
|
-
function _forTo(array, body, check) {
|
249
|
-
var i = -1, pact, reject;
|
250
|
-
function _cycle(result) {
|
251
|
-
try {
|
252
|
-
while (++i < array.length && (!check || !check())) {
|
253
|
-
result = body(i);
|
254
|
-
if (result && result.then) {
|
255
|
-
if (_isSettledPact(result)) {
|
256
|
-
result = result.v;
|
257
|
-
} else {
|
258
|
-
result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
|
259
|
-
return;
|
260
|
-
}
|
261
|
-
}
|
262
|
-
}
|
263
|
-
if (pact) {
|
264
|
-
_settle(pact, 1, result);
|
265
|
-
} else {
|
266
|
-
pact = result;
|
267
|
-
}
|
268
|
-
} catch (e) {
|
269
|
-
_settle(pact || (pact = new _Pact()), 2, e);
|
270
|
-
}
|
271
|
-
}
|
272
|
-
_cycle();
|
273
|
-
return pact;
|
274
|
-
}
|
275
174
|
|
276
175
|
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
277
176
|
|
278
177
|
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
279
178
|
|
280
|
-
// Asynchronously implement a generic for loop
|
281
|
-
function _for(test, update, body) {
|
282
|
-
var stage;
|
283
|
-
for (;;) {
|
284
|
-
var shouldContinue = test();
|
285
|
-
if (_isSettledPact(shouldContinue)) {
|
286
|
-
shouldContinue = shouldContinue.v;
|
287
|
-
}
|
288
|
-
if (!shouldContinue) {
|
289
|
-
return result;
|
290
|
-
}
|
291
|
-
if (shouldContinue.then) {
|
292
|
-
stage = 0;
|
293
|
-
break;
|
294
|
-
}
|
295
|
-
var result = body();
|
296
|
-
if (result && result.then) {
|
297
|
-
if (_isSettledPact(result)) {
|
298
|
-
result = result.s;
|
299
|
-
} else {
|
300
|
-
stage = 1;
|
301
|
-
break;
|
302
|
-
}
|
303
|
-
}
|
304
|
-
if (update) {
|
305
|
-
var updateValue = update();
|
306
|
-
if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
|
307
|
-
stage = 2;
|
308
|
-
break;
|
309
|
-
}
|
310
|
-
}
|
311
|
-
}
|
312
|
-
var pact = new _Pact();
|
313
|
-
var reject = _settle.bind(null, pact, 2);
|
314
|
-
(stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);
|
315
|
-
return pact;
|
316
|
-
function _resumeAfterBody(value) {
|
317
|
-
result = value;
|
318
|
-
do {
|
319
|
-
if (update) {
|
320
|
-
updateValue = update();
|
321
|
-
if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
|
322
|
-
updateValue.then(_resumeAfterUpdate).then(void 0, reject);
|
323
|
-
return;
|
324
|
-
}
|
325
|
-
}
|
326
|
-
shouldContinue = test();
|
327
|
-
if (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {
|
328
|
-
_settle(pact, 1, result);
|
329
|
-
return;
|
330
|
-
}
|
331
|
-
if (shouldContinue.then) {
|
332
|
-
shouldContinue.then(_resumeAfterTest).then(void 0, reject);
|
333
|
-
return;
|
334
|
-
}
|
335
|
-
result = body();
|
336
|
-
if (_isSettledPact(result)) {
|
337
|
-
result = result.v;
|
338
|
-
}
|
339
|
-
} while (!result || !result.then);
|
340
|
-
result.then(_resumeAfterBody).then(void 0, reject);
|
341
|
-
}
|
342
|
-
function _resumeAfterTest(shouldContinue) {
|
343
|
-
if (shouldContinue) {
|
344
|
-
result = body();
|
345
|
-
if (result && result.then) {
|
346
|
-
result.then(_resumeAfterBody).then(void 0, reject);
|
347
|
-
} else {
|
348
|
-
_resumeAfterBody(result);
|
349
|
-
}
|
350
|
-
} else {
|
351
|
-
_settle(pact, 1, result);
|
352
|
-
}
|
353
|
-
}
|
354
|
-
function _resumeAfterUpdate() {
|
355
|
-
if (shouldContinue = test()) {
|
356
|
-
if (shouldContinue.then) {
|
357
|
-
shouldContinue.then(_resumeAfterTest).then(void 0, reject);
|
358
|
-
} else {
|
359
|
-
_resumeAfterTest(shouldContinue);
|
360
|
-
}
|
361
|
-
} else {
|
362
|
-
_settle(pact, 1, result);
|
363
|
-
}
|
364
|
-
}
|
365
|
-
}
|
366
|
-
|
367
179
|
// Asynchronously call a function and send errors to recovery continuation
|
368
180
|
function _catch(body, recover) {
|
369
181
|
try {
|
@@ -1499,8 +1311,11 @@ var switchSuperAdminAcademy = function switchSuperAdminAcademy(academyId, role)
|
|
1499
1311
|
return api.post(SUPER_ADMIN_ACADEMY_URL + "/" + academyId + "/switch-academy/" + role);
|
1500
1312
|
};
|
1501
1313
|
|
1502
|
-
var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
|
1314
|
+
var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy) {
|
1503
1315
|
var _currentPusher$connec2;
|
1316
|
+
if (showLoadingAcademy === void 0) {
|
1317
|
+
showLoadingAcademy = true;
|
1318
|
+
}
|
1504
1319
|
var _useGoogleSignOut = useGoogleSignOut({}),
|
1505
1320
|
handleSignOut = _useGoogleSignOut.handleSignOut;
|
1506
1321
|
var _useTranslation = useTranslation(),
|
@@ -1529,10 +1344,10 @@ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
|
|
1529
1344
|
var handleGetAcademyDetail = function handleGetAcademyDetail() {
|
1530
1345
|
try {
|
1531
1346
|
var _temp2 = function _temp2() {
|
1532
|
-
dispatch(setLoading(false));
|
1347
|
+
showLoadingAcademy && dispatch(setLoading(false));
|
1533
1348
|
};
|
1534
1349
|
if (!academyDomain) return Promise.resolve();
|
1535
|
-
dispatch(setLoading(true));
|
1350
|
+
showLoadingAcademy && dispatch(setLoading(true));
|
1536
1351
|
var _temp = _catch(function () {
|
1537
1352
|
return Promise.resolve(getAcademyDetail()).then(function (info) {
|
1538
1353
|
if (info) {
|
@@ -1670,27 +1485,38 @@ var loadingStyle$1 = {
|
|
1670
1485
|
alignItems: "center"
|
1671
1486
|
};
|
1672
1487
|
var LoadingComponent = function LoadingComponent(_ref) {
|
1673
|
-
var isLoading = _ref.isLoading
|
1488
|
+
var isLoading = _ref.isLoading,
|
1489
|
+
children = _ref.children,
|
1490
|
+
_ref$spinClassName = _ref.spinClassName,
|
1491
|
+
spinClassName = _ref$spinClassName === void 0 ? "text-secondary" : _ref$spinClassName,
|
1492
|
+
_ref$className = _ref.className,
|
1493
|
+
className = _ref$className === void 0 ? "" : _ref$className;
|
1674
1494
|
return isLoading ? React__default.createElement("div", {
|
1675
1495
|
style: loadingStyle$1
|
1496
|
+
}, React__default.createElement(Stack, {
|
1497
|
+
direction: "column",
|
1498
|
+
justifyContent: "center",
|
1499
|
+
alignItems: "center",
|
1500
|
+
className: className
|
1676
1501
|
}, React__default.createElement("div", {
|
1677
|
-
className: "spinner-border
|
1502
|
+
className: "spinner-border " + spinClassName,
|
1678
1503
|
role: "status"
|
1679
1504
|
}, React__default.createElement("span", {
|
1680
1505
|
className: "sr-only"
|
1681
|
-
}))) : null;
|
1506
|
+
})), React__default.createElement("div", null, children))) : null;
|
1682
1507
|
};
|
1683
1508
|
|
1684
1509
|
var LayoutContext = function LayoutContext(_ref) {
|
1685
1510
|
var children = _ref.children,
|
1686
1511
|
role = _ref.role,
|
1687
1512
|
_ref$pusherRegisterUr = _ref.pusherRegisterUrls,
|
1688
|
-
pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr
|
1513
|
+
pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr,
|
1514
|
+
showLoadingAcademy = _ref.showLoadingAcademy;
|
1689
1515
|
var user = useSelector(function (state) {
|
1690
1516
|
var _state$common;
|
1691
1517
|
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
1692
1518
|
});
|
1693
|
-
useLayoutContext(role, pusherRegisterUrls);
|
1519
|
+
useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy);
|
1694
1520
|
if (!(user !== null && user !== void 0 && user.email)) return React__default.createElement(LoadingComponent, {
|
1695
1521
|
isLoading: true
|
1696
1522
|
});else return React__default.createElement(Fragment$1, null, children);
|
@@ -1885,7 +1711,9 @@ var getSubjectListApi = function getSubjectListApi() {
|
|
1885
1711
|
}
|
1886
1712
|
};
|
1887
1713
|
|
1888
|
-
var useSubjectSelect = function useSubjectSelect() {
|
1714
|
+
var useSubjectSelect = function useSubjectSelect(_ref) {
|
1715
|
+
var onChangeExam = _ref.onChangeExam,
|
1716
|
+
exam = _ref.exam;
|
1889
1717
|
var firstLoad = true;
|
1890
1718
|
var dispatch = useDispatch();
|
1891
1719
|
var _useState = useState(),
|
@@ -1943,18 +1771,15 @@ var useSubjectSelect = function useSubjectSelect() {
|
|
1943
1771
|
var selectedSubject = subjectList === null || subjectList === void 0 ? void 0 : subjectList.find(function (subject) {
|
1944
1772
|
return subject.id === id;
|
1945
1773
|
});
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
if (!subject) return;
|
1950
|
-
setSelectedSubject(subject);
|
1774
|
+
onChangeExam(_extends({}, exam, {
|
1775
|
+
subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
|
1776
|
+
}));
|
1951
1777
|
};
|
1952
1778
|
return {
|
1953
1779
|
subjectOptions: subjectOptions,
|
1954
1780
|
selectedSubject: selectedSubject,
|
1955
1781
|
subjectList: subjectList,
|
1956
|
-
handleChangeSubject: handleChangeSubject
|
1957
|
-
handleChangeSelectedSubject: handleChangeSelectedSubject
|
1782
|
+
handleChangeSubject: handleChangeSubject
|
1958
1783
|
};
|
1959
1784
|
};
|
1960
1785
|
|
@@ -2604,7 +2429,7 @@ var exam = "시험";
|
|
2604
2429
|
var me = "나";
|
2605
2430
|
var teacher_name = "선생님 성함";
|
2606
2431
|
var class_schedule = "수업 시간표";
|
2607
|
-
var summary = "
|
2432
|
+
var summary = "전체 현황";
|
2608
2433
|
var load_exam = "시험 로드";
|
2609
2434
|
var exam_name = "시험 이름";
|
2610
2435
|
var student_phone_number_header = "학생 전화번호";
|
@@ -2630,6 +2455,13 @@ var total_users = "총 사용자";
|
|
2630
2455
|
var added_date = "추가된 날짜";
|
2631
2456
|
var sync_exam_results = "시험 결과 동기화";
|
2632
2457
|
var update_data_fail = "데이터 업데이트 실패";
|
2458
|
+
var add_students_to_class = "수업에 학생 추가";
|
2459
|
+
var click_to_choose_file = "파일을 선택하려면 클릭하세요.";
|
2460
|
+
var exam_data = "시험 데이터";
|
2461
|
+
var questions_correct_rate = "질문 정답률";
|
2462
|
+
var question_management = "질문 관리";
|
2463
|
+
var student_data = "학생 데이터";
|
2464
|
+
var problem_number_question_chart = "문제 {{number}}번";
|
2633
2465
|
var are_you_sure_to_sync_exam_results_to_academy = "시험 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까(백그라운드에서 실행되며 시간이 다소 소요됨)";
|
2634
2466
|
var messages = {
|
2635
2467
|
exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
|
@@ -3373,6 +3205,13 @@ var lang_ko = {
|
|
3373
3205
|
added_date: added_date,
|
3374
3206
|
sync_exam_results: sync_exam_results,
|
3375
3207
|
update_data_fail: update_data_fail,
|
3208
|
+
add_students_to_class: add_students_to_class,
|
3209
|
+
click_to_choose_file: click_to_choose_file,
|
3210
|
+
exam_data: exam_data,
|
3211
|
+
questions_correct_rate: questions_correct_rate,
|
3212
|
+
question_management: question_management,
|
3213
|
+
student_data: student_data,
|
3214
|
+
problem_number_question_chart: problem_number_question_chart,
|
3376
3215
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy,
|
3377
3216
|
messages: messages,
|
3378
3217
|
submit: submit,
|
@@ -3509,8 +3348,8 @@ var number_answer$1 = "No.{{number}}";
|
|
3509
3348
|
var answer_no$1 = "Ans.{{number}}";
|
3510
3349
|
var answer_rate$1 = "Answer rate";
|
3511
3350
|
var seconds$1 = "s";
|
3512
|
-
var search_placeholder$1 = "Search by
|
3513
|
-
var search_by_student$1 = "Search by
|
3351
|
+
var search_placeholder$1 = "Search by Exam Name";
|
3352
|
+
var search_by_student$1 = "Search by Student Name";
|
3514
3353
|
var study_touch$1 = "Study touch";
|
3515
3354
|
var exam_information$1 = "Exam information";
|
3516
3355
|
var issue_number$1 = "Issue number";
|
@@ -3586,8 +3425,8 @@ var update_exam$1 = "Update exam";
|
|
3586
3425
|
var create_exam$1 = "Create exam";
|
3587
3426
|
var back$1 = "Back";
|
3588
3427
|
var date_format_exam$1 = "MMMM YYYY";
|
3589
|
-
var date_format$1 = "MMM.D YYYY";
|
3590
|
-
var date_time_format$1 = "HH:mm MMM.D YYYY ";
|
3428
|
+
var date_format$1 = "MMM. D. YYYY";
|
3429
|
+
var date_time_format$1 = "HH:mm MMM. D YYYY ";
|
3591
3430
|
var date_time_format_12h$1 = "MM-DD-YYYY HH:mm A";
|
3592
3431
|
var full_date_time_format$1 = "MMM Do YYYY HH:mm:ss";
|
3593
3432
|
var total_questions$1 = "Total questions";
|
@@ -3660,8 +3499,9 @@ var problem_number_question$1 = "Question {{number}}";
|
|
3660
3499
|
var teacher_in_charge$1 = "Teacher In Charge";
|
3661
3500
|
var counselor$1 = "Counselor";
|
3662
3501
|
var new_question$1 = "New Question";
|
3663
|
-
var hour$1 = "
|
3664
|
-
var
|
3502
|
+
var hour$1 = "hr";
|
3503
|
+
var hours = "hrs";
|
3504
|
+
var minute$1 = "min";
|
3665
3505
|
var second$1 = "second";
|
3666
3506
|
var question_order$1 = "Number {{number}}";
|
3667
3507
|
var send_message$1 = "Send Message";
|
@@ -3690,7 +3530,7 @@ var check_attendance$1 = "Check attendance";
|
|
3690
3530
|
var attendance_check$1 = "Attendance check";
|
3691
3531
|
var class_date$1 = "Class date";
|
3692
3532
|
var class_time$1 = "Class time";
|
3693
|
-
var attendance$1 = "Attendance";
|
3533
|
+
var attendance$1 = "Attendance List";
|
3694
3534
|
var attendance_completed$1 = "Attendance completed";
|
3695
3535
|
var none_attendance$1 = "Non-attendance";
|
3696
3536
|
var academy_list$1 = "Academy list";
|
@@ -4120,6 +3960,13 @@ var total_users$1 = "Total users";
|
|
4120
3960
|
var added_date$1 = "Added date";
|
4121
3961
|
var sync_exam_results$1 = "Sync exam results";
|
4122
3962
|
var update_data_fail$1 = "Update data fail";
|
3963
|
+
var add_students_to_class$1 = "Add students to class";
|
3964
|
+
var click_to_choose_file$1 = "Click to choose file";
|
3965
|
+
var exam_data$1 = "Exam Data";
|
3966
|
+
var questions_correct_rate$1 = "Questions Correct Rate";
|
3967
|
+
var question_management$1 = "Question Management";
|
3968
|
+
var student_data$1 = "Student Data";
|
3969
|
+
var problem_number_question_chart$1 = "Q. {{number}}";
|
4123
3970
|
var are_you_sure_to_sync_exam_results_to_academy$1 = "Are you sure to sync exam results to academy \"{{ academyName }}\" (it will run in the background and take a while)";
|
4124
3971
|
var messages$1 = {
|
4125
3972
|
exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
|
@@ -4408,6 +4255,7 @@ var lang_en = {
|
|
4408
4255
|
counselor: counselor$1,
|
4409
4256
|
new_question: new_question$1,
|
4410
4257
|
hour: hour$1,
|
4258
|
+
hours: hours,
|
4411
4259
|
minute: minute$1,
|
4412
4260
|
second: second$1,
|
4413
4261
|
question_order: question_order$1,
|
@@ -4862,6 +4710,13 @@ var lang_en = {
|
|
4862
4710
|
added_date: added_date$1,
|
4863
4711
|
sync_exam_results: sync_exam_results$1,
|
4864
4712
|
update_data_fail: update_data_fail$1,
|
4713
|
+
add_students_to_class: add_students_to_class$1,
|
4714
|
+
click_to_choose_file: click_to_choose_file$1,
|
4715
|
+
exam_data: exam_data$1,
|
4716
|
+
questions_correct_rate: questions_correct_rate$1,
|
4717
|
+
question_management: question_management$1,
|
4718
|
+
student_data: student_data$1,
|
4719
|
+
problem_number_question_chart: problem_number_question_chart$1,
|
4865
4720
|
are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy$1,
|
4866
4721
|
messages: messages$1,
|
4867
4722
|
submit: submit$1,
|
@@ -5666,7 +5521,6 @@ var ContentTooltip = function ContentTooltip(_ref) {
|
|
5666
5521
|
var ChatRightItem = function ChatRightItem(_ref) {
|
5667
5522
|
var content = _ref.content,
|
5668
5523
|
createdAt = _ref.createdAt,
|
5669
|
-
sender = _ref.sender,
|
5670
5524
|
showTimestamp = _ref.showTimestamp,
|
5671
5525
|
isStudent = _ref.isStudent,
|
5672
5526
|
showName = _ref.showName,
|
@@ -5699,13 +5553,15 @@ var ChatRightItem = function ChatRightItem(_ref) {
|
|
5699
5553
|
alignItems: "center",
|
5700
5554
|
justifyContent: "end",
|
5701
5555
|
flexDirection: "row"
|
5702
|
-
}, React__default.createElement(iconPersonNoActive,
|
5556
|
+
}, React__default.createElement(iconPersonNoActive, {
|
5557
|
+
color: styles.gray_700
|
5558
|
+
}), React__default.createElement(Typography, {
|
5703
5559
|
fontWeight: 700,
|
5704
5560
|
fontSize: 14,
|
5705
5561
|
padding: "4px",
|
5706
5562
|
lineHeight: "16.71px",
|
5707
5563
|
color: styles.gray_700
|
5708
|
-
},
|
5564
|
+
}, t("me"))), React__default.createElement(Stack, {
|
5709
5565
|
display: "flex",
|
5710
5566
|
flexDirection: "row",
|
5711
5567
|
gap: "8px",
|
@@ -6594,7 +6450,7 @@ var ChatHeader = function ChatHeader(_ref) {
|
|
6594
6450
|
sx: {
|
6595
6451
|
color: styles.gray_500
|
6596
6452
|
}
|
6597
|
-
}, (!!filterDurationExam.hours() ? filterDurationExam.hours() + " " + t("hour") : "") + " " + (!!filterDurationExam.minutes() ? filterDurationExam.minutes() + " " + t("minute") : "") + " " + (!!filterDurationExam.seconds() ? filterDurationExam.seconds() + " " + t("second") : "")))), React__default.createElement(Box, {
|
6453
|
+
}, (!!filterDurationExam.hours() ? filterDurationExam.hours() + " " + (filterDurationExam.hours() > 1 ? t("hours") : t("hour")) : "") + " " + (!!filterDurationExam.minutes() ? filterDurationExam.minutes() + " " + t("minute") : "") + " " + (!!filterDurationExam.seconds() ? filterDurationExam.seconds() + " " + t("second") : "")))), React__default.createElement(Box, {
|
6598
6454
|
display: "flex",
|
6599
6455
|
alignItems: "end",
|
6600
6456
|
gap: "6px",
|
@@ -6615,16 +6471,12 @@ var ChatHeader = function ChatHeader(_ref) {
|
|
6615
6471
|
fontSize: "12px",
|
6616
6472
|
lineHeight: "14.32px",
|
6617
6473
|
color: styles.less_dark
|
6618
|
-
},
|
6619
|
-
number: score || 0
|
6620
|
-
})), React__default.createElement(Typography, {
|
6474
|
+
}, score || 0), React__default.createElement(Typography, {
|
6621
6475
|
fontWeight: 700,
|
6622
6476
|
fontSize: "12px",
|
6623
6477
|
lineHeight: "14.32px",
|
6624
6478
|
color: styles.gray_300
|
6625
|
-
}, "/",
|
6626
|
-
number: totalScore || 0
|
6627
|
-
}))), React__default.createElement(Typography, {
|
6479
|
+
}, "/", totalScore || 0)), React__default.createElement(Typography, {
|
6628
6480
|
fontWeight: 500,
|
6629
6481
|
fontSize: "12px",
|
6630
6482
|
lineHeight: "14.32px",
|
@@ -7575,45 +7427,11 @@ var QuestionView = function QuestionView(_ref2) {
|
|
7575
7427
|
}))));
|
7576
7428
|
};
|
7577
7429
|
|
7578
|
-
var ADMIN_CATEGORY_URL = SUPER_ADMIN_BASE_URL + "/api/category";
|
7579
|
-
var CATEGORY_URL = BASE_URL + "/api/examcategory";
|
7580
|
-
var getCategoryListAdminApi = function getCategoryListAdminApi(data) {
|
7581
|
-
try {
|
7582
|
-
return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL, {
|
7583
|
-
params: data
|
7584
|
-
}));
|
7585
|
-
} catch (e) {
|
7586
|
-
return Promise.reject(e);
|
7587
|
-
}
|
7588
|
-
};
|
7589
|
-
var getCategoryListApi = function getCategoryListApi(data) {
|
7590
|
-
try {
|
7591
|
-
return Promise.resolve(api.get("" + CATEGORY_URL, {
|
7592
|
-
params: data
|
7593
|
-
}));
|
7594
|
-
} catch (e) {
|
7595
|
-
return Promise.reject(e);
|
7596
|
-
}
|
7597
|
-
};
|
7598
|
-
|
7599
7430
|
var useCategorySelect = function useCategorySelect(_ref) {
|
7600
|
-
var
|
7601
|
-
var firstLoad = true;
|
7602
|
-
var dispatch = useDispatch();
|
7431
|
+
var categoryList = _ref.categoryList;
|
7603
7432
|
var _useState = useState(),
|
7604
|
-
|
7605
|
-
|
7606
|
-
var _useState2 = useState(),
|
7607
|
-
selectedCategory = _useState2[0],
|
7608
|
-
setSelectedCategory = _useState2[1];
|
7609
|
-
var isDomain = useSelector(function (state) {
|
7610
|
-
var _state$common, _state$common$user;
|
7611
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.academyDomain;
|
7612
|
-
});
|
7613
|
-
var isSuperAdmin = useSelector(function (state) {
|
7614
|
-
var _state$common2, _state$common2$user;
|
7615
|
-
return (state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.roles) || [];
|
7616
|
-
}).includes(Role.Admin) && !isDomain;
|
7433
|
+
selectedCategory = _useState[0],
|
7434
|
+
setSelectedCategory = _useState[1];
|
7617
7435
|
var categoryOptions = useMemo(function () {
|
7618
7436
|
return categoryList === null || categoryList === void 0 ? void 0 : categoryList.map(function (category) {
|
7619
7437
|
var _category$path;
|
@@ -7623,39 +7441,6 @@ var useCategorySelect = function useCategorySelect(_ref) {
|
|
7623
7441
|
};
|
7624
7442
|
});
|
7625
7443
|
}, [JSON.stringify(categoryList)]);
|
7626
|
-
var getCategoryList = function getCategoryList(isLoading) {
|
7627
|
-
if (isLoading === void 0) {
|
7628
|
-
isLoading = true;
|
7629
|
-
}
|
7630
|
-
try {
|
7631
|
-
var _temp2 = function _temp2() {
|
7632
|
-
isLoading && dispatch(setLoading(false));
|
7633
|
-
};
|
7634
|
-
if (!subjectId) return Promise.resolve();
|
7635
|
-
if (firstLoad) firstLoad = false;
|
7636
|
-
isLoading && dispatch(setLoading(true));
|
7637
|
-
var _temp = _catch(function () {
|
7638
|
-
return Promise.resolve(isSuperAdmin ? getCategoryListAdminApi({
|
7639
|
-
subjectId: subjectId
|
7640
|
-
}) : getCategoryListApi({
|
7641
|
-
subjectId: subjectId
|
7642
|
-
})).then(function (res) {
|
7643
|
-
var data = res.data.items;
|
7644
|
-
setCategoryList(data || []);
|
7645
|
-
setSelectedCategory(data[0]);
|
7646
|
-
});
|
7647
|
-
}, function (error) {
|
7648
|
-
setCategoryList([]);
|
7649
|
-
console.log(error);
|
7650
|
-
});
|
7651
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
7652
|
-
} catch (e) {
|
7653
|
-
return Promise.reject(e);
|
7654
|
-
}
|
7655
|
-
};
|
7656
|
-
useEffect(function () {
|
7657
|
-
getCategoryList();
|
7658
|
-
}, [subjectId]);
|
7659
7444
|
var handleChangeCategory = function handleChangeCategory(value) {
|
7660
7445
|
var id = value.value;
|
7661
7446
|
var selectedCategory = categoryList === null || categoryList === void 0 ? void 0 : categoryList.find(function (category) {
|
@@ -7748,7 +7533,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
|
|
7748
7533
|
questions = _ref.questions,
|
7749
7534
|
answerCount = _ref.answerCount,
|
7750
7535
|
questionCount = _ref.questionCount,
|
7751
|
-
|
7536
|
+
categoryList = _ref.categoryList,
|
7752
7537
|
categoryId = _ref.categoryId,
|
7753
7538
|
isActive = _ref.isActive,
|
7754
7539
|
isDisabled = _ref.isDisabled,
|
@@ -7763,7 +7548,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
|
|
7763
7548
|
var _useTranslation = useTranslation(),
|
7764
7549
|
t = _useTranslation.t;
|
7765
7550
|
var _useCategorySelect = useCategorySelect({
|
7766
|
-
|
7551
|
+
categoryList: categoryList
|
7767
7552
|
}),
|
7768
7553
|
categoryOptions = _useCategorySelect.categoryOptions;
|
7769
7554
|
var theme = useTheme();
|
@@ -9628,12 +9413,45 @@ var DURATION_OPTIONS = Array.from({
|
|
9628
9413
|
});
|
9629
9414
|
var DEFAULT_ANSWER_COUNT$1 = 5;
|
9630
9415
|
|
9416
|
+
var ADMIN_CATEGORY_URL = SUPER_ADMIN_BASE_URL + "/api/category";
|
9417
|
+
var CATEGORY_URL = BASE_URL + "/api/examcategory";
|
9418
|
+
var getCategoryListAdminApi = function getCategoryListAdminApi(data) {
|
9419
|
+
try {
|
9420
|
+
return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL, {
|
9421
|
+
params: data
|
9422
|
+
}));
|
9423
|
+
} catch (e) {
|
9424
|
+
return Promise.reject(e);
|
9425
|
+
}
|
9426
|
+
};
|
9427
|
+
var getCategoryListApi = function getCategoryListApi(data) {
|
9428
|
+
try {
|
9429
|
+
return Promise.resolve(api.get("" + CATEGORY_URL, {
|
9430
|
+
params: data
|
9431
|
+
}));
|
9432
|
+
} catch (e) {
|
9433
|
+
return Promise.reject(e);
|
9434
|
+
}
|
9435
|
+
};
|
9436
|
+
|
9631
9437
|
var useExamDetailView = function useExamDetailView(props) {
|
9632
9438
|
var exam = props.exam,
|
9633
|
-
selectedSubject = props.selectedSubject,
|
9634
9439
|
onChangeExam = props.onChangeExam;
|
9635
9440
|
var _useTranslation = useTranslation(),
|
9636
9441
|
t = _useTranslation.t;
|
9442
|
+
var firstLoad = true;
|
9443
|
+
var dispatch = useDispatch();
|
9444
|
+
var isDomain = useSelector(function (state) {
|
9445
|
+
var _state$common, _state$common$user;
|
9446
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.academyDomain;
|
9447
|
+
});
|
9448
|
+
var isSuperAdmin = useSelector(function (state) {
|
9449
|
+
var _state$common2, _state$common2$user;
|
9450
|
+
return (state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.roles) || [];
|
9451
|
+
}).includes(Role.Admin) && !isDomain;
|
9452
|
+
var _useState = useState([]),
|
9453
|
+
categoryList = _useState[0],
|
9454
|
+
setCategoryList = _useState[1];
|
9637
9455
|
var handleChangeQuestionCount = function handleChangeQuestionCount(article, questionCount, answerCount) {
|
9638
9456
|
if (!exam) return;
|
9639
9457
|
var examQuestions = exam.questions;
|
@@ -9811,6 +9629,39 @@ var useExamDetailView = function useExamDetailView(props) {
|
|
9811
9629
|
}])
|
9812
9630
|
}));
|
9813
9631
|
};
|
9632
|
+
var getCategoryList = function getCategoryList(isLoading) {
|
9633
|
+
if (isLoading === void 0) {
|
9634
|
+
isLoading = true;
|
9635
|
+
}
|
9636
|
+
try {
|
9637
|
+
var _temp2 = function _temp2() {
|
9638
|
+
isLoading && dispatch(setLoading(false));
|
9639
|
+
};
|
9640
|
+
if (!exam.subjectId) return Promise.resolve();
|
9641
|
+
if (firstLoad) firstLoad = false;
|
9642
|
+
isLoading && dispatch(setLoading(true));
|
9643
|
+
var _temp = _catch(function () {
|
9644
|
+
return Promise.resolve(isSuperAdmin ? getCategoryListAdminApi({
|
9645
|
+
subjectId: exam.subjectId
|
9646
|
+
}) : getCategoryListApi({
|
9647
|
+
subjectId: exam.subjectId
|
9648
|
+
})).then(function (res) {
|
9649
|
+
var data = res.data.items;
|
9650
|
+
setCategoryList(data || []);
|
9651
|
+
});
|
9652
|
+
}, function (error) {
|
9653
|
+
setCategoryList([]);
|
9654
|
+
console.log(error);
|
9655
|
+
});
|
9656
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
9657
|
+
} catch (e) {
|
9658
|
+
return Promise.reject(e);
|
9659
|
+
}
|
9660
|
+
};
|
9661
|
+
useEffect(function () {
|
9662
|
+
if (categoryList !== null && categoryList !== void 0 && categoryList.length) return;
|
9663
|
+
getCategoryList();
|
9664
|
+
}, [exam.subjectId, JSON.stringify(categoryList)]);
|
9814
9665
|
var examGroupByArticle = useMemo(function () {
|
9815
9666
|
if (!exam) return [];
|
9816
9667
|
var articles = [];
|
@@ -9835,27 +9686,23 @@ var useExamDetailView = function useExamDetailView(props) {
|
|
9835
9686
|
var durationOptions = useMemo(function () {
|
9836
9687
|
var options = DURATION_OPTIONS.map(function (i) {
|
9837
9688
|
return {
|
9838
|
-
label: t(
|
9689
|
+
label: t("mins_mins", {
|
9839
9690
|
mins: i
|
9840
9691
|
}),
|
9841
9692
|
value: i
|
9842
9693
|
};
|
9843
9694
|
});
|
9844
9695
|
if (!!exam.duration && exam.duration > DURATION_OPTIONS[DURATION_OPTIONS.length - 1]) return [].concat(options, [{
|
9845
|
-
label: t(
|
9696
|
+
label: t("mins_mins", {
|
9846
9697
|
mins: exam.duration
|
9847
9698
|
}),
|
9848
9699
|
value: exam.duration
|
9849
9700
|
}]);
|
9850
9701
|
return options;
|
9851
9702
|
}, [exam.duration]);
|
9852
|
-
useEffect(function () {
|
9853
|
-
if ((selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) !== exam.subjectId) onChangeExam(_extends({}, exam, {
|
9854
|
-
subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
|
9855
|
-
}));
|
9856
|
-
}, [selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id, exam.subjectId]);
|
9857
9703
|
return {
|
9858
9704
|
t: t,
|
9705
|
+
categoryList: categoryList,
|
9859
9706
|
durationOptions: durationOptions,
|
9860
9707
|
examGroupByArticle: examGroupByArticle,
|
9861
9708
|
handleAddArticle: handleAddArticle,
|
@@ -9877,16 +9724,19 @@ var ExamDetailView = function ExamDetailView(_ref) {
|
|
9877
9724
|
isDisabled = _ref.isDisabled,
|
9878
9725
|
isEdit = _ref.isEdit,
|
9879
9726
|
onChangeExam = _ref.onChangeExam;
|
9880
|
-
var _useSubjectSelect = useSubjectSelect(
|
9727
|
+
var _useSubjectSelect = useSubjectSelect({
|
9728
|
+
onChangeExam: onChangeExam,
|
9729
|
+
exam: exam
|
9730
|
+
}),
|
9881
9731
|
subjectOptions = _useSubjectSelect.subjectOptions,
|
9882
9732
|
selectedSubject = _useSubjectSelect.selectedSubject,
|
9883
9733
|
handleChangeSubject = _useSubjectSelect.handleChangeSubject;
|
9884
9734
|
var _useExamDetailView = useExamDetailView({
|
9885
9735
|
exam: exam,
|
9886
|
-
onChangeExam: onChangeExam
|
9887
|
-
selectedSubject: selectedSubject
|
9736
|
+
onChangeExam: onChangeExam
|
9888
9737
|
}),
|
9889
9738
|
t = _useExamDetailView.t,
|
9739
|
+
categoryList = _useExamDetailView.categoryList,
|
9890
9740
|
durationOptions = _useExamDetailView.durationOptions,
|
9891
9741
|
examGroupByArticle = _useExamDetailView.examGroupByArticle,
|
9892
9742
|
handleAddArticle = _useExamDetailView.handleAddArticle,
|
@@ -9935,10 +9785,10 @@ var ExamDetailView = function ExamDetailView(_ref) {
|
|
9935
9785
|
className: 'mb-2'
|
9936
9786
|
}, React__default.createElement("label", {
|
9937
9787
|
className: styles["form-label"] + " " + styles$2["question-label"],
|
9938
|
-
htmlFor: "
|
9939
|
-
}, t("subject")
|
9788
|
+
htmlFor: "subject"
|
9789
|
+
}, t("subject")), React__default.createElement(CustomSelect, {
|
9940
9790
|
inputId: "subject",
|
9941
|
-
value:
|
9791
|
+
value: exam === null || exam === void 0 ? void 0 : exam.subjectId,
|
9942
9792
|
options: subjectOptions,
|
9943
9793
|
onChange: handleChangeSubject,
|
9944
9794
|
isDisabled: isDisabled || isEdit
|
@@ -9949,6 +9799,7 @@ var ExamDetailView = function ExamDetailView(_ref) {
|
|
9949
9799
|
xs: 12,
|
9950
9800
|
className: index === examGroupByArticle.length - 1 ? "mb-2" : ''
|
9951
9801
|
}, React__default.createElement(ArticleGroupView, Object.assign({}, i, {
|
9802
|
+
categoryList: categoryList,
|
9952
9803
|
isActive: index === examGroupByArticle.length - 1,
|
9953
9804
|
onChangeQuestionCount: handleChangeQuestionCount,
|
9954
9805
|
onChangeCategory: handleChangeCategory,
|
@@ -10833,18 +10684,6 @@ var createConversationApi = function createConversationApi(data) {
|
|
10833
10684
|
return api.post(BASE_URL + "/api/conversation", data);
|
10834
10685
|
};
|
10835
10686
|
|
10836
|
-
var toNumberOrder = function toNumberOrder(value) {
|
10837
|
-
return "The " + value + (value % 10 === 1 ? 'st' : value % 10 === 2 ? 'nd' : value % 10 === 3 ? 'rd' : 'th');
|
10838
|
-
};
|
10839
|
-
var formatDuration = function formatDuration(t, duration) {
|
10840
|
-
if (!duration) return "0" + t("seconds");
|
10841
|
-
var totalTime = Math.round(duration);
|
10842
|
-
return totalTime > 60 ? t("mins_mins_seconds_seconds", {
|
10843
|
-
mins: Math.floor(totalTime / 60),
|
10844
|
-
seconds: totalTime % 60
|
10845
|
-
}) : "" + Math.round(duration) + t("seconds");
|
10846
|
-
};
|
10847
|
-
|
10848
10687
|
var ORDER_NUMBERS = {
|
10849
10688
|
1: "the_first",
|
10850
10689
|
2: "the_second",
|
@@ -10899,6 +10738,7 @@ var EXAM_RESULT = {
|
|
10899
10738
|
parentPhoneNumber: "",
|
10900
10739
|
schoolName: "Academy",
|
10901
10740
|
className: "1",
|
10741
|
+
fullName: "Abc",
|
10902
10742
|
major: "",
|
10903
10743
|
roles: []
|
10904
10744
|
},
|
@@ -11631,6 +11471,18 @@ var defaultSeries = function defaultSeries(t) {
|
|
11631
11471
|
}];
|
11632
11472
|
};
|
11633
11473
|
|
11474
|
+
var formatDuration = function formatDuration(t, duration) {
|
11475
|
+
if (!duration) return "0" + t("seconds");
|
11476
|
+
var totalTime = Math.round(duration);
|
11477
|
+
return totalTime > 60 ? t("mins_mins_seconds_seconds", {
|
11478
|
+
mins: Math.floor(totalTime / 60),
|
11479
|
+
seconds: totalTime % 60
|
11480
|
+
}) : "" + Math.round(duration) + t("seconds");
|
11481
|
+
};
|
11482
|
+
var formatQuestionOrder = function formatQuestionOrder(index, t, language) {
|
11483
|
+
return language === Language.en ? "" + (index + 1) + getOrdinalSuffix(index + 1, language) : t(ORDER_NUMBERS[index + 1]);
|
11484
|
+
};
|
11485
|
+
|
11634
11486
|
var RECENT_USER_URL = BASE_URL + "/api/recentUsers";
|
11635
11487
|
var getRecentUserActionListApi = function getRecentUserActionListApi(query) {
|
11636
11488
|
return api.get("" + RECENT_USER_URL, {
|
@@ -11653,19 +11505,18 @@ var createRecentUserActionListApi = function createRecentUserActionListApi(_ref)
|
|
11653
11505
|
});
|
11654
11506
|
};
|
11655
11507
|
|
11656
|
-
var useExamResult = function useExamResult(
|
11508
|
+
var useExamResult = function useExamResult(props) {
|
11657
11509
|
var _allSeries$dataChartI;
|
11658
|
-
|
11659
|
-
|
11660
|
-
|
11661
|
-
|
11662
|
-
|
11663
|
-
|
11664
|
-
|
11665
|
-
|
11666
|
-
|
11667
|
-
var query = new URLSearchParams(
|
11668
|
-
var dispatch = useDispatch();
|
11510
|
+
var searchParams = props.searchParams,
|
11511
|
+
history = props.history,
|
11512
|
+
examSessionId = props.examSessionId,
|
11513
|
+
studentId = props.studentId,
|
11514
|
+
_props$code = props.code,
|
11515
|
+
code = _props$code === void 0 ? "" : _props$code,
|
11516
|
+
handleChangeTab = props.handleChangeTab,
|
11517
|
+
selectedTab = props.selectedTab,
|
11518
|
+
isPrint = props.isPrint;
|
11519
|
+
var query = new URLSearchParams(searchParams);
|
11669
11520
|
var user = useSelector(function (state) {
|
11670
11521
|
var _state$common;
|
11671
11522
|
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
@@ -11677,7 +11528,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11677
11528
|
var _state$common2;
|
11678
11529
|
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.language;
|
11679
11530
|
});
|
11680
|
-
var _useState = useState(
|
11531
|
+
var _useState = useState(),
|
11681
11532
|
isLoading = _useState[0],
|
11682
11533
|
setIsLoading = _useState[1];
|
11683
11534
|
var _useState2 = useState(),
|
@@ -11698,9 +11549,12 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11698
11549
|
var _useState7 = useState(0),
|
11699
11550
|
dataChartIndex = _useState7[0],
|
11700
11551
|
setDataChartIndex = _useState7[1];
|
11701
|
-
var _useState8 = useState(
|
11552
|
+
var _useState8 = useState(),
|
11702
11553
|
openProblem = _useState8[0],
|
11703
11554
|
setOpenProblem = _useState8[1];
|
11555
|
+
var _useState9 = useState(),
|
11556
|
+
errorMessage = _useState9[0],
|
11557
|
+
setErrorMessage = _useState9[1];
|
11704
11558
|
var _useTranslation = useTranslation(),
|
11705
11559
|
t = _useTranslation.t;
|
11706
11560
|
var getStudentData = function getStudentData(examCode) {
|
@@ -11713,7 +11567,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11713
11567
|
var _temp = _catch(function () {
|
11714
11568
|
return Promise.resolve(Promise.all([getResults(examCode), getResultsLongTimeSpend(examCode), getResultsEffectSize(examCode), getResultsTimeOrderQuestion(examCode), getResultsCategories(examCode)])).then(function (result) {
|
11715
11569
|
var _result$0$data, _result$1$data, _result$2$data, _result$3$data, _result$4$data;
|
11716
|
-
handleChangeTab(0);
|
11570
|
+
handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
|
11717
11571
|
setDataChartIndex(0);
|
11718
11572
|
setResultData((_result$0$data = result[0].data) === null || _result$0$data === void 0 ? void 0 : _result$0$data.data);
|
11719
11573
|
setLongTimeSpend((_result$1$data = result[1].data) === null || _result$1$data === void 0 ? void 0 : _result$1$data.data);
|
@@ -11722,19 +11576,21 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11722
11576
|
setCategoryResponses(((_result$4$data = result[4].data) === null || _result$4$data === void 0 ? void 0 : _result$4$data.data) || []);
|
11723
11577
|
});
|
11724
11578
|
}, function (error) {
|
11725
|
-
|
11579
|
+
var message = getErrorMessage(t, error);
|
11580
|
+
!isPrint && toast.error(message);
|
11581
|
+
setErrorMessage(message);
|
11726
11582
|
});
|
11727
11583
|
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
11728
11584
|
} catch (e) {
|
11729
11585
|
return Promise.reject(e);
|
11730
11586
|
}
|
11731
11587
|
};
|
11732
|
-
var getStudentDataByTeacher = function getStudentDataByTeacher(
|
11588
|
+
var getStudentDataByTeacher = function getStudentDataByTeacher(examSessionId, studentId) {
|
11733
11589
|
try {
|
11734
11590
|
var _temp5 = function _temp5() {
|
11735
11591
|
setIsLoading(false);
|
11736
11592
|
};
|
11737
|
-
if (!
|
11593
|
+
if (!examSessionId || !studentId) return Promise.resolve();
|
11738
11594
|
setIsLoading(true);
|
11739
11595
|
var _temp4 = _catch(function () {
|
11740
11596
|
return Promise.resolve(Promise.all([getResultsTeacher(examSessionId, studentId), getResultsLongTimeSpendTeacher(examSessionId, studentId), getResultsEffectSizeTeacher(examSessionId, studentId), getResultsTimeOrderQuestionTeacher(examSessionId, studentId), getResultsCategoriesTeacher(examSessionId, studentId)])).then(function (result) {
|
@@ -11742,7 +11598,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11742
11598
|
function _temp3(_createRecentUserActi) {
|
11743
11599
|
_createRecentUserActi;
|
11744
11600
|
}
|
11745
|
-
handleChangeTab(0);
|
11601
|
+
handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
|
11746
11602
|
setDataChartIndex(0);
|
11747
11603
|
setResultData((_result$0$data2 = result[0].data) === null || _result$0$data2 === void 0 ? void 0 : _result$0$data2.data);
|
11748
11604
|
setLongTimeSpend((_result$1$data2 = result[1].data) === null || _result$1$data2 === void 0 ? void 0 : _result$1$data2.data);
|
@@ -11762,7 +11618,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11762
11618
|
})).then(_temp3);
|
11763
11619
|
});
|
11764
11620
|
}, function (error) {
|
11765
|
-
|
11621
|
+
var message = getErrorMessage(t, error);
|
11622
|
+
!isPrint && toast.error(message);
|
11623
|
+
setErrorMessage(message);
|
11766
11624
|
});
|
11767
11625
|
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
11768
11626
|
} catch (e) {
|
@@ -11777,7 +11635,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11777
11635
|
setCategoryResponses(CATEGORY_RESPONSES);
|
11778
11636
|
};
|
11779
11637
|
var resetData = function resetData() {
|
11638
|
+
setIsLoading(undefined);
|
11780
11639
|
setResultData(undefined);
|
11640
|
+
setErrorMessage(undefined);
|
11781
11641
|
setLongTimeSpend([]);
|
11782
11642
|
setEffectSize([]);
|
11783
11643
|
setTimelyOrderQuestions([]);
|
@@ -11788,7 +11648,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11788
11648
|
resetData();
|
11789
11649
|
if (!(user !== null && user !== void 0 && user.email)) return;
|
11790
11650
|
isStudent && getStudentData(examCode);
|
11791
|
-
!isStudent && getStudentDataByTeacher(
|
11651
|
+
!isStudent && getStudentDataByTeacher(examSessionId, studentId);
|
11792
11652
|
};
|
11793
11653
|
examCode === "example-code" ? setExampleData() : getData();
|
11794
11654
|
}, [examCode, isStudent, code, examSessionId, studentId, user === null || user === void 0 ? void 0 : user.email]);
|
@@ -11828,7 +11688,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11828
11688
|
var dataPointIndex = _ref.dataPointIndex;
|
11829
11689
|
if (dataPointIndex > 0) {
|
11830
11690
|
var _questions;
|
11831
|
-
return val != null ? t("
|
11691
|
+
return val != null ? t("problem_number_question_chart", {
|
11832
11692
|
number: questions !== null ? (((_questions = questions[questionLength - val]) === null || _questions === void 0 ? void 0 : _questions.questionOrder) || 0) + 1 : val
|
11833
11693
|
}) : t("no_data");
|
11834
11694
|
}
|
@@ -11837,11 +11697,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11837
11697
|
}
|
11838
11698
|
}),
|
11839
11699
|
xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
|
11840
|
-
categories: [""].concat(Array.from({
|
11700
|
+
categories: ["s"].concat(Array.from({
|
11841
11701
|
length: questionLength
|
11842
11702
|
}, function (_, i) {
|
11843
|
-
return
|
11844
|
-
}), [""]),
|
11703
|
+
return formatQuestionOrder(i, t, language);
|
11704
|
+
}), ["e"]),
|
11845
11705
|
tooltip: {
|
11846
11706
|
formatter: function formatter(val) {
|
11847
11707
|
if (val > 1) return t(ORDER_NUMBERS[val - 1]);
|
@@ -11913,7 +11773,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11913
11773
|
var dataPointIndex = _ref2.dataPointIndex;
|
11914
11774
|
if (dataPointIndex > 0) {
|
11915
11775
|
var _questions3;
|
11916
|
-
return val != null ? t("
|
11776
|
+
return val != null ? t("problem_number_question_chart", {
|
11917
11777
|
number: questions !== null ? (((_questions3 = questions[questionLength - val]) === null || _questions3 === void 0 ? void 0 : _questions3.questionOrder) || 0) + 1 : val
|
11918
11778
|
}) : t("no_data");
|
11919
11779
|
}
|
@@ -11923,11 +11783,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11923
11783
|
}),
|
11924
11784
|
colors: ['#3DC674', '#C3099A'],
|
11925
11785
|
xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
|
11926
|
-
categories: [""].concat(Array.from({
|
11786
|
+
categories: ["s"].concat(Array.from({
|
11927
11787
|
length: questionLength
|
11928
11788
|
}, function (_, i) {
|
11929
|
-
return
|
11930
|
-
}), [""]),
|
11789
|
+
return formatQuestionOrder(i, t, language);
|
11790
|
+
}), ["e"]),
|
11931
11791
|
tooltip: {
|
11932
11792
|
formatter: function formatter(val) {
|
11933
11793
|
if (val > 1) return t(ORDER_NUMBERS[val - 1]);
|
@@ -11941,7 +11801,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11941
11801
|
labels: _extends({}, DEFAULT_LINE_CHART_OPTIONS.yaxis.labels, {
|
11942
11802
|
formatter: function formatter(val) {
|
11943
11803
|
var _questions4;
|
11944
|
-
return val != null ? t("
|
11804
|
+
return val != null ? t("problem_number_question_chart", {
|
11945
11805
|
number: questions !== null ? (((_questions4 = questions[questionLength - val]) === null || _questions4 === void 0 ? void 0 : _questions4.questionOrder) || 0) + 1 : val
|
11946
11806
|
}) : t("no_data");
|
11947
11807
|
}
|
@@ -11950,224 +11810,6 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
11950
11810
|
});
|
11951
11811
|
}, [JSON.stringify(allChartOptions), dataChartIndex, language]);
|
11952
11812
|
var series = (_allSeries$dataChartI = allSeries[dataChartIndex]) != null ? _allSeries$dataChartI : defaultSeries(t);
|
11953
|
-
var handleExportPdf = function handleExportPdf() {
|
11954
|
-
try {
|
11955
|
-
var _temp24 = function _temp24(_result) {
|
11956
|
-
if (_exit) return _result;
|
11957
|
-
dispatch(setLoading(false));
|
11958
|
-
};
|
11959
|
-
var _exit = false;
|
11960
|
-
dispatch(setLoading(true));
|
11961
|
-
var _temp23 = _catch(function () {
|
11962
|
-
var canvas = document.querySelector("#canvas");
|
11963
|
-
var headerCanvas = document.querySelector("#header-canvas");
|
11964
|
-
if (!canvas || !headerCanvas) {
|
11965
|
-
_exit = true;
|
11966
|
-
return;
|
11967
|
-
}
|
11968
|
-
var doc = new jsPDF({
|
11969
|
-
orientation: "p",
|
11970
|
-
unit: "px",
|
11971
|
-
format: "a4"
|
11972
|
-
});
|
11973
|
-
var WIDTH_PAPER = doc.internal.pageSize.width;
|
11974
|
-
var HEIGHT_PAPER = doc.internal.pageSize.height;
|
11975
|
-
var line = 0;
|
11976
|
-
var breakPage = function breakPage() {
|
11977
|
-
doc.addPage();
|
11978
|
-
line = 20;
|
11979
|
-
};
|
11980
|
-
var imgWidth = WIDTH_PAPER;
|
11981
|
-
var chartWidth = WIDTH_PAPER - 20;
|
11982
|
-
return Promise.resolve(html2canvas(headerCanvas)).then(function (header) {
|
11983
|
-
function _temp22() {
|
11984
|
-
function _temp20(_createRecentUserActi2) {
|
11985
|
-
_createRecentUserActi2;
|
11986
|
-
}
|
11987
|
-
doc.save("download.pdf");
|
11988
|
-
return isStudent ? _temp20(!isStudent && createRecentUserActionListApi({
|
11989
|
-
userId: studentId,
|
11990
|
-
action: RecentUserAction$1.PrintedExamResult,
|
11991
|
-
data: "" + examSessionId,
|
11992
|
-
roles: [Role.Teacher]
|
11993
|
-
})) : Promise.resolve(!isStudent && createRecentUserActionListApi({
|
11994
|
-
userId: studentId,
|
11995
|
-
action: RecentUserAction$1.PrintedExamResult,
|
11996
|
-
data: "" + examSessionId,
|
11997
|
-
roles: [Role.Teacher]
|
11998
|
-
})).then(_temp20);
|
11999
|
-
}
|
12000
|
-
var imgHeaderHeight = header.height * imgWidth / header.width;
|
12001
|
-
var imgHeaderData = header.toDataURL('image/png');
|
12002
|
-
doc.addImage(imgHeaderData, 'PNG', 0, 0, imgWidth, imgHeaderHeight);
|
12003
|
-
line += imgHeaderHeight;
|
12004
|
-
if (line > HEIGHT_PAPER) breakPage();
|
12005
|
-
var _temp21 = function () {
|
12006
|
-
if (canvas && canvas.childElementCount > 0) {
|
12007
|
-
var _index = 0;
|
12008
|
-
var _temp19 = _for(function () {
|
12009
|
-
return _index < canvas.childElementCount;
|
12010
|
-
}, function () {
|
12011
|
-
return _index++;
|
12012
|
-
}, function () {
|
12013
|
-
function _temp18() {
|
12014
|
-
function _temp16() {
|
12015
|
-
line += 20;
|
12016
|
-
}
|
12017
|
-
var printChartTitle = function printChartTitle() {
|
12018
|
-
try {
|
12019
|
-
if (chartTitleData && chartTitleHeight) {
|
12020
|
-
if (line + chartTitleHeight + 10 > HEIGHT_PAPER) breakPage();else line + 10;
|
12021
|
-
doc.addImage(chartTitleData, 'PNG', 10, line, chartWidth, chartTitleHeight);
|
12022
|
-
line += chartTitleHeight;
|
12023
|
-
}
|
12024
|
-
return Promise.resolve();
|
12025
|
-
} catch (e) {
|
12026
|
-
return Promise.reject(e);
|
12027
|
-
}
|
12028
|
-
};
|
12029
|
-
var _temp15 = function () {
|
12030
|
-
if (printContainerEls.length) {
|
12031
|
-
var _temp14 = _forTo(printContainerEls, function (i) {
|
12032
|
-
function _temp13() {
|
12033
|
-
function _temp11() {
|
12034
|
-
var printTitle = function printTitle() {
|
12035
|
-
try {
|
12036
|
-
if (!printTitleHeight || !printTitleData) return Promise.resolve();
|
12037
|
-
doc.addImage(printTitleData, 'PNG', 0, line, chartWidth, printTitleHeight);
|
12038
|
-
line += printTitleHeight;
|
12039
|
-
return Promise.resolve();
|
12040
|
-
} catch (e) {
|
12041
|
-
return Promise.reject(e);
|
12042
|
-
}
|
12043
|
-
};
|
12044
|
-
var printHeader = function printHeader(top) {
|
12045
|
-
if (top === void 0) {
|
12046
|
-
top = 0;
|
12047
|
-
}
|
12048
|
-
try {
|
12049
|
-
if (!printHeaderData || !printHeaderHeight) return Promise.resolve();
|
12050
|
-
line += top;
|
12051
|
-
if (line + printHeaderHeight > HEIGHT_PAPER) breakPage();
|
12052
|
-
doc.addImage(printHeaderData, 'PNG', 10, line, chartWidth, printHeaderHeight);
|
12053
|
-
line += printHeaderHeight;
|
12054
|
-
return Promise.resolve();
|
12055
|
-
} catch (e) {
|
12056
|
-
return Promise.reject(e);
|
12057
|
-
}
|
12058
|
-
};
|
12059
|
-
var printContents = printContainerEl.querySelectorAll("." + PrintContentClassName);
|
12060
|
-
if (!printContents.length) return;
|
12061
|
-
printTitle();
|
12062
|
-
var _temp9 = _forTo(printContents, function (j) {
|
12063
|
-
var rowItem = printContents[j];
|
12064
|
-
return Promise.resolve(html2canvas(rowItem)).then(function (rowItemCanvas) {
|
12065
|
-
function _temp8() {
|
12066
|
-
doc.addImage(data, 'PNG', 10, line, chartWidth, height);
|
12067
|
-
line += height;
|
12068
|
-
}
|
12069
|
-
var height = rowItemCanvas.height * chartWidth / rowItemCanvas.width;
|
12070
|
-
var data = rowItemCanvas.toDataURL('image/png');
|
12071
|
-
if (i === 0 && j === 0 && line + height + (printHeaderHeight || 0) + ((chartTitleHeight || 0) + 10) + 20 > HEIGHT_PAPER) breakPage();
|
12072
|
-
i === 0 && j === 0 && printChartTitle();
|
12073
|
-
var _temp7 = function () {
|
12074
|
-
if (line + height + 20 > HEIGHT_PAPER) {
|
12075
|
-
breakPage();
|
12076
|
-
return Promise.resolve(printHeader()).then(function () {});
|
12077
|
-
} else {
|
12078
|
-
var _temp25 = function () {
|
12079
|
-
if (j === 0) {
|
12080
|
-
return Promise.resolve(printHeader(10)).then(function () {});
|
12081
|
-
}
|
12082
|
-
}();
|
12083
|
-
if (_temp25 && _temp25.then) return _temp25.then(function () {});
|
12084
|
-
}
|
12085
|
-
}();
|
12086
|
-
return _temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7);
|
12087
|
-
});
|
12088
|
-
});
|
12089
|
-
if (_temp9 && _temp9.then) return _temp9.then(function () {});
|
12090
|
-
}
|
12091
|
-
var _temp10 = function () {
|
12092
|
-
if (printHeaderEl) {
|
12093
|
-
return Promise.resolve(html2canvas(printHeaderEl)).then(function (_html2canvas3) {
|
12094
|
-
printHeaderCanvas = _html2canvas3;
|
12095
|
-
printHeaderHeight = printHeaderCanvas.height * chartWidth / printHeaderCanvas.width;
|
12096
|
-
printHeaderData = printHeaderCanvas.toDataURL('image/png');
|
12097
|
-
});
|
12098
|
-
}
|
12099
|
-
}();
|
12100
|
-
return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10);
|
12101
|
-
}
|
12102
|
-
var printContainerEl = printContainerEls[i];
|
12103
|
-
var printTitleEl = printContainerEl.querySelector("." + PrintTitleClassName);
|
12104
|
-
var printHeaderEl = printContainerEl.querySelector("." + PrintHeaderClassName);
|
12105
|
-
var printTitleCanvas = null;
|
12106
|
-
var printTitleHeight = null;
|
12107
|
-
var printTitleData = "";
|
12108
|
-
var printHeaderCanvas = null;
|
12109
|
-
var printHeaderHeight = null;
|
12110
|
-
var printHeaderData = "";
|
12111
|
-
var _temp12 = function () {
|
12112
|
-
if (printTitleEl) {
|
12113
|
-
return Promise.resolve(html2canvas(printTitleEl)).then(function (_html2canvas2) {
|
12114
|
-
printTitleCanvas = _html2canvas2;
|
12115
|
-
printTitleHeight = printTitleCanvas.height * chartWidth / printTitleCanvas.width;
|
12116
|
-
printTitleData = printTitleCanvas.toDataURL('image/png');
|
12117
|
-
});
|
12118
|
-
}
|
12119
|
-
}();
|
12120
|
-
return _temp12 && _temp12.then ? _temp12.then(_temp13) : _temp13(_temp12);
|
12121
|
-
});
|
12122
|
-
if (_temp14 && _temp14.then) return _temp14.then(function () {});
|
12123
|
-
} else {
|
12124
|
-
return Promise.resolve(html2canvas(chart)).then(function (chartCanvas) {
|
12125
|
-
var imgBodyHeight = chartCanvas.height * chartWidth / chartCanvas.width;
|
12126
|
-
var imgBodyData = chartCanvas.toDataURL('image/png');
|
12127
|
-
line += 10;
|
12128
|
-
if (line + imgBodyHeight + 20 + (chartTitleHeight || 0) > HEIGHT_PAPER) breakPage();
|
12129
|
-
printChartTitle();
|
12130
|
-
doc.addImage(imgBodyData, 'PNG', 10, line, chartWidth, imgBodyHeight);
|
12131
|
-
line += imgBodyHeight;
|
12132
|
-
});
|
12133
|
-
}
|
12134
|
-
}();
|
12135
|
-
return _temp15 && _temp15.then ? _temp15.then(_temp16) : _temp16(_temp15);
|
12136
|
-
}
|
12137
|
-
var chart = canvas.children.item(_index);
|
12138
|
-
if (chart.getAttribute("id") === "header-canvas") return;
|
12139
|
-
var chartTitle = chart.querySelector(".chart-title");
|
12140
|
-
var printContainerEls = chart.querySelectorAll("." + PrintContainerClassName);
|
12141
|
-
var printChartTitleCanvas = null;
|
12142
|
-
var chartTitleHeight = null;
|
12143
|
-
var chartTitleData = "";
|
12144
|
-
var _temp17 = function () {
|
12145
|
-
if (chartTitle && printContainerEls.length) {
|
12146
|
-
return Promise.resolve(html2canvas(chartTitle)).then(function (_html2canvas) {
|
12147
|
-
printChartTitleCanvas = _html2canvas;
|
12148
|
-
chartTitleHeight = printChartTitleCanvas.height * chartWidth / printChartTitleCanvas.width;
|
12149
|
-
chartTitleData = printChartTitleCanvas.toDataURL('image/png');
|
12150
|
-
});
|
12151
|
-
}
|
12152
|
-
}();
|
12153
|
-
return _temp17 && _temp17.then ? _temp17.then(_temp18) : _temp18(_temp17);
|
12154
|
-
});
|
12155
|
-
if (_temp19 && _temp19.then) return _temp19.then(function () {});
|
12156
|
-
}
|
12157
|
-
}();
|
12158
|
-
return _temp21 && _temp21.then ? _temp21.then(_temp22) : _temp22(_temp21);
|
12159
|
-
});
|
12160
|
-
}, function (error) {
|
12161
|
-
console.log({
|
12162
|
-
error: error
|
12163
|
-
});
|
12164
|
-
toast.error(getErrorMessage(t, error));
|
12165
|
-
});
|
12166
|
-
return Promise.resolve(_temp23 && _temp23.then ? _temp23.then(_temp24) : _temp24(_temp23));
|
12167
|
-
} catch (e) {
|
12168
|
-
return Promise.reject(e);
|
12169
|
-
}
|
12170
|
-
};
|
12171
11813
|
useEffect(function () {
|
12172
11814
|
setDataChartIndex(0);
|
12173
11815
|
}, [selectedTab]);
|
@@ -12190,11 +11832,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
|
|
12190
11832
|
timelyOrderQuestions: timelyOrderQuestions,
|
12191
11833
|
openProblem: openProblem,
|
12192
11834
|
categoryResponses: categoryResponses,
|
11835
|
+
errorMessage: errorMessage,
|
12193
11836
|
setOpenProblem: setOpenProblem,
|
12194
11837
|
handlePrevChart: handlePrevChart,
|
12195
11838
|
handleNextChart: handleNextChart,
|
12196
|
-
handleExit: handleExit
|
12197
|
-
handleExportPdf: handleExportPdf
|
11839
|
+
handleExit: handleExit
|
12198
11840
|
};
|
12199
11841
|
};
|
12200
11842
|
|
@@ -13311,7 +12953,7 @@ Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==t
|
|
13311
12953
|
|
13312
12954
|
var ReactApexChart = unwrapExports(reactApexcharts_min);
|
13313
12955
|
|
13314
|
-
var styles$4 = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","titleBox":"_1dveO","title":"_mxRxf","point":"_2fD-F","buttonGroup":"_2DGl3","btnFeedback":"_xGW1x","btnTerminate":"_3mLu2","myanswer":"_eDBpS","titleMyAnswer1":"_2fMq3","titleMyAnswer2":"_3gEYh","contentMyAnswer":"_2K_sx","myAnswerItem":"_2qiLh","time":"_6TCOK","timeCol":"_hmseC","answer-response":"_3GfJt","answer-response-0":"_3ut64","answer-response-1":"_2VtpD","answer-response-2":"_58lQU","answer-response-3":"_1ucMY","answer-response-4":"_1qkxy","answerCorrect":"_2jIeT","answerIncorrect":"_to2v0","answerNograss":"_1JSte","answerEasy":"_2_uTU","answerDiscrimination":"_1DBoA","answerTrap":"_1q3tD","answerNoTime":"_3iItu","questionOrder":"_1fNkS","myTimeLabel":"_1Z_F3","myPoolTime":"_4KwG0","topTimeLabel":"_245H-","topTime":"_3tZqw","meanTimeLabel":"_PlPLY","meanTime":"_12a7R","compareChart":"_3MW16","prevChart":"_1fNkb","chart":"_3K4oY","nextChart":"_3YKBp","titleChart":"_13BVP","titleCompareGrass":"_o1txm","tableCompareGrass":"_bT5nf","thcolumn1":"_3Umg0","tdcolumn1":"_3dRMF","tdcolumn3":"_2tcBP","classification":"_1AFeb","wrapperProblem":"_oTqG7","titleProblem":"_35eIx","titleProblemClose":"_3t4HO","titleTrickyProblem":"_1-oxK","wrongQuestions":"_2dpMR","question":"_1lSOX","assignedQuestions":"_1ONUt","wrapperContent":"_nPoR0","content":"_2zmZn","contentColumn1":"_334SY","span1":"_3Lf-U","span2":"_ZpMot","contentColumn2":"_16P3l","duration":"_1kT28","topDuration":"_1fVRi","overallCorrectRate":"_3jLGe","answer":"_VsZ0K","contentVulnerable":"_QxKMy","wrappContentProblem":"_nnqpW","contentProblem":"_3Z1nV","labelProblem":"_36Xpx","name":"_3ZJQW","percent":"_2J3MK","slider":"_1MPdO","track":"_3CV_y","noData":"__g-ff","loading":"_3j485","table-responsive":"_2O6RX","form-label":"_1RYOQ","form-control":"_3VRVT","form-label-dialog":"_3oCSh","btn-cancel":"_3USKq","btn-register":"_3y_iD","pdfBtnBox":"_3xZHo","pdfBtn":"_1DtWq","form-select":"_1a_vw"};
|
12956
|
+
var styles$4 = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","titleBox":"_1dveO","title":"_mxRxf","point":"_2fD-F","buttonGroup":"_2DGl3","btnFeedback":"_xGW1x","btnTerminate":"_3mLu2","myanswer":"_eDBpS","titleMyAnswer1":"_2fMq3","titleMyAnswer2":"_3gEYh","contentMyAnswer":"_2K_sx","myAnswerItem":"_2qiLh","time":"_6TCOK","timeCol":"_hmseC","answer-response":"_3GfJt","answer-response-0":"_3ut64","answer-response-1":"_2VtpD","answer-response-2":"_58lQU","answer-response-3":"_1ucMY","answer-response-4":"_1qkxy","answerCorrect":"_2jIeT","answerIncorrect":"_to2v0","answerNograss":"_1JSte","answerEasy":"_2_uTU","answerDiscrimination":"_1DBoA","answerTrap":"_1q3tD","answerNoTime":"_3iItu","questionOrder":"_1fNkS","myTimeLabel":"_1Z_F3","myPoolTime":"_4KwG0","topTimeLabel":"_245H-","topTime":"_3tZqw","meanTimeLabel":"_PlPLY","meanTime":"_12a7R","compareChart":"_3MW16","prevChart":"_1fNkb","chart":"_3K4oY","nextChart":"_3YKBp","titleChart":"_13BVP","titleCompareGrass":"_o1txm","tableCompareGrass":"_bT5nf","thcolumn1":"_3Umg0","tdcolumn1":"_3dRMF","tdcolumn3":"_2tcBP","classification":"_1AFeb","wrapperProblem":"_oTqG7","titleProblem":"_35eIx","titleProblemClose":"_3t4HO","titleTrickyProblem":"_1-oxK","wrongQuestions":"_2dpMR","question":"_1lSOX","assignedQuestions":"_1ONUt","wrapperContent":"_nPoR0","content":"_2zmZn","contentColumn1":"_334SY","span1":"_3Lf-U","span2":"_ZpMot","contentColumn2":"_16P3l","duration":"_1kT28","topDuration":"_1fVRi","overallCorrectRate":"_3jLGe","answer":"_VsZ0K","contentVulnerable":"_QxKMy","wrappContentProblem":"_nnqpW","contentProblem":"_3Z1nV","labelProblem":"_36Xpx","name":"_3ZJQW","percent":"_2J3MK","slider":"_1MPdO","track":"_3CV_y","noData":"__g-ff","loading":"_3j485","table-responsive":"_2O6RX","form-label":"_1RYOQ","form-control":"_3VRVT","form-label-dialog":"_3oCSh","btn-cancel":"_3USKq","btn-register":"_3y_iD","pdfBtnBox":"_3xZHo","pdfBtn":"_1DtWq","form-select":"_1a_vw","loader":"_2uC7T","dot":"_Xz-Mr","bounce":"_3THgz"};
|
13315
12957
|
|
13316
12958
|
var iconStarQuestion = function iconStarQuestion(_ref) {
|
13317
12959
|
var _ref$width = _ref.width,
|
@@ -13702,8 +13344,7 @@ function CreateNewQuestionDialog(_ref) {
|
|
13702
13344
|
function MyAnswer(_ref) {
|
13703
13345
|
var data = _ref.data,
|
13704
13346
|
categories = _ref.categories,
|
13705
|
-
isStudent = _ref.isStudent
|
13706
|
-
isPrint = _ref.isPrint;
|
13347
|
+
isStudent = _ref.isStudent;
|
13707
13348
|
var _useCreateQuestionDia = useCreateQuestionDialog({
|
13708
13349
|
questions: data.questions
|
13709
13350
|
}),
|
@@ -13831,24 +13472,12 @@ function MyAnswer(_ref) {
|
|
13831
13472
|
})))));
|
13832
13473
|
});
|
13833
13474
|
};
|
13834
|
-
var renderPrintQuestions = function renderPrintQuestions(questions) {
|
13835
|
-
var chunkedQuestions = _.chunk(questions, 10);
|
13836
|
-
return chunkedQuestions.map(function (i, index) {
|
13837
|
-
return React__default.createElement("div", {
|
13838
|
-
key: index,
|
13839
|
-
className: PrintContentClassName
|
13840
|
-
}, renderQuestions(i));
|
13841
|
-
});
|
13842
|
-
};
|
13843
13475
|
return React__default.createElement("div", {
|
13844
13476
|
className: styles$4["myanswer"]
|
13845
13477
|
}, formattedData && formattedData.length > 0 && formattedData.map(function (item) {
|
13846
13478
|
return React__default.createElement("div", {
|
13847
|
-
key: item.category.id
|
13848
|
-
|
13849
|
-
}, React__default.createElement("div", {
|
13850
|
-
className: isPrint ? PrintHeaderClassName : ""
|
13851
|
-
}, React__default.createElement(Stack, {
|
13479
|
+
key: item.category.id
|
13480
|
+
}, React__default.createElement("div", null, React__default.createElement(Stack, {
|
13852
13481
|
bgcolor: "#F9FAFB",
|
13853
13482
|
flexDirection: "row",
|
13854
13483
|
padding: "12px",
|
@@ -13860,6 +13489,7 @@ function MyAnswer(_ref) {
|
|
13860
13489
|
gap: "4px"
|
13861
13490
|
}
|
13862
13491
|
}, React__default.createElement(Typography, {
|
13492
|
+
paddingInline: "4px",
|
13863
13493
|
sx: {
|
13864
13494
|
fontSize: "13px",
|
13865
13495
|
fontWeight: 600,
|
@@ -13874,6 +13504,7 @@ function MyAnswer(_ref) {
|
|
13874
13504
|
gap: "4px"
|
13875
13505
|
}
|
13876
13506
|
}, React__default.createElement(Typography, {
|
13507
|
+
paddingInline: "4px",
|
13877
13508
|
sx: {
|
13878
13509
|
fontSize: "13px",
|
13879
13510
|
fontWeight: 600,
|
@@ -13888,6 +13519,7 @@ function MyAnswer(_ref) {
|
|
13888
13519
|
gap: "4px"
|
13889
13520
|
}
|
13890
13521
|
}, React__default.createElement(Typography, {
|
13522
|
+
paddingInline: "4px",
|
13891
13523
|
sx: {
|
13892
13524
|
fontSize: "13px",
|
13893
13525
|
fontWeight: 600,
|
@@ -13903,6 +13535,7 @@ function MyAnswer(_ref) {
|
|
13903
13535
|
gap: "4px"
|
13904
13536
|
}
|
13905
13537
|
}, React__default.createElement(Typography, {
|
13538
|
+
paddingInline: "4px",
|
13906
13539
|
sx: {
|
13907
13540
|
fontSize: "13px",
|
13908
13541
|
fontWeight: 600,
|
@@ -13918,6 +13551,7 @@ function MyAnswer(_ref) {
|
|
13918
13551
|
gap: "4px"
|
13919
13552
|
}
|
13920
13553
|
}, React__default.createElement(Typography, {
|
13554
|
+
paddingInline: "4px",
|
13921
13555
|
sx: {
|
13922
13556
|
fontSize: "13px",
|
13923
13557
|
fontWeight: 600,
|
@@ -13940,7 +13574,7 @@ function MyAnswer(_ref) {
|
|
13940
13574
|
}
|
13941
13575
|
}, item.category.name))), React__default.createElement("div", {
|
13942
13576
|
className: styles$4["contentMyAnswer"]
|
13943
|
-
},
|
13577
|
+
}, renderQuestions(item.questions)));
|
13944
13578
|
}), React__default.createElement(CreateNewQuestionDialog, {
|
13945
13579
|
questionOptions: questionOptions,
|
13946
13580
|
questionOrderSelected: questionOrderSelected,
|
@@ -13994,8 +13628,7 @@ var iconBtnNextChart = function iconBtnNextChart(_ref) {
|
|
13994
13628
|
};
|
13995
13629
|
|
13996
13630
|
var CompareGrass = function CompareGrass(_ref) {
|
13997
|
-
var effectSize = _ref.effectSize
|
13998
|
-
isPrint = _ref.isPrint;
|
13631
|
+
var effectSize = _ref.effectSize;
|
13999
13632
|
var _useTranslation = useTranslation(),
|
14000
13633
|
t = _useTranslation.t;
|
14001
13634
|
var renderTableBody = function renderTableBody(effectSize) {
|
@@ -14058,17 +13691,8 @@ var CompareGrass = function CompareGrass(_ref) {
|
|
14058
13691
|
}))));
|
14059
13692
|
});
|
14060
13693
|
};
|
14061
|
-
var renderPrintTableBody = function renderPrintTableBody(effectSize) {
|
14062
|
-
var chunkedEffectSizeQuestions = _.chunk(effectSize, 10);
|
14063
|
-
return chunkedEffectSizeQuestions.map(function (i, index) {
|
14064
|
-
return React__default.createElement("tbody", {
|
14065
|
-
key: index,
|
14066
|
-
className: PrintContentClassName
|
14067
|
-
}, renderTableBody(i));
|
14068
|
-
});
|
14069
|
-
};
|
14070
13694
|
return React__default.createElement("div", {
|
14071
|
-
className: styles$4["compareGrass"]
|
13695
|
+
className: "" + styles$4["compareGrass"]
|
14072
13696
|
}, React__default.createElement("div", {
|
14073
13697
|
className: styles$4["tableCompareGrass"]
|
14074
13698
|
}, React__default.createElement("div", {
|
@@ -14080,8 +13704,7 @@ var CompareGrass = function CompareGrass(_ref) {
|
|
14080
13704
|
}, React__default.createElement("thead", {
|
14081
13705
|
style: {
|
14082
13706
|
borderBottom: "1px solid #E4E7EC"
|
14083
|
-
}
|
14084
|
-
className: isPrint ? PrintHeaderClassName : ""
|
13707
|
+
}
|
14085
13708
|
}, React__default.createElement("tr", null, React__default.createElement("th", {
|
14086
13709
|
className: styles$4["thcolumn1"]
|
14087
13710
|
}, t("problem_number")), React__default.createElement("th", {
|
@@ -14100,7 +13723,7 @@ var CompareGrass = function CompareGrass(_ref) {
|
|
14100
13723
|
style: {
|
14101
13724
|
textAlign: "center"
|
14102
13725
|
}
|
14103
|
-
}, t("problem_classification")))),
|
13726
|
+
}, t("problem_classification")))), React__default.createElement("tbody", null, renderTableBody(effectSize))))));
|
14104
13727
|
};
|
14105
13728
|
|
14106
13729
|
var iconX = function iconX(_ref) {
|
@@ -14152,8 +13775,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
|
|
14152
13775
|
var keyOpen = _ref.keyOpen,
|
14153
13776
|
data = _ref.data,
|
14154
13777
|
openProblem = _ref.openProblem,
|
14155
|
-
changeOpen = _ref.changeOpen
|
14156
|
-
isPrint = _ref.isPrint;
|
13778
|
+
changeOpen = _ref.changeOpen;
|
14157
13779
|
var _useTranslation = useTranslation(),
|
14158
13780
|
t = _useTranslation.t;
|
14159
13781
|
var isOpen = openProblem === keyOpen;
|
@@ -14192,45 +13814,12 @@ var TrickyProblem = function TrickyProblem(_ref) {
|
|
14192
13814
|
className: styles$4["noData"]
|
14193
13815
|
}, t("no_data"))));
|
14194
13816
|
};
|
14195
|
-
var renderPrintProblems = function renderPrintProblems() {
|
14196
|
-
return React__default.createElement(Fragment$1, null, React__default.createElement("div", {
|
14197
|
-
className: PrintContentClassName
|
14198
|
-
}, React__default.createElement("div", {
|
14199
|
-
className: styles$4["titleTrickyProblem"]
|
14200
|
-
}, React__default.createElement(iconX, null), React__default.createElement("span", null, t("incorrect_problem_among_the_starred_problems"))), React__default.createElement("div", {
|
14201
|
-
className: styles$4["wrongQuestions"]
|
14202
|
-
}, !!inCorrectQuestions.length && inCorrectQuestions.map(function (question) {
|
14203
|
-
return React__default.createElement("span", {
|
14204
|
-
key: question.id,
|
14205
|
-
className: styles$4["question"]
|
14206
|
-
}, t("number_question", {
|
14207
|
-
number: question.questionOrder + 1
|
14208
|
-
}));
|
14209
|
-
}), !data.questions.length && React__default.createElement("div", {
|
14210
|
-
className: styles$4["noData"]
|
14211
|
-
}, t("no_data")))), React__default.createElement("div", {
|
14212
|
-
className: PrintContentClassName
|
14213
|
-
}, React__default.createElement("div", {
|
14214
|
-
className: styles$4["titleTrickyProblem"]
|
14215
|
-
}, React__default.createElement(iconAssignedQuestions, null), React__default.createElement("span", null, t("correct_problem_among_the_starred_problems"))), React__default.createElement("div", {
|
14216
|
-
className: styles$4["assignedQuestions"]
|
14217
|
-
}, !!correctQuestions.length && correctQuestions.map(function (question) {
|
14218
|
-
return React__default.createElement("div", {
|
14219
|
-
key: question.id,
|
14220
|
-
className: styles$4["question"]
|
14221
|
-
}, t("number_question", {
|
14222
|
-
number: question.questionOrder + 1
|
14223
|
-
}));
|
14224
|
-
}), !data.questions.length && React__default.createElement("div", {
|
14225
|
-
className: styles$4["noData"]
|
14226
|
-
}, t("no_data")))));
|
14227
|
-
};
|
14228
13817
|
return React__default.createElement("div", {
|
14229
|
-
className: styles$4["wrapperProblem"]
|
13818
|
+
className: "" + styles$4["wrapperProblem"]
|
14230
13819
|
}, React__default.createElement("div", {
|
14231
|
-
className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"])
|
13820
|
+
className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
|
14232
13821
|
onClick: function onClick() {
|
14233
|
-
return changeOpen(isOpen ?
|
13822
|
+
return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
|
14234
13823
|
}
|
14235
13824
|
}, React__default.createElement(Typography, {
|
14236
13825
|
sx: {
|
@@ -14244,7 +13833,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
|
|
14244
13833
|
}) : React__default.createElement(IoChevronDown, {
|
14245
13834
|
size: 24,
|
14246
13835
|
color: styles$4.gray_300
|
14247
|
-
})), isOpen && React__default.createElement(Fragment$1, null,
|
13836
|
+
})), isOpen && React__default.createElement(Fragment$1, null, renderProblems()));
|
14248
13837
|
};
|
14249
13838
|
|
14250
13839
|
var ProtractedProblem = function ProtractedProblem(_ref) {
|
@@ -14252,7 +13841,6 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
|
|
14252
13841
|
data = _ref.data,
|
14253
13842
|
openProblem = _ref.openProblem,
|
14254
13843
|
changeOpen = _ref.changeOpen,
|
14255
|
-
isPrint = _ref.isPrint,
|
14256
13844
|
isMyStoryStudent = _ref.isMyStoryStudent;
|
14257
13845
|
var _useTranslation = useTranslation(),
|
14258
13846
|
t = _useTranslation.t;
|
@@ -14327,21 +13915,12 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
|
|
14327
13915
|
}, formatTimeSecond(item.topDuration, t)))));
|
14328
13916
|
});
|
14329
13917
|
};
|
14330
|
-
var renderPrintQuestions = function renderPrintQuestions() {
|
14331
|
-
var chunkedData = _.chunk(data, 5);
|
14332
|
-
return chunkedData.map(function (i, index) {
|
14333
|
-
return React__default.createElement("tbody", {
|
14334
|
-
key: index,
|
14335
|
-
className: PrintContentClassName
|
14336
|
-
}, isMyStoryStudent ? renderTableBody(i) : renderQuestions(i));
|
14337
|
-
});
|
14338
|
-
};
|
14339
13918
|
return React__default.createElement("div", {
|
14340
|
-
className: styles$4["wrapperProblem"]
|
13919
|
+
className: "" + styles$4["wrapperProblem"]
|
14341
13920
|
}, React__default.createElement("div", {
|
14342
|
-
className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"])
|
13921
|
+
className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
|
14343
13922
|
onClick: function onClick() {
|
14344
|
-
return changeOpen(isOpen ?
|
13923
|
+
return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
|
14345
13924
|
}
|
14346
13925
|
}, React__default.createElement(Stack, {
|
14347
13926
|
flexDirection: "row",
|
@@ -14377,8 +13956,7 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
|
|
14377
13956
|
}, isMyStoryStudent && React__default.createElement("thead", {
|
14378
13957
|
style: {
|
14379
13958
|
borderBottom: "1px solid #E4E7EC"
|
14380
|
-
}
|
14381
|
-
className: isPrint ? PrintHeaderClassName : ""
|
13959
|
+
}
|
14382
13960
|
}, React__default.createElement("tr", null, React__default.createElement("th", {
|
14383
13961
|
className: styles$4["thcolumn1"]
|
14384
13962
|
}, t("problem_number")), React__default.createElement("th", {
|
@@ -14393,8 +13971,8 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
|
|
14393
13971
|
style: {
|
14394
13972
|
textAlign: "center"
|
14395
13973
|
}
|
14396
|
-
}, t("time_comparison")))),
|
14397
|
-
className: styles$4["noData"]
|
13974
|
+
}, t("time_comparison")))), React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(data) : renderQuestions(data))))) : React__default.createElement("div", {
|
13975
|
+
className: "" + styles$4["noData"]
|
14398
13976
|
}, t("no_data"))));
|
14399
13977
|
};
|
14400
13978
|
|
@@ -14403,7 +13981,6 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
14403
13981
|
keyOpen = _ref.keyOpen,
|
14404
13982
|
openProblem = _ref.openProblem,
|
14405
13983
|
changeOpen = _ref.changeOpen,
|
14406
|
-
isPrint = _ref.isPrint,
|
14407
13984
|
isMyStoryStudent = _ref.isMyStoryStudent;
|
14408
13985
|
var _useTranslation = useTranslation(),
|
14409
13986
|
t = _useTranslation.t;
|
@@ -14467,11 +14044,13 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
14467
14044
|
return questions.map(function (question) {
|
14468
14045
|
return React__default.createElement(Grid, {
|
14469
14046
|
container: true,
|
14047
|
+
flexWrap: "nowrap",
|
14470
14048
|
className: styles$4["content"],
|
14471
14049
|
key: question.id
|
14472
14050
|
}, React__default.createElement(Grid, {
|
14473
14051
|
item: true,
|
14474
14052
|
xs: 1.5,
|
14053
|
+
minWidth: "120px",
|
14475
14054
|
className: styles$4["contentColumn1"]
|
14476
14055
|
}, React__default.createElement("div", null, React__default.createElement("span", {
|
14477
14056
|
className: styles$4["span1"]
|
@@ -14498,22 +14077,14 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
14498
14077
|
}), ")"))));
|
14499
14078
|
});
|
14500
14079
|
};
|
14501
|
-
var
|
14502
|
-
|
14503
|
-
return chunkedQuestions.map(function (i, index) {
|
14504
|
-
return React__default.createElement("tbody", {
|
14505
|
-
key: index,
|
14506
|
-
className: PrintContentClassName
|
14507
|
-
}, isMyStoryStudent ? renderTableBody(i) : renderQuestions(i));
|
14508
|
-
});
|
14080
|
+
var handleToggle = function handleToggle() {
|
14081
|
+
changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
|
14509
14082
|
};
|
14510
14083
|
return React__default.createElement("div", {
|
14511
|
-
className: styles$4["wrapperProblem"]
|
14084
|
+
className: "" + styles$4["wrapperProblem"]
|
14512
14085
|
}, React__default.createElement("div", {
|
14513
|
-
className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"])
|
14514
|
-
onClick:
|
14515
|
-
return changeOpen(isOpen ? "" : keyOpen);
|
14516
|
-
}
|
14086
|
+
className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
|
14087
|
+
onClick: handleToggle
|
14517
14088
|
}, React__default.createElement(Stack, {
|
14518
14089
|
flexDirection: "row",
|
14519
14090
|
gap: "24px",
|
@@ -14540,16 +14111,15 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
14540
14111
|
className: styles$4["tableCompareGrass"]
|
14541
14112
|
}, React__default.createElement("div", {
|
14542
14113
|
className: styles$4["table-responsive"]
|
14543
|
-
}, React__default.createElement(Table, {
|
14114
|
+
}, isMyStoryStudent && React__default.createElement(Table, {
|
14544
14115
|
style: {
|
14545
14116
|
width: "100%",
|
14546
14117
|
marginBottom: isMyStoryStudent ? "120px" : 0
|
14547
14118
|
}
|
14548
|
-
},
|
14119
|
+
}, React__default.createElement("thead", {
|
14549
14120
|
style: {
|
14550
14121
|
borderBottom: "1px solid #E4E7EC"
|
14551
|
-
}
|
14552
|
-
className: isPrint ? PrintHeaderClassName : ""
|
14122
|
+
}
|
14553
14123
|
}, React__default.createElement("tr", null, React__default.createElement("th", {
|
14554
14124
|
className: styles$4["thcolumn1"]
|
14555
14125
|
}, t("problem_number")), React__default.createElement("th", {
|
@@ -14568,23 +14138,44 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
14568
14138
|
style: {
|
14569
14139
|
textAlign: "center"
|
14570
14140
|
}
|
14571
|
-
}, t("_category")))),
|
14572
|
-
className: styles$4["noData"]
|
14141
|
+
}, t("_category")))), React__default.createElement("tbody", null, renderTableBody(incorrectQuestions))), !isMyStoryStudent && renderQuestions(incorrectQuestions))) : React__default.createElement("div", {
|
14142
|
+
className: "" + styles$4["noData"]
|
14573
14143
|
}, t("no_data"))));
|
14574
14144
|
};
|
14575
14145
|
|
14146
|
+
var AnswerResponseSignal;
|
14147
|
+
(function (AnswerResponseSignal) {
|
14148
|
+
AnswerResponseSignal[AnswerResponseSignal["Purple"] = 0] = "Purple";
|
14149
|
+
AnswerResponseSignal[AnswerResponseSignal["Red"] = 1] = "Red";
|
14150
|
+
AnswerResponseSignal[AnswerResponseSignal["Yellow"] = 2] = "Yellow";
|
14151
|
+
AnswerResponseSignal[AnswerResponseSignal["Green"] = 3] = "Green";
|
14152
|
+
AnswerResponseSignal[AnswerResponseSignal["Black"] = 4] = "Black";
|
14153
|
+
})(AnswerResponseSignal || (AnswerResponseSignal = {}));
|
14154
|
+
var ProblemKey;
|
14155
|
+
(function (ProblemKey) {
|
14156
|
+
ProblemKey[ProblemKey["TrickyProblem"] = 0] = "TrickyProblem";
|
14157
|
+
ProblemKey[ProblemKey["ProtractedProblem"] = 1] = "ProtractedProblem";
|
14158
|
+
ProblemKey[ProblemKey["GradesByTerritory"] = 2] = "GradesByTerritory";
|
14159
|
+
ProblemKey[ProblemKey["Vulnerable"] = 3] = "Vulnerable";
|
14160
|
+
})(ProblemKey || (ProblemKey = {}));
|
14161
|
+
var PrintState;
|
14162
|
+
(function (PrintState) {
|
14163
|
+
PrintState[PrintState["Default"] = 0] = "Default";
|
14164
|
+
PrintState[PrintState["Printing"] = 1] = "Printing";
|
14165
|
+
PrintState[PrintState["Pending"] = 2] = "Pending";
|
14166
|
+
PrintState[PrintState["Printed"] = 3] = "Printed";
|
14167
|
+
})(PrintState || (PrintState = {}));
|
14168
|
+
|
14576
14169
|
var GradesByTerritory = function GradesByTerritory(_ref) {
|
14577
|
-
var
|
14578
|
-
data = _ref.data,
|
14170
|
+
var data = _ref.data,
|
14579
14171
|
openProblem = _ref.openProblem,
|
14580
14172
|
changeOpen = _ref.changeOpen,
|
14581
|
-
isPrint = _ref.isPrint,
|
14582
14173
|
resultData = _ref.resultData,
|
14583
14174
|
isMyStoryStudent = _ref.isMyStoryStudent;
|
14584
14175
|
var _useTranslation = useTranslation(),
|
14585
14176
|
t = _useTranslation.t;
|
14586
14177
|
var formattedData = totalSolveTimeCategories(resultData, data);
|
14587
|
-
var isOpen = openProblem ===
|
14178
|
+
var isOpen = openProblem === ProblemKey.GradesByTerritory;
|
14588
14179
|
var renderTableBody = function renderTableBody(data) {
|
14589
14180
|
return data.map(function (item, index) {
|
14590
14181
|
return React__default.createElement("tr", {
|
@@ -14658,21 +14249,12 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
|
|
14658
14249
|
}))));
|
14659
14250
|
});
|
14660
14251
|
};
|
14661
|
-
var renderPrintCategories = function renderPrintCategories() {
|
14662
|
-
var chunkedCategories = _.chunk(formattedData, 10);
|
14663
|
-
return chunkedCategories.map(function (i, index) {
|
14664
|
-
return React__default.createElement("tbody", {
|
14665
|
-
key: index,
|
14666
|
-
className: PrintContentClassName
|
14667
|
-
}, isMyStoryStudent ? renderTableBody(i) : renderCategories(i));
|
14668
|
-
});
|
14669
|
-
};
|
14670
14252
|
return React__default.createElement("div", {
|
14671
|
-
className: styles$4["wrapperProblem"]
|
14253
|
+
className: "" + styles$4["wrapperProblem"]
|
14672
14254
|
}, React__default.createElement("div", {
|
14673
|
-
className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"])
|
14255
|
+
className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
|
14674
14256
|
onClick: function onClick() {
|
14675
|
-
return changeOpen(isOpen ?
|
14257
|
+
return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : ProblemKey.GradesByTerritory);
|
14676
14258
|
}
|
14677
14259
|
}, React__default.createElement(Typography, {
|
14678
14260
|
sx: {
|
@@ -14690,16 +14272,15 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
|
|
14690
14272
|
className: styles$4["tableCompareGrass"]
|
14691
14273
|
}, React__default.createElement("div", {
|
14692
14274
|
className: styles$4["table-responsive"]
|
14693
|
-
}, React__default.createElement(Table, {
|
14275
|
+
}, isMyStoryStudent && React__default.createElement(Table, {
|
14694
14276
|
style: {
|
14695
14277
|
width: "100%",
|
14696
14278
|
marginBottom: isMyStoryStudent ? "120px" : 0
|
14697
14279
|
}
|
14698
|
-
},
|
14280
|
+
}, React__default.createElement("thead", {
|
14699
14281
|
style: {
|
14700
14282
|
borderBottom: "1px solid #E4E7EC"
|
14701
|
-
}
|
14702
|
-
className: isPrint ? PrintHeaderClassName : ""
|
14283
|
+
}
|
14703
14284
|
}, React__default.createElement("tr", null, React__default.createElement("th", {
|
14704
14285
|
className: styles$4["thcolumn1"]
|
14705
14286
|
}, t("categories")), React__default.createElement("th", {
|
@@ -14718,8 +14299,8 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
|
|
14718
14299
|
style: {
|
14719
14300
|
textAlign: "center"
|
14720
14301
|
}
|
14721
|
-
}, t("total_solve_time")))),
|
14722
|
-
className: styles$4["noData"]
|
14302
|
+
}, t("total_solve_time")))), React__default.createElement("tbody", null, renderTableBody(formattedData))), !isMyStoryStudent && renderCategories(formattedData))) : React__default.createElement("div", {
|
14303
|
+
className: "" + styles$4["noData"]
|
14723
14304
|
}, t("no_data"))));
|
14724
14305
|
};
|
14725
14306
|
|
@@ -14923,23 +14504,379 @@ var useTab = function useTab() {
|
|
14923
14504
|
};
|
14924
14505
|
};
|
14925
14506
|
|
14507
|
+
var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, totalChart, onSuccess, onError, autoPrint) {
|
14508
|
+
if (autoPrint === void 0) {
|
14509
|
+
autoPrint = false;
|
14510
|
+
}
|
14511
|
+
var contentRef = useRef(null);
|
14512
|
+
var _useState = useState([]),
|
14513
|
+
renderedCharts = _useState[0],
|
14514
|
+
setRenderedCharts = _useState[1];
|
14515
|
+
var _useTranslation = useTranslation(),
|
14516
|
+
t = _useTranslation.t;
|
14517
|
+
var _useState2 = useState(PrintState.Default),
|
14518
|
+
printState = _useState2[0],
|
14519
|
+
setPrintState = _useState2[1];
|
14520
|
+
var setRenderedChart = function setRenderedChart(chart) {
|
14521
|
+
setRenderedCharts(function (state) {
|
14522
|
+
return [].concat(state, [chart]);
|
14523
|
+
});
|
14524
|
+
};
|
14525
|
+
var reset = function reset() {
|
14526
|
+
setRenderedCharts([]);
|
14527
|
+
setPrintState(PrintState.Default);
|
14528
|
+
};
|
14529
|
+
var autoPrintPdf = function autoPrintPdf() {
|
14530
|
+
if (printState === PrintState.Printing) return;
|
14531
|
+
if (autoPrint && printState !== PrintState.Default) return;
|
14532
|
+
if (totalChart !== renderedCharts.length) {
|
14533
|
+
!autoPrint && setPrintState(PrintState.Pending);
|
14534
|
+
return;
|
14535
|
+
}
|
14536
|
+
var name = !fileName ? "Exam-Result_" + new Date().getTime() : fileName;
|
14537
|
+
if (contentRef.current && contentRef.current != null) {
|
14538
|
+
setPrintState(PrintState.Printing);
|
14539
|
+
setTimeout(function () {
|
14540
|
+
try {
|
14541
|
+
var _temp2 = function _temp2() {
|
14542
|
+
setPrintState(PrintState.Printed);
|
14543
|
+
};
|
14544
|
+
var _temp = _catch(function () {
|
14545
|
+
var element = contentRef.current;
|
14546
|
+
var options = {
|
14547
|
+
margin: 5,
|
14548
|
+
filename: name + ".pdf",
|
14549
|
+
html2canvas: {
|
14550
|
+
scale: 2
|
14551
|
+
},
|
14552
|
+
jsPDF: {
|
14553
|
+
format: 'a4',
|
14554
|
+
orientation: 'portrait'
|
14555
|
+
},
|
14556
|
+
pagebreak: {
|
14557
|
+
mode: ['avoid-all', 'css', 'legacy']
|
14558
|
+
}
|
14559
|
+
};
|
14560
|
+
return Promise.resolve(html2pdf().from(element).set(options).save()).then(function () {
|
14561
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
14562
|
+
});
|
14563
|
+
}, function (error) {
|
14564
|
+
!window.opener && toast.error(getErrorMessage(t, error));
|
14565
|
+
onError === null || onError === void 0 ? void 0 : onError(error === null || error === void 0 ? void 0 : error.message);
|
14566
|
+
});
|
14567
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
14568
|
+
} catch (e) {
|
14569
|
+
return Promise.reject(e);
|
14570
|
+
}
|
14571
|
+
}, 300);
|
14572
|
+
}
|
14573
|
+
};
|
14574
|
+
var handlePrintPdf = function handlePrintPdf() {
|
14575
|
+
autoPrintPdf();
|
14576
|
+
};
|
14577
|
+
useEffect(function () {
|
14578
|
+
(autoPrint || printState === PrintState.Pending) && isDataFetching === false && autoPrintPdf();
|
14579
|
+
}, [totalChart, renderedCharts.length, fileName, autoPrint, printState, isDataFetching]);
|
14580
|
+
useEffect(function () {
|
14581
|
+
isDataFetching && reset();
|
14582
|
+
}, [isDataFetching]);
|
14583
|
+
return {
|
14584
|
+
contentRef: contentRef,
|
14585
|
+
printState: printState,
|
14586
|
+
setRenderedChart: setRenderedChart,
|
14587
|
+
handlePrintPdf: handlePrintPdf,
|
14588
|
+
reset: reset
|
14589
|
+
};
|
14590
|
+
};
|
14591
|
+
|
14592
|
+
var printStyles = {"page-break":"_35kyG","print-exact-color":"_1PFgl","avoid-break-inside":"_3rPGh"};
|
14593
|
+
|
14594
|
+
var TimeOrderChart = function TimeOrderChart(_ref) {
|
14595
|
+
var timelyOrderQuestion = _ref.timelyOrderQuestion,
|
14596
|
+
options = _ref.options,
|
14597
|
+
series = _ref.series,
|
14598
|
+
setIsRendered = _ref.setIsRendered;
|
14599
|
+
var _useTranslation = useTranslation(),
|
14600
|
+
t = _useTranslation.t;
|
14601
|
+
var chartRef = useRef(null);
|
14602
|
+
var chartOptions = _extends({}, options, {
|
14603
|
+
chart: _extends({}, options.chart, {
|
14604
|
+
animations: {
|
14605
|
+
enabled: false
|
14606
|
+
}
|
14607
|
+
})
|
14608
|
+
});
|
14609
|
+
useEffect(function () {
|
14610
|
+
if (chartRef.current) {
|
14611
|
+
setIsRendered(timelyOrderQuestion.article);
|
14612
|
+
}
|
14613
|
+
}, [timelyOrderQuestion.article]);
|
14614
|
+
return React__default.createElement("div", {
|
14615
|
+
className: "" + printStyles["avoid-break-inside"]
|
14616
|
+
}, React__default.createElement(Typography, {
|
14617
|
+
className: "pb-2",
|
14618
|
+
sx: {
|
14619
|
+
fontSize: "14px",
|
14620
|
+
fontWeight: 700,
|
14621
|
+
color: "#414E62"
|
14622
|
+
}
|
14623
|
+
}, t("article_number"), " ", timelyOrderQuestion.article), React__default.createElement("div", {
|
14624
|
+
className: "" + styles$4["compareChart"]
|
14625
|
+
}, React__default.createElement("div", {
|
14626
|
+
className: "" + styles$4["prevChart"]
|
14627
|
+
}), React__default.createElement("div", {
|
14628
|
+
className: styles$4["chart"] + " sr-line-chart"
|
14629
|
+
}, React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
|
14630
|
+
ref: chartRef,
|
14631
|
+
height: 389,
|
14632
|
+
options: chartOptions,
|
14633
|
+
series: series
|
14634
|
+
}))), React__default.createElement("div", {
|
14635
|
+
className: "" + styles$4["nextChart"]
|
14636
|
+
})));
|
14637
|
+
};
|
14638
|
+
|
14639
|
+
var textStyle = {
|
14640
|
+
fontSize: "18px",
|
14641
|
+
fontWeight: 700,
|
14642
|
+
color: styles.gray_500
|
14643
|
+
};
|
14644
|
+
var courseNameStyle = {
|
14645
|
+
fontSize: "14px",
|
14646
|
+
fontWeight: 600,
|
14647
|
+
color: styles.less_dark
|
14648
|
+
};
|
14649
|
+
var examTitleStyle = {
|
14650
|
+
fontSize: "20px",
|
14651
|
+
fontWeight: 600,
|
14652
|
+
color: styles.darker
|
14653
|
+
};
|
14654
|
+
var studentNameStyle = {
|
14655
|
+
fontSize: "24px",
|
14656
|
+
fontWeight: 600,
|
14657
|
+
color: styles.darker,
|
14658
|
+
lineHeight: 1
|
14659
|
+
};
|
14660
|
+
var PrintExamResult = function PrintExamResult(_ref) {
|
14661
|
+
var resultData = _ref.resultData,
|
14662
|
+
examTime = _ref.examTime,
|
14663
|
+
isStudent = _ref.isStudent,
|
14664
|
+
categoryResponses = _ref.categoryResponses,
|
14665
|
+
timelyOrderQuestions = _ref.timelyOrderQuestions,
|
14666
|
+
allChartOptions = _ref.allChartOptions,
|
14667
|
+
allSeries = _ref.allSeries,
|
14668
|
+
effectSize = _ref.effectSize,
|
14669
|
+
isMyStoryStudent = _ref.isMyStoryStudent,
|
14670
|
+
longTimeSpend = _ref.longTimeSpend,
|
14671
|
+
contentRef = _ref.contentRef,
|
14672
|
+
setRenderedChart = _ref.setRenderedChart;
|
14673
|
+
var academy = useSelector(function (state) {
|
14674
|
+
var _state$common;
|
14675
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.academy;
|
14676
|
+
});
|
14677
|
+
return React__default.createElement(Box, {
|
14678
|
+
sx: {
|
14679
|
+
minWidth: "768px",
|
14680
|
+
width: "768px",
|
14681
|
+
maxWidth: "768px!important",
|
14682
|
+
background: "#FFF",
|
14683
|
+
padding: "24px",
|
14684
|
+
overflow: "auto"
|
14685
|
+
},
|
14686
|
+
id: "canvas",
|
14687
|
+
className: printStyles["print-exact-color"] + " " + printStyles["container"],
|
14688
|
+
ref: contentRef
|
14689
|
+
}, React__default.createElement(Grid, {
|
14690
|
+
container: true,
|
14691
|
+
marginBottom: "24px"
|
14692
|
+
}, React__default.createElement(Grid, {
|
14693
|
+
item: true,
|
14694
|
+
xs: 12
|
14695
|
+
}, React__default.createElement(Stack, {
|
14696
|
+
direction: "row",
|
14697
|
+
justifyContent: "space-between",
|
14698
|
+
flexWrap: "nowrap",
|
14699
|
+
spacing: 1,
|
14700
|
+
marginBottom: "12px"
|
14701
|
+
}, React__default.createElement(Stack, {
|
14702
|
+
direction: "column"
|
14703
|
+
}, React__default.createElement(Typography, {
|
14704
|
+
sx: studentNameStyle
|
14705
|
+
}, resultData.student.fullName), React__default.createElement(Typography, {
|
14706
|
+
sx: {
|
14707
|
+
fontSize: "16px",
|
14708
|
+
fontWeight: 600,
|
14709
|
+
color: styles.gray_500
|
14710
|
+
}
|
14711
|
+
}, resultData.student.email)), academy && React__default.createElement(Typography, {
|
14712
|
+
sx: _extends({}, studentNameStyle, {
|
14713
|
+
textAlign: "end"
|
14714
|
+
})
|
14715
|
+
}, academy.name)), resultData.courseName && React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
14716
|
+
sx: courseNameStyle
|
14717
|
+
}, resultData.courseName)), React__default.createElement(Box, {
|
14718
|
+
display: "flex",
|
14719
|
+
gap: "16px",
|
14720
|
+
flexDirection: "column"
|
14721
|
+
}, React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
14722
|
+
sx: examTitleStyle
|
14723
|
+
}, resultData.title)), React__default.createElement(Stack, {
|
14724
|
+
flexDirection: "row",
|
14725
|
+
gap: "16px"
|
14726
|
+
}, React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
14727
|
+
sx: {
|
14728
|
+
fontSize: "13px",
|
14729
|
+
fontWeight: 600,
|
14730
|
+
color: styles.gray_500
|
14731
|
+
}
|
14732
|
+
}, t$1("my_score")), React__default.createElement(Typography, {
|
14733
|
+
sx: {
|
14734
|
+
fontSize: "14px",
|
14735
|
+
fontWeight: 600,
|
14736
|
+
color: styles.darker
|
14737
|
+
}
|
14738
|
+
}, t$1("score_format", {
|
14739
|
+
score: resultData === null || resultData === void 0 ? void 0 : resultData.score
|
14740
|
+
}))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
14741
|
+
sx: {
|
14742
|
+
fontSize: "13px",
|
14743
|
+
fontWeight: 600,
|
14744
|
+
color: styles.gray_500
|
14745
|
+
}
|
14746
|
+
}, t$1("exam_date")), React__default.createElement(Typography, {
|
14747
|
+
sx: {
|
14748
|
+
fontSize: "14px",
|
14749
|
+
fontWeight: 600,
|
14750
|
+
color: styles.gray_700
|
14751
|
+
}
|
14752
|
+
}, utcToLocalTime(resultData === null || resultData === void 0 ? void 0 : resultData.startTime, t$1("date_format")))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
14753
|
+
sx: {
|
14754
|
+
fontSize: "13px",
|
14755
|
+
fontWeight: 600,
|
14756
|
+
color: styles.gray_500
|
14757
|
+
}
|
14758
|
+
}, t$1("exam_time")), React__default.createElement(Typography, {
|
14759
|
+
sx: {
|
14760
|
+
fontSize: "14px",
|
14761
|
+
fontWeight: 600,
|
14762
|
+
color: styles.gray_700
|
14763
|
+
}
|
14764
|
+
}, examTime)), React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
14765
|
+
sx: {
|
14766
|
+
fontSize: "13px",
|
14767
|
+
fontWeight: 600,
|
14768
|
+
color: styles.gray_500
|
14769
|
+
}
|
14770
|
+
}, t$1("total_students")), React__default.createElement(Typography, {
|
14771
|
+
sx: {
|
14772
|
+
fontSize: "14px",
|
14773
|
+
fontWeight: 600,
|
14774
|
+
color: styles.gray_700
|
14775
|
+
}
|
14776
|
+
}, t$1("number_people", {
|
14777
|
+
number: resultData === null || resultData === void 0 ? void 0 : resultData.totalStudent
|
14778
|
+
}))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
14779
|
+
sx: {
|
14780
|
+
fontSize: "13px",
|
14781
|
+
fontWeight: 600,
|
14782
|
+
color: styles.gray_500
|
14783
|
+
}
|
14784
|
+
}, t$1("teacher_in_charge")), React__default.createElement(Typography, {
|
14785
|
+
sx: {
|
14786
|
+
fontSize: "14px",
|
14787
|
+
fontWeight: 600,
|
14788
|
+
color: styles.gray_700
|
14789
|
+
}
|
14790
|
+
}, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), React__default.createElement(Stack, {
|
14791
|
+
display: "flex",
|
14792
|
+
flexDirection: "column",
|
14793
|
+
gap: "12px"
|
14794
|
+
}, React__default.createElement(Typography, {
|
14795
|
+
sx: textStyle
|
14796
|
+
}, t$1(TabList[0].label)), React__default.createElement(MyAnswer, {
|
14797
|
+
data: resultData,
|
14798
|
+
categories: categoryResponses,
|
14799
|
+
isStudent: isStudent
|
14800
|
+
})), React__default.createElement(Stack, {
|
14801
|
+
display: "flex",
|
14802
|
+
flexDirection: "column",
|
14803
|
+
gap: "12px",
|
14804
|
+
marginTop: "24px"
|
14805
|
+
}, React__default.createElement(Typography, {
|
14806
|
+
sx: textStyle
|
14807
|
+
}, t$1(TabList[1].label)), timelyOrderQuestions.map(function (timelyOrderQuestion, index) {
|
14808
|
+
return React__default.createElement(TimeOrderChart, {
|
14809
|
+
key: index,
|
14810
|
+
timelyOrderQuestion: timelyOrderQuestion,
|
14811
|
+
options: allChartOptions[index],
|
14812
|
+
series: allSeries[index],
|
14813
|
+
setIsRendered: setRenderedChart
|
14814
|
+
});
|
14815
|
+
})), React__default.createElement(Stack, {
|
14816
|
+
display: "flex",
|
14817
|
+
flexDirection: "column",
|
14818
|
+
gap: "12px",
|
14819
|
+
marginTop: "24px"
|
14820
|
+
}, React__default.createElement(Typography, {
|
14821
|
+
sx: textStyle
|
14822
|
+
}, t$1(TabList[2].label)), React__default.createElement(CompareGrass, {
|
14823
|
+
effectSize: effectSize
|
14824
|
+
})), React__default.createElement(Stack, {
|
14825
|
+
display: "flex",
|
14826
|
+
flexDirection: "column",
|
14827
|
+
gap: "12px",
|
14828
|
+
marginTop: "24px"
|
14829
|
+
}, React__default.createElement(Typography, {
|
14830
|
+
sx: textStyle
|
14831
|
+
}, t$1(TabList[3].label)), React__default.createElement(TrickyProblem, {
|
14832
|
+
keyOpen: ProblemKey.TrickyProblem,
|
14833
|
+
data: resultData,
|
14834
|
+
openProblem: ProblemKey.TrickyProblem
|
14835
|
+
}), React__default.createElement(Vulnerable, {
|
14836
|
+
keyOpen: ProblemKey.Vulnerable,
|
14837
|
+
data: resultData,
|
14838
|
+
openProblem: ProblemKey.Vulnerable,
|
14839
|
+
isMyStoryStudent: isMyStoryStudent
|
14840
|
+
}), React__default.createElement(ProtractedProblem, {
|
14841
|
+
keyOpen: ProblemKey.ProtractedProblem,
|
14842
|
+
data: longTimeSpend,
|
14843
|
+
openProblem: ProblemKey.ProtractedProblem,
|
14844
|
+
isMyStoryStudent: isMyStoryStudent
|
14845
|
+
}), React__default.createElement(GradesByTerritory, {
|
14846
|
+
data: categoryResponses,
|
14847
|
+
resultData: resultData,
|
14848
|
+
openProblem: ProblemKey.GradesByTerritory,
|
14849
|
+
isMyStoryStudent: isMyStoryStudent
|
14850
|
+
})));
|
14851
|
+
};
|
14852
|
+
|
14926
14853
|
var ExamResultV2 = function ExamResultV2(_ref) {
|
14927
14854
|
var searchParams = _ref.searchParams,
|
14928
14855
|
history = _ref.history,
|
14929
|
-
examSessionId = _ref.examSessionId,
|
14930
|
-
|
14856
|
+
_ref$examSessionId = _ref.examSessionId,
|
14857
|
+
examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
|
14858
|
+
_ref$studentId = _ref.studentId,
|
14859
|
+
studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
|
14931
14860
|
code = _ref.code,
|
14932
14861
|
isMyStoryStudent = _ref.isMyStoryStudent;
|
14933
14862
|
var _useTab = useTab(),
|
14934
14863
|
selected = _useTab.selected,
|
14935
14864
|
handleChangeTab = _useTab.handleChangeTab;
|
14936
|
-
var _useExamResult = useExamResult(
|
14865
|
+
var _useExamResult = useExamResult({
|
14866
|
+
searchParams: searchParams,
|
14867
|
+
history: history,
|
14868
|
+
examSessionId: examSessionId,
|
14869
|
+
studentId: studentId,
|
14870
|
+
code: code,
|
14871
|
+
handleChangeTab: handleChangeTab,
|
14872
|
+
selectedTab: selected
|
14873
|
+
}),
|
14937
14874
|
isLoading = _useExamResult.isLoading,
|
14938
14875
|
examTime = _useExamResult.examTime,
|
14939
14876
|
series = _useExamResult.series,
|
14940
14877
|
allSeries = _useExamResult.allSeries,
|
14941
|
-
chartOptions = _useExamResult.chartOptions,
|
14942
14878
|
allChartOptions = _useExamResult.allChartOptions,
|
14879
|
+
chartOptions = _useExamResult.chartOptions,
|
14943
14880
|
dataChartIndex = _useExamResult.dataChartIndex,
|
14944
14881
|
timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
|
14945
14882
|
isStudent = _useExamResult.isStudent,
|
@@ -14948,7 +14885,6 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
14948
14885
|
longTimeSpend = _useExamResult.longTimeSpend,
|
14949
14886
|
effectSize = _useExamResult.effectSize,
|
14950
14887
|
categoryResponses = _useExamResult.categoryResponses,
|
14951
|
-
handleExportPdf = _useExamResult.handleExportPdf,
|
14952
14888
|
setOpenProblem = _useExamResult.setOpenProblem,
|
14953
14889
|
handlePrevChart = _useExamResult.handlePrevChart,
|
14954
14890
|
handleNextChart = _useExamResult.handleNextChart;
|
@@ -14958,9 +14894,15 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
14958
14894
|
handleCreateQuestion = _useCreateQuestionDia.handleCreateQuestion,
|
14959
14895
|
openCreateQuestionDialog = _useCreateQuestionDia.openCreateQuestionDialog,
|
14960
14896
|
toggleCreateQuestion = _useCreateQuestionDia.toggleCreateQuestion;
|
14897
|
+
var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
|
14898
|
+
var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length),
|
14899
|
+
contentRef = _usePrintExamResult.contentRef,
|
14900
|
+
printState = _usePrintExamResult.printState,
|
14901
|
+
handlePrintPdf = _usePrintExamResult.handlePrintPdf,
|
14902
|
+
setRenderedChart = _usePrintExamResult.setRenderedChart;
|
14961
14903
|
var isTabletUp = useMediaQuery('(min-width:900px)');
|
14962
14904
|
return React__default.createElement(Fragment$1, null, React__default.createElement(LoadingComponent, {
|
14963
|
-
isLoading: isLoading
|
14905
|
+
isLoading: !!isLoading
|
14964
14906
|
}), timelyOrderQuestions[dataChartIndex] && longTimeSpend && resultData && effectSize ? React__default.createElement("div", {
|
14965
14907
|
style: {
|
14966
14908
|
width: "100%"
|
@@ -15076,7 +15018,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
15076
15018
|
className: styles$4["pdfBtnBox"]
|
15077
15019
|
}, React__default.createElement("button", {
|
15078
15020
|
className: styles$4["pdfBtn"] + " " + styles["truncate"],
|
15079
|
-
onClick:
|
15021
|
+
onClick: handlePrintPdf
|
15080
15022
|
}, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print_all"))))))), React__default.createElement(Grid, {
|
15081
15023
|
item: true,
|
15082
15024
|
xs: 12
|
@@ -15122,7 +15064,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
15122
15064
|
className: styles$4["pdfBtnBox"]
|
15123
15065
|
}, React__default.createElement("button", {
|
15124
15066
|
className: styles$4["pdfBtn"] + " " + styles["truncate"],
|
15125
|
-
onClick:
|
15067
|
+
onClick: handlePrintPdf
|
15126
15068
|
}, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print"))))))), React__default.createElement(Grid, {
|
15127
15069
|
item: true,
|
15128
15070
|
xs: 12
|
@@ -15159,240 +15101,54 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
15159
15101
|
value: selected,
|
15160
15102
|
index: 3
|
15161
15103
|
}, React__default.createElement(TrickyProblem, {
|
15162
|
-
keyOpen:
|
15104
|
+
keyOpen: ProblemKey.TrickyProblem,
|
15163
15105
|
data: resultData,
|
15164
15106
|
openProblem: openProblem,
|
15165
15107
|
changeOpen: setOpenProblem
|
15166
15108
|
}), React__default.createElement(Vulnerable, {
|
15167
|
-
keyOpen:
|
15109
|
+
keyOpen: ProblemKey.Vulnerable,
|
15168
15110
|
data: resultData,
|
15169
15111
|
openProblem: openProblem,
|
15170
15112
|
changeOpen: setOpenProblem,
|
15171
15113
|
isMyStoryStudent: isMyStoryStudent
|
15172
15114
|
}), React__default.createElement(ProtractedProblem, {
|
15173
|
-
keyOpen:
|
15115
|
+
keyOpen: ProblemKey.ProtractedProblem,
|
15174
15116
|
data: longTimeSpend,
|
15175
15117
|
openProblem: openProblem,
|
15176
15118
|
changeOpen: setOpenProblem,
|
15177
15119
|
isMyStoryStudent: isMyStoryStudent
|
15178
15120
|
}), React__default.createElement(GradesByTerritory, {
|
15179
|
-
keyOpen: "GradesByTerritory",
|
15180
15121
|
data: categoryResponses,
|
15181
15122
|
resultData: resultData,
|
15182
15123
|
openProblem: openProblem,
|
15183
15124
|
isMyStoryStudent: isMyStoryStudent,
|
15184
15125
|
changeOpen: setOpenProblem
|
15185
|
-
}))), React__default.createElement(Grid, {
|
15186
|
-
item: true,
|
15187
|
-
xs: 12,
|
15188
|
-
className: "position-absolute",
|
15189
|
-
sx: {
|
15190
|
-
zIndex: -1,
|
15191
|
-
width: "1024px"
|
15192
|
-
},
|
15193
|
-
id: "canvas"
|
15194
|
-
}, React__default.createElement(Grid, {
|
15195
|
-
container: true,
|
15196
|
-
padding: "24px",
|
15197
|
-
id: "header-canvas"
|
15198
|
-
}, React__default.createElement(Grid, {
|
15199
|
-
item: true
|
15200
|
-
}, resultData.courseName && React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
15201
|
-
sx: {
|
15202
|
-
fontSize: "14px",
|
15203
|
-
fontWeight: 600,
|
15204
|
-
color: styles.less_dark
|
15205
|
-
}
|
15206
|
-
}, resultData.courseName)), React__default.createElement(Box, {
|
15207
|
-
display: "flex",
|
15208
|
-
gap: "16px",
|
15209
|
-
flexDirection: "column"
|
15210
|
-
}, React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
15211
|
-
sx: {
|
15212
|
-
fontSize: "20px",
|
15213
|
-
fontWeight: 600,
|
15214
|
-
color: styles.darker
|
15215
|
-
}
|
15216
|
-
}, resultData.title)), React__default.createElement(Stack, {
|
15217
|
-
flexDirection: "row",
|
15218
|
-
gap: "16px"
|
15219
|
-
}, React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
15220
|
-
sx: {
|
15221
|
-
fontSize: "13px",
|
15222
|
-
fontWeight: 600,
|
15223
|
-
color: styles.gray_500
|
15224
|
-
}
|
15225
|
-
}, t("my_score")), React__default.createElement(Typography, {
|
15226
|
-
sx: {
|
15227
|
-
fontSize: "14px",
|
15228
|
-
fontWeight: 600,
|
15229
|
-
color: styles.darker
|
15230
|
-
}
|
15231
|
-
}, t("score_format", {
|
15232
|
-
score: resultData === null || resultData === void 0 ? void 0 : resultData.score
|
15233
|
-
}))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
15234
|
-
sx: {
|
15235
|
-
fontSize: "13px",
|
15236
|
-
fontWeight: 600,
|
15237
|
-
color: styles.gray_500
|
15238
|
-
}
|
15239
|
-
}, t("exam_date")), React__default.createElement(Typography, {
|
15240
|
-
sx: {
|
15241
|
-
fontSize: "14px",
|
15242
|
-
fontWeight: 600,
|
15243
|
-
color: styles.gray_700
|
15244
|
-
}
|
15245
|
-
}, utcToLocalTime(resultData === null || resultData === void 0 ? void 0 : resultData.startTime, t("date_format")))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
15246
|
-
sx: {
|
15247
|
-
fontSize: "13px",
|
15248
|
-
fontWeight: 600,
|
15249
|
-
color: styles.gray_500
|
15250
|
-
}
|
15251
|
-
}, t("exam_time")), React__default.createElement(Typography, {
|
15252
|
-
sx: {
|
15253
|
-
fontSize: "14px",
|
15254
|
-
fontWeight: 600,
|
15255
|
-
color: styles.gray_700
|
15256
|
-
}
|
15257
|
-
}, examTime)), React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
15258
|
-
sx: {
|
15259
|
-
fontSize: "13px",
|
15260
|
-
fontWeight: 600,
|
15261
|
-
color: styles.gray_500
|
15262
|
-
}
|
15263
|
-
}, t("total_students")), React__default.createElement(Typography, {
|
15264
|
-
sx: {
|
15265
|
-
fontSize: "14px",
|
15266
|
-
fontWeight: 600,
|
15267
|
-
color: styles.gray_700
|
15268
|
-
}
|
15269
|
-
}, t("number_people", {
|
15270
|
-
number: resultData === null || resultData === void 0 ? void 0 : resultData.totalStudent
|
15271
|
-
}))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
|
15272
|
-
sx: {
|
15273
|
-
fontSize: "13px",
|
15274
|
-
fontWeight: 600,
|
15275
|
-
color: styles.gray_500
|
15276
|
-
}
|
15277
|
-
}, t("teacher_in_charge")), React__default.createElement(Typography, {
|
15278
|
-
sx: {
|
15279
|
-
fontSize: "14px",
|
15280
|
-
fontWeight: 600,
|
15281
|
-
color: styles.gray_700
|
15282
|
-
}
|
15283
|
-
}, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), React__default.createElement(Stack, {
|
15284
|
-
display: "flex",
|
15285
|
-
flexDirection: "column",
|
15286
|
-
gap: "12px"
|
15287
|
-
}, React__default.createElement(Typography, {
|
15288
|
-
className: "chart-title",
|
15289
|
-
sx: {
|
15290
|
-
fontSize: "18px",
|
15291
|
-
fontWeight: 700,
|
15292
|
-
color: styles.gray_500
|
15293
|
-
}
|
15294
|
-
}, t(TabList[0].label)), React__default.createElement(MyAnswer, {
|
15295
|
-
data: resultData,
|
15296
|
-
categories: categoryResponses,
|
15297
|
-
isStudent: isStudent,
|
15298
|
-
isPrint: true
|
15299
|
-
})), React__default.createElement(Stack, {
|
15300
|
-
display: "flex",
|
15301
|
-
flexDirection: "column",
|
15302
|
-
gap: "12px",
|
15303
|
-
marginTop: "24px"
|
15304
|
-
}, React__default.createElement(Typography, {
|
15305
|
-
className: "chart-title",
|
15306
|
-
sx: {
|
15307
|
-
fontSize: "18px",
|
15308
|
-
fontWeight: 700,
|
15309
|
-
color: styles.gray_500
|
15310
|
-
}
|
15311
|
-
}, t(TabList[1].label)), timelyOrderQuestions.map(function (timelyOrderQuestion, index) {
|
15312
|
-
return React__default.createElement("div", {
|
15313
|
-
key: index,
|
15314
|
-
className: PrintContainerClassName
|
15315
|
-
}, React__default.createElement(Typography, {
|
15316
|
-
className: "pb-2 " + PrintHeaderClassName,
|
15317
|
-
sx: {
|
15318
|
-
fontSize: "14px",
|
15319
|
-
fontWeight: 700,
|
15320
|
-
color: "#414E62"
|
15321
|
-
}
|
15322
|
-
}, t("article_number"), " ", timelyOrderQuestion.article), React__default.createElement("div", {
|
15323
|
-
className: styles$4["compareChart"] + " " + PrintContentClassName
|
15324
|
-
}, React__default.createElement("div", {
|
15325
|
-
className: "" + styles$4["prevChart"]
|
15326
|
-
}), React__default.createElement("div", {
|
15327
|
-
className: styles$4["chart"] + " sr-line-chart"
|
15328
|
-
}, React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
|
15329
|
-
height: 389,
|
15330
|
-
options: allChartOptions[index],
|
15331
|
-
series: allSeries[index]
|
15332
|
-
}))), React__default.createElement("div", {
|
15333
|
-
className: "" + styles$4["nextChart"]
|
15334
|
-
})));
|
15335
|
-
})), React__default.createElement(Stack, {
|
15336
|
-
display: "flex",
|
15337
|
-
flexDirection: "column",
|
15338
|
-
gap: "12px",
|
15339
|
-
marginTop: "24px"
|
15340
|
-
}, React__default.createElement(Typography, {
|
15341
|
-
className: "chart-title",
|
15342
|
-
sx: {
|
15343
|
-
fontSize: "18px",
|
15344
|
-
fontWeight: 700,
|
15345
|
-
color: styles.gray_500
|
15346
|
-
}
|
15347
|
-
}, t(TabList[2].label)), React__default.createElement(CompareGrass, {
|
15348
|
-
effectSize: effectSize,
|
15349
|
-
isPrint: true
|
15350
|
-
})), React__default.createElement(Stack, {
|
15351
|
-
display: "flex",
|
15352
|
-
flexDirection: "column",
|
15353
|
-
gap: "12px",
|
15354
|
-
marginTop: "24px"
|
15355
|
-
}, React__default.createElement(Typography, {
|
15356
|
-
className: "chart-title",
|
15357
|
-
sx: {
|
15358
|
-
fontSize: "18px",
|
15359
|
-
fontWeight: 700,
|
15360
|
-
color: styles.gray_500
|
15361
|
-
}
|
15362
|
-
}, t(TabList[3].label)), React__default.createElement(TrickyProblem, {
|
15363
|
-
keyOpen: "TrickyProblem",
|
15364
|
-
data: resultData,
|
15365
|
-
openProblem: "TrickyProblem",
|
15366
|
-
changeOpen: setOpenProblem,
|
15367
|
-
isPrint: true
|
15368
|
-
}), React__default.createElement(Vulnerable, {
|
15369
|
-
keyOpen: "Vulnerable",
|
15370
|
-
data: resultData,
|
15371
|
-
openProblem: "Vulnerable",
|
15372
|
-
changeOpen: setOpenProblem,
|
15373
|
-
isMyStoryStudent: isMyStoryStudent,
|
15374
|
-
isPrint: true
|
15375
|
-
}), React__default.createElement(ProtractedProblem, {
|
15376
|
-
keyOpen: "ProtractedProblem",
|
15377
|
-
data: longTimeSpend,
|
15378
|
-
openProblem: "ProtractedProblem",
|
15379
|
-
changeOpen: setOpenProblem,
|
15380
|
-
isPrint: true,
|
15381
|
-
isMyStoryStudent: isMyStoryStudent
|
15382
|
-
}), React__default.createElement(GradesByTerritory, {
|
15383
|
-
keyOpen: "GradesByTerritory",
|
15384
|
-
data: categoryResponses,
|
15385
|
-
resultData: resultData,
|
15386
|
-
openProblem: "GradesByTerritory",
|
15387
|
-
changeOpen: setOpenProblem,
|
15388
|
-
isPrint: true,
|
15389
|
-
isMyStoryStudent: isMyStoryStudent
|
15390
15126
|
})))), React__default.createElement(CreateNewQuestionDialog$1, {
|
15391
15127
|
examSessionId: resultData === null || resultData === void 0 ? void 0 : resultData.examSessionId,
|
15392
15128
|
handleCreateQuestion: handleCreateQuestion,
|
15393
15129
|
openCreateQuestionDialog: openCreateQuestionDialog,
|
15394
15130
|
toggleCreateQuestion: toggleCreateQuestion
|
15395
|
-
})
|
15131
|
+
}), isLoading === false && React__default.createElement(Box, {
|
15132
|
+
width: 0,
|
15133
|
+
height: 0,
|
15134
|
+
overflow: "hidden"
|
15135
|
+
}, React__default.createElement(PrintExamResult, {
|
15136
|
+
contentRef: contentRef,
|
15137
|
+
allChartOptions: allChartOptions,
|
15138
|
+
allSeries: allSeries,
|
15139
|
+
categoryResponses: categoryResponses,
|
15140
|
+
effectSize: effectSize,
|
15141
|
+
examTime: examTime,
|
15142
|
+
isStudent: isStudent,
|
15143
|
+
longTimeSpend: longTimeSpend,
|
15144
|
+
resultData: resultData,
|
15145
|
+
timelyOrderQuestions: timelyOrderQuestions,
|
15146
|
+
isMyStoryStudent: isMyStoryStudent,
|
15147
|
+
fileName: fileName,
|
15148
|
+
setRenderedChart: setRenderedChart
|
15149
|
+
}))) : React__default.createElement(Fragment$1, null), React__default.createElement(LoadingComponent, {
|
15150
|
+
isLoading: printState === PrintState.Pending || printState === PrintState.Printing
|
15151
|
+
}));
|
15396
15152
|
};
|
15397
15153
|
|
15398
15154
|
var RecentUserActionSortBy;
|
@@ -16671,5 +16427,135 @@ var useVirtualizeList = function useVirtualizeList(totalItems, rowHeight, offset
|
|
16671
16427
|
};
|
16672
16428
|
};
|
16673
16429
|
|
16674
|
-
|
16430
|
+
var usePrintView = function usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage) {
|
16431
|
+
var _useState = useState(false),
|
16432
|
+
isDone = _useState[0],
|
16433
|
+
setDone = _useState[1];
|
16434
|
+
var handelPrintSuccess = function handelPrintSuccess() {
|
16435
|
+
var _window$opener$postMe, _window$opener;
|
16436
|
+
var data = {
|
16437
|
+
examSessionId: examSessionId,
|
16438
|
+
studentId: studentId,
|
16439
|
+
succeed: true
|
16440
|
+
};
|
16441
|
+
if (window.opener && !window.opener.closed) (_window$opener$postMe = (_window$opener = window.opener).postMessage) === null || _window$opener$postMe === void 0 ? void 0 : _window$opener$postMe.call(_window$opener, data, window.location.origin);
|
16442
|
+
setDone(true);
|
16443
|
+
};
|
16444
|
+
var handelPrintError = function handelPrintError(errorMessage) {
|
16445
|
+
var _window$opener$postMe2, _window$opener2;
|
16446
|
+
var data = {
|
16447
|
+
examSessionId: examSessionId,
|
16448
|
+
studentId: studentId,
|
16449
|
+
succeed: false,
|
16450
|
+
errorMessage: errorMessage
|
16451
|
+
};
|
16452
|
+
if (window.opener && !window.opener.closed) (_window$opener$postMe2 = (_window$opener2 = window.opener).postMessage) === null || _window$opener$postMe2 === void 0 ? void 0 : _window$opener$postMe2.call(_window$opener2, data, window.location.origin);
|
16453
|
+
setDone(true);
|
16454
|
+
};
|
16455
|
+
var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
|
16456
|
+
useEffect(function () {
|
16457
|
+
setNotFound === null || setNotFound === void 0 ? void 0 : setNotFound(isLoading === false && !!errorMessage);
|
16458
|
+
if (isLoading === false && !!errorMessage) handelPrintError(errorMessage);
|
16459
|
+
}, [isLoading, errorMessage]);
|
16460
|
+
return {
|
16461
|
+
fileName: fileName,
|
16462
|
+
isDone: isDone,
|
16463
|
+
handelPrintSuccess: handelPrintSuccess,
|
16464
|
+
handelPrintError: handelPrintError
|
16465
|
+
};
|
16466
|
+
};
|
16467
|
+
|
16468
|
+
var LoadingDots = function LoadingDots(_ref) {
|
16469
|
+
var text = _ref.text;
|
16470
|
+
return React__default.createElement(Stack, {
|
16471
|
+
className: "mt-3",
|
16472
|
+
direction: "row",
|
16473
|
+
spacing: 0.5
|
16474
|
+
}, React__default.createElement(Typography, {
|
16475
|
+
color: "#FFF",
|
16476
|
+
fontSize: 20
|
16477
|
+
}, text), React__default.createElement("div", {
|
16478
|
+
className: styles$4["loader"]
|
16479
|
+
}, React__default.createElement("div", {
|
16480
|
+
className: styles$4["dot"]
|
16481
|
+
}), React__default.createElement("div", {
|
16482
|
+
className: styles$4["dot"]
|
16483
|
+
}), React__default.createElement("div", {
|
16484
|
+
className: styles$4["dot"]
|
16485
|
+
})));
|
16486
|
+
};
|
16487
|
+
|
16488
|
+
var PrintExamResultView = function PrintExamResultView(_ref) {
|
16489
|
+
var isMyStoryStudent = _ref.isMyStoryStudent,
|
16490
|
+
_ref$searchParams = _ref.searchParams,
|
16491
|
+
searchParams = _ref$searchParams === void 0 ? "" : _ref$searchParams,
|
16492
|
+
history = _ref.history,
|
16493
|
+
_ref$examSessionId = _ref.examSessionId,
|
16494
|
+
examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
|
16495
|
+
_ref$studentId = _ref.studentId,
|
16496
|
+
studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
|
16497
|
+
code = _ref.code,
|
16498
|
+
setNotFound = _ref.setNotFound;
|
16499
|
+
var _useExamResult = useExamResult({
|
16500
|
+
searchParams: searchParams,
|
16501
|
+
history: history,
|
16502
|
+
examSessionId: examSessionId,
|
16503
|
+
studentId: studentId,
|
16504
|
+
code: code,
|
16505
|
+
isPrint: true
|
16506
|
+
}),
|
16507
|
+
isLoading = _useExamResult.isLoading,
|
16508
|
+
examTime = _useExamResult.examTime,
|
16509
|
+
allSeries = _useExamResult.allSeries,
|
16510
|
+
allChartOptions = _useExamResult.allChartOptions,
|
16511
|
+
timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
|
16512
|
+
isStudent = _useExamResult.isStudent,
|
16513
|
+
resultData = _useExamResult.resultData,
|
16514
|
+
longTimeSpend = _useExamResult.longTimeSpend,
|
16515
|
+
effectSize = _useExamResult.effectSize,
|
16516
|
+
categoryResponses = _useExamResult.categoryResponses,
|
16517
|
+
errorMessage = _useExamResult.errorMessage;
|
16518
|
+
var _usePrintView = usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage),
|
16519
|
+
fileName = _usePrintView.fileName,
|
16520
|
+
isDone = _usePrintView.isDone,
|
16521
|
+
handelPrintSuccess = _usePrintView.handelPrintSuccess,
|
16522
|
+
handelPrintError = _usePrintView.handelPrintError;
|
16523
|
+
var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length, handelPrintSuccess, handelPrintError, true),
|
16524
|
+
contentRef = _usePrintExamResult.contentRef,
|
16525
|
+
setRenderedChart = _usePrintExamResult.setRenderedChart;
|
16526
|
+
var isTabletUp = useMediaQuery("(min-width:900px)");
|
16527
|
+
return React__default.createElement(Box, {
|
16528
|
+
sx: {
|
16529
|
+
display: "flex",
|
16530
|
+
justifyContent: "center"
|
16531
|
+
},
|
16532
|
+
displayPrint: "block"
|
16533
|
+
}, isLoading === false && resultData && effectSize ? React__default.createElement(PrintExamResult, {
|
16534
|
+
contentRef: contentRef,
|
16535
|
+
allChartOptions: allChartOptions,
|
16536
|
+
allSeries: allSeries,
|
16537
|
+
categoryResponses: categoryResponses,
|
16538
|
+
effectSize: effectSize,
|
16539
|
+
examTime: examTime,
|
16540
|
+
isStudent: isStudent,
|
16541
|
+
longTimeSpend: longTimeSpend,
|
16542
|
+
resultData: resultData,
|
16543
|
+
timelyOrderQuestions: timelyOrderQuestions,
|
16544
|
+
isMyStoryStudent: isMyStoryStudent,
|
16545
|
+
fileName: fileName,
|
16546
|
+
setRenderedChart: setRenderedChart
|
16547
|
+
}) : isLoading === undefined || isLoading === true ? React__default.createElement(LoadingComponent, {
|
16548
|
+
isLoading: !!isLoading,
|
16549
|
+
spinClassName: "text-white"
|
16550
|
+
}, isTabletUp && React__default.createElement(LoadingDots, {
|
16551
|
+
text: "Loading data"
|
16552
|
+
})) : React__default.createElement(NotFound, null), React__default.createElement(LoadingComponent, {
|
16553
|
+
isLoading: isDone !== true && isLoading === false && !!resultData,
|
16554
|
+
spinClassName: "text-white"
|
16555
|
+
}, isTabletUp && React__default.createElement(LoadingDots, {
|
16556
|
+
text: "Please wait for a while! Printing"
|
16557
|
+
})));
|
16558
|
+
};
|
16559
|
+
|
16560
|
+
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AnswerCountSelector, ArticleCategorySelector, ArticleGroupView, BASE_URL, ChatContainer, ChatItemType, types as ChatTypes, CommonDialog, ConfirmDialog, index$1 as CoreHooks, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_PAGING_RESPONSE, DefaultErrorMessage, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, index as Enums, ExamDetailView, ExamEvent, ExamResultV2, Header, InputText, LANGUAGES, Language, LayoutContext, Loading, LoadingComponent, Login, SignIn as LoginWithPassword, NotFound, PUSHER_CONFIG, PassCodeCheck, PrintExamResultView, QuestionCountSelector, RecentUserAction, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SubjectSelector, index$2 as Textbook, TextbookViewDetail as TextbookDetail, TextbookList, TheAcademyDropdown, TheLanguageDropdown, index$3 as Types, api, apiUpload, canAccess as canAccessRoute, checkSuperUrl, createRecentUserActionListApi, diffFromNow, formatTime, getAcademyDomain, getAccessToken, getErrorMessage, getOrdinalSuffix, getRecentUserActionListApi, i18n, minutesToTimeSpan, setAlert, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, times as timeUtils, toISOString, useAutoAcademyDomain, useCategorySelect, useChatContainer, useCountDownTimer, useGoogleSignOut, useLanguage, useLoadMore, useLogin, usePusherConversation, useSubjectSelect, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
|
16675
16561
|
//# sourceMappingURL=index.modern.js.map
|