touchstudy-core 0.1.73 → 0.1.75

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.
Files changed (35) hide show
  1. package/dist/components/Loading/LoadingComponent.d.ts +4 -2
  2. package/dist/containers/ExamResult/components/Charts/TimeOrderChart.d.ts +10 -0
  3. package/dist/containers/ExamResult/components/CompareGrass/index.d.ts +0 -1
  4. package/dist/containers/ExamResult/components/Dialog/PrintDialog.d.ts +6 -0
  5. package/dist/containers/ExamResult/components/GradesByTerritory/index.d.ts +3 -5
  6. package/dist/containers/ExamResult/components/LoadingDots.d.ts +6 -0
  7. package/dist/containers/ExamResult/components/MyAnswer/index.d.ts +1 -2
  8. package/dist/containers/ExamResult/components/ProtractedProblem/index.d.ts +4 -5
  9. package/dist/containers/ExamResult/components/TrickyProblem/index.d.ts +4 -5
  10. package/dist/containers/ExamResult/components/Vulnerable/index.d.ts +4 -5
  11. package/dist/containers/ExamResult/configs/functions.d.ts +1 -0
  12. package/dist/containers/ExamResult/configs/types.d.ts +13 -0
  13. package/dist/containers/ExamResult/hooks/useExamResult.d.ts +16 -6
  14. package/dist/containers/ExamResult/hooks/usePrintExamResult.d.ts +10 -0
  15. package/dist/containers/ExamResult/hooks/usePrintView.d.ts +8 -0
  16. package/dist/containers/ExamResult/views/ExamResultView.d.ts +11 -0
  17. package/dist/containers/ExamResult/views/PrintExamResult.d.ts +19 -0
  18. package/dist/containers/ExamResult/views/PrintExamResultView.d.ts +12 -0
  19. package/dist/containers/ExamResult/views/PrintPdfExamResult.d.ts +12 -0
  20. package/dist/containers/Exams/components/ArticleGroupView.d.ts +2 -0
  21. package/dist/containers/Exams/hooks/useExamDetailView.d.ts +2 -2
  22. package/dist/containers/Select/Category/hook/useCategorySelect.d.ts +2 -1
  23. package/dist/containers/Select/Subject/hook/useSubjectSelect.d.ts +6 -2
  24. package/dist/index.css +33 -0
  25. package/dist/index.d.ts +2 -1
  26. package/dist/index.js +844 -938
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.modern.js +841 -937
  29. package/dist/index.modern.js.map +1 -1
  30. package/dist/layouts/Header.d.ts +1 -0
  31. package/dist/layouts/LayoutContext.d.ts +1 -0
  32. package/dist/layouts/TheAcademyDropdown.d.ts +1 -0
  33. package/dist/utils/hooks/useLayoutContext.d.ts +1 -1
  34. package/dist/utils/hooks/useSwitchAcademy.d.ts +1 -1
  35. package/package.json +2 -2
@@ -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 {
@@ -649,9 +461,11 @@ var useLogin = function useLogin(history, homeAcademyUrl, homeUrl, registerUrl)
649
461
  isLogout = true;
650
462
  }
651
463
  try {
652
- var _temp6 = function _temp6() {
464
+ var _temp6 = function _temp6(_result) {
465
+ if (_exit) return _result;
653
466
  dispatch(setLoading(false));
654
467
  };
468
+ var _exit = false;
655
469
  dispatch(setLoading(true));
656
470
  var _temp5 = _catch(function () {
657
471
  return Promise.resolve(apiLogin()).then(function (loginResponse) {
@@ -661,9 +475,10 @@ var useLogin = function useLogin(history, homeAcademyUrl, homeUrl, registerUrl)
661
475
  var isAcademy = !!(user !== null && user !== void 0 && user.academyDomain);
662
476
  var needToRegister = isStudent && isFirstLogin && isAcademy;
663
477
  var redirectUrl = getRedirectUrl();
478
+ if (isStudent && !registerUrl) throw new Error("an_unexpected_error_has_occurred");
664
479
  if (!redirectUrl) redirectUrl = needToRegister ? registerUrl : isAcademy ? homeAcademyUrl : homeUrl;
665
480
  redirectLoginUser(_extends({}, user, {
666
- isFirstLogin: isFirstLogin
481
+ isNotEnoughStatements: isFirstLogin
667
482
  }), token, redirectUrl);
668
483
  });
669
484
  }, function (error) {
@@ -1499,8 +1314,11 @@ var switchSuperAdminAcademy = function switchSuperAdminAcademy(academyId, role)
1499
1314
  return api.post(SUPER_ADMIN_ACADEMY_URL + "/" + academyId + "/switch-academy/" + role);
1500
1315
  };
1501
1316
 
1502
- var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
1317
+ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy) {
1503
1318
  var _currentPusher$connec2;
1319
+ if (showLoadingAcademy === void 0) {
1320
+ showLoadingAcademy = true;
1321
+ }
1504
1322
  var _useGoogleSignOut = useGoogleSignOut({}),
1505
1323
  handleSignOut = _useGoogleSignOut.handleSignOut;
1506
1324
  var _useTranslation = useTranslation(),
@@ -1529,10 +1347,10 @@ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
1529
1347
  var handleGetAcademyDetail = function handleGetAcademyDetail() {
1530
1348
  try {
1531
1349
  var _temp2 = function _temp2() {
1532
- dispatch(setLoading(false));
1350
+ showLoadingAcademy && dispatch(setLoading(false));
1533
1351
  };
1534
1352
  if (!academyDomain) return Promise.resolve();
1535
- dispatch(setLoading(true));
1353
+ showLoadingAcademy && dispatch(setLoading(true));
1536
1354
  var _temp = _catch(function () {
1537
1355
  return Promise.resolve(getAcademyDetail()).then(function (info) {
1538
1356
  if (info) {
@@ -1573,9 +1391,7 @@ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
1573
1391
  dispatch(setLoading(true));
1574
1392
  var _temp3 = _catch(function () {
1575
1393
  return Promise.resolve(getAcademyDomain() ? getInfo() : getSuperAdminInfoFromWeb()).then(function (info) {
1576
- if (!info) {
1577
- resetAuth();
1578
- }
1394
+ if (!info.data) resetAuth();
1579
1395
  dispatch(setUser(info.data));
1580
1396
  });
1581
1397
  }, function (err) {
@@ -1670,27 +1486,38 @@ var loadingStyle$1 = {
1670
1486
  alignItems: "center"
1671
1487
  };
1672
1488
  var LoadingComponent = function LoadingComponent(_ref) {
1673
- var isLoading = _ref.isLoading;
1489
+ var isLoading = _ref.isLoading,
1490
+ children = _ref.children,
1491
+ _ref$spinClassName = _ref.spinClassName,
1492
+ spinClassName = _ref$spinClassName === void 0 ? "text-secondary" : _ref$spinClassName,
1493
+ _ref$className = _ref.className,
1494
+ className = _ref$className === void 0 ? "" : _ref$className;
1674
1495
  return isLoading ? React__default.createElement("div", {
1675
1496
  style: loadingStyle$1
1497
+ }, React__default.createElement(Stack, {
1498
+ direction: "column",
1499
+ justifyContent: "center",
1500
+ alignItems: "center",
1501
+ className: className
1676
1502
  }, React__default.createElement("div", {
1677
- className: "spinner-border text-secondary",
1503
+ className: "spinner-border " + spinClassName,
1678
1504
  role: "status"
1679
1505
  }, React__default.createElement("span", {
1680
1506
  className: "sr-only"
1681
- }))) : null;
1507
+ })), React__default.createElement("div", null, children))) : null;
1682
1508
  };
1683
1509
 
1684
1510
  var LayoutContext = function LayoutContext(_ref) {
1685
1511
  var children = _ref.children,
1686
1512
  role = _ref.role,
1687
1513
  _ref$pusherRegisterUr = _ref.pusherRegisterUrls,
1688
- pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr;
1514
+ pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr,
1515
+ showLoadingAcademy = _ref.showLoadingAcademy;
1689
1516
  var user = useSelector(function (state) {
1690
1517
  var _state$common;
1691
1518
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
1692
1519
  });
1693
- useLayoutContext(role, pusherRegisterUrls);
1520
+ useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy);
1694
1521
  if (!(user !== null && user !== void 0 && user.email)) return React__default.createElement(LoadingComponent, {
1695
1522
  isLoading: true
1696
1523
  });else return React__default.createElement(Fragment$1, null, children);
@@ -1885,7 +1712,9 @@ var getSubjectListApi = function getSubjectListApi() {
1885
1712
  }
1886
1713
  };
1887
1714
 
1888
- var useSubjectSelect = function useSubjectSelect() {
1715
+ var useSubjectSelect = function useSubjectSelect(_ref) {
1716
+ var onChangeExam = _ref.onChangeExam,
1717
+ exam = _ref.exam;
1889
1718
  var firstLoad = true;
1890
1719
  var dispatch = useDispatch();
1891
1720
  var _useState = useState(),
@@ -1943,18 +1772,15 @@ var useSubjectSelect = function useSubjectSelect() {
1943
1772
  var selectedSubject = subjectList === null || subjectList === void 0 ? void 0 : subjectList.find(function (subject) {
1944
1773
  return subject.id === id;
1945
1774
  });
1946
- setSelectedSubject(selectedSubject);
1947
- };
1948
- var handleChangeSelectedSubject = function handleChangeSelectedSubject(subject) {
1949
- if (!subject) return;
1950
- setSelectedSubject(subject);
1775
+ onChangeExam(_extends({}, exam, {
1776
+ subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
1777
+ }));
1951
1778
  };
1952
1779
  return {
1953
1780
  subjectOptions: subjectOptions,
1954
1781
  selectedSubject: selectedSubject,
1955
1782
  subjectList: subjectList,
1956
- handleChangeSubject: handleChangeSubject,
1957
- handleChangeSelectedSubject: handleChangeSelectedSubject
1783
+ handleChangeSubject: handleChangeSubject
1958
1784
  };
1959
1785
  };
1960
1786
 
@@ -2604,7 +2430,7 @@ var exam = "시험";
2604
2430
  var me = "나";
2605
2431
  var teacher_name = "선생님 성함";
2606
2432
  var class_schedule = "수업 시간표";
2607
- var summary = "요약";
2433
+ var summary = "전체 현황";
2608
2434
  var load_exam = "시험 로드";
2609
2435
  var exam_name = "시험 이름";
2610
2436
  var student_phone_number_header = "학생 전화번호";
@@ -2630,6 +2456,13 @@ var total_users = "총 사용자";
2630
2456
  var added_date = "추가된 날짜";
2631
2457
  var sync_exam_results = "시험 결과 동기화";
2632
2458
  var update_data_fail = "데이터 업데이트 실패";
2459
+ var add_students_to_class = "수업에 학생 추가";
2460
+ var click_to_choose_file = "파일을 선택하려면 클릭하세요.";
2461
+ var exam_data = "시험 데이터";
2462
+ var questions_correct_rate = "질문 정답률";
2463
+ var question_management = "질문 관리";
2464
+ var student_data = "학생 데이터";
2465
+ var problem_number_question_chart = "문제 {{number}}번";
2633
2466
  var are_you_sure_to_sync_exam_results_to_academy = "시험 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까(백그라운드에서 실행되며 시간이 다소 소요됨)";
2634
2467
  var messages = {
2635
2468
  exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
@@ -2713,6 +2546,8 @@ var reset_passcode = "사용된 시간 비밀번호 재설정";
2713
2546
  var at_academy = "학원에서";
2714
2547
  var sent_at = "보낸 시간";
2715
2548
  var create_data_successfully = "데이터를 성공적으로 생성했습니다";
2549
+ var reduce_time = "시간 단축";
2550
+ var reduce_duration = "기간 단축";
2716
2551
  var lang_ko = {
2717
2552
  problem_solving: problem_solving,
2718
2553
  my_story: my_story,
@@ -3373,6 +3208,13 @@ var lang_ko = {
3373
3208
  added_date: added_date,
3374
3209
  sync_exam_results: sync_exam_results,
3375
3210
  update_data_fail: update_data_fail,
3211
+ add_students_to_class: add_students_to_class,
3212
+ click_to_choose_file: click_to_choose_file,
3213
+ exam_data: exam_data,
3214
+ questions_correct_rate: questions_correct_rate,
3215
+ question_management: question_management,
3216
+ student_data: student_data,
3217
+ problem_number_question_chart: problem_number_question_chart,
3376
3218
  are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy,
3377
3219
  messages: messages,
3378
3220
  submit: submit,
@@ -3453,7 +3295,9 @@ var lang_ko = {
3453
3295
  reset_passcode: reset_passcode,
3454
3296
  at_academy: at_academy,
3455
3297
  sent_at: sent_at,
3456
- create_data_successfully: create_data_successfully
3298
+ create_data_successfully: create_data_successfully,
3299
+ reduce_time: reduce_time,
3300
+ reduce_duration: reduce_duration
3457
3301
  };
3458
3302
 
3459
3303
  var problem_solving$1 = "Problem Solving";
@@ -3509,8 +3353,8 @@ var number_answer$1 = "No.{{number}}";
3509
3353
  var answer_no$1 = "Ans.{{number}}";
3510
3354
  var answer_rate$1 = "Answer rate";
3511
3355
  var seconds$1 = "s";
3512
- var search_placeholder$1 = "Search by exam name";
3513
- var search_by_student$1 = "Search by student name";
3356
+ var search_placeholder$1 = "Search by Exam Name";
3357
+ var search_by_student$1 = "Search by Student Name";
3514
3358
  var study_touch$1 = "Study touch";
3515
3359
  var exam_information$1 = "Exam information";
3516
3360
  var issue_number$1 = "Issue number";
@@ -3586,8 +3430,8 @@ var update_exam$1 = "Update exam";
3586
3430
  var create_exam$1 = "Create exam";
3587
3431
  var back$1 = "Back";
3588
3432
  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 ";
3433
+ var date_format$1 = "MMM. D. YYYY";
3434
+ var date_time_format$1 = "HH:mm MMM. D YYYY ";
3591
3435
  var date_time_format_12h$1 = "MM-DD-YYYY HH:mm A";
3592
3436
  var full_date_time_format$1 = "MMM Do YYYY HH:mm:ss";
3593
3437
  var total_questions$1 = "Total questions";
@@ -3660,8 +3504,9 @@ var problem_number_question$1 = "Question {{number}}";
3660
3504
  var teacher_in_charge$1 = "Teacher In Charge";
3661
3505
  var counselor$1 = "Counselor";
3662
3506
  var new_question$1 = "New Question";
3663
- var hour$1 = "hour";
3664
- var minute$1 = "minutes";
3507
+ var hour$1 = "hr";
3508
+ var hours = "hrs";
3509
+ var minute$1 = "min";
3665
3510
  var second$1 = "second";
3666
3511
  var question_order$1 = "Number {{number}}";
3667
3512
  var send_message$1 = "Send Message";
@@ -3690,7 +3535,7 @@ var check_attendance$1 = "Check attendance";
3690
3535
  var attendance_check$1 = "Attendance check";
3691
3536
  var class_date$1 = "Class date";
3692
3537
  var class_time$1 = "Class time";
3693
- var attendance$1 = "Attendance";
3538
+ var attendance$1 = "Attendance List";
3694
3539
  var attendance_completed$1 = "Attendance completed";
3695
3540
  var none_attendance$1 = "Non-attendance";
3696
3541
  var academy_list$1 = "Academy list";
@@ -4120,6 +3965,13 @@ var total_users$1 = "Total users";
4120
3965
  var added_date$1 = "Added date";
4121
3966
  var sync_exam_results$1 = "Sync exam results";
4122
3967
  var update_data_fail$1 = "Update data fail";
3968
+ var add_students_to_class$1 = "Add students to class";
3969
+ var click_to_choose_file$1 = "Click to choose file";
3970
+ var exam_data$1 = "Exam Data";
3971
+ var questions_correct_rate$1 = "Questions Correct Rate";
3972
+ var question_management$1 = "Question Management";
3973
+ var student_data$1 = "Student Data";
3974
+ var problem_number_question_chart$1 = "Q. {{number}}";
4123
3975
  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
3976
  var messages$1 = {
4125
3977
  exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
@@ -4202,6 +4054,9 @@ var expired_date$1 = "Expired Date";
4202
4054
  var reset_passcode$1 = "Reset Used Times Pass Code";
4203
4055
  var at_academy$1 = "At academy";
4204
4056
  var sent_at$1 = "Sent at";
4057
+ var create_data_successfully$1 = "Data was created successfully";
4058
+ var reduce_time$1 = "Reduce time";
4059
+ var reduce_duration$1 = "Reduce duration";
4205
4060
  var lang_en = {
4206
4061
  problem_solving: problem_solving$1,
4207
4062
  my_story: my_story$1,
@@ -4408,6 +4263,7 @@ var lang_en = {
4408
4263
  counselor: counselor$1,
4409
4264
  new_question: new_question$1,
4410
4265
  hour: hour$1,
4266
+ hours: hours,
4411
4267
  minute: minute$1,
4412
4268
  second: second$1,
4413
4269
  question_order: question_order$1,
@@ -4862,6 +4718,13 @@ var lang_en = {
4862
4718
  added_date: added_date$1,
4863
4719
  sync_exam_results: sync_exam_results$1,
4864
4720
  update_data_fail: update_data_fail$1,
4721
+ add_students_to_class: add_students_to_class$1,
4722
+ click_to_choose_file: click_to_choose_file$1,
4723
+ exam_data: exam_data$1,
4724
+ questions_correct_rate: questions_correct_rate$1,
4725
+ question_management: question_management$1,
4726
+ student_data: student_data$1,
4727
+ problem_number_question_chart: problem_number_question_chart$1,
4865
4728
  are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy$1,
4866
4729
  messages: messages$1,
4867
4730
  submit: submit$1,
@@ -4941,7 +4804,10 @@ var lang_en = {
4941
4804
  expired_date: expired_date$1,
4942
4805
  reset_passcode: reset_passcode$1,
4943
4806
  at_academy: at_academy$1,
4944
- sent_at: sent_at$1
4807
+ sent_at: sent_at$1,
4808
+ create_data_successfully: create_data_successfully$1,
4809
+ reduce_time: reduce_time$1,
4810
+ reduce_duration: reduce_duration$1
4945
4811
  };
4946
4812
 
4947
4813
  i18n.use(initReactI18next).init({
@@ -5036,7 +4902,7 @@ var TheLanguageDropdown = function TheLanguageDropdown(_ref) {
5036
4902
  })));
5037
4903
  };
5038
4904
 
5039
- var useSwitchAcademy = function useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, canFetchAcademies) {
4905
+ var useSwitchAcademy = function useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, registerUrl, canFetchAcademies) {
5040
4906
  var _user$roles;
5041
4907
  if (role === void 0) {
5042
4908
  role = Role.Student;
@@ -5045,7 +4911,7 @@ var useSwitchAcademy = function useSwitchAcademy(role, history, homeAcademyUrl,
5045
4911
  canFetchAcademies = false;
5046
4912
  }
5047
4913
  var dispatch = useDispatch();
5048
- var _useLogin = useLogin(history, homeAcademyUrl, homeUrl),
4914
+ var _useLogin = useLogin(history, homeAcademyUrl, homeUrl, registerUrl),
5049
4915
  handleLoginAccessToken = _useLogin.handleLoginAccessToken;
5050
4916
  var academyList = useSelector(function (state) {
5051
4917
  var _state$academies;
@@ -5201,10 +5067,11 @@ var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
5201
5067
  homeAcademyUrl = _ref.homeAcademyUrl,
5202
5068
  homeUrl = _ref.homeUrl,
5203
5069
  hideAcademyName = _ref.hideAcademyName,
5070
+ registerUrl = _ref.registerUrl,
5204
5071
  onSignOut = _ref.onSignOut;
5205
5072
  var theme = useTheme();
5206
5073
  var isLargerThanLg = useMediaQuery(theme.breakpoints.up("lg"));
5207
- var _useSwitchAcademy = useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, true),
5074
+ var _useSwitchAcademy = useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, registerUrl, true),
5208
5075
  academyList = _useSwitchAcademy.academyList,
5209
5076
  handleSwitchAcademy = _useSwitchAcademy.handleSwitchAcademy,
5210
5077
  selectedAcademy = _useSwitchAcademy.selectedAcademy,
@@ -5666,7 +5533,6 @@ var ContentTooltip = function ContentTooltip(_ref) {
5666
5533
  var ChatRightItem = function ChatRightItem(_ref) {
5667
5534
  var content = _ref.content,
5668
5535
  createdAt = _ref.createdAt,
5669
- sender = _ref.sender,
5670
5536
  showTimestamp = _ref.showTimestamp,
5671
5537
  isStudent = _ref.isStudent,
5672
5538
  showName = _ref.showName,
@@ -5699,13 +5565,15 @@ var ChatRightItem = function ChatRightItem(_ref) {
5699
5565
  alignItems: "center",
5700
5566
  justifyContent: "end",
5701
5567
  flexDirection: "row"
5702
- }, React__default.createElement(iconPersonNoActive, null), React__default.createElement(Typography, {
5568
+ }, React__default.createElement(iconPersonNoActive, {
5569
+ color: styles.gray_700
5570
+ }), React__default.createElement(Typography, {
5703
5571
  fontWeight: 700,
5704
5572
  fontSize: 14,
5705
5573
  padding: "4px",
5706
5574
  lineHeight: "16.71px",
5707
5575
  color: styles.gray_700
5708
- }, sender === null || sender === void 0 ? void 0 : sender.fullName)), React__default.createElement(Stack, {
5576
+ }, t("me"))), React__default.createElement(Stack, {
5709
5577
  display: "flex",
5710
5578
  flexDirection: "row",
5711
5579
  gap: "8px",
@@ -6594,7 +6462,7 @@ var ChatHeader = function ChatHeader(_ref) {
6594
6462
  sx: {
6595
6463
  color: styles.gray_500
6596
6464
  }
6597
- }, (!!filterDurationExam.hours() ? filterDurationExam.hours() + " " + t("hour") : "") + " " + (!!filterDurationExam.minutes() ? filterDurationExam.minutes() + " " + t("minute") : "") + " " + (!!filterDurationExam.seconds() ? filterDurationExam.seconds() + " " + t("second") : "")))), React__default.createElement(Box, {
6465
+ }, (!!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
6466
  display: "flex",
6599
6467
  alignItems: "end",
6600
6468
  gap: "6px",
@@ -6615,16 +6483,12 @@ var ChatHeader = function ChatHeader(_ref) {
6615
6483
  fontSize: "12px",
6616
6484
  lineHeight: "14.32px",
6617
6485
  color: styles.less_dark
6618
- }, t("points", {
6619
- number: score || 0
6620
- })), React__default.createElement(Typography, {
6486
+ }, score || 0), React__default.createElement(Typography, {
6621
6487
  fontWeight: 700,
6622
6488
  fontSize: "12px",
6623
6489
  lineHeight: "14.32px",
6624
6490
  color: styles.gray_300
6625
- }, "/", t("points", {
6626
- number: totalScore || 0
6627
- }))), React__default.createElement(Typography, {
6491
+ }, "/", totalScore || 0)), React__default.createElement(Typography, {
6628
6492
  fontWeight: 500,
6629
6493
  fontSize: "12px",
6630
6494
  lineHeight: "14.32px",
@@ -7575,45 +7439,11 @@ var QuestionView = function QuestionView(_ref2) {
7575
7439
  }))));
7576
7440
  };
7577
7441
 
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
7442
  var useCategorySelect = function useCategorySelect(_ref) {
7600
- var subjectId = _ref.subjectId;
7601
- var firstLoad = true;
7602
- var dispatch = useDispatch();
7443
+ var categoryList = _ref.categoryList;
7603
7444
  var _useState = useState(),
7604
- categoryList = _useState[0],
7605
- setCategoryList = _useState[1];
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;
7445
+ selectedCategory = _useState[0],
7446
+ setSelectedCategory = _useState[1];
7617
7447
  var categoryOptions = useMemo(function () {
7618
7448
  return categoryList === null || categoryList === void 0 ? void 0 : categoryList.map(function (category) {
7619
7449
  var _category$path;
@@ -7623,39 +7453,6 @@ var useCategorySelect = function useCategorySelect(_ref) {
7623
7453
  };
7624
7454
  });
7625
7455
  }, [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
7456
  var handleChangeCategory = function handleChangeCategory(value) {
7660
7457
  var id = value.value;
7661
7458
  var selectedCategory = categoryList === null || categoryList === void 0 ? void 0 : categoryList.find(function (category) {
@@ -7748,7 +7545,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
7748
7545
  questions = _ref.questions,
7749
7546
  answerCount = _ref.answerCount,
7750
7547
  questionCount = _ref.questionCount,
7751
- selectedSubject = _ref.selectedSubject,
7548
+ categoryList = _ref.categoryList,
7752
7549
  categoryId = _ref.categoryId,
7753
7550
  isActive = _ref.isActive,
7754
7551
  isDisabled = _ref.isDisabled,
@@ -7763,7 +7560,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
7763
7560
  var _useTranslation = useTranslation(),
7764
7561
  t = _useTranslation.t;
7765
7562
  var _useCategorySelect = useCategorySelect({
7766
- subjectId: defaultCategoryOptions === undefined ? selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id : undefined
7563
+ categoryList: categoryList
7767
7564
  }),
7768
7565
  categoryOptions = _useCategorySelect.categoryOptions;
7769
7566
  var theme = useTheme();
@@ -9628,12 +9425,45 @@ var DURATION_OPTIONS = Array.from({
9628
9425
  });
9629
9426
  var DEFAULT_ANSWER_COUNT$1 = 5;
9630
9427
 
9428
+ var ADMIN_CATEGORY_URL = SUPER_ADMIN_BASE_URL + "/api/category";
9429
+ var CATEGORY_URL = BASE_URL + "/api/examcategory";
9430
+ var getCategoryListAdminApi = function getCategoryListAdminApi(data) {
9431
+ try {
9432
+ return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL, {
9433
+ params: data
9434
+ }));
9435
+ } catch (e) {
9436
+ return Promise.reject(e);
9437
+ }
9438
+ };
9439
+ var getCategoryListApi = function getCategoryListApi(data) {
9440
+ try {
9441
+ return Promise.resolve(api.get("" + CATEGORY_URL, {
9442
+ params: data
9443
+ }));
9444
+ } catch (e) {
9445
+ return Promise.reject(e);
9446
+ }
9447
+ };
9448
+
9631
9449
  var useExamDetailView = function useExamDetailView(props) {
9632
9450
  var exam = props.exam,
9633
- selectedSubject = props.selectedSubject,
9634
9451
  onChangeExam = props.onChangeExam;
9635
9452
  var _useTranslation = useTranslation(),
9636
9453
  t = _useTranslation.t;
9454
+ var firstLoad = true;
9455
+ var dispatch = useDispatch();
9456
+ var isDomain = useSelector(function (state) {
9457
+ var _state$common, _state$common$user;
9458
+ 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;
9459
+ });
9460
+ var isSuperAdmin = useSelector(function (state) {
9461
+ var _state$common2, _state$common2$user;
9462
+ 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) || [];
9463
+ }).includes(Role.Admin) && !isDomain;
9464
+ var _useState = useState([]),
9465
+ categoryList = _useState[0],
9466
+ setCategoryList = _useState[1];
9637
9467
  var handleChangeQuestionCount = function handleChangeQuestionCount(article, questionCount, answerCount) {
9638
9468
  if (!exam) return;
9639
9469
  var examQuestions = exam.questions;
@@ -9811,6 +9641,39 @@ var useExamDetailView = function useExamDetailView(props) {
9811
9641
  }])
9812
9642
  }));
9813
9643
  };
9644
+ var getCategoryList = function getCategoryList(isLoading) {
9645
+ if (isLoading === void 0) {
9646
+ isLoading = true;
9647
+ }
9648
+ try {
9649
+ var _temp2 = function _temp2() {
9650
+ isLoading && dispatch(setLoading(false));
9651
+ };
9652
+ if (!exam.subjectId) return Promise.resolve();
9653
+ if (firstLoad) firstLoad = false;
9654
+ isLoading && dispatch(setLoading(true));
9655
+ var _temp = _catch(function () {
9656
+ return Promise.resolve(isSuperAdmin ? getCategoryListAdminApi({
9657
+ subjectId: exam.subjectId
9658
+ }) : getCategoryListApi({
9659
+ subjectId: exam.subjectId
9660
+ })).then(function (res) {
9661
+ var data = res.data.items;
9662
+ setCategoryList(data || []);
9663
+ });
9664
+ }, function (error) {
9665
+ setCategoryList([]);
9666
+ console.log(error);
9667
+ });
9668
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
9669
+ } catch (e) {
9670
+ return Promise.reject(e);
9671
+ }
9672
+ };
9673
+ useEffect(function () {
9674
+ if (categoryList !== null && categoryList !== void 0 && categoryList.length) return;
9675
+ getCategoryList();
9676
+ }, [exam.subjectId, JSON.stringify(categoryList)]);
9814
9677
  var examGroupByArticle = useMemo(function () {
9815
9678
  if (!exam) return [];
9816
9679
  var articles = [];
@@ -9835,27 +9698,23 @@ var useExamDetailView = function useExamDetailView(props) {
9835
9698
  var durationOptions = useMemo(function () {
9836
9699
  var options = DURATION_OPTIONS.map(function (i) {
9837
9700
  return {
9838
- label: t('mins_mins', {
9701
+ label: t("mins_mins", {
9839
9702
  mins: i
9840
9703
  }),
9841
9704
  value: i
9842
9705
  };
9843
9706
  });
9844
9707
  if (!!exam.duration && exam.duration > DURATION_OPTIONS[DURATION_OPTIONS.length - 1]) return [].concat(options, [{
9845
- label: t('mins_mins', {
9708
+ label: t("mins_mins", {
9846
9709
  mins: exam.duration
9847
9710
  }),
9848
9711
  value: exam.duration
9849
9712
  }]);
9850
9713
  return options;
9851
9714
  }, [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
9715
  return {
9858
9716
  t: t,
9717
+ categoryList: categoryList,
9859
9718
  durationOptions: durationOptions,
9860
9719
  examGroupByArticle: examGroupByArticle,
9861
9720
  handleAddArticle: handleAddArticle,
@@ -9877,16 +9736,19 @@ var ExamDetailView = function ExamDetailView(_ref) {
9877
9736
  isDisabled = _ref.isDisabled,
9878
9737
  isEdit = _ref.isEdit,
9879
9738
  onChangeExam = _ref.onChangeExam;
9880
- var _useSubjectSelect = useSubjectSelect(),
9739
+ var _useSubjectSelect = useSubjectSelect({
9740
+ onChangeExam: onChangeExam,
9741
+ exam: exam
9742
+ }),
9881
9743
  subjectOptions = _useSubjectSelect.subjectOptions,
9882
9744
  selectedSubject = _useSubjectSelect.selectedSubject,
9883
9745
  handleChangeSubject = _useSubjectSelect.handleChangeSubject;
9884
9746
  var _useExamDetailView = useExamDetailView({
9885
9747
  exam: exam,
9886
- onChangeExam: onChangeExam,
9887
- selectedSubject: selectedSubject
9748
+ onChangeExam: onChangeExam
9888
9749
  }),
9889
9750
  t = _useExamDetailView.t,
9751
+ categoryList = _useExamDetailView.categoryList,
9890
9752
  durationOptions = _useExamDetailView.durationOptions,
9891
9753
  examGroupByArticle = _useExamDetailView.examGroupByArticle,
9892
9754
  handleAddArticle = _useExamDetailView.handleAddArticle,
@@ -9935,10 +9797,10 @@ var ExamDetailView = function ExamDetailView(_ref) {
9935
9797
  className: 'mb-2'
9936
9798
  }, React__default.createElement("label", {
9937
9799
  className: styles["form-label"] + " " + styles$2["question-label"],
9938
- htmlFor: "duration"
9939
- }, t("subject"), " ", selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.name), React__default.createElement(CustomSelect, {
9800
+ htmlFor: "subject"
9801
+ }, t("subject")), React__default.createElement(CustomSelect, {
9940
9802
  inputId: "subject",
9941
- value: selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id,
9803
+ value: exam === null || exam === void 0 ? void 0 : exam.subjectId,
9942
9804
  options: subjectOptions,
9943
9805
  onChange: handleChangeSubject,
9944
9806
  isDisabled: isDisabled || isEdit
@@ -9949,6 +9811,7 @@ var ExamDetailView = function ExamDetailView(_ref) {
9949
9811
  xs: 12,
9950
9812
  className: index === examGroupByArticle.length - 1 ? "mb-2" : ''
9951
9813
  }, React__default.createElement(ArticleGroupView, Object.assign({}, i, {
9814
+ categoryList: categoryList,
9952
9815
  isActive: index === examGroupByArticle.length - 1,
9953
9816
  onChangeQuestionCount: handleChangeQuestionCount,
9954
9817
  onChangeCategory: handleChangeCategory,
@@ -10833,18 +10696,6 @@ var createConversationApi = function createConversationApi(data) {
10833
10696
  return api.post(BASE_URL + "/api/conversation", data);
10834
10697
  };
10835
10698
 
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
10699
  var ORDER_NUMBERS = {
10849
10700
  1: "the_first",
10850
10701
  2: "the_second",
@@ -10899,6 +10750,7 @@ var EXAM_RESULT = {
10899
10750
  parentPhoneNumber: "",
10900
10751
  schoolName: "Academy",
10901
10752
  className: "1",
10753
+ fullName: "Abc",
10902
10754
  major: "",
10903
10755
  roles: []
10904
10756
  },
@@ -11631,6 +11483,18 @@ var defaultSeries = function defaultSeries(t) {
11631
11483
  }];
11632
11484
  };
11633
11485
 
11486
+ var formatDuration = function formatDuration(t, duration) {
11487
+ if (!duration) return "0" + t("seconds");
11488
+ var totalTime = Math.round(duration);
11489
+ return totalTime > 60 ? t("mins_mins_seconds_seconds", {
11490
+ mins: Math.floor(totalTime / 60),
11491
+ seconds: totalTime % 60
11492
+ }) : "" + Math.round(duration) + t("seconds");
11493
+ };
11494
+ var formatQuestionOrder = function formatQuestionOrder(index, t, language) {
11495
+ return language === Language.en ? "" + (index + 1) + getOrdinalSuffix(index + 1, language) : t(ORDER_NUMBERS[index + 1]);
11496
+ };
11497
+
11634
11498
  var RECENT_USER_URL = BASE_URL + "/api/recentUsers";
11635
11499
  var getRecentUserActionListApi = function getRecentUserActionListApi(query) {
11636
11500
  return api.get("" + RECENT_USER_URL, {
@@ -11653,19 +11517,18 @@ var createRecentUserActionListApi = function createRecentUserActionListApi(_ref)
11653
11517
  });
11654
11518
  };
11655
11519
 
11656
- var useExamResult = function useExamResult(searchParam, history, examSessionId, studentId, code, handleChangeTab, selectedTab) {
11520
+ var useExamResult = function useExamResult(props) {
11657
11521
  var _allSeries$dataChartI;
11658
- if (examSessionId === void 0) {
11659
- examSessionId = 0;
11660
- }
11661
- if (studentId === void 0) {
11662
- studentId = 0;
11663
- }
11664
- if (code === void 0) {
11665
- code = "";
11666
- }
11667
- var query = new URLSearchParams(searchParam);
11668
- var dispatch = useDispatch();
11522
+ var searchParams = props.searchParams,
11523
+ history = props.history,
11524
+ examSessionId = props.examSessionId,
11525
+ studentId = props.studentId,
11526
+ _props$code = props.code,
11527
+ code = _props$code === void 0 ? "" : _props$code,
11528
+ handleChangeTab = props.handleChangeTab,
11529
+ selectedTab = props.selectedTab,
11530
+ isPrint = props.isPrint;
11531
+ var query = new URLSearchParams(searchParams);
11669
11532
  var user = useSelector(function (state) {
11670
11533
  var _state$common;
11671
11534
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
@@ -11677,7 +11540,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11677
11540
  var _state$common2;
11678
11541
  return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.language;
11679
11542
  });
11680
- var _useState = useState(false),
11543
+ var _useState = useState(),
11681
11544
  isLoading = _useState[0],
11682
11545
  setIsLoading = _useState[1];
11683
11546
  var _useState2 = useState(),
@@ -11698,9 +11561,12 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11698
11561
  var _useState7 = useState(0),
11699
11562
  dataChartIndex = _useState7[0],
11700
11563
  setDataChartIndex = _useState7[1];
11701
- var _useState8 = useState(""),
11564
+ var _useState8 = useState(),
11702
11565
  openProblem = _useState8[0],
11703
11566
  setOpenProblem = _useState8[1];
11567
+ var _useState9 = useState(),
11568
+ errorMessage = _useState9[0],
11569
+ setErrorMessage = _useState9[1];
11704
11570
  var _useTranslation = useTranslation(),
11705
11571
  t = _useTranslation.t;
11706
11572
  var getStudentData = function getStudentData(examCode) {
@@ -11713,7 +11579,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11713
11579
  var _temp = _catch(function () {
11714
11580
  return Promise.resolve(Promise.all([getResults(examCode), getResultsLongTimeSpend(examCode), getResultsEffectSize(examCode), getResultsTimeOrderQuestion(examCode), getResultsCategories(examCode)])).then(function (result) {
11715
11581
  var _result$0$data, _result$1$data, _result$2$data, _result$3$data, _result$4$data;
11716
- handleChangeTab(0);
11582
+ handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
11717
11583
  setDataChartIndex(0);
11718
11584
  setResultData((_result$0$data = result[0].data) === null || _result$0$data === void 0 ? void 0 : _result$0$data.data);
11719
11585
  setLongTimeSpend((_result$1$data = result[1].data) === null || _result$1$data === void 0 ? void 0 : _result$1$data.data);
@@ -11722,19 +11588,21 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11722
11588
  setCategoryResponses(((_result$4$data = result[4].data) === null || _result$4$data === void 0 ? void 0 : _result$4$data.data) || []);
11723
11589
  });
11724
11590
  }, function (error) {
11725
- toast.error(getErrorMessage(t, error));
11591
+ var message = getErrorMessage(t, error);
11592
+ !isPrint && toast.error(message);
11593
+ setErrorMessage(message);
11726
11594
  });
11727
11595
  return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
11728
11596
  } catch (e) {
11729
11597
  return Promise.reject(e);
11730
11598
  }
11731
11599
  };
11732
- var getStudentDataByTeacher = function getStudentDataByTeacher(examCode, examSessionId, studentId) {
11600
+ var getStudentDataByTeacher = function getStudentDataByTeacher(examSessionId, studentId) {
11733
11601
  try {
11734
11602
  var _temp5 = function _temp5() {
11735
11603
  setIsLoading(false);
11736
11604
  };
11737
- if (!examCode || !examSessionId || !studentId) return Promise.resolve();
11605
+ if (!examSessionId || !studentId) return Promise.resolve();
11738
11606
  setIsLoading(true);
11739
11607
  var _temp4 = _catch(function () {
11740
11608
  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 +11610,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11742
11610
  function _temp3(_createRecentUserActi) {
11743
11611
  _createRecentUserActi;
11744
11612
  }
11745
- handleChangeTab(0);
11613
+ handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
11746
11614
  setDataChartIndex(0);
11747
11615
  setResultData((_result$0$data2 = result[0].data) === null || _result$0$data2 === void 0 ? void 0 : _result$0$data2.data);
11748
11616
  setLongTimeSpend((_result$1$data2 = result[1].data) === null || _result$1$data2 === void 0 ? void 0 : _result$1$data2.data);
@@ -11762,7 +11630,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11762
11630
  })).then(_temp3);
11763
11631
  });
11764
11632
  }, function (error) {
11765
- toast.error(getErrorMessage(t, error));
11633
+ var message = getErrorMessage(t, error);
11634
+ !isPrint && toast.error(message);
11635
+ setErrorMessage(message);
11766
11636
  });
11767
11637
  return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
11768
11638
  } catch (e) {
@@ -11777,7 +11647,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11777
11647
  setCategoryResponses(CATEGORY_RESPONSES);
11778
11648
  };
11779
11649
  var resetData = function resetData() {
11650
+ setIsLoading(undefined);
11780
11651
  setResultData(undefined);
11652
+ setErrorMessage(undefined);
11781
11653
  setLongTimeSpend([]);
11782
11654
  setEffectSize([]);
11783
11655
  setTimelyOrderQuestions([]);
@@ -11788,7 +11660,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11788
11660
  resetData();
11789
11661
  if (!(user !== null && user !== void 0 && user.email)) return;
11790
11662
  isStudent && getStudentData(examCode);
11791
- !isStudent && getStudentDataByTeacher(code, examSessionId, studentId);
11663
+ !isStudent && getStudentDataByTeacher(examSessionId, studentId);
11792
11664
  };
11793
11665
  examCode === "example-code" ? setExampleData() : getData();
11794
11666
  }, [examCode, isStudent, code, examSessionId, studentId, user === null || user === void 0 ? void 0 : user.email]);
@@ -11828,7 +11700,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11828
11700
  var dataPointIndex = _ref.dataPointIndex;
11829
11701
  if (dataPointIndex > 0) {
11830
11702
  var _questions;
11831
- return val != null ? t("problem_number_question", {
11703
+ return val != null ? t("problem_number_question_chart", {
11832
11704
  number: questions !== null ? (((_questions = questions[questionLength - val]) === null || _questions === void 0 ? void 0 : _questions.questionOrder) || 0) + 1 : val
11833
11705
  }) : t("no_data");
11834
11706
  }
@@ -11837,11 +11709,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11837
11709
  }
11838
11710
  }),
11839
11711
  xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
11840
- categories: [""].concat(Array.from({
11712
+ categories: ["s"].concat(Array.from({
11841
11713
  length: questionLength
11842
11714
  }, function (_, i) {
11843
- return ORDER_NUMBERS[i + 1] ? t(ORDER_NUMBERS[i + 1]) : toNumberOrder(i + 1);
11844
- }), [""]),
11715
+ return formatQuestionOrder(i, t, language);
11716
+ }), ["e"]),
11845
11717
  tooltip: {
11846
11718
  formatter: function formatter(val) {
11847
11719
  if (val > 1) return t(ORDER_NUMBERS[val - 1]);
@@ -11913,7 +11785,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11913
11785
  var dataPointIndex = _ref2.dataPointIndex;
11914
11786
  if (dataPointIndex > 0) {
11915
11787
  var _questions3;
11916
- return val != null ? t("problem_number_question", {
11788
+ return val != null ? t("problem_number_question_chart", {
11917
11789
  number: questions !== null ? (((_questions3 = questions[questionLength - val]) === null || _questions3 === void 0 ? void 0 : _questions3.questionOrder) || 0) + 1 : val
11918
11790
  }) : t("no_data");
11919
11791
  }
@@ -11923,11 +11795,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11923
11795
  }),
11924
11796
  colors: ['#3DC674', '#C3099A'],
11925
11797
  xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
11926
- categories: [""].concat(Array.from({
11798
+ categories: ["s"].concat(Array.from({
11927
11799
  length: questionLength
11928
11800
  }, function (_, i) {
11929
- return ORDER_NUMBERS[i + 1] ? t(ORDER_NUMBERS[i + 1]) : toNumberOrder(i + 1);
11930
- }), [""]),
11801
+ return formatQuestionOrder(i, t, language);
11802
+ }), ["e"]),
11931
11803
  tooltip: {
11932
11804
  formatter: function formatter(val) {
11933
11805
  if (val > 1) return t(ORDER_NUMBERS[val - 1]);
@@ -11941,7 +11813,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11941
11813
  labels: _extends({}, DEFAULT_LINE_CHART_OPTIONS.yaxis.labels, {
11942
11814
  formatter: function formatter(val) {
11943
11815
  var _questions4;
11944
- return val != null ? t("problem_number_question", {
11816
+ return val != null ? t("problem_number_question_chart", {
11945
11817
  number: questions !== null ? (((_questions4 = questions[questionLength - val]) === null || _questions4 === void 0 ? void 0 : _questions4.questionOrder) || 0) + 1 : val
11946
11818
  }) : t("no_data");
11947
11819
  }
@@ -11950,224 +11822,6 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11950
11822
  });
11951
11823
  }, [JSON.stringify(allChartOptions), dataChartIndex, language]);
11952
11824
  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
11825
  useEffect(function () {
12172
11826
  setDataChartIndex(0);
12173
11827
  }, [selectedTab]);
@@ -12190,11 +11844,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
12190
11844
  timelyOrderQuestions: timelyOrderQuestions,
12191
11845
  openProblem: openProblem,
12192
11846
  categoryResponses: categoryResponses,
11847
+ errorMessage: errorMessage,
12193
11848
  setOpenProblem: setOpenProblem,
12194
11849
  handlePrevChart: handlePrevChart,
12195
11850
  handleNextChart: handleNextChart,
12196
- handleExit: handleExit,
12197
- handleExportPdf: handleExportPdf
11851
+ handleExit: handleExit
12198
11852
  };
12199
11853
  };
12200
11854
 
@@ -13311,7 +12965,7 @@ Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==t
13311
12965
 
13312
12966
  var ReactApexChart = unwrapExports(reactApexcharts_min);
13313
12967
 
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"};
12968
+ 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
12969
 
13316
12970
  var iconStarQuestion = function iconStarQuestion(_ref) {
13317
12971
  var _ref$width = _ref.width,
@@ -13702,8 +13356,7 @@ function CreateNewQuestionDialog(_ref) {
13702
13356
  function MyAnswer(_ref) {
13703
13357
  var data = _ref.data,
13704
13358
  categories = _ref.categories,
13705
- isStudent = _ref.isStudent,
13706
- isPrint = _ref.isPrint;
13359
+ isStudent = _ref.isStudent;
13707
13360
  var _useCreateQuestionDia = useCreateQuestionDialog({
13708
13361
  questions: data.questions
13709
13362
  }),
@@ -13831,24 +13484,12 @@ function MyAnswer(_ref) {
13831
13484
  })))));
13832
13485
  });
13833
13486
  };
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
13487
  return React__default.createElement("div", {
13844
13488
  className: styles$4["myanswer"]
13845
13489
  }, formattedData && formattedData.length > 0 && formattedData.map(function (item) {
13846
13490
  return React__default.createElement("div", {
13847
- key: item.category.id,
13848
- className: isPrint ? PrintContainerClassName : ""
13849
- }, React__default.createElement("div", {
13850
- className: isPrint ? PrintHeaderClassName : ""
13851
- }, React__default.createElement(Stack, {
13491
+ key: item.category.id
13492
+ }, React__default.createElement("div", null, React__default.createElement(Stack, {
13852
13493
  bgcolor: "#F9FAFB",
13853
13494
  flexDirection: "row",
13854
13495
  padding: "12px",
@@ -13860,6 +13501,7 @@ function MyAnswer(_ref) {
13860
13501
  gap: "4px"
13861
13502
  }
13862
13503
  }, React__default.createElement(Typography, {
13504
+ paddingInline: "4px",
13863
13505
  sx: {
13864
13506
  fontSize: "13px",
13865
13507
  fontWeight: 600,
@@ -13874,6 +13516,7 @@ function MyAnswer(_ref) {
13874
13516
  gap: "4px"
13875
13517
  }
13876
13518
  }, React__default.createElement(Typography, {
13519
+ paddingInline: "4px",
13877
13520
  sx: {
13878
13521
  fontSize: "13px",
13879
13522
  fontWeight: 600,
@@ -13888,6 +13531,7 @@ function MyAnswer(_ref) {
13888
13531
  gap: "4px"
13889
13532
  }
13890
13533
  }, React__default.createElement(Typography, {
13534
+ paddingInline: "4px",
13891
13535
  sx: {
13892
13536
  fontSize: "13px",
13893
13537
  fontWeight: 600,
@@ -13903,6 +13547,7 @@ function MyAnswer(_ref) {
13903
13547
  gap: "4px"
13904
13548
  }
13905
13549
  }, React__default.createElement(Typography, {
13550
+ paddingInline: "4px",
13906
13551
  sx: {
13907
13552
  fontSize: "13px",
13908
13553
  fontWeight: 600,
@@ -13918,6 +13563,7 @@ function MyAnswer(_ref) {
13918
13563
  gap: "4px"
13919
13564
  }
13920
13565
  }, React__default.createElement(Typography, {
13566
+ paddingInline: "4px",
13921
13567
  sx: {
13922
13568
  fontSize: "13px",
13923
13569
  fontWeight: 600,
@@ -13940,7 +13586,7 @@ function MyAnswer(_ref) {
13940
13586
  }
13941
13587
  }, item.category.name))), React__default.createElement("div", {
13942
13588
  className: styles$4["contentMyAnswer"]
13943
- }, isPrint ? renderPrintQuestions(item.questions) : renderQuestions(item.questions)));
13589
+ }, renderQuestions(item.questions)));
13944
13590
  }), React__default.createElement(CreateNewQuestionDialog, {
13945
13591
  questionOptions: questionOptions,
13946
13592
  questionOrderSelected: questionOrderSelected,
@@ -13994,8 +13640,7 @@ var iconBtnNextChart = function iconBtnNextChart(_ref) {
13994
13640
  };
13995
13641
 
13996
13642
  var CompareGrass = function CompareGrass(_ref) {
13997
- var effectSize = _ref.effectSize,
13998
- isPrint = _ref.isPrint;
13643
+ var effectSize = _ref.effectSize;
13999
13644
  var _useTranslation = useTranslation(),
14000
13645
  t = _useTranslation.t;
14001
13646
  var renderTableBody = function renderTableBody(effectSize) {
@@ -14058,17 +13703,8 @@ var CompareGrass = function CompareGrass(_ref) {
14058
13703
  }))));
14059
13704
  });
14060
13705
  };
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
13706
  return React__default.createElement("div", {
14071
- className: styles$4["compareGrass"] + " " + (isPrint ? PrintContainerClassName : "")
13707
+ className: "" + styles$4["compareGrass"]
14072
13708
  }, React__default.createElement("div", {
14073
13709
  className: styles$4["tableCompareGrass"]
14074
13710
  }, React__default.createElement("div", {
@@ -14080,8 +13716,7 @@ var CompareGrass = function CompareGrass(_ref) {
14080
13716
  }, React__default.createElement("thead", {
14081
13717
  style: {
14082
13718
  borderBottom: "1px solid #E4E7EC"
14083
- },
14084
- className: isPrint ? PrintHeaderClassName : ""
13719
+ }
14085
13720
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14086
13721
  className: styles$4["thcolumn1"]
14087
13722
  }, t("problem_number")), React__default.createElement("th", {
@@ -14100,7 +13735,7 @@ var CompareGrass = function CompareGrass(_ref) {
14100
13735
  style: {
14101
13736
  textAlign: "center"
14102
13737
  }
14103
- }, t("problem_classification")))), isPrint ? renderPrintTableBody(effectSize) : React__default.createElement("tbody", null, renderTableBody(effectSize))))));
13738
+ }, t("problem_classification")))), React__default.createElement("tbody", null, renderTableBody(effectSize))))));
14104
13739
  };
14105
13740
 
14106
13741
  var iconX = function iconX(_ref) {
@@ -14152,8 +13787,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
14152
13787
  var keyOpen = _ref.keyOpen,
14153
13788
  data = _ref.data,
14154
13789
  openProblem = _ref.openProblem,
14155
- changeOpen = _ref.changeOpen,
14156
- isPrint = _ref.isPrint;
13790
+ changeOpen = _ref.changeOpen;
14157
13791
  var _useTranslation = useTranslation(),
14158
13792
  t = _useTranslation.t;
14159
13793
  var isOpen = openProblem === keyOpen;
@@ -14192,45 +13826,12 @@ var TrickyProblem = function TrickyProblem(_ref) {
14192
13826
  className: styles$4["noData"]
14193
13827
  }, t("no_data"))));
14194
13828
  };
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
13829
  return React__default.createElement("div", {
14229
- className: styles$4["wrapperProblem"] + " " + (isPrint ? PrintContainerClassName : "")
13830
+ className: "" + styles$4["wrapperProblem"]
14230
13831
  }, React__default.createElement("div", {
14231
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintHeaderClassName : ""),
13832
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14232
13833
  onClick: function onClick() {
14233
- return changeOpen(isOpen ? "" : keyOpen);
13834
+ return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
14234
13835
  }
14235
13836
  }, React__default.createElement(Typography, {
14236
13837
  sx: {
@@ -14244,7 +13845,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
14244
13845
  }) : React__default.createElement(IoChevronDown, {
14245
13846
  size: 24,
14246
13847
  color: styles$4.gray_300
14247
- })), isOpen && React__default.createElement(Fragment$1, null, isPrint ? renderPrintProblems() : renderProblems()));
13848
+ })), isOpen && React__default.createElement(Fragment$1, null, renderProblems()));
14248
13849
  };
14249
13850
 
14250
13851
  var ProtractedProblem = function ProtractedProblem(_ref) {
@@ -14252,7 +13853,6 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14252
13853
  data = _ref.data,
14253
13854
  openProblem = _ref.openProblem,
14254
13855
  changeOpen = _ref.changeOpen,
14255
- isPrint = _ref.isPrint,
14256
13856
  isMyStoryStudent = _ref.isMyStoryStudent;
14257
13857
  var _useTranslation = useTranslation(),
14258
13858
  t = _useTranslation.t;
@@ -14327,21 +13927,12 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14327
13927
  }, formatTimeSecond(item.topDuration, t)))));
14328
13928
  });
14329
13929
  };
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
13930
  return React__default.createElement("div", {
14340
- className: styles$4["wrapperProblem"] + " " + (isPrint ? PrintContainerClassName : "")
13931
+ className: "" + styles$4["wrapperProblem"]
14341
13932
  }, React__default.createElement("div", {
14342
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintTitleClassName : ""),
13933
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14343
13934
  onClick: function onClick() {
14344
- return changeOpen(isOpen ? "" : keyOpen);
13935
+ return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
14345
13936
  }
14346
13937
  }, React__default.createElement(Stack, {
14347
13938
  flexDirection: "row",
@@ -14377,8 +13968,7 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14377
13968
  }, isMyStoryStudent && React__default.createElement("thead", {
14378
13969
  style: {
14379
13970
  borderBottom: "1px solid #E4E7EC"
14380
- },
14381
- className: isPrint ? PrintHeaderClassName : ""
13971
+ }
14382
13972
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14383
13973
  className: styles$4["thcolumn1"]
14384
13974
  }, t("problem_number")), React__default.createElement("th", {
@@ -14393,26 +13983,29 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14393
13983
  style: {
14394
13984
  textAlign: "center"
14395
13985
  }
14396
- }, t("time_comparison")))), isPrint ? renderPrintQuestions() : React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(data) : renderQuestions(data))))) : React__default.createElement("div", {
14397
- className: styles$4["noData"] + " " + (isPrint ? PrintContentClassName : "")
13986
+ }, t("time_comparison")))), React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(data) : renderQuestions(data))))) : React__default.createElement("div", {
13987
+ className: "" + styles$4["noData"]
14398
13988
  }, t("no_data"))));
14399
13989
  };
14400
13990
 
13991
+ var limitQuestions = 5;
13992
+ var correctRateThreshHold = 70;
14401
13993
  var Vulnerable = function Vulnerable(_ref) {
14402
13994
  var data = _ref.data,
14403
13995
  keyOpen = _ref.keyOpen,
14404
13996
  openProblem = _ref.openProblem,
14405
13997
  changeOpen = _ref.changeOpen,
14406
- isPrint = _ref.isPrint,
14407
13998
  isMyStoryStudent = _ref.isMyStoryStudent;
14408
13999
  var _useTranslation = useTranslation(),
14409
14000
  t = _useTranslation.t;
14410
14001
  var isOpen = openProblem === keyOpen;
14411
- var incorrectQuestions = data.questions.filter(function (i) {
14412
- return i.selectedAnswers !== "" && i.isCorrect === false;
14413
- }).sort(function (q1, q2) {
14414
- return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
14415
- });
14002
+ var incorrectQuestions = useMemo(function () {
14003
+ return data.questions.filter(function (i) {
14004
+ return i.selectedAnswers !== "" && i.isCorrect === false && i.isStar === false && i.overallCorrectRate >= correctRateThreshHold;
14005
+ }).sort(function (q1, q2) {
14006
+ return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
14007
+ }).slice(0, limitQuestions);
14008
+ }, [JSON.stringify(data.questions)]);
14416
14009
  var renderTableBody = function renderTableBody(data) {
14417
14010
  return data.map(function (item, index) {
14418
14011
  return React__default.createElement("tr", {
@@ -14467,11 +14060,13 @@ var Vulnerable = function Vulnerable(_ref) {
14467
14060
  return questions.map(function (question) {
14468
14061
  return React__default.createElement(Grid, {
14469
14062
  container: true,
14063
+ flexWrap: "nowrap",
14470
14064
  className: styles$4["content"],
14471
14065
  key: question.id
14472
14066
  }, React__default.createElement(Grid, {
14473
14067
  item: true,
14474
14068
  xs: 1.5,
14069
+ minWidth: "120px",
14475
14070
  className: styles$4["contentColumn1"]
14476
14071
  }, React__default.createElement("div", null, React__default.createElement("span", {
14477
14072
  className: styles$4["span1"]
@@ -14498,22 +14093,14 @@ var Vulnerable = function Vulnerable(_ref) {
14498
14093
  }), ")"))));
14499
14094
  });
14500
14095
  };
14501
- var renderPrintQuestions = function renderPrintQuestions(questions) {
14502
- var chunkedQuestions = _.chunk(questions, 5);
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
- });
14096
+ var handleToggle = function handleToggle() {
14097
+ changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
14509
14098
  };
14510
14099
  return React__default.createElement("div", {
14511
- className: styles$4["wrapperProblem"] + " " + PrintContainerClassName
14100
+ className: "" + styles$4["wrapperProblem"]
14512
14101
  }, React__default.createElement("div", {
14513
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintTitleClassName : ""),
14514
- onClick: function onClick() {
14515
- return changeOpen(isOpen ? "" : keyOpen);
14516
- }
14102
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14103
+ onClick: handleToggle
14517
14104
  }, React__default.createElement(Stack, {
14518
14105
  flexDirection: "row",
14519
14106
  gap: "24px",
@@ -14540,16 +14127,15 @@ var Vulnerable = function Vulnerable(_ref) {
14540
14127
  className: styles$4["tableCompareGrass"]
14541
14128
  }, React__default.createElement("div", {
14542
14129
  className: styles$4["table-responsive"]
14543
- }, React__default.createElement(Table, {
14130
+ }, isMyStoryStudent && React__default.createElement(Table, {
14544
14131
  style: {
14545
14132
  width: "100%",
14546
14133
  marginBottom: isMyStoryStudent ? "120px" : 0
14547
14134
  }
14548
- }, isMyStoryStudent && React__default.createElement("thead", {
14135
+ }, React__default.createElement("thead", {
14549
14136
  style: {
14550
14137
  borderBottom: "1px solid #E4E7EC"
14551
- },
14552
- className: isPrint ? PrintHeaderClassName : ""
14138
+ }
14553
14139
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14554
14140
  className: styles$4["thcolumn1"]
14555
14141
  }, t("problem_number")), React__default.createElement("th", {
@@ -14568,23 +14154,44 @@ var Vulnerable = function Vulnerable(_ref) {
14568
14154
  style: {
14569
14155
  textAlign: "center"
14570
14156
  }
14571
- }, t("_category")))), isPrint ? renderPrintQuestions(incorrectQuestions) : React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(incorrectQuestions) : renderQuestions(incorrectQuestions))))) : React__default.createElement("div", {
14572
- className: styles$4["noData"] + " " + (isPrint ? PrintContentClassName : "")
14157
+ }, t("_category")))), React__default.createElement("tbody", null, renderTableBody(incorrectQuestions))), !isMyStoryStudent && renderQuestions(incorrectQuestions))) : React__default.createElement("div", {
14158
+ className: "" + styles$4["noData"]
14573
14159
  }, t("no_data"))));
14574
14160
  };
14575
14161
 
14162
+ var AnswerResponseSignal;
14163
+ (function (AnswerResponseSignal) {
14164
+ AnswerResponseSignal[AnswerResponseSignal["Purple"] = 0] = "Purple";
14165
+ AnswerResponseSignal[AnswerResponseSignal["Red"] = 1] = "Red";
14166
+ AnswerResponseSignal[AnswerResponseSignal["Yellow"] = 2] = "Yellow";
14167
+ AnswerResponseSignal[AnswerResponseSignal["Green"] = 3] = "Green";
14168
+ AnswerResponseSignal[AnswerResponseSignal["Black"] = 4] = "Black";
14169
+ })(AnswerResponseSignal || (AnswerResponseSignal = {}));
14170
+ var ProblemKey;
14171
+ (function (ProblemKey) {
14172
+ ProblemKey[ProblemKey["TrickyProblem"] = 0] = "TrickyProblem";
14173
+ ProblemKey[ProblemKey["ProtractedProblem"] = 1] = "ProtractedProblem";
14174
+ ProblemKey[ProblemKey["GradesByTerritory"] = 2] = "GradesByTerritory";
14175
+ ProblemKey[ProblemKey["Vulnerable"] = 3] = "Vulnerable";
14176
+ })(ProblemKey || (ProblemKey = {}));
14177
+ var PrintState;
14178
+ (function (PrintState) {
14179
+ PrintState[PrintState["Default"] = 0] = "Default";
14180
+ PrintState[PrintState["Printing"] = 1] = "Printing";
14181
+ PrintState[PrintState["Pending"] = 2] = "Pending";
14182
+ PrintState[PrintState["Printed"] = 3] = "Printed";
14183
+ })(PrintState || (PrintState = {}));
14184
+
14576
14185
  var GradesByTerritory = function GradesByTerritory(_ref) {
14577
- var keyOpen = _ref.keyOpen,
14578
- data = _ref.data,
14186
+ var data = _ref.data,
14579
14187
  openProblem = _ref.openProblem,
14580
14188
  changeOpen = _ref.changeOpen,
14581
- isPrint = _ref.isPrint,
14582
14189
  resultData = _ref.resultData,
14583
14190
  isMyStoryStudent = _ref.isMyStoryStudent;
14584
14191
  var _useTranslation = useTranslation(),
14585
14192
  t = _useTranslation.t;
14586
14193
  var formattedData = totalSolveTimeCategories(resultData, data);
14587
- var isOpen = openProblem === keyOpen;
14194
+ var isOpen = openProblem === ProblemKey.GradesByTerritory;
14588
14195
  var renderTableBody = function renderTableBody(data) {
14589
14196
  return data.map(function (item, index) {
14590
14197
  return React__default.createElement("tr", {
@@ -14658,21 +14265,12 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
14658
14265
  }))));
14659
14266
  });
14660
14267
  };
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
14268
  return React__default.createElement("div", {
14671
- className: styles$4["wrapperProblem"] + " " + (isPrint ? PrintContainerClassName : "")
14269
+ className: "" + styles$4["wrapperProblem"]
14672
14270
  }, React__default.createElement("div", {
14673
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintTitleClassName : ""),
14271
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14674
14272
  onClick: function onClick() {
14675
- return changeOpen(isOpen ? "" : keyOpen);
14273
+ return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : ProblemKey.GradesByTerritory);
14676
14274
  }
14677
14275
  }, React__default.createElement(Typography, {
14678
14276
  sx: {
@@ -14690,16 +14288,15 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
14690
14288
  className: styles$4["tableCompareGrass"]
14691
14289
  }, React__default.createElement("div", {
14692
14290
  className: styles$4["table-responsive"]
14693
- }, React__default.createElement(Table, {
14291
+ }, isMyStoryStudent && React__default.createElement(Table, {
14694
14292
  style: {
14695
14293
  width: "100%",
14696
14294
  marginBottom: isMyStoryStudent ? "120px" : 0
14697
14295
  }
14698
- }, isMyStoryStudent && React__default.createElement("thead", {
14296
+ }, React__default.createElement("thead", {
14699
14297
  style: {
14700
14298
  borderBottom: "1px solid #E4E7EC"
14701
- },
14702
- className: isPrint ? PrintHeaderClassName : ""
14299
+ }
14703
14300
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14704
14301
  className: styles$4["thcolumn1"]
14705
14302
  }, t("categories")), React__default.createElement("th", {
@@ -14718,8 +14315,8 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
14718
14315
  style: {
14719
14316
  textAlign: "center"
14720
14317
  }
14721
- }, t("total_solve_time")))), isPrint ? renderPrintCategories() : React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(formattedData) : renderCategories(formattedData))))) : React__default.createElement("div", {
14722
- className: styles$4["noData"] + " " + (isPrint ? PrintContentClassName : "")
14318
+ }, t("total_solve_time")))), React__default.createElement("tbody", null, renderTableBody(formattedData))), !isMyStoryStudent && renderCategories(formattedData))) : React__default.createElement("div", {
14319
+ className: "" + styles$4["noData"]
14723
14320
  }, t("no_data"))));
14724
14321
  };
14725
14322
 
@@ -14923,23 +14520,379 @@ var useTab = function useTab() {
14923
14520
  };
14924
14521
  };
14925
14522
 
14523
+ var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, totalChart, onSuccess, onError, autoPrint) {
14524
+ if (autoPrint === void 0) {
14525
+ autoPrint = false;
14526
+ }
14527
+ var contentRef = useRef(null);
14528
+ var _useState = useState([]),
14529
+ renderedCharts = _useState[0],
14530
+ setRenderedCharts = _useState[1];
14531
+ var _useTranslation = useTranslation(),
14532
+ t = _useTranslation.t;
14533
+ var _useState2 = useState(PrintState.Default),
14534
+ printState = _useState2[0],
14535
+ setPrintState = _useState2[1];
14536
+ var setRenderedChart = function setRenderedChart(chart) {
14537
+ setRenderedCharts(function (state) {
14538
+ return [].concat(state, [chart]);
14539
+ });
14540
+ };
14541
+ var reset = function reset() {
14542
+ setRenderedCharts([]);
14543
+ setPrintState(PrintState.Default);
14544
+ };
14545
+ var autoPrintPdf = function autoPrintPdf() {
14546
+ if (printState === PrintState.Printing) return;
14547
+ if (autoPrint && printState !== PrintState.Default) return;
14548
+ if (totalChart !== renderedCharts.length) {
14549
+ !autoPrint && setPrintState(PrintState.Pending);
14550
+ return;
14551
+ }
14552
+ var name = !fileName ? "Exam-Result_" + new Date().getTime() : fileName;
14553
+ if (contentRef.current && contentRef.current != null) {
14554
+ setPrintState(PrintState.Printing);
14555
+ setTimeout(function () {
14556
+ try {
14557
+ var _temp2 = function _temp2() {
14558
+ setPrintState(PrintState.Printed);
14559
+ };
14560
+ var _temp = _catch(function () {
14561
+ var element = contentRef.current;
14562
+ var options = {
14563
+ margin: 5,
14564
+ filename: name + ".pdf",
14565
+ html2canvas: {
14566
+ scale: 2
14567
+ },
14568
+ jsPDF: {
14569
+ format: 'a4',
14570
+ orientation: 'portrait'
14571
+ },
14572
+ pagebreak: {
14573
+ mode: ['avoid-all', 'css', 'legacy']
14574
+ }
14575
+ };
14576
+ return Promise.resolve(html2pdf().from(element).set(options).save()).then(function () {
14577
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
14578
+ });
14579
+ }, function (error) {
14580
+ !window.opener && toast.error(getErrorMessage(t, error));
14581
+ onError === null || onError === void 0 ? void 0 : onError(error === null || error === void 0 ? void 0 : error.message);
14582
+ });
14583
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
14584
+ } catch (e) {
14585
+ return Promise.reject(e);
14586
+ }
14587
+ }, 300);
14588
+ }
14589
+ };
14590
+ var handlePrintPdf = function handlePrintPdf() {
14591
+ autoPrintPdf();
14592
+ };
14593
+ useEffect(function () {
14594
+ (autoPrint || printState === PrintState.Pending) && isDataFetching === false && autoPrintPdf();
14595
+ }, [totalChart, renderedCharts.length, fileName, autoPrint, printState, isDataFetching]);
14596
+ useEffect(function () {
14597
+ isDataFetching && reset();
14598
+ }, [isDataFetching]);
14599
+ return {
14600
+ contentRef: contentRef,
14601
+ printState: printState,
14602
+ setRenderedChart: setRenderedChart,
14603
+ handlePrintPdf: handlePrintPdf,
14604
+ reset: reset
14605
+ };
14606
+ };
14607
+
14608
+ var printStyles = {"page-break":"_35kyG","print-exact-color":"_1PFgl","avoid-break-inside":"_3rPGh"};
14609
+
14610
+ var TimeOrderChart = function TimeOrderChart(_ref) {
14611
+ var timelyOrderQuestion = _ref.timelyOrderQuestion,
14612
+ options = _ref.options,
14613
+ series = _ref.series,
14614
+ setIsRendered = _ref.setIsRendered;
14615
+ var _useTranslation = useTranslation(),
14616
+ t = _useTranslation.t;
14617
+ var chartRef = useRef(null);
14618
+ var chartOptions = _extends({}, options, {
14619
+ chart: _extends({}, options.chart, {
14620
+ animations: {
14621
+ enabled: false
14622
+ }
14623
+ })
14624
+ });
14625
+ useEffect(function () {
14626
+ if (chartRef.current) {
14627
+ setIsRendered(timelyOrderQuestion.article);
14628
+ }
14629
+ }, [timelyOrderQuestion.article]);
14630
+ return React__default.createElement("div", {
14631
+ className: "" + printStyles["avoid-break-inside"]
14632
+ }, React__default.createElement(Typography, {
14633
+ className: "pb-2",
14634
+ sx: {
14635
+ fontSize: "14px",
14636
+ fontWeight: 700,
14637
+ color: "#414E62"
14638
+ }
14639
+ }, t("article_number"), " ", timelyOrderQuestion.article), React__default.createElement("div", {
14640
+ className: "" + styles$4["compareChart"]
14641
+ }, React__default.createElement("div", {
14642
+ className: "" + styles$4["prevChart"]
14643
+ }), React__default.createElement("div", {
14644
+ className: styles$4["chart"] + " sr-line-chart"
14645
+ }, React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
14646
+ ref: chartRef,
14647
+ height: 389,
14648
+ options: chartOptions,
14649
+ series: series
14650
+ }))), React__default.createElement("div", {
14651
+ className: "" + styles$4["nextChart"]
14652
+ })));
14653
+ };
14654
+
14655
+ var textStyle = {
14656
+ fontSize: "18px",
14657
+ fontWeight: 700,
14658
+ color: styles.gray_500
14659
+ };
14660
+ var courseNameStyle = {
14661
+ fontSize: "14px",
14662
+ fontWeight: 600,
14663
+ color: styles.less_dark
14664
+ };
14665
+ var examTitleStyle = {
14666
+ fontSize: "20px",
14667
+ fontWeight: 600,
14668
+ color: styles.darker
14669
+ };
14670
+ var studentNameStyle = {
14671
+ fontSize: "24px",
14672
+ fontWeight: 600,
14673
+ color: styles.darker,
14674
+ lineHeight: 1
14675
+ };
14676
+ var PrintExamResult = function PrintExamResult(_ref) {
14677
+ var resultData = _ref.resultData,
14678
+ examTime = _ref.examTime,
14679
+ isStudent = _ref.isStudent,
14680
+ categoryResponses = _ref.categoryResponses,
14681
+ timelyOrderQuestions = _ref.timelyOrderQuestions,
14682
+ allChartOptions = _ref.allChartOptions,
14683
+ allSeries = _ref.allSeries,
14684
+ effectSize = _ref.effectSize,
14685
+ isMyStoryStudent = _ref.isMyStoryStudent,
14686
+ longTimeSpend = _ref.longTimeSpend,
14687
+ contentRef = _ref.contentRef,
14688
+ setRenderedChart = _ref.setRenderedChart;
14689
+ var academy = useSelector(function (state) {
14690
+ var _state$common;
14691
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.academy;
14692
+ });
14693
+ return React__default.createElement(Box, {
14694
+ sx: {
14695
+ minWidth: "768px",
14696
+ width: "768px",
14697
+ maxWidth: "768px!important",
14698
+ background: "#FFF",
14699
+ padding: "24px",
14700
+ overflow: "auto"
14701
+ },
14702
+ id: "canvas",
14703
+ className: printStyles["print-exact-color"] + " " + printStyles["container"],
14704
+ ref: contentRef
14705
+ }, React__default.createElement(Grid, {
14706
+ container: true,
14707
+ marginBottom: "24px"
14708
+ }, React__default.createElement(Grid, {
14709
+ item: true,
14710
+ xs: 12
14711
+ }, React__default.createElement(Stack, {
14712
+ direction: "row",
14713
+ justifyContent: "space-between",
14714
+ flexWrap: "nowrap",
14715
+ spacing: 1,
14716
+ marginBottom: "12px"
14717
+ }, React__default.createElement(Stack, {
14718
+ direction: "column"
14719
+ }, React__default.createElement(Typography, {
14720
+ sx: studentNameStyle
14721
+ }, resultData.student.fullName), React__default.createElement(Typography, {
14722
+ sx: {
14723
+ fontSize: "16px",
14724
+ fontWeight: 600,
14725
+ color: styles.gray_500
14726
+ }
14727
+ }, resultData.student.email)), academy && React__default.createElement(Typography, {
14728
+ sx: _extends({}, studentNameStyle, {
14729
+ textAlign: "end"
14730
+ })
14731
+ }, academy.name)), resultData.courseName && React__default.createElement(Stack, null, React__default.createElement(Typography, {
14732
+ sx: courseNameStyle
14733
+ }, resultData.courseName)), React__default.createElement(Box, {
14734
+ display: "flex",
14735
+ gap: "16px",
14736
+ flexDirection: "column"
14737
+ }, React__default.createElement(Stack, null, React__default.createElement(Typography, {
14738
+ sx: examTitleStyle
14739
+ }, resultData.title)), React__default.createElement(Stack, {
14740
+ flexDirection: "row",
14741
+ gap: "16px"
14742
+ }, React__default.createElement(Stack, null, React__default.createElement(Typography, {
14743
+ sx: {
14744
+ fontSize: "13px",
14745
+ fontWeight: 600,
14746
+ color: styles.gray_500
14747
+ }
14748
+ }, t$1("my_score")), React__default.createElement(Typography, {
14749
+ sx: {
14750
+ fontSize: "14px",
14751
+ fontWeight: 600,
14752
+ color: styles.darker
14753
+ }
14754
+ }, t$1("score_format", {
14755
+ score: resultData === null || resultData === void 0 ? void 0 : resultData.score
14756
+ }))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
14757
+ sx: {
14758
+ fontSize: "13px",
14759
+ fontWeight: 600,
14760
+ color: styles.gray_500
14761
+ }
14762
+ }, t$1("exam_date")), React__default.createElement(Typography, {
14763
+ sx: {
14764
+ fontSize: "14px",
14765
+ fontWeight: 600,
14766
+ color: styles.gray_700
14767
+ }
14768
+ }, utcToLocalTime(resultData === null || resultData === void 0 ? void 0 : resultData.startTime, t$1("date_format")))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
14769
+ sx: {
14770
+ fontSize: "13px",
14771
+ fontWeight: 600,
14772
+ color: styles.gray_500
14773
+ }
14774
+ }, t$1("exam_time")), React__default.createElement(Typography, {
14775
+ sx: {
14776
+ fontSize: "14px",
14777
+ fontWeight: 600,
14778
+ color: styles.gray_700
14779
+ }
14780
+ }, examTime)), React__default.createElement(Stack, null, React__default.createElement(Typography, {
14781
+ sx: {
14782
+ fontSize: "13px",
14783
+ fontWeight: 600,
14784
+ color: styles.gray_500
14785
+ }
14786
+ }, t$1("total_students")), React__default.createElement(Typography, {
14787
+ sx: {
14788
+ fontSize: "14px",
14789
+ fontWeight: 600,
14790
+ color: styles.gray_700
14791
+ }
14792
+ }, t$1("number_people", {
14793
+ number: resultData === null || resultData === void 0 ? void 0 : resultData.totalStudent
14794
+ }))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
14795
+ sx: {
14796
+ fontSize: "13px",
14797
+ fontWeight: 600,
14798
+ color: styles.gray_500
14799
+ }
14800
+ }, t$1("teacher_in_charge")), React__default.createElement(Typography, {
14801
+ sx: {
14802
+ fontSize: "14px",
14803
+ fontWeight: 600,
14804
+ color: styles.gray_700
14805
+ }
14806
+ }, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), React__default.createElement(Stack, {
14807
+ display: "flex",
14808
+ flexDirection: "column",
14809
+ gap: "12px"
14810
+ }, React__default.createElement(Typography, {
14811
+ sx: textStyle
14812
+ }, t$1(TabList[0].label)), React__default.createElement(MyAnswer, {
14813
+ data: resultData,
14814
+ categories: categoryResponses,
14815
+ isStudent: isStudent
14816
+ })), React__default.createElement(Stack, {
14817
+ display: "flex",
14818
+ flexDirection: "column",
14819
+ gap: "12px",
14820
+ marginTop: "24px"
14821
+ }, React__default.createElement(Typography, {
14822
+ sx: textStyle
14823
+ }, t$1(TabList[1].label)), timelyOrderQuestions.map(function (timelyOrderQuestion, index) {
14824
+ return React__default.createElement(TimeOrderChart, {
14825
+ key: index,
14826
+ timelyOrderQuestion: timelyOrderQuestion,
14827
+ options: allChartOptions[index],
14828
+ series: allSeries[index],
14829
+ setIsRendered: setRenderedChart
14830
+ });
14831
+ })), React__default.createElement(Stack, {
14832
+ display: "flex",
14833
+ flexDirection: "column",
14834
+ gap: "12px",
14835
+ marginTop: "24px"
14836
+ }, React__default.createElement(Typography, {
14837
+ sx: textStyle
14838
+ }, t$1(TabList[2].label)), React__default.createElement(CompareGrass, {
14839
+ effectSize: effectSize
14840
+ })), React__default.createElement(Stack, {
14841
+ display: "flex",
14842
+ flexDirection: "column",
14843
+ gap: "12px",
14844
+ marginTop: "24px"
14845
+ }, React__default.createElement(Typography, {
14846
+ sx: textStyle
14847
+ }, t$1(TabList[3].label)), React__default.createElement(TrickyProblem, {
14848
+ keyOpen: ProblemKey.TrickyProblem,
14849
+ data: resultData,
14850
+ openProblem: ProblemKey.TrickyProblem
14851
+ }), React__default.createElement(Vulnerable, {
14852
+ keyOpen: ProblemKey.Vulnerable,
14853
+ data: resultData,
14854
+ openProblem: ProblemKey.Vulnerable,
14855
+ isMyStoryStudent: isMyStoryStudent
14856
+ }), React__default.createElement(ProtractedProblem, {
14857
+ keyOpen: ProblemKey.ProtractedProblem,
14858
+ data: longTimeSpend,
14859
+ openProblem: ProblemKey.ProtractedProblem,
14860
+ isMyStoryStudent: isMyStoryStudent
14861
+ }), React__default.createElement(GradesByTerritory, {
14862
+ data: categoryResponses,
14863
+ resultData: resultData,
14864
+ openProblem: ProblemKey.GradesByTerritory,
14865
+ isMyStoryStudent: isMyStoryStudent
14866
+ })));
14867
+ };
14868
+
14926
14869
  var ExamResultV2 = function ExamResultV2(_ref) {
14927
14870
  var searchParams = _ref.searchParams,
14928
14871
  history = _ref.history,
14929
- examSessionId = _ref.examSessionId,
14930
- studentId = _ref.studentId,
14872
+ _ref$examSessionId = _ref.examSessionId,
14873
+ examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
14874
+ _ref$studentId = _ref.studentId,
14875
+ studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
14931
14876
  code = _ref.code,
14932
14877
  isMyStoryStudent = _ref.isMyStoryStudent;
14933
14878
  var _useTab = useTab(),
14934
14879
  selected = _useTab.selected,
14935
14880
  handleChangeTab = _useTab.handleChangeTab;
14936
- var _useExamResult = useExamResult(searchParams, history, examSessionId, studentId, code, handleChangeTab, selected),
14881
+ var _useExamResult = useExamResult({
14882
+ searchParams: searchParams,
14883
+ history: history,
14884
+ examSessionId: examSessionId,
14885
+ studentId: studentId,
14886
+ code: code,
14887
+ handleChangeTab: handleChangeTab,
14888
+ selectedTab: selected
14889
+ }),
14937
14890
  isLoading = _useExamResult.isLoading,
14938
14891
  examTime = _useExamResult.examTime,
14939
14892
  series = _useExamResult.series,
14940
14893
  allSeries = _useExamResult.allSeries,
14941
- chartOptions = _useExamResult.chartOptions,
14942
14894
  allChartOptions = _useExamResult.allChartOptions,
14895
+ chartOptions = _useExamResult.chartOptions,
14943
14896
  dataChartIndex = _useExamResult.dataChartIndex,
14944
14897
  timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
14945
14898
  isStudent = _useExamResult.isStudent,
@@ -14948,7 +14901,6 @@ var ExamResultV2 = function ExamResultV2(_ref) {
14948
14901
  longTimeSpend = _useExamResult.longTimeSpend,
14949
14902
  effectSize = _useExamResult.effectSize,
14950
14903
  categoryResponses = _useExamResult.categoryResponses,
14951
- handleExportPdf = _useExamResult.handleExportPdf,
14952
14904
  setOpenProblem = _useExamResult.setOpenProblem,
14953
14905
  handlePrevChart = _useExamResult.handlePrevChart,
14954
14906
  handleNextChart = _useExamResult.handleNextChart;
@@ -14958,9 +14910,15 @@ var ExamResultV2 = function ExamResultV2(_ref) {
14958
14910
  handleCreateQuestion = _useCreateQuestionDia.handleCreateQuestion,
14959
14911
  openCreateQuestionDialog = _useCreateQuestionDia.openCreateQuestionDialog,
14960
14912
  toggleCreateQuestion = _useCreateQuestionDia.toggleCreateQuestion;
14913
+ var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
14914
+ var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length),
14915
+ contentRef = _usePrintExamResult.contentRef,
14916
+ printState = _usePrintExamResult.printState,
14917
+ handlePrintPdf = _usePrintExamResult.handlePrintPdf,
14918
+ setRenderedChart = _usePrintExamResult.setRenderedChart;
14961
14919
  var isTabletUp = useMediaQuery('(min-width:900px)');
14962
14920
  return React__default.createElement(Fragment$1, null, React__default.createElement(LoadingComponent, {
14963
- isLoading: isLoading
14921
+ isLoading: !!isLoading
14964
14922
  }), timelyOrderQuestions[dataChartIndex] && longTimeSpend && resultData && effectSize ? React__default.createElement("div", {
14965
14923
  style: {
14966
14924
  width: "100%"
@@ -15076,7 +15034,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15076
15034
  className: styles$4["pdfBtnBox"]
15077
15035
  }, React__default.createElement("button", {
15078
15036
  className: styles$4["pdfBtn"] + " " + styles["truncate"],
15079
- onClick: handleExportPdf
15037
+ onClick: handlePrintPdf
15080
15038
  }, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print_all"))))))), React__default.createElement(Grid, {
15081
15039
  item: true,
15082
15040
  xs: 12
@@ -15122,7 +15080,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15122
15080
  className: styles$4["pdfBtnBox"]
15123
15081
  }, React__default.createElement("button", {
15124
15082
  className: styles$4["pdfBtn"] + " " + styles["truncate"],
15125
- onClick: handleExportPdf
15083
+ onClick: handlePrintPdf
15126
15084
  }, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print"))))))), React__default.createElement(Grid, {
15127
15085
  item: true,
15128
15086
  xs: 12
@@ -15159,240 +15117,54 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15159
15117
  value: selected,
15160
15118
  index: 3
15161
15119
  }, React__default.createElement(TrickyProblem, {
15162
- keyOpen: "TrickyProblem",
15120
+ keyOpen: ProblemKey.TrickyProblem,
15163
15121
  data: resultData,
15164
15122
  openProblem: openProblem,
15165
15123
  changeOpen: setOpenProblem
15166
15124
  }), React__default.createElement(Vulnerable, {
15167
- keyOpen: "Vulnerable",
15125
+ keyOpen: ProblemKey.Vulnerable,
15168
15126
  data: resultData,
15169
15127
  openProblem: openProblem,
15170
15128
  changeOpen: setOpenProblem,
15171
15129
  isMyStoryStudent: isMyStoryStudent
15172
15130
  }), React__default.createElement(ProtractedProblem, {
15173
- keyOpen: "ProtractedProblem",
15131
+ keyOpen: ProblemKey.ProtractedProblem,
15174
15132
  data: longTimeSpend,
15175
15133
  openProblem: openProblem,
15176
15134
  changeOpen: setOpenProblem,
15177
15135
  isMyStoryStudent: isMyStoryStudent
15178
15136
  }), React__default.createElement(GradesByTerritory, {
15179
- keyOpen: "GradesByTerritory",
15180
15137
  data: categoryResponses,
15181
15138
  resultData: resultData,
15182
15139
  openProblem: openProblem,
15183
15140
  isMyStoryStudent: isMyStoryStudent,
15184
15141
  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
15142
  })))), React__default.createElement(CreateNewQuestionDialog$1, {
15391
15143
  examSessionId: resultData === null || resultData === void 0 ? void 0 : resultData.examSessionId,
15392
15144
  handleCreateQuestion: handleCreateQuestion,
15393
15145
  openCreateQuestionDialog: openCreateQuestionDialog,
15394
15146
  toggleCreateQuestion: toggleCreateQuestion
15395
- })) : React__default.createElement(Fragment$1, null));
15147
+ }), isLoading === false && React__default.createElement(Box, {
15148
+ width: 0,
15149
+ height: 0,
15150
+ overflow: "hidden"
15151
+ }, React__default.createElement(PrintExamResult, {
15152
+ contentRef: contentRef,
15153
+ allChartOptions: allChartOptions,
15154
+ allSeries: allSeries,
15155
+ categoryResponses: categoryResponses,
15156
+ effectSize: effectSize,
15157
+ examTime: examTime,
15158
+ isStudent: isStudent,
15159
+ longTimeSpend: longTimeSpend,
15160
+ resultData: resultData,
15161
+ timelyOrderQuestions: timelyOrderQuestions,
15162
+ isMyStoryStudent: isMyStoryStudent,
15163
+ fileName: fileName,
15164
+ setRenderedChart: setRenderedChart
15165
+ }))) : React__default.createElement(Fragment$1, null), React__default.createElement(LoadingComponent, {
15166
+ isLoading: printState === PrintState.Pending || printState === PrintState.Printing
15167
+ }));
15396
15168
  };
15397
15169
 
15398
15170
  var RecentUserActionSortBy;
@@ -16012,6 +15784,7 @@ var Header = function Header(_ref) {
16012
15784
  var _user$roles;
16013
15785
  var academyListRoute = _ref.academyListRoute,
16014
15786
  homeRoute = _ref.homeRoute,
15787
+ registerRoute = _ref.registerRoute,
16015
15788
  headerTabs = _ref.headerTabs,
16016
15789
  role = _ref.role,
16017
15790
  history = _ref.history,
@@ -16060,6 +15833,7 @@ var Header = function Header(_ref) {
16060
15833
  }, React__default.createElement(TheAcademyDropdown, {
16061
15834
  homeAcademyUrl: academyListRoute.path,
16062
15835
  homeUrl: homeRoute.path,
15836
+ registerUrl: registerRoute === null || registerRoute === void 0 ? void 0 : registerRoute.path,
16063
15837
  role: role,
16064
15838
  history: history,
16065
15839
  onSignOut: onSignOut,
@@ -16671,5 +16445,135 @@ var useVirtualizeList = function useVirtualizeList(totalItems, rowHeight, offset
16671
16445
  };
16672
16446
  };
16673
16447
 
16674
- 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, 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 };
16448
+ var usePrintView = function usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage) {
16449
+ var _useState = useState(false),
16450
+ isDone = _useState[0],
16451
+ setDone = _useState[1];
16452
+ var handelPrintSuccess = function handelPrintSuccess() {
16453
+ var _window$opener$postMe, _window$opener;
16454
+ var data = {
16455
+ examSessionId: examSessionId,
16456
+ studentId: studentId,
16457
+ succeed: true
16458
+ };
16459
+ 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);
16460
+ setDone(true);
16461
+ };
16462
+ var handelPrintError = function handelPrintError(errorMessage) {
16463
+ var _window$opener$postMe2, _window$opener2;
16464
+ var data = {
16465
+ examSessionId: examSessionId,
16466
+ studentId: studentId,
16467
+ succeed: false,
16468
+ errorMessage: errorMessage
16469
+ };
16470
+ 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);
16471
+ setDone(true);
16472
+ };
16473
+ var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
16474
+ useEffect(function () {
16475
+ setNotFound === null || setNotFound === void 0 ? void 0 : setNotFound(isLoading === false && !!errorMessage);
16476
+ if (isLoading === false && !!errorMessage) handelPrintError(errorMessage);
16477
+ }, [isLoading, errorMessage]);
16478
+ return {
16479
+ fileName: fileName,
16480
+ isDone: isDone,
16481
+ handelPrintSuccess: handelPrintSuccess,
16482
+ handelPrintError: handelPrintError
16483
+ };
16484
+ };
16485
+
16486
+ var LoadingDots = function LoadingDots(_ref) {
16487
+ var text = _ref.text;
16488
+ return React__default.createElement(Stack, {
16489
+ className: "mt-3",
16490
+ direction: "row",
16491
+ spacing: 0.5
16492
+ }, React__default.createElement(Typography, {
16493
+ color: "#FFF",
16494
+ fontSize: 20
16495
+ }, text), React__default.createElement("div", {
16496
+ className: styles$4["loader"]
16497
+ }, React__default.createElement("div", {
16498
+ className: styles$4["dot"]
16499
+ }), React__default.createElement("div", {
16500
+ className: styles$4["dot"]
16501
+ }), React__default.createElement("div", {
16502
+ className: styles$4["dot"]
16503
+ })));
16504
+ };
16505
+
16506
+ var PrintExamResultView = function PrintExamResultView(_ref) {
16507
+ var isMyStoryStudent = _ref.isMyStoryStudent,
16508
+ _ref$searchParams = _ref.searchParams,
16509
+ searchParams = _ref$searchParams === void 0 ? "" : _ref$searchParams,
16510
+ history = _ref.history,
16511
+ _ref$examSessionId = _ref.examSessionId,
16512
+ examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
16513
+ _ref$studentId = _ref.studentId,
16514
+ studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
16515
+ code = _ref.code,
16516
+ setNotFound = _ref.setNotFound;
16517
+ var _useExamResult = useExamResult({
16518
+ searchParams: searchParams,
16519
+ history: history,
16520
+ examSessionId: examSessionId,
16521
+ studentId: studentId,
16522
+ code: code,
16523
+ isPrint: true
16524
+ }),
16525
+ isLoading = _useExamResult.isLoading,
16526
+ examTime = _useExamResult.examTime,
16527
+ allSeries = _useExamResult.allSeries,
16528
+ allChartOptions = _useExamResult.allChartOptions,
16529
+ timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
16530
+ isStudent = _useExamResult.isStudent,
16531
+ resultData = _useExamResult.resultData,
16532
+ longTimeSpend = _useExamResult.longTimeSpend,
16533
+ effectSize = _useExamResult.effectSize,
16534
+ categoryResponses = _useExamResult.categoryResponses,
16535
+ errorMessage = _useExamResult.errorMessage;
16536
+ var _usePrintView = usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage),
16537
+ fileName = _usePrintView.fileName,
16538
+ isDone = _usePrintView.isDone,
16539
+ handelPrintSuccess = _usePrintView.handelPrintSuccess,
16540
+ handelPrintError = _usePrintView.handelPrintError;
16541
+ var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length, handelPrintSuccess, handelPrintError, true),
16542
+ contentRef = _usePrintExamResult.contentRef,
16543
+ setRenderedChart = _usePrintExamResult.setRenderedChart;
16544
+ var isTabletUp = useMediaQuery("(min-width:900px)");
16545
+ return React__default.createElement(Box, {
16546
+ sx: {
16547
+ display: "flex",
16548
+ justifyContent: "center"
16549
+ },
16550
+ displayPrint: "block"
16551
+ }, isLoading === false && resultData && effectSize ? React__default.createElement(PrintExamResult, {
16552
+ contentRef: contentRef,
16553
+ allChartOptions: allChartOptions,
16554
+ allSeries: allSeries,
16555
+ categoryResponses: categoryResponses,
16556
+ effectSize: effectSize,
16557
+ examTime: examTime,
16558
+ isStudent: isStudent,
16559
+ longTimeSpend: longTimeSpend,
16560
+ resultData: resultData,
16561
+ timelyOrderQuestions: timelyOrderQuestions,
16562
+ isMyStoryStudent: isMyStoryStudent,
16563
+ fileName: fileName,
16564
+ setRenderedChart: setRenderedChart
16565
+ }) : isLoading === undefined || isLoading === true ? React__default.createElement(LoadingComponent, {
16566
+ isLoading: !!isLoading,
16567
+ spinClassName: "text-white"
16568
+ }, isTabletUp && React__default.createElement(LoadingDots, {
16569
+ text: "Loading data"
16570
+ })) : React__default.createElement(NotFound, null), React__default.createElement(LoadingComponent, {
16571
+ isLoading: isDone !== true && isLoading === false && !!resultData,
16572
+ spinClassName: "text-white"
16573
+ }, isTabletUp && React__default.createElement(LoadingDots, {
16574
+ text: "Please wait for a while! Printing"
16575
+ })));
16576
+ };
16577
+
16578
+ 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
16579
  //# sourceMappingURL=index.modern.js.map