touchstudy-core 0.1.136 → 0.1.137

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 (73) hide show
  1. package/README.md +46 -46
  2. package/dist/.DS_Store +0 -0
  3. package/dist/components/.DS_Store +0 -0
  4. package/dist/components/Commons/NotFound.d.ts +1 -4
  5. package/dist/components/Print/PrintExamView2.d.ts +1 -2
  6. package/dist/containers/.DS_Store +0 -0
  7. package/dist/containers/Classes/configs/constants.d.ts +8 -1
  8. package/dist/containers/Classes/configs/types.d.ts +2 -0
  9. package/dist/containers/PreparedTextbook/components/Article.d.ts +3 -2
  10. package/dist/containers/PreparedTextbook/configs/enums.d.ts +1 -1
  11. package/dist/containers/PreparedTextbook/configs/functions.d.ts +2 -1
  12. package/dist/containers/PreparedTextbook/configs/types.d.ts +1 -0
  13. package/dist/containers/Users/configs/types.d.ts +2 -2
  14. package/dist/index.css +9 -9
  15. package/dist/index.js +1194 -1032
  16. package/dist/index.js.map +1 -1
  17. package/dist/index.modern.js +1209 -1050
  18. package/dist/index.modern.js.map +1 -1
  19. package/dist/redux/.DS_Store +0 -0
  20. package/dist/rootReducer.d.ts +2 -2
  21. package/dist/utils/.DS_Store +0 -0
  22. package/dist/utils/constants.d.ts +16 -0
  23. package/dist/utils/enums/academy.d.ts +6 -0
  24. package/dist/utils/enums/index.d.ts +1 -0
  25. package/dist/utils/hooks/useLanguage.d.ts +1 -0
  26. package/dist/utils/types/index.d.ts +1 -0
  27. package/package.json +102 -102
  28. package/dist/StudyTouch_Character_v1_Question~jLFvuYmI.png +0 -0
  29. package/dist/components/Chats/ChatHeader.d.ts +0 -25
  30. package/dist/components/Chats/ChatItem.d.ts +0 -31
  31. package/dist/components/Chats/ChatLeftItem.d.ts +0 -4
  32. package/dist/components/Chats/ChatList.d.ts +0 -14
  33. package/dist/components/Chats/ChatRightItem.d.ts +0 -4
  34. package/dist/components/Chats/InputChat.d.ts +0 -16
  35. package/dist/components/Chats/components/CustomTooltip.d.ts +0 -2
  36. package/dist/components/CkEditor/CkEditor.d.ts +0 -19
  37. package/dist/components/CkEditor/config.d.ts +0 -19
  38. package/dist/components/CkEditor/index.d.ts +0 -2
  39. package/dist/components/ErrorHandler.d.ts +0 -6
  40. package/dist/components/LabelRequired.d.ts +0 -8
  41. package/dist/components/Selectors/InActiveAcademySelector.d.ts +0 -16
  42. package/dist/containers/Academies/hooks/usePassCodeDialog.d.ts +0 -10
  43. package/dist/containers/ExamResult/components/MyAnswer/components/CreateNewQuestion.d.ts +0 -15
  44. package/dist/containers/Exams/configs/types.d.ts +0 -22
  45. package/dist/containers/PreparedTextbook/apiClients/academyService.d.ts +0 -1
  46. package/dist/containers/PreparedTextbook/components/TextbookOwners.d.ts +0 -13
  47. package/dist/containers/Users/components/Dialogs/DeleteUserCsvDialog.d.ts +0 -10
  48. package/dist/containers/Users/components/Dialogs/RecentUserActionDialog.d.ts +0 -9
  49. package/dist/containers/Users/components/Dialogs/UserDialog.d.ts +0 -12
  50. package/dist/tests/performances/do-exam-session-list-student.d.ts +0 -19
  51. package/dist/tests/performances/do-exam-session-request-answer-one-time.d.ts +0 -19
  52. package/dist/tests/performances/do-exam-session-skip-answer.d.ts +0 -19
  53. package/dist/tests/performances/do-exam-session2.d.ts +0 -19
  54. package/dist/utils/canAccessRoute.d.ts +0 -2
  55. package/dist/utils/diffFromNow.d.ts +0 -3
  56. package/dist/utils/encodeParams.d.ts +0 -2
  57. package/dist/utils/formatTime.d.ts +0 -4
  58. package/dist/utils/getAcademyDomain.d.ts +0 -2
  59. package/dist/utils/getAccessToken.d.ts +0 -2
  60. package/dist/utils/getErrorMessage.d.ts +0 -1
  61. package/dist/utils/getLanguage.d.ts +0 -2
  62. package/dist/utils/getLearningSpace.d.ts +0 -2
  63. package/dist/utils/getRedirectUrl.d.ts +0 -2
  64. package/dist/utils/helpers.d.ts +0 -22
  65. package/dist/utils/isLocalHost.d.ts +0 -2
  66. package/dist/utils/minutesToTimeSpan.d.ts +0 -2
  67. package/dist/utils/pusherTo.d.ts +0 -1
  68. package/dist/utils/times.d.ts +0 -6
  69. package/dist/utils/toISOString.d.ts +0 -2
  70. package/dist/utils/toLocalTime.d.ts +0 -1
  71. package/dist/utils/types/checkSuperUrl.d.ts +0 -1
  72. package/dist/utils/types.d.ts +0 -9
  73. package/dist/utils/utcToLocalTime.d.ts +0 -2
@@ -14,19 +14,19 @@ import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
14
14
  export { DemoContainer } from '@mui/x-date-pickers/internals/demo';
15
15
  import React__default, { useState, useEffect, Fragment as Fragment$1, useRef, useCallback, useMemo, createElement, memo } from 'react';
16
16
  import { useTheme, Container, Typography, Stack, List, ListItem, FormGroup, FormControlLabel, Checkbox, Button, Box, Dialog, DialogTitle, IconButton, DialogContent, TextField, DialogActions, styled, FormLabel, Pagination, Paper, InputBase, Tooltip, tooltipClasses, Grid, ClickAwayListener, useMediaQuery, CircularProgress, InputAdornment, Card as Card$1, Avatar, Table, TableHead, TableRow, TableCell, TableBody, TableContainer, RadioGroup, Radio, FormControl, InputLabel, Chip, Accordion, AccordionSummary, AccordionDetails, Select as Select$1, MenuItem, Switch, Tabs, Tab, Divider, CardMedia as CardMedia$1, MenuList } from '@mui/material';
17
- import { useDispatch, useSelector } from 'react-redux';
18
17
  import moment from 'moment';
19
18
  export { default as moment } from 'moment';
20
- import 'moment/locale/ko.js';
21
- import 'moment/locale/en-au.js';
22
- import _$5 from 'lodash';
23
19
  import { FaSave, FaCaretDown, FaTimes, FaTrash, FaSortUp, FaSortDown, FaPlus, FaPlusCircle, FaUpload, FaEye as FaEye$1, FaPencilAlt, FaShare, FaExchangeAlt, FaBookOpen } from 'react-icons/fa';
24
20
  import { IoMdArrowBack, IoIosAdd, IoMdAdd, IoIosAlert, IoIosArrowDown, IoIosSearch, IoIosArrowUp } from 'react-icons/io';
25
21
  import { IoClose, IoSearch, IoCloseOutline, IoChevronUp, IoChevronDown, IoChatbubbleEllipsesSharp, IoPrint, IoWarning, IoCheckmarkCircle, IoChevronUpOutline, IoChevronDownOutline, IoReceiptSharp, IoBook, IoCalendarClear, IoPerson, IoInformationCircle, IoTrash, IoAddCircle, IoCloseCircle, IoLogOut } from 'react-icons/io5';
22
+ import { useSelector, useDispatch } from 'react-redux';
26
23
  import Select, { components } from 'react-select';
27
24
  import CreatableSelect from 'react-select/creatable';
28
25
  import axios from 'axios';
26
+ import _$5 from 'lodash';
29
27
  import { useGoogleLogout, GoogleLogin } from '@leecheuk/react-google-login';
28
+ import 'moment/locale/ko.js';
29
+ import 'moment/locale/en-au.js';
30
30
  import { Formik, Form, Field, FieldArray } from 'formik';
31
31
  import { AutoSizer } from 'react-virtualized';
32
32
  import tinymce from 'tinymce';
@@ -824,7 +824,7 @@ var delete_users_csv = "사용자 CSV 삭제";
824
824
  var are_you_sure_to_delete_users = "사용자를 삭제하시겠습니까?";
825
825
  var enter_phone_number = "전화번호를 입력하세요";
826
826
  var enter_school_name = "학교 이름을 입력하세요";
827
- var enter_grade = "성적 입력";
827
+ var enter_grade = "성적 입력 (먼저 학교 이름을 입력하세요)";
828
828
  var enter_major_name = "부서명을 입력하세요";
829
829
  var enter_parent_name = "부모 이름을 입력하세요";
830
830
  var enter_parent_phone_number = "부모 전화번호를 입력하세요";
@@ -1401,7 +1401,7 @@ var math = "수학";
1401
1401
  var korea = "한국";
1402
1402
  var fix_this_information_for_this_book = "이 책에 대한 정보 수정";
1403
1403
  var slect_school = "학교를 선택하세요";
1404
- var elemantary_school = "초등학교";
1404
+ var elementary_school = "초등학교";
1405
1405
  var middle_school = "중학교";
1406
1406
  var high_school = "고등학교";
1407
1407
  var question_type_search_keyword = "질문 유형 검색 키워드";
@@ -1426,6 +1426,18 @@ var current_correct_answer_entered = "현재 입력한 정답";
1426
1426
  var correct_answer_is_required = "정답은 필수입니다.";
1427
1427
  var cancel_2 = "취소하기";
1428
1428
  var article_required = "기사가 필요합니다";
1429
+ var elementary_school_1st_grade = "초등학교 1학년";
1430
+ var elementary_school_2nd_grade = "초등학교 2학년";
1431
+ var elementary_school_3rd_grade = "초등학교 3학년";
1432
+ var elementary_school_4th_grade = "초등학교 4학년";
1433
+ var elementary_school_5th_grade = "초등학교 5학년";
1434
+ var elementary_school_6th_grade = "초등학교 6학년";
1435
+ var middle_school_1st_grade = "중학교 1학년";
1436
+ var middle_school_2nd_grade = "중학교 2학년";
1437
+ var middle_school_3rd_grade = "중학교 3학년";
1438
+ var high_school_1st_grade = "고등학교 1학년";
1439
+ var high_school_2nd_grade = "고등학교 2학년";
1440
+ var high_school_3rd_grade = "고등학교 3학년";
1429
1441
  var lang_ko = {
1430
1442
  problem_solving: problem_solving,
1431
1443
  my_story: my_story,
@@ -2462,7 +2474,7 @@ var lang_ko = {
2462
2474
  korea: korea,
2463
2475
  fix_this_information_for_this_book: fix_this_information_for_this_book,
2464
2476
  slect_school: slect_school,
2465
- elemantary_school: elemantary_school,
2477
+ elementary_school: elementary_school,
2466
2478
  middle_school: middle_school,
2467
2479
  high_school: high_school,
2468
2480
  question_type_search_keyword: question_type_search_keyword,
@@ -2486,7 +2498,19 @@ var lang_ko = {
2486
2498
  current_correct_answer_entered: current_correct_answer_entered,
2487
2499
  correct_answer_is_required: correct_answer_is_required,
2488
2500
  cancel_2: cancel_2,
2489
- article_required: article_required
2501
+ article_required: article_required,
2502
+ elementary_school_1st_grade: elementary_school_1st_grade,
2503
+ elementary_school_2nd_grade: elementary_school_2nd_grade,
2504
+ elementary_school_3rd_grade: elementary_school_3rd_grade,
2505
+ elementary_school_4th_grade: elementary_school_4th_grade,
2506
+ elementary_school_5th_grade: elementary_school_5th_grade,
2507
+ elementary_school_6th_grade: elementary_school_6th_grade,
2508
+ middle_school_1st_grade: middle_school_1st_grade,
2509
+ middle_school_2nd_grade: middle_school_2nd_grade,
2510
+ middle_school_3rd_grade: middle_school_3rd_grade,
2511
+ high_school_1st_grade: high_school_1st_grade,
2512
+ high_school_2nd_grade: high_school_2nd_grade,
2513
+ high_school_3rd_grade: high_school_3rd_grade
2490
2514
  };
2491
2515
 
2492
2516
  var problem_solving$1 = "Problem Solving";
@@ -2990,7 +3014,7 @@ var delete_users_csv$1 = "Delete users csv";
2990
3014
  var are_you_sure_to_delete_users$1 = "Are you sure to delete users?";
2991
3015
  var enter_phone_number$1 = "Enter phone number";
2992
3016
  var enter_school_name$1 = "Enter school name";
2993
- var enter_grade$1 = "Enter grade";
3017
+ var enter_grade$1 = "Enter grade (please enter school name first)";
2994
3018
  var enter_major_name$1 = "Enter department name";
2995
3019
  var enter_parent_name$1 = "Enter parent name";
2996
3020
  var enter_parent_phone_number$1 = "Enter parent phone number";
@@ -3545,7 +3569,7 @@ var math$1 = "Math";
3545
3569
  var korea$1 = "Korea";
3546
3570
  var fix_this_information_for_this_book$1 = "Fix this information for this book";
3547
3571
  var slect_school$1 = "Select school";
3548
- var elemantary_school$1 = "Elemantary School";
3572
+ var elementary_school$1 = "Elementary School";
3549
3573
  var middle_school$1 = "Middle School";
3550
3574
  var high_school$1 = "High School";
3551
3575
  var question_type_search_keyword$1 = "Question type search keyword";
@@ -3570,6 +3594,18 @@ var current_correct_answer_entered$1 = "Current correct answer entered";
3570
3594
  var correct_answer_is_required$1 = "Correct answer is required";
3571
3595
  var cancel_2$1 = "Cancel";
3572
3596
  var article_required$1 = "Article is required";
3597
+ var elementary_school_1st_grade$1 = "Elementary school 1st grade";
3598
+ var elementary_school_2nd_grade$1 = "Elementary school 2nd grade";
3599
+ var elementary_school_3rd_grade$1 = "Elementary school 3rd grade";
3600
+ var elementary_school_4th_grade$1 = "Elementary school 4th grade";
3601
+ var elementary_school_5th_grade$1 = "Elementary school 5th grade";
3602
+ var elementary_school_6th_grade$1 = "Elementary school th grade";
3603
+ var middle_school_1st_grade$1 = "Middle school 1st grade";
3604
+ var middle_school_2nd_grade$1 = "Middle school 2nd grade";
3605
+ var middle_school_3rd_grade$1 = "Middle school 3rd grade";
3606
+ var high_school_1st_grade$1 = "High school 1st grade";
3607
+ var high_school_2nd_grade$1 = "High school 2nd grade";
3608
+ var high_school_3rd_grade$1 = "High school 3rd grade";
3573
3609
  var lang_en = {
3574
3610
  problem_solving: problem_solving$1,
3575
3611
  my_story: my_story$1,
@@ -4608,7 +4644,7 @@ var lang_en = {
4608
4644
  korea: korea$1,
4609
4645
  fix_this_information_for_this_book: fix_this_information_for_this_book$1,
4610
4646
  slect_school: slect_school$1,
4611
- elemantary_school: elemantary_school$1,
4647
+ elementary_school: elementary_school$1,
4612
4648
  middle_school: middle_school$1,
4613
4649
  high_school: high_school$1,
4614
4650
  question_type_search_keyword: question_type_search_keyword$1,
@@ -4632,7 +4668,19 @@ var lang_en = {
4632
4668
  current_correct_answer_entered: current_correct_answer_entered$1,
4633
4669
  correct_answer_is_required: correct_answer_is_required$1,
4634
4670
  cancel_2: cancel_2$1,
4635
- article_required: article_required$1
4671
+ article_required: article_required$1,
4672
+ elementary_school_1st_grade: elementary_school_1st_grade$1,
4673
+ elementary_school_2nd_grade: elementary_school_2nd_grade$1,
4674
+ elementary_school_3rd_grade: elementary_school_3rd_grade$1,
4675
+ elementary_school_4th_grade: elementary_school_4th_grade$1,
4676
+ elementary_school_5th_grade: elementary_school_5th_grade$1,
4677
+ elementary_school_6th_grade: elementary_school_6th_grade$1,
4678
+ middle_school_1st_grade: middle_school_1st_grade$1,
4679
+ middle_school_2nd_grade: middle_school_2nd_grade$1,
4680
+ middle_school_3rd_grade: middle_school_3rd_grade$1,
4681
+ high_school_1st_grade: high_school_1st_grade$1,
4682
+ high_school_2nd_grade: high_school_2nd_grade$1,
4683
+ high_school_3rd_grade: high_school_3rd_grade$1
4636
4684
  };
4637
4685
 
4638
4686
  i18n.use(initReactI18next).init({
@@ -4651,30 +4699,498 @@ i18n.use(initReactI18next).init({
4651
4699
  }
4652
4700
  });
4653
4701
 
4654
- function _extends() {
4655
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
4656
- for (var e = 1; e < arguments.length; e++) {
4657
- var t = arguments[e];
4658
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
4702
+ var PrintState;
4703
+ (function (PrintState) {
4704
+ PrintState[PrintState["Idling"] = 0] = "Idling";
4705
+ PrintState[PrintState["Stopped"] = 1] = "Stopped";
4706
+ PrintState[PrintState["Printing"] = 2] = "Printing";
4707
+ PrintState[PrintState["Paused"] = 3] = "Paused";
4708
+ })(PrintState || (PrintState = {}));
4709
+
4710
+ var PreparedType;
4711
+ (function (PreparedType) {
4712
+ PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
4713
+ PreparedType[PreparedType["official_mock_exam"] = 2] = "official_mock_exam";
4714
+ PreparedType[PreparedType["private_mock_exam"] = 3] = "private_mock_exam";
4715
+ })(PreparedType || (PreparedType = {}));
4716
+
4717
+ var ExamEvent;
4718
+ (function (ExamEvent) {
4719
+ ExamEvent["StartExam"] = "start-exam";
4720
+ ExamEvent["TerminateExam"] = "terminate-exam";
4721
+ ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
4722
+ ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
4723
+ })(ExamEvent || (ExamEvent = {}));
4724
+
4725
+ var ExamStatus;
4726
+ (function (ExamStatus) {
4727
+ ExamStatus[ExamStatus["Default"] = 0] = "Default";
4728
+ ExamStatus[ExamStatus["Pending"] = 1] = "Pending";
4729
+ ExamStatus[ExamStatus["InProgress"] = 2] = "InProgress";
4730
+ ExamStatus[ExamStatus["Completed"] = 3] = "Completed";
4731
+ })(ExamStatus || (ExamStatus = {}));
4732
+ var QuestionAnswerType;
4733
+ (function (QuestionAnswerType) {
4734
+ QuestionAnswerType[QuestionAnswerType["SingleChoice"] = 0] = "SingleChoice";
4735
+ QuestionAnswerType[QuestionAnswerType["MultipleChoice"] = 1] = "MultipleChoice";
4736
+ QuestionAnswerType[QuestionAnswerType["ShortAnswer"] = 2] = "ShortAnswer";
4737
+ })(QuestionAnswerType || (QuestionAnswerType = {}));
4738
+
4739
+ var OrderType;
4740
+ (function (OrderType) {
4741
+ OrderType["ASC"] = "ASC";
4742
+ OrderType["DESC"] = "DESC";
4743
+ })(OrderType || (OrderType = {}));
4744
+
4745
+ var RecentUserAction;
4746
+ (function (RecentUserAction) {
4747
+ RecentUserAction["ViewedUser"] = "ViewedUser";
4748
+ RecentUserAction["ViewedQNA"] = "ViewedQNA";
4749
+ RecentUserAction["ViewedExamResult"] = "ViewedExamResult";
4750
+ RecentUserAction["PrintedExamResult"] = "PrintedExamResult";
4751
+ RecentUserAction["ViewedAttendance"] = "ViewedAttendance";
4752
+ })(RecentUserAction || (RecentUserAction = {}));
4753
+
4754
+ var UserSortColumn;
4755
+ (function (UserSortColumn) {
4756
+ UserSortColumn["CreatedAt"] = "CreatedAt";
4757
+ UserSortColumn["FullName"] = "FullName";
4758
+ UserSortColumn["PhoneNumber"] = "PhoneNumber";
4759
+ UserSortColumn["Email"] = "Email";
4760
+ UserSortColumn["SchoolName"] = "SchoolName";
4761
+ UserSortColumn["Major"] = "Major";
4762
+ UserSortColumn["ParentName"] = "ParentName";
4763
+ UserSortColumn["ParentPhoneNumber"] = "ParentPhoneNumber";
4764
+ UserSortColumn["Grade"] = "Grade";
4765
+ })(UserSortColumn || (UserSortColumn = {}));
4766
+
4767
+ var SchoolType;
4768
+ (function (SchoolType) {
4769
+ SchoolType[SchoolType["Default"] = 0] = "Default";
4770
+ SchoolType[SchoolType["Elementary"] = 1] = "Elementary";
4771
+ SchoolType[SchoolType["Middle"] = 2] = "Middle";
4772
+ SchoolType[SchoolType["High"] = 3] = "High";
4773
+ })(SchoolType || (SchoolType = {}));
4774
+
4775
+ var GOOGLE_RECAPTCHA_KEY = process.env.REACT_APP_GOOGLE_RECAPTCHA_KEY || "";
4776
+ var GOOGLE_CLIENT_ID = process.env.REACT_APP_GOOGLE_CLIENT_ID || "";
4777
+ var GOOGLE_RECAPTCHA_ID = process.env.REACT_APP_GOOGLE_RECAPTCHA_ID || "";
4778
+ var GOOGLE_RECAPTCHA_SECRET = process.env.REACT_APP_GOOGLE_RECAPTCHA_SECRET || "";
4779
+ var BASE_URL = process.env.REACT_APP_BASE_URL || "";
4780
+ var SUPER_ADMIN_BASE_URL = process.env.REACT_APP_SUPER_ADMIN_BASE_URL || "";
4781
+ var PUSHER_CONFIG = {
4782
+ cluster: process.env.REACT_APP_PUSHER_CONFIG_CLUSTER || "",
4783
+ key: process.env.REACT_APP_PUSHER_CONFIG_KEY || ""
4784
+ };
4785
+ var RELEASE_DATE = process.env.REACT_APP_RELEASE_VERSION || "";
4786
+ var ACCESS_TOKEN = "ACCESS_TOKEN";
4787
+ var ACADEMY_DOMAIN = "ACADEMY_DOMAIN";
4788
+ var LEARNING_SPACE = "LEARNING_SPACE";
4789
+ var REDIRECT_URL = "REDIRECT_URL";
4790
+ var PRE_REDIRECT_URL = "PRE_REDIRECT_URL";
4791
+ var LANGUAGE = "LANGUAGE";
4792
+ var AcademyHeaders = "Academy-Headers";
4793
+ var AcceptNoAcademy = "AcceptNoAcademy";
4794
+ var LanguageHeaders = "Accept-Language";
4795
+ var NoAcademyHeaders = "Accept-No-Academy";
4796
+ var DefaultErrorMessage = "an_unexpected_error_has_occurred";
4797
+ var DATE_MIN_VALUE = "0001-01-01T00:00:00+00:00";
4798
+ var DATE_TIME_MIN_VALUE = "0001-01-01T00:00:00";
4799
+ var EXAM_CHANNEL = "presence-exam-channel";
4800
+ var EXAM_STUDENT_CHANNEL = "EXAM-CHANNEL-{examCode}-STUDENT-{studentId}";
4801
+ var Role;
4802
+ (function (Role) {
4803
+ Role["Student"] = "Student";
4804
+ Role["Teacher"] = "Teacher";
4805
+ Role["Admin"] = "Admin";
4806
+ Role["AcademyAdmin"] = "AcademyAdmin";
4807
+ Role["AcademyAdminTeacher"] = "AcademyAdmin/Teacher";
4808
+ })(Role || (Role = {}));
4809
+ var Language;
4810
+ (function (Language) {
4811
+ Language["ko"] = "ko";
4812
+ Language["en"] = "en";
4813
+ })(Language || (Language = {}));
4814
+ var RecentUserActionNames = {
4815
+ ViewedUser: "viewed_user",
4816
+ ViewedQNA: "viewed_QNA",
4817
+ ViewedExamResult: "viewed_exam_result",
4818
+ PrintedExamResult: "printed_exam_result",
4819
+ ViewedAttendance: "viewed_attendance",
4820
+ UpdatedUser: "updated_user",
4821
+ CreatedNewUser: "created_new_user",
4822
+ ImportedUser: "imported_user",
4823
+ ImportedRemoveUser: "imported_remove_user",
4824
+ DeletedUser: "deleted_user",
4825
+ CompletedQNA: "completed_QNA",
4826
+ AnsweredQNA: "answered_QNA",
4827
+ RemoveMessageQNA: "remove_message_QNA",
4828
+ UpdateMessageQNA: "update_message_QNA",
4829
+ UpdatedAttendance: "updated_attendance",
4830
+ AddedTeacherToClass: "added_teacher_to_class",
4831
+ RemovedTeacherFromClass: "removed_teacher_from_class",
4832
+ AddedStudentToClass: "added_student_to_class",
4833
+ RemovedStudentFromClass: "removed_student_from_class"
4834
+ };
4835
+ var PrintHeaderClassName = "print-header";
4836
+ var PrintTitleClassName = "print-title";
4837
+ var PrintContentClassName = "print-content";
4838
+ var PrintContainerClassName = "print-container";
4839
+ var DEFAULT_PAGING_RESPONSE = {
4840
+ page: 0,
4841
+ limit: 0,
4842
+ totalItems: 0,
4843
+ totalPages: 0
4844
+ };
4845
+ var SCHOOL_OPTIONS = [{
4846
+ label: "elementary_school",
4847
+ value: SchoolType.Elementary
4848
+ }, {
4849
+ label: "middle_school",
4850
+ value: SchoolType.Middle
4851
+ }, {
4852
+ label: "high_school",
4853
+ value: SchoolType.High
4854
+ }];
4855
+ var ELEMENTARY_GRADES = [{
4856
+ label: "elementary_school_1st_grade",
4857
+ value: 1
4858
+ }, {
4859
+ label: "elementary_school_2nd_grade",
4860
+ value: 2
4861
+ }, {
4862
+ label: "elementary_school_3rd_grade",
4863
+ value: 3
4864
+ }, {
4865
+ label: "elementary_school_4th_grade",
4866
+ value: 4
4867
+ }, {
4868
+ label: "elementary_school_5th_grade",
4869
+ value: 5
4870
+ }, {
4871
+ label: "elementary_school_6th_grade",
4872
+ value: 6
4873
+ }];
4874
+ var MIDDLE_GRADES = [{
4875
+ label: "middle_school_1st_grade",
4876
+ value: 1
4877
+ }, {
4878
+ label: "middle_school_2nd_grade",
4879
+ value: 2
4880
+ }, {
4881
+ label: "middle_school_3rd_grade",
4882
+ value: 3
4883
+ }];
4884
+ var HIGH_GRADES = [{
4885
+ label: "high_school_1st_grade",
4886
+ value: 1
4887
+ }, {
4888
+ label: "high_school_2nd_grade",
4889
+ value: 2
4890
+ }, {
4891
+ label: "high_school_3rd_grade",
4892
+ value: 3
4893
+ }];
4894
+
4895
+ var utcToLocalTime = (function (time, FORMAT) {
4896
+ if (time === DATE_MIN_VALUE || time === DATE_TIME_MIN_VALUE) return "";
4897
+ try {
4898
+ return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
4899
+ } catch (_unused) {
4900
+ return "";
4901
+ }
4902
+ });
4903
+
4904
+ var TabList = [{
4905
+ label: "comprehensive_analysis",
4906
+ value: 0
4907
+ }, {
4908
+ label: "solution_order",
4909
+ value: 1
4910
+ }, {
4911
+ label: "compare_solution",
4912
+ value: 2
4913
+ }, {
4914
+ label: "problem_analysis",
4915
+ value: 3
4916
+ }];
4917
+
4918
+ var TOTAL = 3;
4919
+ var PrintExamView2 = function PrintExamView2(_ref) {
4920
+ var role = _ref.role,
4921
+ dataExamSession = _ref.dataExamSession;
4922
+ var _useTranslation = useTranslation(),
4923
+ t = _useTranslation.t;
4924
+ var isTeacher = Role.Teacher === role;
4925
+ var dataProps = isTeacher ? dataExamSession.map(function (i) {
4926
+ return {
4927
+ studentId: i === null || i === void 0 ? void 0 : i.studentId,
4928
+ examSessionId: i === null || i === void 0 ? void 0 : i.examSessionId
4929
+ };
4930
+ }) : dataExamSession.map(function (i) {
4931
+ return {
4932
+ code: i === null || i === void 0 ? void 0 : i.code
4933
+ };
4934
+ });
4935
+ var _useState = useState(dataProps),
4936
+ data = _useState[0],
4937
+ setData = _useState[1];
4938
+ var _useState2 = useState([]),
4939
+ completed = _useState2[0],
4940
+ setCompleted = _useState2[1];
4941
+ var _useState3 = useState([]),
4942
+ inprogress = _useState3[0],
4943
+ setInProgress = _useState3[1];
4944
+ var _useState4 = useState(PrintState.Idling),
4945
+ state = _useState4[0],
4946
+ setState = _useState4[1];
4947
+ var _useState5 = useState([]),
4948
+ errorLinks = _useState5[0],
4949
+ setErrorLinks = _useState5[1];
4950
+ var _useState6 = useState([]),
4951
+ status = _useState6[0],
4952
+ setStatus = _useState6[1];
4953
+ var theme = useTheme();
4954
+ var handleChangeStatus = function handleChangeStatus(event) {
4955
+ if (event.target.checked) {
4956
+ setStatus(function (prev) {
4957
+ var _event$target;
4958
+ return [].concat(prev, [(_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value]);
4959
+ });
4960
+ } else setStatus(function (prev) {
4961
+ return prev === null || prev === void 0 ? void 0 : prev.filter(function (i) {
4962
+ var _event$target2;
4963
+ return i !== ((_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.value);
4964
+ });
4965
+ });
4966
+ };
4967
+ var handleProgressPrint = function handleProgressPrint() {
4968
+ setData(dataProps);
4969
+ setCompleted([]);
4970
+ setInProgress([]);
4971
+ setErrorLinks([]);
4972
+ setState(PrintState.Printing);
4973
+ };
4974
+ var print = function print(_ref2) {
4975
+ var examSessionId = _ref2.examSessionId,
4976
+ studentId = _ref2.studentId,
4977
+ code = _ref2.code;
4978
+ var width = 200;
4979
+ var height = 200;
4980
+ var left = window.screenX + window.outerWidth / 2 - width / 2;
4981
+ var top = window.screenY + window.outerHeight / 2 - height / 2;
4982
+ var url = isTeacher ? window.location.origin + "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print?status=" + status.join(",") : window.location.origin + "/student/exam-results/" + code + "/print";
4983
+ var windowName = isTeacher ? "popup-" + examSessionId + "-" + studentId : "popup-" + code;
4984
+ var windowSpecs = "left=" + left + ",top=" + top + ",width=" + width + ",height=" + height + ",location=yes,resizable=yes,scrollbars=yes,status=yes";
4985
+ var childWindow = window.open(url, windowName, windowSpecs);
4986
+ if (childWindow == null) {
4987
+ setErrorLinks(function (prev) {
4988
+ return [].concat(prev, [{
4989
+ code: code,
4990
+ examSessionId: "" + examSessionId,
4991
+ studentId: "" + studentId,
4992
+ message: isTeacher ? "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print?status=" + status.join(",") : "/student/exam-results/" + code + "/print"
4993
+ }]);
4994
+ });
4995
+ if (!isTeacher) {
4996
+ setData(function (es) {
4997
+ return [].concat(es.filter(function (i) {
4998
+ return i.code !== code;
4999
+ }));
5000
+ });
5001
+ } else {
5002
+ setData(function (es) {
5003
+ return [].concat(es.filter(function (i) {
5004
+ return i.examSessionId !== examSessionId || i.studentId !== studentId;
5005
+ }));
5006
+ });
5007
+ }
5008
+ return;
4659
5009
  }
4660
- return n;
4661
- }, _extends.apply(null, arguments);
4662
- }
4663
- function _objectDestructuringEmpty(t) {
4664
- if (null == t) throw new TypeError("Cannot destructure " + t);
4665
- }
4666
- function _objectWithoutPropertiesLoose(r, e) {
4667
- if (null == r) return {};
4668
- var t = {};
4669
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
4670
- if (-1 !== e.indexOf(n)) continue;
4671
- t[n] = r[n];
5010
+ if (!isTeacher) {
5011
+ setInProgress(function (es) {
5012
+ return [].concat(es.filter(function (i) {
5013
+ return i.code !== code;
5014
+ }), [{
5015
+ code: code
5016
+ }]);
5017
+ });
5018
+ setData(function (es) {
5019
+ return [].concat(es.filter(function (i) {
5020
+ return i.code !== code;
5021
+ }));
5022
+ });
5023
+ } else {
5024
+ setInProgress(function (es) {
5025
+ return [].concat(es.filter(function (i) {
5026
+ return i.examSessionId !== examSessionId || i.studentId !== studentId;
5027
+ }), [{
5028
+ examSessionId: examSessionId,
5029
+ studentId: studentId
5030
+ }]);
5031
+ });
5032
+ setData(function (es) {
5033
+ return [].concat(es.filter(function (i) {
5034
+ return i.examSessionId !== examSessionId || i.studentId !== studentId;
5035
+ }));
5036
+ });
5037
+ }
5038
+ window.addEventListener("message", function (event) {
5039
+ var isCheck = isTeacher ? event.data.examSessionId !== "" + examSessionId || event.data.studentId !== "" + studentId : event.data.code !== "" + code;
5040
+ if (event.origin !== window.location.origin || isCheck) {
5041
+ return;
5042
+ }
5043
+ if (event.data.succeed) {
5044
+ if (!isTeacher) {
5045
+ setCompleted(function (es) {
5046
+ return [].concat(es.filter(function (i) {
5047
+ return i.code !== code;
5048
+ }), [{
5049
+ code: code
5050
+ }]);
5051
+ });
5052
+ setInProgress(function (es) {
5053
+ return [].concat(es.filter(function (i) {
5054
+ return i.code !== code;
5055
+ }));
5056
+ });
5057
+ } else {
5058
+ setCompleted(function (es) {
5059
+ return [].concat(es.filter(function (i) {
5060
+ return i.examSessionId !== examSessionId || i.studentId !== studentId;
5061
+ }), [{
5062
+ examSessionId: examSessionId,
5063
+ studentId: studentId
5064
+ }]);
5065
+ });
5066
+ setInProgress(function (es) {
5067
+ return [].concat(es.filter(function (i) {
5068
+ return i.examSessionId !== examSessionId || i.studentId !== studentId;
5069
+ }));
5070
+ });
5071
+ }
5072
+ } else {
5073
+ setErrorLinks(function (prev) {
5074
+ var _event$data, _event$data2;
5075
+ return [].concat(prev, [{
5076
+ code: (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.code,
5077
+ examSessionId: (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.examSessionId,
5078
+ studentId: "" + studentId,
5079
+ message: isTeacher ? "/teacher/exam-results/" + event.data.examSessionId + "/students/" + event.data.studentId + "/print?status=" + status.join(",") : "/student/exam-results/" + event.data.code + "/print"
5080
+ }]);
5081
+ });
5082
+ }
5083
+ childWindow === null || childWindow === void 0 ? void 0 : childWindow.close();
5084
+ });
5085
+ };
5086
+ useEffect(function () {
5087
+ if (inprogress.length < TOTAL && data.length > 0 && state === PrintState.Printing) {
5088
+ var item = data[0];
5089
+ print({
5090
+ examSessionId: item === null || item === void 0 ? void 0 : item.examSessionId,
5091
+ studentId: item === null || item === void 0 ? void 0 : item.studentId,
5092
+ code: item === null || item === void 0 ? void 0 : item.code
5093
+ });
5094
+ }
5095
+ }, [inprogress.length, completed.length, data.length, state, data]);
5096
+ return React__default.createElement(Container, null, state === PrintState.Idling ? React__default.createElement(Typography, null, t("total_number_of_selected_results") + ": ", " ", React__default.createElement("span", {
5097
+ className: "fw-bold"
5098
+ }, t("number_results", {
5099
+ number: ("" + data.length).padStart(2, "0")
5100
+ }))) : React__default.createElement(Fragment$1, null, React__default.createElement(Typography, null, t("completed") + ": ", React__default.createElement("span", {
5101
+ className: "fw-bold"
5102
+ }, t("number_results", {
5103
+ number: ("" + completed.length).padStart(2, "0")
5104
+ }))), React__default.createElement(Typography, null, t("in_progress") + ": ", React__default.createElement("span", {
5105
+ className: "fw-bold"
5106
+ }, t("number_results", {
5107
+ number: ("" + inprogress.length).padStart(2, "0")
5108
+ }))), React__default.createElement(Typography, null, t("remaining") + ": ", React__default.createElement("span", {
5109
+ className: "fw-bold"
5110
+ }, t("number_results", {
5111
+ number: ("" + data.length).padStart(2, "0")
5112
+ })))), !!errorLinks.length && React__default.createElement(Stack, {
5113
+ className: "mt-2"
5114
+ }, React__default.createElement(Typography, {
5115
+ fontWeight: 700
5116
+ }, t("download_failed"), ":"), Array.from(new Set(errorLinks)).map(function (i, index) {
5117
+ var _info$createdBy;
5118
+ var info = isTeacher ? dataExamSession.find(function (exam) {
5119
+ return "" + (exam === null || exam === void 0 ? void 0 : exam.examSessionId) === "" + (i === null || i === void 0 ? void 0 : i.examSessionId) && "" + (exam === null || exam === void 0 ? void 0 : exam.studentId) === "" + (i === null || i === void 0 ? void 0 : i.studentId);
5120
+ }) : dataExamSession.find(function (exam) {
5121
+ return (exam === null || exam === void 0 ? void 0 : exam.code) === (i === null || i === void 0 ? void 0 : i.code);
5122
+ });
5123
+ return React__default.createElement(Stack, {
5124
+ key: index,
5125
+ borderBottom: 1,
5126
+ borderColor: theme.palette.grey[500]
5127
+ }, React__default.createElement("a", {
5128
+ href: i.message,
5129
+ target: "_blank",
5130
+ rel: "noopener noreferrer"
5131
+ }, (info === null || info === void 0 ? void 0 : info.studentName) || (info === null || info === void 0 ? void 0 : (_info$createdBy = info.createdBy) === null || _info$createdBy === void 0 ? void 0 : _info$createdBy.fullName)), (info === null || info === void 0 ? void 0 : info.title) && React__default.createElement(Typography, null, t("exam") + ": " + (info === null || info === void 0 ? void 0 : info.title)), (info === null || info === void 0 ? void 0 : info.startTime) && React__default.createElement(Typography, null, t("start_time") + ": " + utcToLocalTime(info === null || info === void 0 ? void 0 : info.startTime, t("date_time_format"))));
5132
+ })), React__default.createElement(Stack, {
5133
+ direction: "column",
5134
+ className: "mt-3"
5135
+ }, React__default.createElement(Stack, null, React__default.createElement(Typography, {
5136
+ className: "fw-bold"
5137
+ }, React__default.createElement("span", {
5138
+ className: "text-danger me-1"
5139
+ }, "*"), t("your_browser_must"), ":"), React__default.createElement(List, {
5140
+ className: "ps-3 pt-0"
5141
+ }, React__default.createElement(ListItem, {
5142
+ disablePadding: true
5143
+ }, t("allowed_to_send_pop_ups_and_use_redirects")), React__default.createElement(ListItem, {
5144
+ disablePadding: true
5145
+ }, t("disable_ask_where_to_save_each_file_before_downloading")))), isTeacher && React__default.createElement(Stack, null, React__default.createElement(Typography, {
5146
+ fontWeight: 700
5147
+ }, t("choose_to_print"), ":"), React__default.createElement(FormGroup, {
5148
+ sx: {
5149
+ display: "flex",
5150
+ flexDirection: "row",
5151
+ gap: 1,
5152
+ flexWrap: "wrap"
5153
+ }
5154
+ }, TabList.map(function (_ref3, index) {
5155
+ var label = _ref3.label,
5156
+ value = _ref3.value;
5157
+ return React__default.createElement(FormControlLabel, {
5158
+ key: index,
5159
+ control: React__default.createElement(Checkbox, {
5160
+ onChange: handleChangeStatus,
5161
+ value: value,
5162
+ checked: status.some(function (i) {
5163
+ return i === value.toString();
5164
+ })
5165
+ }),
5166
+ label: t(label)
5167
+ });
5168
+ }))), React__default.createElement(Button, {
5169
+ className: "mt-3",
5170
+ variant: "contained",
5171
+ onClick: handleProgressPrint
5172
+ }, t("print_pdf"))));
5173
+ };
5174
+
5175
+ 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","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","btn-login-google":"_2HqmH","math-jax":"_3Pfdk","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"};
5176
+
5177
+ var config = {
5178
+ loader: {
5179
+ load: ["input/tex", "output/svg"]
4672
5180
  }
4673
- return t;
4674
- }
4675
- function _taggedTemplateLiteralLoose(e, t) {
4676
- return t || (t = e.slice(0)), e.raw = t, e;
4677
- }
5181
+ };
5182
+ var MathJaxContainer = function MathJaxContainer(_ref) {
5183
+ var content = _ref.content;
5184
+ return React__default.createElement(MathJaxContext, {
5185
+ config: config,
5186
+ asyncLoad: true
5187
+ }, React__default.createElement(MathJax, {
5188
+ id: "" + styles["math-jax"],
5189
+ dangerouslySetInnerHTML: {
5190
+ __html: content
5191
+ }
5192
+ }));
5193
+ };
4678
5194
 
4679
5195
  var LANGUAGES = [{
4680
5196
  code: "ko",
@@ -4696,795 +5212,6 @@ var LANGUAGES = [{
4696
5212
  var DEFAULT_LANGUAGE = LANGUAGES[0];
4697
5213
  var LOGIN_URL = "/login";
4698
5214
 
4699
- var pushTo = function pushTo(history, data, isReplace) {
4700
- if (isReplace === void 0) {
4701
- isReplace = false;
4702
- }
4703
- if (history.push && !isReplace || history.replace && isReplace) {
4704
- !isReplace && history.push(data);
4705
- isReplace && history.replace(data);
4706
- } else history(data, {
4707
- replace: isReplace
4708
- });
4709
- };
4710
-
4711
- var canAccess = function canAccess(userRoles, componentRoles) {
4712
- if (!Array.isArray(userRoles)) {
4713
- return false;
4714
- }
4715
- if (Array.isArray(componentRoles)) {
4716
- var intersects = userRoles.filter(function (i) {
4717
- return componentRoles.includes(i);
4718
- });
4719
- return intersects.length > 0;
4720
- }
4721
- return true;
4722
- };
4723
-
4724
- var checkSuperUrl = function checkSuperUrl(superUrls, pathname) {
4725
- return superUrls.some(function (i) {
4726
- if (i.includes(":")) {
4727
- var urls = i.split("/");
4728
- var names = pathname.split("/");
4729
- if (urls.length != names.length) return false;
4730
- var isMatches = true;
4731
- urls.forEach(function (u, index) {
4732
- if (u != names[index] && !u.startsWith(":")) isMatches = false;
4733
- });
4734
- return isMatches;
4735
- }
4736
- return pathname.startsWith(i);
4737
- });
4738
- };
4739
-
4740
- var GOOGLE_RECAPTCHA_KEY = process.env.REACT_APP_GOOGLE_RECAPTCHA_KEY || "";
4741
- var GOOGLE_CLIENT_ID = process.env.REACT_APP_GOOGLE_CLIENT_ID || "";
4742
- var GOOGLE_RECAPTCHA_ID = process.env.REACT_APP_GOOGLE_RECAPTCHA_ID || "";
4743
- var GOOGLE_RECAPTCHA_SECRET = process.env.REACT_APP_GOOGLE_RECAPTCHA_SECRET || "";
4744
- var BASE_URL = process.env.REACT_APP_BASE_URL || "";
4745
- var SUPER_ADMIN_BASE_URL = process.env.REACT_APP_SUPER_ADMIN_BASE_URL || "";
4746
- var PUSHER_CONFIG = {
4747
- cluster: process.env.REACT_APP_PUSHER_CONFIG_CLUSTER || "",
4748
- key: process.env.REACT_APP_PUSHER_CONFIG_KEY || ""
4749
- };
4750
- var RELEASE_DATE = process.env.REACT_APP_RELEASE_VERSION || "";
4751
- var ACCESS_TOKEN = "ACCESS_TOKEN";
4752
- var ACADEMY_DOMAIN = "ACADEMY_DOMAIN";
4753
- var LEARNING_SPACE = "LEARNING_SPACE";
4754
- var REDIRECT_URL = "REDIRECT_URL";
4755
- var PRE_REDIRECT_URL = "PRE_REDIRECT_URL";
4756
- var LANGUAGE = "LANGUAGE";
4757
- var AcademyHeaders = "Academy-Headers";
4758
- var AcceptNoAcademy = "AcceptNoAcademy";
4759
- var LanguageHeaders = "Accept-Language";
4760
- var NoAcademyHeaders = "Accept-No-Academy";
4761
- var DefaultErrorMessage = "an_unexpected_error_has_occurred";
4762
- var DATE_MIN_VALUE = "0001-01-01T00:00:00+00:00";
4763
- var DATE_TIME_MIN_VALUE = "0001-01-01T00:00:00";
4764
- var EXAM_CHANNEL = "presence-exam-channel";
4765
- var EXAM_STUDENT_CHANNEL = "EXAM-CHANNEL-{examCode}-STUDENT-{studentId}";
4766
- var Role;
4767
- (function (Role) {
4768
- Role["Student"] = "Student";
4769
- Role["Teacher"] = "Teacher";
4770
- Role["Admin"] = "Admin";
4771
- Role["AcademyAdmin"] = "AcademyAdmin";
4772
- Role["AcademyAdminTeacher"] = "AcademyAdmin/Teacher";
4773
- })(Role || (Role = {}));
4774
- var Language;
4775
- (function (Language) {
4776
- Language["ko"] = "ko";
4777
- Language["en"] = "en";
4778
- })(Language || (Language = {}));
4779
- var RecentUserActionNames = {
4780
- ViewedUser: "viewed_user",
4781
- ViewedQNA: "viewed_QNA",
4782
- ViewedExamResult: "viewed_exam_result",
4783
- PrintedExamResult: "printed_exam_result",
4784
- ViewedAttendance: "viewed_attendance",
4785
- UpdatedUser: "updated_user",
4786
- CreatedNewUser: "created_new_user",
4787
- ImportedUser: "imported_user",
4788
- ImportedRemoveUser: "imported_remove_user",
4789
- DeletedUser: "deleted_user",
4790
- CompletedQNA: "completed_QNA",
4791
- AnsweredQNA: "answered_QNA",
4792
- RemoveMessageQNA: "remove_message_QNA",
4793
- UpdateMessageQNA: "update_message_QNA",
4794
- UpdatedAttendance: "updated_attendance",
4795
- AddedTeacherToClass: "added_teacher_to_class",
4796
- RemovedTeacherFromClass: "removed_teacher_from_class",
4797
- AddedStudentToClass: "added_student_to_class",
4798
- RemovedStudentFromClass: "removed_student_from_class"
4799
- };
4800
- var PrintHeaderClassName = "print-header";
4801
- var PrintTitleClassName = "print-title";
4802
- var PrintContentClassName = "print-content";
4803
- var PrintContainerClassName = "print-container";
4804
- var DEFAULT_PAGING_RESPONSE = {
4805
- page: 0,
4806
- limit: 0,
4807
- totalItems: 0,
4808
- totalPages: 0
4809
- };
4810
-
4811
- var diffFromNow = (function (time, unitOfTime, targetTime) {
4812
- if (time === DATE_MIN_VALUE || targetTime === DATE_MIN_VALUE) return 0;
4813
- try {
4814
- var now = !targetTime ? moment() : moment.utc(targetTime).local();
4815
- return now.diff(moment.utc(time).local(), unitOfTime);
4816
- } catch (_unused) {
4817
- return "";
4818
- }
4819
- });
4820
-
4821
- var encodeParams = (function (params) {
4822
- return Object.keys(params).filter(function (key) {
4823
- return params[key] || params[key] === 0 || params[key] === false;
4824
- }).map(function (key) {
4825
- if (Array.isArray(params[key])) {
4826
- return params[key].map(function (i) {
4827
- return encodeURIComponent(key) + "=" + encodeURIComponent(i);
4828
- }).join('&');
4829
- }
4830
- return encodeURIComponent(key) + "=" + encodeURIComponent(params[key]);
4831
- }).join('&');
4832
- });
4833
-
4834
- var formatTime = (function (time, ORIGINAL_FORMAT, FORMAT) {
4835
- if (time === DATE_MIN_VALUE) return "";
4836
- try {
4837
- return moment(time, ORIGINAL_FORMAT).format(FORMAT || "yyyy-MM-DD");
4838
- } catch (_unused) {
4839
- return "";
4840
- }
4841
- });
4842
- var compareTimeSpanFromMoment = function compareTimeSpanFromMoment(time1, time2) {
4843
- var totalMinutes1 = time1.get("hour") * 60 + time1.get("minute");
4844
- var totalMinutes2 = time2.get("hour") * 60 + time2.get("minute");
4845
- return totalMinutes1 > totalMinutes2 ? 1 : totalMinutes1 < totalMinutes2 ? -1 : 0;
4846
- };
4847
-
4848
- var getAcademyDomain = function getAcademyDomain() {
4849
- try {
4850
- return localStorage.getItem(ACADEMY_DOMAIN);
4851
- } catch (err) {
4852
- return null;
4853
- }
4854
- };
4855
-
4856
- var getAccessToken = (function () {
4857
- try {
4858
- return localStorage.getItem(ACCESS_TOKEN);
4859
- } catch (err) {
4860
- return null;
4861
- }
4862
- });
4863
-
4864
- var getErrorMessage = function getErrorMessage(t, error, defaultErrorMessage) {
4865
- var _error$response, _error$response$data, _error$response2, _error$response3, _error$response3$data;
4866
- var errorMessage = error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.title;
4867
- if ((error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 500) return defaultErrorMessage || t(DefaultErrorMessage);
4868
- if (typeof errorMessage === "string") return decodeURIComponent(errorMessage);
4869
- errorMessage = (error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : _error$response3$data.message);
4870
- if (typeof errorMessage === "string") return errorMessage;
4871
- return defaultErrorMessage || t(DefaultErrorMessage);
4872
- };
4873
-
4874
- var getLanguage = (function () {
4875
- try {
4876
- return localStorage.getItem(LANGUAGE);
4877
- } catch (err) {
4878
- return null;
4879
- }
4880
- });
4881
-
4882
- var getRedirectUrl = function getRedirectUrl() {
4883
- try {
4884
- return localStorage.getItem(REDIRECT_URL);
4885
- } catch (err) {
4886
- return undefined;
4887
- }
4888
- };
4889
-
4890
- var isLocalHost = Boolean(window.location.hostname === "localhost" || window.location.hostname === "[::1]" || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));
4891
-
4892
- var getLearningSpace = function getLearningSpace() {
4893
- try {
4894
- return localStorage.getItem(LEARNING_SPACE) === "true";
4895
- } catch (err) {
4896
- return false;
4897
- }
4898
- };
4899
-
4900
- var minutesToTimeSpan = (function (time) {
4901
- var h = Math.floor(time / 60);
4902
- var m = time % 60;
4903
- return h.toString().padStart(2, "0") + ":" + m.toString().padStart(2, "0") + ":00";
4904
- });
4905
-
4906
- var timAgo = function timAgo(date, t) {
4907
- if (date === DATE_MIN_VALUE || date === DATE_TIME_MIN_VALUE) return '';
4908
- var time = moment.utc(date).local();
4909
- var days = moment().diff(time, 'days');
4910
- if (days === 0) return t('less_than_a_day');
4911
- var months = days / 30;
4912
- var years = months / 12;
4913
- if (years > 0) return years > 1 ? t('n_years_ago') : t("one_year_ago");
4914
- if (months > 0) return months > 1 ? t('n_months_ago') : t("one_month_ago");
4915
- return days > 1 ? t('n_days_ago') : t("one_day_ago");
4916
- };
4917
-
4918
- var toISOString = (function (time) {
4919
- try {
4920
- return moment(time).toISOString();
4921
- } catch (_unused) {
4922
- return "";
4923
- }
4924
- });
4925
-
4926
- var toLocalTime = function toLocalTime(time, FORMAT) {
4927
- if (time === DATE_MIN_VALUE || time === DATE_TIME_MIN_VALUE) return "";
4928
- try {
4929
- return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
4930
- } catch (_unused) {
4931
- return "";
4932
- }
4933
- };
4934
-
4935
- var utcToLocalTime = (function (time, FORMAT) {
4936
- if (time === DATE_MIN_VALUE || time === DATE_TIME_MIN_VALUE) return "";
4937
- try {
4938
- return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
4939
- } catch (_unused) {
4940
- return "";
4941
- }
4942
- });
4943
-
4944
- var getLocalDayOfWeek = function getLocalDayOfWeek(utcDateTime, dayOfWeek) {
4945
- var currentDayOfWeek = moment.utc(utcDateTime).weekday();
4946
- var diff = dayOfWeek - currentDayOfWeek;
4947
- if (diff < 0) diff += 7;
4948
- return moment.utc(utcDateTime).add(diff, "days").local().weekday();
4949
- };
4950
- var getUtcDayOfWeek = function getUtcDayOfWeek(localDateTime, dayOfWeek) {
4951
- var currentDayOfWeek = _$5.cloneDeep(localDateTime).local().weekday();
4952
- var diff = dayOfWeek - currentDayOfWeek;
4953
- if (diff < 0) diff += 7;
4954
- return localDateTime.add(diff, "days").utc().weekday();
4955
- };
4956
- var timeSpanToLocalMoment = function timeSpanToLocalMoment(time, date) {
4957
- if (!time) return null;
4958
- var times = time.split(":");
4959
- if (times.length !== 3) return null;
4960
- var totalSeconds = +times[0] * 60 * 60 + +times[1] * 60 + +times[2];
4961
- var startOfDay = moment.utc(date).startOf("day");
4962
- var dateTime = date ? startOfDay.add(totalSeconds, "seconds") : moment().startOf("day");
4963
- if (date && dateTime.isBefore(moment.utc(date))) dateTime = dateTime.add(1, "day");
4964
- return dateTime.local();
4965
- };
4966
- var convertHHMMSStoSeconds = function convertHHMMSStoSeconds(time) {
4967
- var times = time.split(":");
4968
- return +times[0] * 60 * 60 + +times[1] * 60 + +times[2];
4969
- };
4970
- var getRemainTime = function getRemainTime(startTime, duration) {
4971
- var timePass = diffFromNow(startTime, "second");
4972
- var durationInNumber = convertHHMMSStoSeconds(duration);
4973
- if (typeof timePass !== "number") return null;
4974
- if (timePass > durationInNumber) return 0;
4975
- return durationInNumber - timePass;
4976
- };
4977
-
4978
- var formatDateTime = function formatDateTime(inputDate) {
4979
- var date = new Date(inputDate);
4980
- var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
4981
- var month = monthNames[date.getMonth()];
4982
- var day = date.getDate();
4983
- var year = date.getFullYear();
4984
- var hour = (date.getHours() < 10 ? "0" : "") + date.getHours();
4985
- var minute = (date.getMinutes() < 10 ? "0" : "") + date.getMinutes();
4986
- var formattedDate = month + " " + day + ", " + year + " " + hour + ":" + minute;
4987
- return formattedDate;
4988
- };
4989
- var ellipsisText = function ellipsisText(text, maxLength) {
4990
- if (!text) return text;
4991
- return (text === null || text === void 0 ? void 0 : text.length) > maxLength ? text.slice(0, maxLength) + " ..." : text;
4992
- };
4993
- var getOrdinalSuffix = function getOrdinalSuffix(number, lang) {
4994
- var suffixes = {
4995
- en: ['th', 'st', 'nd', 'rd'],
4996
- ko: ['']
4997
- };
4998
- switch (lang) {
4999
- case 'en':
5000
- var j = number % 10;
5001
- var k = number % 100;
5002
- if (j === 1 && k !== 11) {
5003
- return suffixes.en[1];
5004
- }
5005
- if (j === 2 && k !== 12) {
5006
- return suffixes.en[2];
5007
- }
5008
- if (j === 3 && k !== 13) {
5009
- return suffixes.en[3];
5010
- }
5011
- return suffixes.en[0];
5012
- case 'ko':
5013
- return suffixes.ko[0];
5014
- default:
5015
- return '';
5016
- }
5017
- };
5018
- var formatDataMyAnswer = function formatDataMyAnswer(inputData, categories) {
5019
- var uniqueCategories = new Set();
5020
- var filterCategories = categories.filter(function (category) {
5021
- if (!uniqueCategories.has(category.name)) {
5022
- uniqueCategories.add(category.name);
5023
- return true;
5024
- }
5025
- return false;
5026
- });
5027
- var questionsByCategory = filterCategories.map(function (category) {
5028
- return {
5029
- category: category,
5030
- questions: inputData.questions.filter(function (question) {
5031
- return question.category.name === category.name;
5032
- })
5033
- };
5034
- });
5035
- return questionsByCategory;
5036
- };
5037
- var formatTextbookDataMyAnswer = function formatTextbookDataMyAnswer(inputData, categories) {
5038
- var uniqueCategories = new Set();
5039
- var filterCategories = categories.filter(function (category) {
5040
- if (!uniqueCategories.has(category.name)) {
5041
- uniqueCategories.add(category.name);
5042
- return true;
5043
- }
5044
- return false;
5045
- });
5046
- var questionsByCategory = filterCategories.map(function (category) {
5047
- return {
5048
- category: category,
5049
- questions: inputData.studentQuestionResults.filter(function (question) {
5050
- return !!question.categories.find(function (i) {
5051
- return i.name === category.name;
5052
- });
5053
- })
5054
- };
5055
- });
5056
- return questionsByCategory;
5057
- };
5058
- var totalSolveTimeCategories = function totalSolveTimeCategories(inputData, categories) {
5059
- var uniqueCategories = new Set();
5060
- var filterCategories = categories.filter(function (category) {
5061
- if (!uniqueCategories.has(category.name)) {
5062
- uniqueCategories.add(category.name);
5063
- return true;
5064
- }
5065
- return false;
5066
- });
5067
- var questionsByCategory = filterCategories.map(function (category) {
5068
- return _extends({}, category, {
5069
- totalSolveTime: inputData.questions.reduce(function (init, question) {
5070
- return question.category.name === category.name ? init += question.duration : init;
5071
- }, 0)
5072
- });
5073
- });
5074
- return questionsByCategory;
5075
- };
5076
- var totalTextbookSolveTimeCategories = function totalTextbookSolveTimeCategories(inputData, categories) {
5077
- var uniqueCategories = new Set();
5078
- var filterCategories = categories.filter(function (category) {
5079
- if (!uniqueCategories.has(category.name)) {
5080
- uniqueCategories.add(category.name);
5081
- return true;
5082
- }
5083
- return false;
5084
- });
5085
- var questionsByCategory = filterCategories.map(function (category) {
5086
- return _extends({}, category, {
5087
- totalSolveTime: inputData.studentQuestionResults.reduce(function (init, question) {
5088
- return !!question.categories.find(function (i) {
5089
- return i.name === category.name;
5090
- }) ? init += question.duration : init;
5091
- }, 0)
5092
- });
5093
- });
5094
- return questionsByCategory;
5095
- };
5096
- var formatTimeSecond = function formatTimeSecond(duration, t) {
5097
- duration = Math.round(duration);
5098
- return "" + (duration < 60 ? "" + duration + t("seconds") : t("mins_mins_seconds_seconds", {
5099
- mins: Math.floor(duration / 60),
5100
- seconds: duration % 60
5101
- }));
5102
- };
5103
- var formatRole = function formatRole(roles, t) {
5104
- if (roles.includes(Role.Admin)) return t("admin");
5105
- if (roles.includes(Role.AcademyAdminTeacher)) return t("academy_admin_teacher");
5106
- if (roles.includes(Role.AcademyAdmin)) return t("academy_admin");
5107
- if (roles.includes(Role.Teacher)) return t("teacher");
5108
- if (roles.includes(Role.Student)) return t("student");
5109
- return "";
5110
- };
5111
- var getRole = function getRole(roles) {
5112
- if (roles.includes(Role.AcademyAdminTeacher)) return Role.AcademyAdminTeacher;
5113
- if (roles.includes(Role.Admin)) return Role.Admin;
5114
- if (roles.includes(Role.AcademyAdmin)) return Role.AcademyAdmin;
5115
- if (roles.includes(Role.Teacher)) return Role.Teacher;
5116
- if (roles.includes(Role.Student)) return Role.Student;
5117
- return null;
5118
- };
5119
-
5120
- var useLanguage = function useLanguage(history) {
5121
- var dispatch = useDispatch();
5122
- var _useTranslation = useTranslation(),
5123
- i18n = _useTranslation.i18n;
5124
- var _useState = useState(false),
5125
- dropdownOpen = _useState[0],
5126
- setDropdownOpen = _useState[1];
5127
- var _useState2 = useState(),
5128
- currentLanguage = _useState2[0],
5129
- setCurrentLanguage = _useState2[1];
5130
- var toggle = function toggle() {
5131
- return setDropdownOpen(function (prevState) {
5132
- return !prevState;
5133
- });
5134
- };
5135
- var changeLanguageApp = function changeLanguageApp(languageItem) {
5136
- var search = window.location.search;
5137
- var searchParams = new URLSearchParams(search);
5138
- if (!languageItem) {
5139
- var _navigator$language, _navigator$language$s;
5140
- var storedLanguage = getLanguage();
5141
- var browserLanguage = (_navigator$language = navigator.language) === null || _navigator$language === void 0 ? void 0 : (_navigator$language$s = _navigator$language.split("-")) === null || _navigator$language$s === void 0 ? void 0 : _navigator$language$s[0];
5142
- var defaultLanguageCode = storedLanguage || browserLanguage;
5143
- languageItem = LANGUAGES.find(function (i) {
5144
- return i.code === defaultLanguageCode;
5145
- }) || currentLanguage || DEFAULT_LANGUAGE;
5146
- }
5147
- setCurrentLanguage(languageItem);
5148
- i18n.changeLanguage(languageItem.code);
5149
- moment.locale(languageItem.momentLangCode);
5150
- localStorage.setItem(LANGUAGE, languageItem.code);
5151
- dispatch(setLanguage(languageItem.code));
5152
- if (window.location.pathname === LOGIN_URL) searchParams["delete"]("lang");else searchParams.set("lang", languageItem.code);
5153
- pushTo(history, _extends({}, window.location, {
5154
- search: searchParams.toString()
5155
- }), true);
5156
- };
5157
- var handleChangeLanguageParam = function handleChangeLanguageParam() {
5158
- var search = window.location.search;
5159
- var searchParams = new URLSearchParams(search);
5160
- var langParam = searchParams.get("lang");
5161
- var languageItem = undefined;
5162
- if (langParam) {
5163
- var languageParamItem = LANGUAGES.find(function (i) {
5164
- return i.code === langParam;
5165
- });
5166
- languageItem = languageParamItem || languageItem;
5167
- }
5168
- changeLanguageApp(languageItem);
5169
- };
5170
- var handleChangeItemLanguage = function handleChangeItemLanguage(lang) {
5171
- var languageItem = LANGUAGES.find(function (i) {
5172
- return i.code === lang;
5173
- });
5174
- changeLanguageApp(languageItem);
5175
- };
5176
- useEffect(function () {
5177
- handleChangeLanguageParam();
5178
- }, [window.location.pathname, window.location.search]);
5179
- return {
5180
- dropdownOpen: dropdownOpen,
5181
- currentLanguage: currentLanguage,
5182
- toggle: toggle,
5183
- handleChangeItemLanguage: handleChangeItemLanguage
5184
- };
5185
- };
5186
-
5187
- var PrintState;
5188
- (function (PrintState) {
5189
- PrintState[PrintState["Idling"] = 0] = "Idling";
5190
- PrintState[PrintState["Stopped"] = 1] = "Stopped";
5191
- PrintState[PrintState["Printing"] = 2] = "Printing";
5192
- PrintState[PrintState["Paused"] = 3] = "Paused";
5193
- })(PrintState || (PrintState = {}));
5194
-
5195
- var TabList = [{
5196
- label: "comprehensive_analysis",
5197
- value: 0
5198
- }, {
5199
- label: "solution_order",
5200
- value: 1
5201
- }, {
5202
- label: "compare_solution",
5203
- value: 2
5204
- }, {
5205
- label: "problem_analysis",
5206
- value: 3
5207
- }];
5208
-
5209
- var TOTAL = 3;
5210
- var PrintExamView2 = function PrintExamView2(_ref) {
5211
- var history = _ref.history,
5212
- role = _ref.role,
5213
- dataExamSession = _ref.dataExamSession;
5214
- var _useTranslation = useTranslation(),
5215
- t = _useTranslation.t;
5216
- var isTeacher = Role.Teacher === role;
5217
- var dataProps = isTeacher ? dataExamSession.map(function (i) {
5218
- return {
5219
- studentId: i === null || i === void 0 ? void 0 : i.studentId,
5220
- examSessionId: i === null || i === void 0 ? void 0 : i.examSessionId
5221
- };
5222
- }) : dataExamSession.map(function (i) {
5223
- return {
5224
- code: i === null || i === void 0 ? void 0 : i.code
5225
- };
5226
- });
5227
- useLanguage(history);
5228
- var _useState = useState(dataProps),
5229
- data = _useState[0],
5230
- setData = _useState[1];
5231
- var _useState2 = useState([]),
5232
- completed = _useState2[0],
5233
- setCompleted = _useState2[1];
5234
- var _useState3 = useState([]),
5235
- inprogress = _useState3[0],
5236
- setInProgress = _useState3[1];
5237
- var _useState4 = useState(PrintState.Idling),
5238
- state = _useState4[0],
5239
- setState = _useState4[1];
5240
- var _useState5 = useState([]),
5241
- errorLinks = _useState5[0],
5242
- setErrorLinks = _useState5[1];
5243
- var _useState6 = useState([]),
5244
- status = _useState6[0],
5245
- setStatus = _useState6[1];
5246
- var theme = useTheme();
5247
- var handleChangeStatus = function handleChangeStatus(event) {
5248
- if (event.target.checked) {
5249
- setStatus(function (prev) {
5250
- var _event$target;
5251
- return [].concat(prev, [(_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value]);
5252
- });
5253
- } else setStatus(function (prev) {
5254
- return prev === null || prev === void 0 ? void 0 : prev.filter(function (i) {
5255
- var _event$target2;
5256
- return i !== ((_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.value);
5257
- });
5258
- });
5259
- };
5260
- var handleProgressPrint = function handleProgressPrint() {
5261
- setData(dataProps);
5262
- setCompleted([]);
5263
- setInProgress([]);
5264
- setErrorLinks([]);
5265
- setState(PrintState.Printing);
5266
- };
5267
- var print = function print(_ref2) {
5268
- var examSessionId = _ref2.examSessionId,
5269
- studentId = _ref2.studentId,
5270
- code = _ref2.code;
5271
- var width = 200;
5272
- var height = 200;
5273
- var left = window.screenX + window.outerWidth / 2 - width / 2;
5274
- var top = window.screenY + window.outerHeight / 2 - height / 2;
5275
- var url = isTeacher ? window.location.origin + "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print?status=" + status.join(",") : window.location.origin + "/student/exam-results/" + code + "/print";
5276
- var windowName = isTeacher ? "popup-" + examSessionId + "-" + studentId : "popup-" + code;
5277
- var windowSpecs = "left=" + left + ",top=" + top + ",width=" + width + ",height=" + height + ",location=yes,resizable=yes,scrollbars=yes,status=yes";
5278
- var childWindow = window.open(url, windowName, windowSpecs);
5279
- if (childWindow == null) {
5280
- setErrorLinks(function (prev) {
5281
- return [].concat(prev, [{
5282
- code: code,
5283
- examSessionId: "" + examSessionId,
5284
- studentId: "" + studentId,
5285
- message: isTeacher ? "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print?status=" + status.join(",") : "/student/exam-results/" + code + "/print"
5286
- }]);
5287
- });
5288
- if (!isTeacher) {
5289
- setData(function (es) {
5290
- return [].concat(es.filter(function (i) {
5291
- return i.code !== code;
5292
- }));
5293
- });
5294
- } else {
5295
- setData(function (es) {
5296
- return [].concat(es.filter(function (i) {
5297
- return i.examSessionId !== examSessionId || i.studentId !== studentId;
5298
- }));
5299
- });
5300
- }
5301
- return;
5302
- }
5303
- if (!isTeacher) {
5304
- setInProgress(function (es) {
5305
- return [].concat(es.filter(function (i) {
5306
- return i.code !== code;
5307
- }), [{
5308
- code: code
5309
- }]);
5310
- });
5311
- setData(function (es) {
5312
- return [].concat(es.filter(function (i) {
5313
- return i.code !== code;
5314
- }));
5315
- });
5316
- } else {
5317
- setInProgress(function (es) {
5318
- return [].concat(es.filter(function (i) {
5319
- return i.examSessionId !== examSessionId || i.studentId !== studentId;
5320
- }), [{
5321
- examSessionId: examSessionId,
5322
- studentId: studentId
5323
- }]);
5324
- });
5325
- setData(function (es) {
5326
- return [].concat(es.filter(function (i) {
5327
- return i.examSessionId !== examSessionId || i.studentId !== studentId;
5328
- }));
5329
- });
5330
- }
5331
- window.addEventListener("message", function (event) {
5332
- var isCheck = isTeacher ? event.data.examSessionId !== "" + examSessionId || event.data.studentId !== "" + studentId : event.data.code !== "" + code;
5333
- if (event.origin !== window.location.origin || isCheck) {
5334
- return;
5335
- }
5336
- if (event.data.succeed) {
5337
- if (!isTeacher) {
5338
- setCompleted(function (es) {
5339
- return [].concat(es.filter(function (i) {
5340
- return i.code !== code;
5341
- }), [{
5342
- code: code
5343
- }]);
5344
- });
5345
- setInProgress(function (es) {
5346
- return [].concat(es.filter(function (i) {
5347
- return i.code !== code;
5348
- }));
5349
- });
5350
- } else {
5351
- setCompleted(function (es) {
5352
- return [].concat(es.filter(function (i) {
5353
- return i.examSessionId !== examSessionId || i.studentId !== studentId;
5354
- }), [{
5355
- examSessionId: examSessionId,
5356
- studentId: studentId
5357
- }]);
5358
- });
5359
- setInProgress(function (es) {
5360
- return [].concat(es.filter(function (i) {
5361
- return i.examSessionId !== examSessionId || i.studentId !== studentId;
5362
- }));
5363
- });
5364
- }
5365
- } else {
5366
- setErrorLinks(function (prev) {
5367
- var _event$data, _event$data2;
5368
- return [].concat(prev, [{
5369
- code: (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.code,
5370
- examSessionId: (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.examSessionId,
5371
- studentId: "" + studentId,
5372
- message: isTeacher ? "/teacher/exam-results/" + event.data.examSessionId + "/students/" + event.data.studentId + "/print?status=" + status.join(",") : "/student/exam-results/" + event.data.code + "/print"
5373
- }]);
5374
- });
5375
- }
5376
- childWindow === null || childWindow === void 0 ? void 0 : childWindow.close();
5377
- });
5378
- };
5379
- useEffect(function () {
5380
- if (inprogress.length < TOTAL && data.length > 0 && state === PrintState.Printing) {
5381
- var item = data[0];
5382
- print({
5383
- examSessionId: item === null || item === void 0 ? void 0 : item.examSessionId,
5384
- studentId: item === null || item === void 0 ? void 0 : item.studentId,
5385
- code: item === null || item === void 0 ? void 0 : item.code
5386
- });
5387
- }
5388
- }, [inprogress.length, completed.length, data.length, state, data]);
5389
- return React__default.createElement(Container, null, state === PrintState.Idling ? React__default.createElement(Typography, null, t("total_number_of_selected_results") + ": ", " ", React__default.createElement("span", {
5390
- className: "fw-bold"
5391
- }, t("number_results", {
5392
- number: ("" + data.length).padStart(2, "0")
5393
- }))) : React__default.createElement(Fragment$1, null, React__default.createElement(Typography, null, t("completed") + ": ", React__default.createElement("span", {
5394
- className: "fw-bold"
5395
- }, t("number_results", {
5396
- number: ("" + completed.length).padStart(2, "0")
5397
- }))), React__default.createElement(Typography, null, t("in_progress") + ": ", React__default.createElement("span", {
5398
- className: "fw-bold"
5399
- }, t("number_results", {
5400
- number: ("" + inprogress.length).padStart(2, "0")
5401
- }))), React__default.createElement(Typography, null, t("remaining") + ": ", React__default.createElement("span", {
5402
- className: "fw-bold"
5403
- }, t("number_results", {
5404
- number: ("" + data.length).padStart(2, "0")
5405
- })))), !!errorLinks.length && React__default.createElement(Stack, {
5406
- className: "mt-2"
5407
- }, React__default.createElement(Typography, {
5408
- fontWeight: 700
5409
- }, t("download_failed"), ":"), Array.from(new Set(errorLinks)).map(function (i, index) {
5410
- var _info$createdBy;
5411
- var info = isTeacher ? dataExamSession.find(function (exam) {
5412
- return "" + (exam === null || exam === void 0 ? void 0 : exam.examSessionId) === "" + (i === null || i === void 0 ? void 0 : i.examSessionId) && "" + (exam === null || exam === void 0 ? void 0 : exam.studentId) === "" + (i === null || i === void 0 ? void 0 : i.studentId);
5413
- }) : dataExamSession.find(function (exam) {
5414
- return (exam === null || exam === void 0 ? void 0 : exam.code) === (i === null || i === void 0 ? void 0 : i.code);
5415
- });
5416
- return React__default.createElement(Stack, {
5417
- key: index,
5418
- borderBottom: 1,
5419
- borderColor: theme.palette.grey[500]
5420
- }, React__default.createElement("a", {
5421
- href: i.message,
5422
- target: "_blank",
5423
- rel: "noopener noreferrer"
5424
- }, (info === null || info === void 0 ? void 0 : info.studentName) || (info === null || info === void 0 ? void 0 : (_info$createdBy = info.createdBy) === null || _info$createdBy === void 0 ? void 0 : _info$createdBy.fullName)), (info === null || info === void 0 ? void 0 : info.title) && React__default.createElement(Typography, null, t("exam") + ": " + (info === null || info === void 0 ? void 0 : info.title)), (info === null || info === void 0 ? void 0 : info.startTime) && React__default.createElement(Typography, null, t("start_time") + ": " + utcToLocalTime(info === null || info === void 0 ? void 0 : info.startTime, t("date_time_format"))));
5425
- })), React__default.createElement(Stack, {
5426
- direction: "column",
5427
- className: "mt-3"
5428
- }, React__default.createElement(Stack, null, React__default.createElement(Typography, {
5429
- className: "fw-bold"
5430
- }, React__default.createElement("span", {
5431
- className: "text-danger me-1"
5432
- }, "*"), t("your_browser_must"), ":"), React__default.createElement(List, {
5433
- className: "ps-3 pt-0"
5434
- }, React__default.createElement(ListItem, {
5435
- disablePadding: true
5436
- }, t("allowed_to_send_pop_ups_and_use_redirects")), React__default.createElement(ListItem, {
5437
- disablePadding: true
5438
- }, t("disable_ask_where_to_save_each_file_before_downloading")))), isTeacher && React__default.createElement(Stack, null, React__default.createElement(Typography, {
5439
- fontWeight: 700
5440
- }, t("choose_to_print"), ":"), React__default.createElement(FormGroup, {
5441
- sx: {
5442
- display: "flex",
5443
- flexDirection: "row",
5444
- gap: 1,
5445
- flexWrap: "wrap"
5446
- }
5447
- }, TabList.map(function (_ref3, index) {
5448
- var label = _ref3.label,
5449
- value = _ref3.value;
5450
- return React__default.createElement(FormControlLabel, {
5451
- key: index,
5452
- control: React__default.createElement(Checkbox, {
5453
- onChange: handleChangeStatus,
5454
- value: value,
5455
- checked: status.some(function (i) {
5456
- return i === value.toString();
5457
- })
5458
- }),
5459
- label: t(label)
5460
- });
5461
- }))), React__default.createElement(Button, {
5462
- className: "mt-3",
5463
- variant: "contained",
5464
- onClick: handleProgressPrint
5465
- }, t("print_pdf"))));
5466
- };
5467
-
5468
- 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","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","btn-login-google":"_2HqmH","math-jax":"_3Pfdk","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"};
5469
-
5470
- var config = {
5471
- loader: {
5472
- load: ["input/tex", "output/svg"]
5473
- }
5474
- };
5475
- var MathJaxContainer = function MathJaxContainer(_ref) {
5476
- var content = _ref.content;
5477
- return React__default.createElement(MathJaxContext, {
5478
- config: config,
5479
- asyncLoad: true
5480
- }, React__default.createElement(MathJax, {
5481
- id: "" + styles["math-jax"],
5482
- dangerouslySetInnerHTML: {
5483
- __html: content
5484
- }
5485
- }));
5486
- };
5487
-
5488
5215
  var ReleaseAlert = function ReleaseAlert() {
5489
5216
  var _useTranslation = useTranslation(),
5490
5217
  t = _useTranslation.t;
@@ -5558,11 +5285,9 @@ var ActionButtons = function ActionButtons(_ref) {
5558
5285
  };
5559
5286
 
5560
5287
  var TITLE = "not_found";
5561
- var NotFound = function NotFound(_ref) {
5562
- var history = _ref.history;
5288
+ var NotFound = function NotFound() {
5563
5289
  var _useTranslation = useTranslation(),
5564
5290
  t = _useTranslation.t;
5565
- history && useLanguage(history);
5566
5291
  useEffect(function () {
5567
5292
  document.title = t("study_peak") + " | " + t(TITLE);
5568
5293
  }, [t]);
@@ -5630,6 +5355,31 @@ var CommonDialog = function CommonDialog(_ref) {
5630
5355
  }, title)), children);
5631
5356
  };
5632
5357
 
5358
+ function _extends() {
5359
+ return _extends = Object.assign ? Object.assign.bind() : function (n) {
5360
+ for (var e = 1; e < arguments.length; e++) {
5361
+ var t = arguments[e];
5362
+ for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
5363
+ }
5364
+ return n;
5365
+ }, _extends.apply(null, arguments);
5366
+ }
5367
+ function _objectDestructuringEmpty(t) {
5368
+ if (null == t) throw new TypeError("Cannot destructure " + t);
5369
+ }
5370
+ function _objectWithoutPropertiesLoose(r, e) {
5371
+ if (null == r) return {};
5372
+ var t = {};
5373
+ for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
5374
+ if (-1 !== e.indexOf(n)) continue;
5375
+ t[n] = r[n];
5376
+ }
5377
+ return t;
5378
+ }
5379
+ function _taggedTemplateLiteralLoose(e, t) {
5380
+ return t || (t = e.slice(0)), e.raw = t, e;
5381
+ }
5382
+
5633
5383
  var confirmDialogTextStyle = {
5634
5384
  color: "#363634",
5635
5385
  fontSize: 16,
@@ -5993,6 +5743,7 @@ var customStyles = {
5993
5743
  },
5994
5744
  option: function option(baseStyles, state) {
5995
5745
  return _extends({}, baseStyles, {
5746
+ zIndex: 999,
5996
5747
  backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.light : 'white',
5997
5748
  "&:active": {
5998
5749
  backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.less_dark : baseStyles.backgroundColor
@@ -6113,8 +5864,7 @@ var CustomSelect = function CustomSelect(_ref) {
6113
5864
  Option: CustomOption
6114
5865
  },
6115
5866
  styles: customStyles,
6116
- placeholder: t("select_placeholder"),
6117
- menuPortalTarget: document.body
5867
+ placeholder: t("select_placeholder")
6118
5868
  }, rest));
6119
5869
  };
6120
5870
 
@@ -6216,131 +5966,415 @@ var AnswerCountSelector = function AnswerCountSelector(_ref) {
6216
5966
  });
6217
5967
  };
6218
5968
 
6219
- var ArticleCategorySelector = function ArticleCategorySelector(_ref) {
6220
- var id = _ref.id,
6221
- value = _ref.value,
6222
- optionValue = _ref.optionValue,
6223
- onChange = _ref.onChange,
6224
- isDisabled = _ref.isDisabled,
6225
- options = _ref.options,
6226
- isMulti = _ref.isMulti,
6227
- placeholder = _ref.placeholder,
6228
- rest = _ref.rest;
6229
- var _useTranslation = useTranslation(),
6230
- t = _useTranslation.t;
6231
- return React__default.createElement(CustomSelect, Object.assign({
6232
- isMulti: isMulti,
6233
- inputId: id,
6234
- value: value,
6235
- options: options,
6236
- onChange: onChange,
6237
- isDisabled: isDisabled,
6238
- placeholder: placeholder || t("select_category"),
6239
- optionValue: optionValue
6240
- }, rest));
6241
- };
5969
+ var ArticleCategorySelector = function ArticleCategorySelector(_ref) {
5970
+ var id = _ref.id,
5971
+ value = _ref.value,
5972
+ optionValue = _ref.optionValue,
5973
+ onChange = _ref.onChange,
5974
+ isDisabled = _ref.isDisabled,
5975
+ options = _ref.options,
5976
+ isMulti = _ref.isMulti,
5977
+ placeholder = _ref.placeholder,
5978
+ rest = _ref.rest;
5979
+ var _useTranslation = useTranslation(),
5980
+ t = _useTranslation.t;
5981
+ return React__default.createElement(CustomSelect, Object.assign({
5982
+ isMulti: isMulti,
5983
+ inputId: id,
5984
+ value: value,
5985
+ options: options,
5986
+ onChange: onChange,
5987
+ isDisabled: isDisabled,
5988
+ placeholder: placeholder || t("select_category"),
5989
+ optionValue: optionValue
5990
+ }, rest));
5991
+ };
5992
+
5993
+ // A type of promise-like that resolves synchronously and supports only one observer
5994
+
5995
+ const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
5996
+
5997
+ const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
5998
+
5999
+ // Asynchronously call a function and send errors to recovery continuation
6000
+ function _catch(body, recover) {
6001
+ try {
6002
+ var result = body();
6003
+ } catch(e) {
6004
+ return recover(e);
6005
+ }
6006
+ if (result && result.then) {
6007
+ return result.then(void 0, recover);
6008
+ }
6009
+ return result;
6010
+ }
6011
+
6012
+ // Asynchronously await a promise and pass the result to a finally continuation
6013
+ function _finallyRethrows(body, finalizer) {
6014
+ try {
6015
+ var result = body();
6016
+ } catch (e) {
6017
+ return finalizer(true, e);
6018
+ }
6019
+ if (result && result.then) {
6020
+ return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
6021
+ }
6022
+ return finalizer(false, result);
6023
+ }
6024
+
6025
+ // Asynchronously await a promise and invoke a finally continuation that always overrides the result
6026
+ function _finally(body, finalizer) {
6027
+ try {
6028
+ var result = body();
6029
+ } catch (e) {
6030
+ return finalizer();
6031
+ }
6032
+ if (result && result.then) {
6033
+ return result.then(finalizer, finalizer);
6034
+ }
6035
+ return finalizer();
6036
+ }
6037
+
6038
+ var canAccess = function canAccess(userRoles, componentRoles) {
6039
+ if (!Array.isArray(userRoles)) {
6040
+ return false;
6041
+ }
6042
+ if (Array.isArray(componentRoles)) {
6043
+ var intersects = userRoles.filter(function (i) {
6044
+ return componentRoles.includes(i);
6045
+ });
6046
+ return intersects.length > 0;
6047
+ }
6048
+ return true;
6049
+ };
6050
+
6051
+ var checkSuperUrl = function checkSuperUrl(superUrls, pathname) {
6052
+ return superUrls.some(function (i) {
6053
+ if (i.includes(":")) {
6054
+ var urls = i.split("/");
6055
+ var names = pathname.split("/");
6056
+ if (urls.length != names.length) return false;
6057
+ var isMatches = true;
6058
+ urls.forEach(function (u, index) {
6059
+ if (u != names[index] && !u.startsWith(":")) isMatches = false;
6060
+ });
6061
+ return isMatches;
6062
+ }
6063
+ return pathname.startsWith(i);
6064
+ });
6065
+ };
6066
+
6067
+ var diffFromNow = (function (time, unitOfTime, targetTime) {
6068
+ if (time === DATE_MIN_VALUE || targetTime === DATE_MIN_VALUE) return 0;
6069
+ try {
6070
+ var now = !targetTime ? moment() : moment.utc(targetTime).local();
6071
+ return now.diff(moment.utc(time).local(), unitOfTime);
6072
+ } catch (_unused) {
6073
+ return "";
6074
+ }
6075
+ });
6076
+
6077
+ var encodeParams = (function (params) {
6078
+ return Object.keys(params).filter(function (key) {
6079
+ return params[key] || params[key] === 0 || params[key] === false;
6080
+ }).map(function (key) {
6081
+ if (Array.isArray(params[key])) {
6082
+ return params[key].map(function (i) {
6083
+ return encodeURIComponent(key) + "=" + encodeURIComponent(i);
6084
+ }).join('&');
6085
+ }
6086
+ return encodeURIComponent(key) + "=" + encodeURIComponent(params[key]);
6087
+ }).join('&');
6088
+ });
6089
+
6090
+ var formatTime = (function (time, ORIGINAL_FORMAT, FORMAT) {
6091
+ if (time === DATE_MIN_VALUE) return "";
6092
+ try {
6093
+ return moment(time, ORIGINAL_FORMAT).format(FORMAT || "yyyy-MM-DD");
6094
+ } catch (_unused) {
6095
+ return "";
6096
+ }
6097
+ });
6098
+ var compareTimeSpanFromMoment = function compareTimeSpanFromMoment(time1, time2) {
6099
+ var totalMinutes1 = time1.get("hour") * 60 + time1.get("minute");
6100
+ var totalMinutes2 = time2.get("hour") * 60 + time2.get("minute");
6101
+ return totalMinutes1 > totalMinutes2 ? 1 : totalMinutes1 < totalMinutes2 ? -1 : 0;
6102
+ };
6103
+
6104
+ var getAcademyDomain = function getAcademyDomain() {
6105
+ try {
6106
+ return localStorage.getItem(ACADEMY_DOMAIN);
6107
+ } catch (err) {
6108
+ return null;
6109
+ }
6110
+ };
6111
+
6112
+ var getAccessToken = (function () {
6113
+ try {
6114
+ return localStorage.getItem(ACCESS_TOKEN);
6115
+ } catch (err) {
6116
+ return null;
6117
+ }
6118
+ });
6242
6119
 
6243
- // A type of promise-like that resolves synchronously and supports only one observer
6120
+ var getErrorMessage = function getErrorMessage(t, error, defaultErrorMessage) {
6121
+ var _error$response, _error$response$data, _error$response2, _error$response3, _error$response3$data;
6122
+ var errorMessage = error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$data = _error$response.data) === null || _error$response$data === void 0 ? void 0 : _error$response$data.title;
6123
+ if ((error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 500) return defaultErrorMessage || t(DefaultErrorMessage);
6124
+ if (typeof errorMessage === "string") return decodeURIComponent(errorMessage);
6125
+ errorMessage = (error === null || error === void 0 ? void 0 : error.message) || (error === null || error === void 0 ? void 0 : (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : (_error$response3$data = _error$response3.data) === null || _error$response3$data === void 0 ? void 0 : _error$response3$data.message);
6126
+ if (typeof errorMessage === "string") return errorMessage;
6127
+ return defaultErrorMessage || t(DefaultErrorMessage);
6128
+ };
6244
6129
 
6245
- const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
6130
+ var getLanguage = (function () {
6131
+ try {
6132
+ return localStorage.getItem(LANGUAGE);
6133
+ } catch (err) {
6134
+ return null;
6135
+ }
6136
+ });
6246
6137
 
6247
- const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
6138
+ var getRedirectUrl = function getRedirectUrl() {
6139
+ try {
6140
+ return localStorage.getItem(REDIRECT_URL);
6141
+ } catch (err) {
6142
+ return undefined;
6143
+ }
6144
+ };
6248
6145
 
6249
- // Asynchronously call a function and send errors to recovery continuation
6250
- function _catch(body, recover) {
6251
- try {
6252
- var result = body();
6253
- } catch(e) {
6254
- return recover(e);
6255
- }
6256
- if (result && result.then) {
6257
- return result.then(void 0, recover);
6258
- }
6259
- return result;
6260
- }
6146
+ var isLocalHost = Boolean(window.location.hostname === "localhost" || window.location.hostname === "[::1]" || window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));
6261
6147
 
6262
- // Asynchronously await a promise and pass the result to a finally continuation
6263
- function _finallyRethrows(body, finalizer) {
6264
- try {
6265
- var result = body();
6266
- } catch (e) {
6267
- return finalizer(true, e);
6268
- }
6269
- if (result && result.then) {
6270
- return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
6271
- }
6272
- return finalizer(false, result);
6273
- }
6148
+ var getLearningSpace = function getLearningSpace() {
6149
+ try {
6150
+ return localStorage.getItem(LEARNING_SPACE) === "true";
6151
+ } catch (err) {
6152
+ return false;
6153
+ }
6154
+ };
6274
6155
 
6275
- // Asynchronously await a promise and invoke a finally continuation that always overrides the result
6276
- function _finally(body, finalizer) {
6277
- try {
6278
- var result = body();
6279
- } catch (e) {
6280
- return finalizer();
6281
- }
6282
- if (result && result.then) {
6283
- return result.then(finalizer, finalizer);
6284
- }
6285
- return finalizer();
6286
- }
6156
+ var minutesToTimeSpan = (function (time) {
6157
+ var h = Math.floor(time / 60);
6158
+ var m = time % 60;
6159
+ return h.toString().padStart(2, "0") + ":" + m.toString().padStart(2, "0") + ":00";
6160
+ });
6287
6161
 
6288
- var PreparedType;
6289
- (function (PreparedType) {
6290
- PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
6291
- PreparedType[PreparedType["official_mock_exam"] = 2] = "official_mock_exam";
6292
- PreparedType[PreparedType["private_mock_exam"] = 3] = "private_mock_exam";
6293
- })(PreparedType || (PreparedType = {}));
6162
+ var pushTo = function pushTo(history, data, isReplace) {
6163
+ if (isReplace === void 0) {
6164
+ isReplace = false;
6165
+ }
6166
+ if (history.push && !isReplace || history.replace && isReplace) {
6167
+ !isReplace && history.push(data);
6168
+ isReplace && history.replace(data);
6169
+ } else history(data, {
6170
+ replace: isReplace
6171
+ });
6172
+ };
6294
6173
 
6295
- var ExamEvent;
6296
- (function (ExamEvent) {
6297
- ExamEvent["StartExam"] = "start-exam";
6298
- ExamEvent["TerminateExam"] = "terminate-exam";
6299
- ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
6300
- ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
6301
- })(ExamEvent || (ExamEvent = {}));
6174
+ var timAgo = function timAgo(date, t) {
6175
+ if (date === DATE_MIN_VALUE || date === DATE_TIME_MIN_VALUE) return '';
6176
+ var time = moment.utc(date).local();
6177
+ var days = moment().diff(time, 'days');
6178
+ if (days === 0) return t('less_than_a_day');
6179
+ var months = days / 30;
6180
+ var years = months / 12;
6181
+ if (years > 0) return years > 1 ? t('n_years_ago') : t("one_year_ago");
6182
+ if (months > 0) return months > 1 ? t('n_months_ago') : t("one_month_ago");
6183
+ return days > 1 ? t('n_days_ago') : t("one_day_ago");
6184
+ };
6302
6185
 
6303
- var ExamStatus;
6304
- (function (ExamStatus) {
6305
- ExamStatus[ExamStatus["Default"] = 0] = "Default";
6306
- ExamStatus[ExamStatus["Pending"] = 1] = "Pending";
6307
- ExamStatus[ExamStatus["InProgress"] = 2] = "InProgress";
6308
- ExamStatus[ExamStatus["Completed"] = 3] = "Completed";
6309
- })(ExamStatus || (ExamStatus = {}));
6310
- var QuestionAnswerType;
6311
- (function (QuestionAnswerType) {
6312
- QuestionAnswerType[QuestionAnswerType["SingleChoice"] = 0] = "SingleChoice";
6313
- QuestionAnswerType[QuestionAnswerType["MultipleChoice"] = 1] = "MultipleChoice";
6314
- QuestionAnswerType[QuestionAnswerType["ShortAnswer"] = 2] = "ShortAnswer";
6315
- })(QuestionAnswerType || (QuestionAnswerType = {}));
6186
+ var toISOString = (function (time) {
6187
+ try {
6188
+ return moment(time).toISOString();
6189
+ } catch (_unused) {
6190
+ return "";
6191
+ }
6192
+ });
6316
6193
 
6317
- var OrderType;
6318
- (function (OrderType) {
6319
- OrderType["ASC"] = "ASC";
6320
- OrderType["DESC"] = "DESC";
6321
- })(OrderType || (OrderType = {}));
6194
+ var toLocalTime = function toLocalTime(time, FORMAT) {
6195
+ if (time === DATE_MIN_VALUE || time === DATE_TIME_MIN_VALUE) return "";
6196
+ try {
6197
+ return moment.utc(time).local().format(FORMAT || "yyyy-MM-DD");
6198
+ } catch (_unused) {
6199
+ return "";
6200
+ }
6201
+ };
6322
6202
 
6323
- var RecentUserAction;
6324
- (function (RecentUserAction) {
6325
- RecentUserAction["ViewedUser"] = "ViewedUser";
6326
- RecentUserAction["ViewedQNA"] = "ViewedQNA";
6327
- RecentUserAction["ViewedExamResult"] = "ViewedExamResult";
6328
- RecentUserAction["PrintedExamResult"] = "PrintedExamResult";
6329
- RecentUserAction["ViewedAttendance"] = "ViewedAttendance";
6330
- })(RecentUserAction || (RecentUserAction = {}));
6203
+ var getLocalDayOfWeek = function getLocalDayOfWeek(utcDateTime, dayOfWeek) {
6204
+ var currentDayOfWeek = moment.utc(utcDateTime).weekday();
6205
+ var diff = dayOfWeek - currentDayOfWeek;
6206
+ if (diff < 0) diff += 7;
6207
+ return moment.utc(utcDateTime).add(diff, "days").local().weekday();
6208
+ };
6209
+ var getUtcDayOfWeek = function getUtcDayOfWeek(localDateTime, dayOfWeek) {
6210
+ var currentDayOfWeek = _$5.cloneDeep(localDateTime).local().weekday();
6211
+ var diff = dayOfWeek - currentDayOfWeek;
6212
+ if (diff < 0) diff += 7;
6213
+ return localDateTime.add(diff, "days").utc().weekday();
6214
+ };
6215
+ var timeSpanToLocalMoment = function timeSpanToLocalMoment(time, date) {
6216
+ if (!time) return null;
6217
+ var times = time.split(":");
6218
+ if (times.length !== 3) return null;
6219
+ var totalSeconds = +times[0] * 60 * 60 + +times[1] * 60 + +times[2];
6220
+ var startOfDay = moment.utc(date).startOf("day");
6221
+ var dateTime = date ? startOfDay.add(totalSeconds, "seconds") : moment().startOf("day");
6222
+ if (date && dateTime.isBefore(moment.utc(date))) dateTime = dateTime.add(1, "day");
6223
+ return dateTime.local();
6224
+ };
6225
+ var convertHHMMSStoSeconds = function convertHHMMSStoSeconds(time) {
6226
+ var times = time.split(":");
6227
+ return +times[0] * 60 * 60 + +times[1] * 60 + +times[2];
6228
+ };
6229
+ var getRemainTime = function getRemainTime(startTime, duration) {
6230
+ var timePass = diffFromNow(startTime, "second");
6231
+ var durationInNumber = convertHHMMSStoSeconds(duration);
6232
+ if (typeof timePass !== "number") return null;
6233
+ if (timePass > durationInNumber) return 0;
6234
+ return durationInNumber - timePass;
6235
+ };
6331
6236
 
6332
- var UserSortColumn;
6333
- (function (UserSortColumn) {
6334
- UserSortColumn["CreatedAt"] = "CreatedAt";
6335
- UserSortColumn["FullName"] = "FullName";
6336
- UserSortColumn["PhoneNumber"] = "PhoneNumber";
6337
- UserSortColumn["Email"] = "Email";
6338
- UserSortColumn["SchoolName"] = "SchoolName";
6339
- UserSortColumn["Major"] = "Major";
6340
- UserSortColumn["ParentName"] = "ParentName";
6341
- UserSortColumn["ParentPhoneNumber"] = "ParentPhoneNumber";
6342
- UserSortColumn["Grade"] = "Grade";
6343
- })(UserSortColumn || (UserSortColumn = {}));
6237
+ var formatDateTime = function formatDateTime(inputDate) {
6238
+ var date = new Date(inputDate);
6239
+ var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
6240
+ var month = monthNames[date.getMonth()];
6241
+ var day = date.getDate();
6242
+ var year = date.getFullYear();
6243
+ var hour = (date.getHours() < 10 ? "0" : "") + date.getHours();
6244
+ var minute = (date.getMinutes() < 10 ? "0" : "") + date.getMinutes();
6245
+ var formattedDate = month + " " + day + ", " + year + " " + hour + ":" + minute;
6246
+ return formattedDate;
6247
+ };
6248
+ var ellipsisText = function ellipsisText(text, maxLength) {
6249
+ if (!text) return text;
6250
+ return (text === null || text === void 0 ? void 0 : text.length) > maxLength ? text.slice(0, maxLength) + " ..." : text;
6251
+ };
6252
+ var getOrdinalSuffix = function getOrdinalSuffix(number, lang) {
6253
+ var suffixes = {
6254
+ en: ['th', 'st', 'nd', 'rd'],
6255
+ ko: ['']
6256
+ };
6257
+ switch (lang) {
6258
+ case 'en':
6259
+ var j = number % 10;
6260
+ var k = number % 100;
6261
+ if (j === 1 && k !== 11) {
6262
+ return suffixes.en[1];
6263
+ }
6264
+ if (j === 2 && k !== 12) {
6265
+ return suffixes.en[2];
6266
+ }
6267
+ if (j === 3 && k !== 13) {
6268
+ return suffixes.en[3];
6269
+ }
6270
+ return suffixes.en[0];
6271
+ case 'ko':
6272
+ return suffixes.ko[0];
6273
+ default:
6274
+ return '';
6275
+ }
6276
+ };
6277
+ var formatDataMyAnswer = function formatDataMyAnswer(inputData, categories) {
6278
+ var uniqueCategories = new Set();
6279
+ var filterCategories = categories.filter(function (category) {
6280
+ if (!uniqueCategories.has(category.name)) {
6281
+ uniqueCategories.add(category.name);
6282
+ return true;
6283
+ }
6284
+ return false;
6285
+ });
6286
+ var questionsByCategory = filterCategories.map(function (category) {
6287
+ return {
6288
+ category: category,
6289
+ questions: inputData.questions.filter(function (question) {
6290
+ return question.category.name === category.name;
6291
+ })
6292
+ };
6293
+ });
6294
+ return questionsByCategory;
6295
+ };
6296
+ var formatTextbookDataMyAnswer = function formatTextbookDataMyAnswer(inputData, categories) {
6297
+ var uniqueCategories = new Set();
6298
+ var filterCategories = categories.filter(function (category) {
6299
+ if (!uniqueCategories.has(category.name)) {
6300
+ uniqueCategories.add(category.name);
6301
+ return true;
6302
+ }
6303
+ return false;
6304
+ });
6305
+ var questionsByCategory = filterCategories.map(function (category) {
6306
+ return {
6307
+ category: category,
6308
+ questions: inputData.studentQuestionResults.filter(function (question) {
6309
+ return !!question.categories.find(function (i) {
6310
+ return i.name === category.name;
6311
+ });
6312
+ })
6313
+ };
6314
+ });
6315
+ return questionsByCategory;
6316
+ };
6317
+ var totalSolveTimeCategories = function totalSolveTimeCategories(inputData, categories) {
6318
+ var uniqueCategories = new Set();
6319
+ var filterCategories = categories.filter(function (category) {
6320
+ if (!uniqueCategories.has(category.name)) {
6321
+ uniqueCategories.add(category.name);
6322
+ return true;
6323
+ }
6324
+ return false;
6325
+ });
6326
+ var questionsByCategory = filterCategories.map(function (category) {
6327
+ return _extends({}, category, {
6328
+ totalSolveTime: inputData.questions.reduce(function (init, question) {
6329
+ return question.category.name === category.name ? init += question.duration : init;
6330
+ }, 0)
6331
+ });
6332
+ });
6333
+ return questionsByCategory;
6334
+ };
6335
+ var totalTextbookSolveTimeCategories = function totalTextbookSolveTimeCategories(inputData, categories) {
6336
+ var uniqueCategories = new Set();
6337
+ var filterCategories = categories.filter(function (category) {
6338
+ if (!uniqueCategories.has(category.name)) {
6339
+ uniqueCategories.add(category.name);
6340
+ return true;
6341
+ }
6342
+ return false;
6343
+ });
6344
+ var questionsByCategory = filterCategories.map(function (category) {
6345
+ return _extends({}, category, {
6346
+ totalSolveTime: inputData.studentQuestionResults.reduce(function (init, question) {
6347
+ return !!question.categories.find(function (i) {
6348
+ return i.name === category.name;
6349
+ }) ? init += question.duration : init;
6350
+ }, 0)
6351
+ });
6352
+ });
6353
+ return questionsByCategory;
6354
+ };
6355
+ var formatTimeSecond = function formatTimeSecond(duration, t) {
6356
+ duration = Math.round(duration);
6357
+ return "" + (duration < 60 ? "" + duration + t("seconds") : t("mins_mins_seconds_seconds", {
6358
+ mins: Math.floor(duration / 60),
6359
+ seconds: duration % 60
6360
+ }));
6361
+ };
6362
+ var formatRole = function formatRole(roles, t) {
6363
+ if (roles.includes(Role.Admin)) return t("admin");
6364
+ if (roles.includes(Role.AcademyAdminTeacher)) return t("academy_admin_teacher");
6365
+ if (roles.includes(Role.AcademyAdmin)) return t("academy_admin");
6366
+ if (roles.includes(Role.Teacher)) return t("teacher");
6367
+ if (roles.includes(Role.Student)) return t("student");
6368
+ return "";
6369
+ };
6370
+ var getRole = function getRole(roles) {
6371
+ if (roles.includes(Role.AcademyAdminTeacher)) return Role.AcademyAdminTeacher;
6372
+ if (roles.includes(Role.Admin)) return Role.Admin;
6373
+ if (roles.includes(Role.AcademyAdmin)) return Role.AcademyAdmin;
6374
+ if (roles.includes(Role.Teacher)) return Role.Teacher;
6375
+ if (roles.includes(Role.Student)) return Role.Student;
6376
+ return null;
6377
+ };
6344
6378
 
6345
6379
  var useAutoAcademyDomain = function useAutoAcademyDomain(_, history, superUrls, homeUrl, homeAcademyUrl, isAuthPage) {
6346
6380
  if (isAuthPage === void 0) {
@@ -6528,6 +6562,78 @@ var useGoogleSignOut = function useGoogleSignOut(props) {
6528
6562
  };
6529
6563
  };
6530
6564
 
6565
+ var useLanguage = function useLanguage(history) {
6566
+ var language = useSelector(function (state) {
6567
+ var _state$common;
6568
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.language;
6569
+ });
6570
+ var dispatch = useDispatch();
6571
+ var _useTranslation = useTranslation(),
6572
+ i18n = _useTranslation.i18n;
6573
+ var _useState = useState(false),
6574
+ dropdownOpen = _useState[0],
6575
+ setDropdownOpen = _useState[1];
6576
+ var _useState2 = useState(),
6577
+ currentLanguage = _useState2[0],
6578
+ setCurrentLanguage = _useState2[1];
6579
+ var toggle = function toggle() {
6580
+ return setDropdownOpen(function (prevState) {
6581
+ return !prevState;
6582
+ });
6583
+ };
6584
+ var changeLanguageApp = function changeLanguageApp(languageItem) {
6585
+ var search = window.location.search;
6586
+ var searchParams = new URLSearchParams(search);
6587
+ if (!languageItem) {
6588
+ var _navigator$language, _navigator$language$s;
6589
+ var storedLanguage = getLanguage();
6590
+ var browserLanguage = (_navigator$language = navigator.language) === null || _navigator$language === void 0 ? void 0 : (_navigator$language$s = _navigator$language.split("-")) === null || _navigator$language$s === void 0 ? void 0 : _navigator$language$s[0];
6591
+ var defaultLanguageCode = storedLanguage || browserLanguage;
6592
+ languageItem = LANGUAGES.find(function (i) {
6593
+ return i.code === defaultLanguageCode;
6594
+ }) || currentLanguage || DEFAULT_LANGUAGE;
6595
+ }
6596
+ setCurrentLanguage(languageItem);
6597
+ i18n.changeLanguage(languageItem.code);
6598
+ moment.locale(languageItem.momentLangCode);
6599
+ localStorage.setItem(LANGUAGE, languageItem.code);
6600
+ dispatch(setLanguage(languageItem.code));
6601
+ if (window.location.pathname === LOGIN_URL) searchParams["delete"]("lang");else searchParams.set("lang", languageItem.code);
6602
+ pushTo(history, _extends({}, window.location, {
6603
+ search: searchParams.toString()
6604
+ }), true);
6605
+ };
6606
+ var handleChangeLanguageParam = function handleChangeLanguageParam() {
6607
+ var search = window.location.search;
6608
+ var searchParams = new URLSearchParams(search);
6609
+ var langParam = searchParams.get("lang");
6610
+ var languageItem = undefined;
6611
+ if (langParam) {
6612
+ var languageParamItem = LANGUAGES.find(function (i) {
6613
+ return i.code === langParam;
6614
+ });
6615
+ languageItem = languageParamItem || languageItem;
6616
+ }
6617
+ changeLanguageApp(languageItem);
6618
+ };
6619
+ var handleChangeItemLanguage = function handleChangeItemLanguage(lang) {
6620
+ var languageItem = LANGUAGES.find(function (i) {
6621
+ return i.code === lang;
6622
+ });
6623
+ changeLanguageApp(languageItem);
6624
+ };
6625
+ useEffect(function () {
6626
+ handleChangeLanguageParam();
6627
+ }, [window.location.pathname, window.location.search]);
6628
+ return {
6629
+ language: language,
6630
+ dropdownOpen: dropdownOpen,
6631
+ currentLanguage: currentLanguage,
6632
+ toggle: toggle,
6633
+ handleChangeItemLanguage: handleChangeItemLanguage
6634
+ };
6635
+ };
6636
+
6531
6637
  var useList = function useList(fetchData, defaultQuery) {
6532
6638
  var dispatch = useDispatch();
6533
6639
  var _useState = useState(defaultQuery),
@@ -11060,7 +11166,6 @@ var Login = function Login(_ref) {
11060
11166
  var isStudent = rest.role === Role.Student;
11061
11167
  var theme = useTheme();
11062
11168
  var isMobileUp = useMediaQuery(theme.breakpoints.up("md"));
11063
- useLanguage(history);
11064
11169
  return React__default.createElement("div", {
11065
11170
  className: styles["login"] + " font-family-lato"
11066
11171
  }, React__default.createElement(Grid, {
@@ -11303,7 +11408,6 @@ function SignIn(_ref) {
11303
11408
  homeAcademyUrl = _ref.homeAcademyUrl,
11304
11409
  homeUrl = _ref.homeUrl,
11305
11410
  registerUrl = _ref.registerUrl;
11306
- useLanguage(history);
11307
11411
  var _useTranslation = useTranslation(),
11308
11412
  t = _useTranslation.t;
11309
11413
  var _useLoginWithPassword = useLogin$2({
@@ -11762,6 +11866,7 @@ var UserClassSortBy;
11762
11866
  (function (UserClassSortBy) {
11763
11867
  UserClassSortBy["CreatedAt"] = "CreatedAt";
11764
11868
  UserClassSortBy["PhoneNumber"] = "PhoneNumber";
11869
+ UserClassSortBy["ParentPhoneNumber"] = "ParentPhoneNumber";
11765
11870
  UserClassSortBy["FullName"] = "FullName";
11766
11871
  UserClassSortBy["Email"] = "Email";
11767
11872
  })(UserClassSortBy || (UserClassSortBy = {}));
@@ -11800,7 +11905,22 @@ var CLASS_HEADERS = [{
11800
11905
  }, {
11801
11906
  title: "actions"
11802
11907
  }];
11803
- var USER_HEADERS = [{
11908
+ var TEACHER_USER_HEADERS = [{
11909
+ title: "#"
11910
+ }, {
11911
+ title: "email",
11912
+ sortKey: UserSortColumn.Email
11913
+ }, {
11914
+ title: "full_name",
11915
+ sortKey: UserSortColumn.FullName
11916
+ }, {
11917
+ title: "phone_number",
11918
+ sortKey: UserSortColumn.PhoneNumber
11919
+ }, {
11920
+ title: "created_at",
11921
+ sortKey: UserSortColumn.CreatedAt
11922
+ }];
11923
+ var STUDENT_USER_HEADERS = [{
11804
11924
  title: "#"
11805
11925
  }, {
11806
11926
  title: "email",
@@ -11811,6 +11931,9 @@ var USER_HEADERS = [{
11811
11931
  }, {
11812
11932
  title: "phone_number",
11813
11933
  sortKey: UserSortColumn.PhoneNumber
11934
+ }, {
11935
+ title: "parent_phone_number",
11936
+ sortKey: UserSortColumn.ParentPhoneNumber
11814
11937
  }, {
11815
11938
  title: "created_at",
11816
11939
  sortKey: UserSortColumn.CreatedAt
@@ -11896,6 +12019,9 @@ var STUDENT_CLASS_HEADERS = [{
11896
12019
  }, {
11897
12020
  title: "phone_number",
11898
12021
  sortKey: UserClassSortBy.PhoneNumber
12022
+ }, {
12023
+ title: "parent_phone_number",
12024
+ sortKey: UserClassSortBy.ParentPhoneNumber
11899
12025
  }, {
11900
12026
  title: "created_at",
11901
12027
  sortKey: UserClassSortBy.CreatedAt
@@ -12511,7 +12637,7 @@ var StudentList = function StudentList(_ref) {
12511
12637
  }))), React__default.createElement(TableBody, null, classList.map(function (i, index) {
12512
12638
  return React__default.createElement(TableRow, {
12513
12639
  key: i.id
12514
- }, React__default.createElement(TableCell, null, (paging.page - 1) * paging.limit + index + 1), React__default.createElement(TableCell, null, i.studentName), React__default.createElement(TableCell, null, i.studentEmail), React__default.createElement(TableCell, null, i.studentPhoneNumber), React__default.createElement(TableCell, null, utcToLocalTime(i.studentCreatedAt, t("date_time_format"))), React__default.createElement(TableCell, null, formatRole(i.roles, t)), React__default.createElement(TableCell, null, React__default.createElement("div", {
12640
+ }, React__default.createElement(TableCell, null, (paging.page - 1) * paging.limit + index + 1), React__default.createElement(TableCell, null, i.studentName), React__default.createElement(TableCell, null, i.studentEmail), React__default.createElement(TableCell, null, i.studentPhoneNumber), React__default.createElement(TableCell, null, i.studentParentPhoneNumber), React__default.createElement(TableCell, null, utcToLocalTime(i.studentCreatedAt, t("date_time_format"))), React__default.createElement(TableCell, null, formatRole(i.roles, t)), React__default.createElement(TableCell, null, React__default.createElement("div", {
12515
12641
  className: "d-flex"
12516
12642
  }, React__default.createElement(IconButton, {
12517
12643
  color: "default",
@@ -12577,6 +12703,7 @@ var SelectDialog = function SelectDialog(_ref) {
12577
12703
  }
12578
12704
  handleClear();
12579
12705
  }, [open]);
12706
+ var USER_HEADERS = isStudent ? STUDENT_USER_HEADERS : TEACHER_USER_HEADERS;
12580
12707
  return React__default.createElement(CommonDialog, {
12581
12708
  open: open,
12582
12709
  onClose: onClose,
@@ -12631,7 +12758,7 @@ var SelectDialog = function SelectDialog(_ref) {
12631
12758
  },
12632
12759
  color: "primary",
12633
12760
  checked: isItemSelected
12634
- })), React__default.createElement(TableCell, null, (paging.page - 1) * paging.limit + index + 1), React__default.createElement(TableCell, null, i === null || i === void 0 ? void 0 : i.studentEmail), React__default.createElement(TableCell, null, i === null || i === void 0 ? void 0 : i.studentName), React__default.createElement(TableCell, null, i === null || i === void 0 ? void 0 : i.studentPhoneNumber), React__default.createElement(TableCell, null, utcToLocalTime(i === null || i === void 0 ? void 0 : i.studentCreatedAt, t("date_time_format"))));
12761
+ })), React__default.createElement(TableCell, null, (paging.page - 1) * paging.limit + index + 1), React__default.createElement(TableCell, null, i === null || i === void 0 ? void 0 : i.studentEmail), React__default.createElement(TableCell, null, i === null || i === void 0 ? void 0 : i.studentName), React__default.createElement(TableCell, null, i === null || i === void 0 ? void 0 : i.studentPhoneNumber), React__default.createElement(TableCell, null, i === null || i === void 0 ? void 0 : i.studentParentPhoneNumber), React__default.createElement(TableCell, null, utcToLocalTime(i === null || i === void 0 ? void 0 : i.studentCreatedAt, t("date_time_format"))));
12635
12762
  }) : userList.map(function (i, index) {
12636
12763
  var isItemSelected = isSelected(i.teacherId);
12637
12764
  return React__default.createElement(TableRow, {
@@ -21272,7 +21399,7 @@ var PrintExamResultView = function PrintExamResultView(_ref) {
21272
21399
  })));
21273
21400
  };
21274
21401
 
21275
- var USER_HEADERS$1 = [{
21402
+ var USER_HEADERS = [{
21276
21403
  title: "#",
21277
21404
  roles: [Role.Teacher, Role.Admin]
21278
21405
  }, {
@@ -21501,10 +21628,9 @@ var _excluded$a = ["ref"],
21501
21628
  _excluded4 = ["ref"],
21502
21629
  _excluded5 = ["ref"],
21503
21630
  _excluded6 = ["ref"],
21504
- _excluded7 = ["ref"],
21505
- _excluded8 = ["ref"];
21631
+ _excluded7 = ["ref"];
21506
21632
  var UserDialog = function UserDialog(_ref) {
21507
- var _errors$fullName, _errors$fullName2, _errors$fullName3, _errors$email, _errors$email2, _errors$email3, _errors$phoneNumber, _errors$phoneNumber2, _errors$phoneNumber3, _errors$schoolName, _errors$schoolName2, _errors$schoolName3, _errors$subjectId, _errors$subjectId2, _errors$grade, _errors$grade2, _errors$grade3, _errors$major, _errors$major2, _errors$major3, _errors$parentName, _errors$parentName2, _errors$parentName3, _errors$parentPhoneNu, _errors$parentPhoneNu2, _errors$parentPhoneNu3;
21633
+ var _errors$fullName, _errors$fullName2, _errors$fullName3, _errors$email, _errors$email2, _errors$email3, _errors$phoneNumber, _errors$phoneNumber2, _errors$phoneNumber3, _errors$schoolName, _errors$schoolName2, _errors$schoolName3, _errors$subjectId, _errors$subjectId2, _errors$grade, _errors$grade2, _errors$major, _errors$major2, _errors$major3, _errors$parentName, _errors$parentName2, _errors$parentName3, _errors$parentPhoneNu, _errors$parentPhoneNu2, _errors$parentPhoneNu3;
21508
21634
  var open = _ref.open,
21509
21635
  data = _ref.data,
21510
21636
  disabled = _ref.disabled,
@@ -21520,6 +21646,7 @@ var UserDialog = function UserDialog(_ref) {
21520
21646
  setValue = _useForm.setValue,
21521
21647
  getValues = _useForm.getValues,
21522
21648
  clearErrors = _useForm.clearErrors,
21649
+ watch = _useForm.watch,
21523
21650
  errors = _useForm.formState.errors;
21524
21651
  var _useTranslation = useTranslation(),
21525
21652
  t = _useTranslation.t;
@@ -21535,18 +21662,15 @@ var UserDialog = function UserDialog(_ref) {
21535
21662
  var _register4 = register("schoolName"),
21536
21663
  schoolNameRef = _register4.ref,
21537
21664
  schoolNameBio = _objectWithoutPropertiesLoose(_register4, _excluded4);
21538
- var _register5 = register("grade"),
21539
- gradeRef = _register5.ref,
21540
- gradeBio = _objectWithoutPropertiesLoose(_register5, _excluded5);
21541
- var _register6 = register("major"),
21542
- majorRef = _register6.ref,
21543
- majorBio = _objectWithoutPropertiesLoose(_register6, _excluded6);
21544
- var _register7 = register("parentName"),
21545
- parentNameRef = _register7.ref,
21546
- parentNameBio = _objectWithoutPropertiesLoose(_register7, _excluded7);
21547
- var _register8 = register("parentPhoneNumber"),
21548
- parentPhoneNumberRef = _register8.ref,
21549
- parentPhoneNumberBio = _objectWithoutPropertiesLoose(_register8, _excluded8);
21665
+ var _register5 = register("major"),
21666
+ majorRef = _register5.ref,
21667
+ majorBio = _objectWithoutPropertiesLoose(_register5, _excluded5);
21668
+ var _register6 = register("parentName"),
21669
+ parentNameRef = _register6.ref,
21670
+ parentNameBio = _objectWithoutPropertiesLoose(_register6, _excluded6);
21671
+ var _register7 = register("parentPhoneNumber"),
21672
+ parentPhoneNumberRef = _register7.ref,
21673
+ parentPhoneNumberBio = _objectWithoutPropertiesLoose(_register7, _excluded7);
21550
21674
  var _useState = useState([]),
21551
21675
  roles = _useState[0],
21552
21676
  setRoles = _useState[1];
@@ -21572,6 +21696,29 @@ var UserDialog = function UserDialog(_ref) {
21572
21696
  isDefaultPassCodeChanged = _useState8[0],
21573
21697
  setDefaultPassCodeChanged = _useState8[1];
21574
21698
  var theme = useTheme();
21699
+ var gradeOptions = useMemo(function () {
21700
+ var _watch;
21701
+ var schoolName = (_watch = watch("schoolName")) === null || _watch === void 0 ? void 0 : _watch.trim();
21702
+ if (schoolName !== null && schoolName !== void 0 && schoolName.includes(t("middle_school")) || schoolName !== null && schoolName !== void 0 && schoolName.includes("중학교")) return MIDDLE_GRADES.map(function (i) {
21703
+ return _extends({}, i, {
21704
+ label: typeof i.label === "string" ? t(i.label) : i.label
21705
+ });
21706
+ });
21707
+ if (schoolName !== null && schoolName !== void 0 && schoolName.includes(t("high_school")) || schoolName !== null && schoolName !== void 0 && schoolName.includes("고등학교")) return HIGH_GRADES.map(function (i) {
21708
+ return _extends({}, i, {
21709
+ label: t(i.label)
21710
+ });
21711
+ });
21712
+ if (schoolName !== null && schoolName !== void 0 && schoolName.includes(t("elementary_school")) || schoolName !== null && schoolName !== void 0 && schoolName.includes("초등학교")) return ELEMENTARY_GRADES.map(function (i) {
21713
+ return _extends({}, i, {
21714
+ label: typeof i.label === "string" ? t(i.label) : i.label
21715
+ });
21716
+ });
21717
+ return [];
21718
+ }, [t, watch("schoolName")]);
21719
+ console.log({
21720
+ bang: watch("grade")
21721
+ });
21575
21722
  var handleChangeRole = function handleChangeRole(role) {
21576
21723
  setRoles([role]);
21577
21724
  setValue("role", role);
@@ -21823,22 +21970,18 @@ var UserDialog = function UserDialog(_ref) {
21823
21970
  className: "mb-1",
21824
21971
  htmlFor: "grade",
21825
21972
  text: t("grade")
21826
- }), React__default.createElement(InputText, Object.assign({
21973
+ }), React__default.createElement(CustomSelect, {
21827
21974
  id: "grade",
21828
21975
  placeholder: t("enter_grade"),
21829
- inputRef: gradeRef,
21830
- type: "number",
21831
- InputProps: {
21832
- inputProps: {
21833
- min: 1,
21834
- max: 12
21835
- }
21836
- }
21837
- }, gradeBio, {
21838
- error: !!((_errors$grade = errors.grade) !== null && _errors$grade !== void 0 && _errors$grade.message),
21976
+ options: gradeOptions,
21977
+ isClearable: false,
21978
+ value: watch("grade"),
21979
+ onChange: function onChange(value) {
21980
+ return setValue('grade', value === null || value === void 0 ? void 0 : value.value);
21981
+ },
21839
21982
  disabled: disabled
21840
- })), ((_errors$grade2 = errors.grade) === null || _errors$grade2 === void 0 ? void 0 : _errors$grade2.message) && React__default.createElement(ErrorHandler, {
21841
- text: t((_errors$grade3 = errors.grade) === null || _errors$grade3 === void 0 ? void 0 : _errors$grade3.message)
21983
+ }), ((_errors$grade = errors.grade) === null || _errors$grade === void 0 ? void 0 : _errors$grade.message) && React__default.createElement(ErrorHandler, {
21984
+ text: t((_errors$grade2 = errors.grade) === null || _errors$grade2 === void 0 ? void 0 : _errors$grade2.message)
21842
21985
  }))), React__default.createElement(Grid, {
21843
21986
  item: true,
21844
21987
  xs: 6
@@ -22393,7 +22536,7 @@ var useUserList = function useUserList(role) {
22393
22536
  useEffect(function () {
22394
22537
  getUserById((selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id) || 0);
22395
22538
  }, [selectedUser === null || selectedUser === void 0 ? void 0 : selectedUser.id]);
22396
- var userHeaders = USER_HEADERS$1.filter(function (i) {
22539
+ var userHeaders = USER_HEADERS.filter(function (i) {
22397
22540
  return i.roles.includes(role);
22398
22541
  });
22399
22542
  return {
@@ -25552,8 +25695,7 @@ var CreateExamDrawer = function CreateExamDrawer(props) {
25552
25695
 
25553
25696
  var TextbookViewDetail = function TextbookViewDetail(props) {
25554
25697
  var _textbook$chapters;
25555
- var navigate = props.navigate,
25556
- as = props.as,
25698
+ var as = props.as,
25557
25699
  className = props.className,
25558
25700
  onNavigateDetail = props.onNavigateDetail;
25559
25701
  var _useTextbookDetail = useTextbookDetail(props),
@@ -25604,9 +25746,7 @@ var TextbookViewDetail = function TextbookViewDetail(props) {
25604
25746
  }),
25605
25747
  categoryOptions = _useCategorySelect.categoryOptions;
25606
25748
  var Wrapper = as || Container;
25607
- if (isNotFound || id && textbook.isPrepared) return React__default.createElement(NotFound, {
25608
- history: navigate
25609
- });
25749
+ if (isNotFound || id && textbook.isPrepared) return React__default.createElement(NotFound, null);
25610
25750
  return React__default.createElement(Wrapper, {
25611
25751
  maxWidth: "xl",
25612
25752
  className: "bg-white py-5 p-4 rounded-4 h-100 d-flex flex-column " + className
@@ -27320,13 +27460,13 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
27320
27460
  };
27321
27461
  };
27322
27462
 
27323
- var SchoolType;
27463
+ var SchoolType$1;
27324
27464
  (function (SchoolType) {
27325
27465
  SchoolType[SchoolType["Default"] = 0] = "Default";
27326
- SchoolType[SchoolType["Elemantary"] = 1] = "Elemantary";
27466
+ SchoolType[SchoolType["Elementary"] = 1] = "Elementary";
27327
27467
  SchoolType[SchoolType["Middle"] = 2] = "Middle";
27328
27468
  SchoolType[SchoolType["High"] = 3] = "High";
27329
- })(SchoolType || (SchoolType = {}));
27469
+ })(SchoolType$1 || (SchoolType$1 = {}));
27330
27470
  var HighSchoolGrade;
27331
27471
  (function (HighSchoolGrade) {
27332
27472
  HighSchoolGrade[HighSchoolGrade["Default"] = 0] = "Default";
@@ -27367,18 +27507,18 @@ var TextbookState;
27367
27507
  TextbookState[TextbookState["Article"] = 3] = "Article";
27368
27508
  })(TextbookState || (TextbookState = {}));
27369
27509
 
27370
- var SCHOOL_OPTIONS = [{
27510
+ var SCHOOL_OPTIONS$1 = [{
27371
27511
  label: "all",
27372
- value: SchoolType.Default
27512
+ value: SchoolType$1.Default
27373
27513
  }, {
27374
- label: "elemantary_school",
27375
- value: SchoolType.Elemantary
27514
+ label: "elementary_school",
27515
+ value: SchoolType$1.Elementary
27376
27516
  }, {
27377
27517
  label: "middle_school",
27378
- value: SchoolType.Middle
27518
+ value: SchoolType$1.Middle
27379
27519
  }, {
27380
27520
  label: "high_school",
27381
- value: SchoolType.High
27521
+ value: SchoolType$1.High
27382
27522
  }];
27383
27523
  var SEMESTER_OPTIONS = Array.from({
27384
27524
  length: 3
@@ -27404,7 +27544,7 @@ var ELEMANTARY_GRADES = Array.from({
27404
27544
  value: index
27405
27545
  };
27406
27546
  });
27407
- var MIDDLE_GRADES = Array.from({
27547
+ var MIDDLE_GRADES$1 = Array.from({
27408
27548
  length: 4
27409
27549
  }, function (_, index) {
27410
27550
  return {
@@ -27412,7 +27552,7 @@ var MIDDLE_GRADES = Array.from({
27412
27552
  value: index
27413
27553
  };
27414
27554
  });
27415
- var HIGH_GRADES = [{
27555
+ var HIGH_GRADES$1 = [{
27416
27556
  label: "all",
27417
27557
  value: HighSchoolGrade.Default
27418
27558
  }, {
@@ -27769,8 +27909,8 @@ var ArticleBlock = function ArticleBlock(_ref) {
27769
27909
  setFieldValue(path + ".categories", [val === null || val === void 0 ? void 0 : val.value]);
27770
27910
  };
27771
27911
  var handleChangeSubCategory = function handleChangeSubCategory(val) {
27772
- setFieldValue(path + ".categoryOptions[1]", [val]);
27773
- setFieldValue(path + ".categories[1]", [val === null || val === void 0 ? void 0 : val.value]);
27912
+ setFieldValue(path + ".categoryOptions[1]", val);
27913
+ setFieldValue(path + ".categories[1]", val === null || val === void 0 ? void 0 : val.value);
27774
27914
  };
27775
27915
  return React__default.createElement(Stack, {
27776
27916
  direction: "row",
@@ -29077,21 +29217,21 @@ var QuestionTypeFilter = function QuestionTypeFilter(_ref) {
29077
29217
  }));
29078
29218
  if (inputRef.current) inputRef.current.value = "";
29079
29219
  };
29080
- var schoolOptions = SCHOOL_OPTIONS.map(function (i) {
29220
+ var schoolOptions = SCHOOL_OPTIONS$1.map(function (i) {
29081
29221
  return _extends({}, i, {
29082
29222
  label: t(i.label)
29083
29223
  });
29084
29224
  });
29085
29225
  var gradeOptions = useMemo(function () {
29086
29226
  switch (filter === null || filter === void 0 ? void 0 : filter.schoolType) {
29087
- case SchoolType.Middle:
29088
- return MIDDLE_GRADES.map(function (i) {
29227
+ case SchoolType$1.Middle:
29228
+ return MIDDLE_GRADES$1.map(function (i) {
29089
29229
  return _extends({}, i, {
29090
29230
  label: typeof i.label === "string" ? t(i.label) : i.label
29091
29231
  });
29092
29232
  });
29093
- case SchoolType.High:
29094
- return HIGH_GRADES.map(function (i) {
29233
+ case SchoolType$1.High:
29234
+ return HIGH_GRADES$1.map(function (i) {
29095
29235
  return _extends({}, i, {
29096
29236
  label: t(i.label)
29097
29237
  });
@@ -29136,7 +29276,7 @@ var QuestionTypeFilter = function QuestionTypeFilter(_ref) {
29136
29276
  options: gradeOptions,
29137
29277
  isClearable: false,
29138
29278
  onChange: handleGradeChange
29139
- })), (!(filter !== null && filter !== void 0 && filter.schoolType) || (filter === null || filter === void 0 ? void 0 : filter.schoolType) === SchoolType.Elemantary) && React__default.createElement(FormGroup, {
29279
+ })), (!(filter !== null && filter !== void 0 && filter.schoolType) || (filter === null || filter === void 0 ? void 0 : filter.schoolType) === SchoolType$1.Elementary) && React__default.createElement(FormGroup, {
29140
29280
  sx: {
29141
29281
  flexGrow: 1
29142
29282
  }
@@ -29145,7 +29285,7 @@ var QuestionTypeFilter = function QuestionTypeFilter(_ref) {
29145
29285
  options: semesterOptions,
29146
29286
  isClearable: false,
29147
29287
  onChange: handleSemesterChange
29148
- })), (!(filter !== null && filter !== void 0 && filter.schoolType) || (filter === null || filter === void 0 ? void 0 : filter.schoolType) === SchoolType.Elemantary) && React__default.createElement(FormGroup, {
29288
+ })), (!(filter !== null && filter !== void 0 && filter.schoolType) || (filter === null || filter === void 0 ? void 0 : filter.schoolType) === SchoolType$1.Elementary) && React__default.createElement(FormGroup, {
29149
29289
  sx: {
29150
29290
  flexGrow: 1
29151
29291
  }
@@ -29281,9 +29421,11 @@ var useTextbookOptions = function useTextbookOptions(subjectId, isMath, filter,
29281
29421
  }
29282
29422
  return isMath ? _temp(_getCategoryQuestionT) : Promise.resolve(isSuperAdmin ? getCategoryListAdminApi$1(_extends({}, questionTypeFilters, {
29283
29423
  subjectId: subjectId,
29424
+ isRootCategory: true,
29284
29425
  textSearch: (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.value
29285
29426
  })) : getCategoryListApi$1(_extends({}, questionTypeFilters, {
29286
29427
  subjectId: subjectId,
29428
+ isRootCategory: true,
29287
29429
  textSearch: (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.value
29288
29430
  }))).then(_temp);
29289
29431
  }
@@ -30186,6 +30328,7 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
30186
30328
  coverImage: selectedTextbook.coverImage || "",
30187
30329
  textbookOwners: selectedTextbook.textbookOwners,
30188
30330
  isPublic: selectedTextbook.isPublic || false,
30331
+ isShared: selectedTextbook.isShared || false,
30189
30332
  isPrepared: true,
30190
30333
  type: selectedTextbook.type,
30191
30334
  chapters: selectedTextbook.chapters.map(function (c) {
@@ -30244,7 +30387,7 @@ var convertResponseToRequest = function convertResponseToRequest(selectedTextboo
30244
30387
  questions: g.questions.map(function (q) {
30245
30388
  var _q$questionType2;
30246
30389
  return _extends({}, q, {
30247
- questionTypeId: q.questionTypeId,
30390
+ questionTypeId: q.questionTypeId || q.questionType.id,
30248
30391
  questionType: (_q$questionType2 = q.questionType) !== null && _q$questionType2 !== void 0 && _q$questionType2.id ? {
30249
30392
  label: q.questionType.name,
30250
30393
  value: q.questionType.id
@@ -30292,6 +30435,10 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
30292
30435
  dirty = formikProps.dirty,
30293
30436
  submitCount = formikProps.submitCount,
30294
30437
  setValues = formikProps.setValues;
30438
+ console.log({
30439
+ values: values,
30440
+ errors: errors
30441
+ });
30295
30442
  useEffect(function () {
30296
30443
  var handleBeforeUnload = function handleBeforeUnload(event) {
30297
30444
  var message = t$1("are_you_sure_you_want_to_quit_yours_changes_may_not_be_saved");
@@ -30436,7 +30583,7 @@ var PreparedTextbookForm = function PreparedTextbookForm(_ref) {
30436
30583
  sx: {
30437
30584
  color: contentsErrors && submitCount ? error.main + "!important" : "gray"
30438
30585
  }
30439
- }, a11yProps(1))), React__default.createElement(Tab, Object.assign({
30586
+ }, a11yProps(1))), !(values !== null && values !== void 0 && values.isPublic) && (!isAdmin || textbookId) && (!textbookId || (values === null || values === void 0 ? void 0 : values.isShared)) && React__default.createElement(Tab, Object.assign({
30440
30587
  label: t$1("textbook.owners"),
30441
30588
  sx: {
30442
30589
  color: textbookOwnersErrors && submitCount ? error.main + "!important" : "gray"
@@ -31593,7 +31740,7 @@ var ChapterDetail = function ChapterDetail(_ref) {
31593
31740
  fontSize: "12px",
31594
31741
  fontWeight: 600,
31595
31742
  color: styles.gray_500
31596
- }, chapter.totalChapterQuestions + " " + t("questions")), expanded ? React__default.createElement(IoChevronUpOutline, {
31743
+ }, (chapter.totalChapterQuestions || 0) + " " + t("questions")), expanded ? React__default.createElement(IoChevronUpOutline, {
31597
31744
  onClick: handleToggleExpand
31598
31745
  }) : React__default.createElement(IoChevronDownOutline, {
31599
31746
  onClick: handleToggleExpand
@@ -31644,7 +31791,7 @@ var ChapterDetail = function ChapterDetail(_ref) {
31644
31791
  fontWeight: 600,
31645
31792
  color: styles.gray_500
31646
31793
  }, t("chapter_progress", {
31647
- total: chapter === null || chapter === void 0 ? void 0 : chapter.totalChapterQuestions
31794
+ total: (chapter === null || chapter === void 0 ? void 0 : chapter.totalChapterQuestions) || 0
31648
31795
  }))) : React__default.createElement(Stack, {
31649
31796
  flexDirection: "row",
31650
31797
  gap: "4px"
@@ -31653,7 +31800,7 @@ var ChapterDetail = function ChapterDetail(_ref) {
31653
31800
  fontWeight: 600,
31654
31801
  color: styles.gray_500
31655
31802
  }, t("chapter_progress", {
31656
- total: chapter === null || chapter === void 0 ? void 0 : chapter.totalChapterQuestions
31803
+ total: (chapter === null || chapter === void 0 ? void 0 : chapter.totalChapterQuestions) || 0
31657
31804
  })), React__default.createElement(Typography, {
31658
31805
  fontSize: "13px",
31659
31806
  fontWeight: 600,
@@ -31866,7 +32013,7 @@ var Statistic = function Statistic(_ref) {
31866
32013
  fontWeight: 600,
31867
32014
  color: styles.gray_500
31868
32015
  }, t("chapter_progress", {
31869
- total: chapter === null || chapter === void 0 ? void 0 : chapter.totalChapterQuestions
32016
+ total: (chapter === null || chapter === void 0 ? void 0 : chapter.totalChapterQuestions) || 0
31870
32017
  }))) : React__default.createElement(Stack, {
31871
32018
  flexDirection: "row",
31872
32019
  gap: "4px"
@@ -31875,7 +32022,7 @@ var Statistic = function Statistic(_ref) {
31875
32022
  fontWeight: 600,
31876
32023
  color: styles.gray_500
31877
32024
  }, t("chapter_progress", {
31878
- total: chapter === null || chapter === void 0 ? void 0 : chapter.totalChapterQuestions
32025
+ total: (chapter === null || chapter === void 0 ? void 0 : chapter.totalChapterQuestions) || 0
31879
32026
  })), React__default.createElement(Typography, {
31880
32027
  fontSize: "13px",
31881
32028
  fontWeight: 600,
@@ -31926,7 +32073,7 @@ var Statistic = function Statistic(_ref) {
31926
32073
  sx: {
31927
32074
  width: "1px",
31928
32075
  position: "absolute",
31929
- left: (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 + "%",
32076
+ left: ((chapter.totalChapterQuestions || 0) != 0 ? (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 : 0) + "%",
31930
32077
  background: styles.darker,
31931
32078
  height: "100%"
31932
32079
  }
@@ -31947,27 +32094,27 @@ var Statistic = function Statistic(_ref) {
31947
32094
  }, React__default.createElement(Stack, {
31948
32095
  sx: {
31949
32096
  background: styles.dark,
31950
- width: (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 + "%",
32097
+ width: ((chapter.totalChapterQuestions || 0) != 0 ? (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 : 0) + "%",
31951
32098
  height: "100%"
31952
32099
  }
31953
32100
  }), React__default.createElement(Stack, {
31954
32101
  sx: {
31955
32102
  width: "1px",
31956
32103
  position: "absolute",
31957
- left: (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 + "%",
32104
+ left: ((chapter.totalChapterQuestions || 0) != 0 ? (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 : 0) + "%",
31958
32105
  background: styles.darker,
31959
32106
  height: "100%"
31960
32107
  }
31961
32108
  }), React__default.createElement(Stack, {
31962
32109
  sx: {
31963
32110
  position: "absolute",
31964
- left: (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 > 90 ? (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 - 7 + "%" : ((chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 || 0) + 5 + "%"
32111
+ left: (chapter.totalChapterQuestions || 0) != 0 ? (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 : ((chapter.totalChapterQuestions || 0) != 0 ? (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 : 0) + 5 + "%"
31965
32112
  }
31966
32113
  }, React__default.createElement(Typography, {
31967
32114
  fontSize: "12px",
31968
32115
  fontWeight: 500,
31969
32116
  color: styles.darker
31970
- }, ((chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100).toFixed(2) + "%")), React__default.createElement(Stack, {
32117
+ }, ((chapter.totalChapterQuestions || 0) != 0 ? (chapter.completedChapterQuestions || 0) / (chapter.totalChapterQuestions || 0) * 100 : 0).toFixed(2) + "%")), React__default.createElement(Stack, {
31971
32118
  sx: {
31972
32119
  width: "1px",
31973
32120
  position: "absolute",
@@ -34080,7 +34227,6 @@ var Header = function Header(_ref) {
34080
34227
  return language === Language.en ? React__default.createElement(studentFullLogoEn, null) : React__default.createElement(studentFullLogoKo, null);
34081
34228
  }
34082
34229
  }, [isTeacherSide, language]);
34083
- var pathname = location.pathname.toLowerCase();
34084
34230
  return React__default.createElement(Stack, {
34085
34231
  width: "100%",
34086
34232
  display: "flex",
@@ -34111,41 +34257,43 @@ var Header = function Header(_ref) {
34111
34257
  flexDirection: "row",
34112
34258
  gap: '12px',
34113
34259
  className: "" + styles["routerBox"]
34114
- }, headerTabs.map(function (_ref2) {
34115
- var path = _ref2.path,
34116
- icon = _ref2.icon,
34117
- label = _ref2.label,
34118
- activePaths = _ref2.activePaths;
34119
- return React__default.createElement(Link, {
34120
- key: path,
34121
- "aria-current": "page",
34122
- to: !isAcademy ? "#" : path,
34123
- className: "text-decoration-none " + ((activePaths !== null && activePaths !== void 0 && activePaths.length ? activePaths.some(function (a) {
34124
- return pathname === a;
34125
- }) : pathname === path) ? "" + styles["router-link-active"] : "") + " " + styles["tabText"] + " " + (!isAcademy ? styles["disabled-link"] : "")
34126
- }, React__default.createElement(Stack, {
34127
- sx: {
34128
- justifyContent: "center",
34129
- flexDirection: "row",
34130
- alignItems: "center",
34131
- textOverflow: "ellipsis",
34132
- overflow: "hidden",
34133
- display: "flex",
34134
- flexWrap: "nowrap",
34135
- padding: activePaths !== null && activePaths !== void 0 && activePaths.some(function (a) {
34136
- return pathname.startsWith(a);
34137
- }) || pathname.startsWith(path) ? "6px 12px" : "6px 24px"
34138
- }
34139
- }, icon, React__default.createElement(Typography, {
34140
- sx: {
34141
- textWrap: "nowrap",
34142
- fontWeight: 700,
34143
- fontSize: "14px",
34144
- display: activePaths !== null && activePaths !== void 0 && activePaths.some(function (a) {
34145
- return pathname.startsWith(a);
34146
- }) || pathname.startsWith(path) ? 'block' : 'none'
34147
- }
34148
- }, t(label))));
34260
+ }, React__default.createElement(ListView, {
34261
+ data: headerTabs,
34262
+ render: function render(data, index) {
34263
+ return React__default.createElement(HeaderLink, {
34264
+ key: index,
34265
+ data: data,
34266
+ render: function render(_ref2, isActive) {
34267
+ var path = _ref2.path,
34268
+ icon = _ref2.icon,
34269
+ label = _ref2.label;
34270
+ return React__default.createElement(Link, {
34271
+ key: path,
34272
+ "aria-current": "page",
34273
+ to: !isAcademy ? "#" : path,
34274
+ className: "text-decoration-none " + (isActive ? "" + styles["router-link-active"] : "") + " " + styles["tabText"] + " " + (!isAcademy ? styles["disabled-link"] : "")
34275
+ }, React__default.createElement(Stack, {
34276
+ sx: {
34277
+ justifyContent: "center",
34278
+ flexDirection: "row",
34279
+ alignItems: "center",
34280
+ textOverflow: "ellipsis",
34281
+ overflow: "hidden",
34282
+ display: "flex",
34283
+ flexWrap: "nowrap",
34284
+ padding: isActive ? "6px 12px" : "6px 24px"
34285
+ }
34286
+ }, icon, React__default.createElement(Typography, {
34287
+ sx: {
34288
+ textWrap: "nowrap",
34289
+ fontWeight: 700,
34290
+ fontSize: "14px",
34291
+ display: isActive ? 'block' : 'none'
34292
+ }
34293
+ }, t(label))));
34294
+ }
34295
+ });
34296
+ }
34149
34297
  })), React__default.createElement(Stack, {
34150
34298
  direction: "row",
34151
34299
  alignItems: "center"
@@ -34168,6 +34316,17 @@ var Header = function Header(_ref) {
34168
34316
  history: history
34169
34317
  }))));
34170
34318
  };
34319
+ var HeaderLink = function HeaderLink(_ref3) {
34320
+ var data = _ref3.data,
34321
+ render = _ref3.render;
34322
+ var activePaths = data.activePaths,
34323
+ path = data.path;
34324
+ var pathname = location.pathname.toLowerCase();
34325
+ var isActive = (activePaths === null || activePaths === void 0 ? void 0 : activePaths.some(function (a) {
34326
+ return pathname.startsWith(a);
34327
+ })) || pathname.startsWith(path);
34328
+ return React__default.createElement(Fragment$1, null, render(data, isActive));
34329
+ };
34171
34330
 
34172
34331
  var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy, domain) {
34173
34332
  var _currentPusher$connec2;
@@ -34355,5 +34514,5 @@ var LayoutContext = function LayoutContext(_ref) {
34355
34514
  });else return React__default.createElement(Fragment$1, null, children);
34356
34515
  };
34357
34516
 
34358
- export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnswerCountSelector, ArticleCategorySelector, ArticleDialog, ArticleGroupView, BASE_URL, _ChapterBox as ChapterBox, ChatContainer, types as ChatTypes, ClassDetail, ClassList, ClassNoteDialog, ClassSelector, CommonDialog, ConfirmDeleteDialog, ConfirmDialog, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_NOTE_FILTER, DEFAULT_PAGING_RESPONSE, DefaultErrorMessage, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamDetailView, ExamEvent, ExamNoteDialog, ExamResultV2, ExamStatus, GOOGLE_CLIENT_ID, GOOGLE_RECAPTCHA_ID, GOOGLE_RECAPTCHA_KEY, GOOGLE_RECAPTCHA_SECRET, Header, InputText, LANGUAGE, LEARNING_SPACE, Language, LanguageHeaders, LayoutContext, ListView, Loading, LoadingComponent, Login, LoginQRCode, LoginWithEmail, SignIn as LoginWithPassword, MathJaxContainer, MathTinyEditor, NewNoteButton, NoAcademyHeaders, NotFound, NotesContainer, NotificationDetail, NotificationList, OrderBy, OrderType, PRE_REDIRECT_URL, PUSHER_CONFIG, PassCodeCheck, PassCodeDialog, PreparedItem, PreparedTextbookList, PreparedTextbookView, PreparedType, PrintContainerClassName, PrintContentClassName, PrintExamResultView, PrintExamView2, PrintHeaderClassName, PrintTitleClassName, QRCodeConfirmation, QuestionAnswerType, QuestionCountSelector, REDIRECT_URL, RELEASE_DATE, RecentUserAction, RecentUserActionNames, RecentUserActionSortBy, ReleaseAlert, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SearchInput, ShareToTeacherDialog, StudentSelector, SubjectSelector, TextbookActionButtons, TextbookViewDetail as TextbookDetail, TextbookDrawer, TextbookList, TheAcademyDropdown, TheLanguageDropdown, TinyEditor, UserList, UserSortColumn, VirtualListView, VirtualTableView, api, apiUpload, canAccess as canAccessRoute, checkSuperUrl, convertHHMMSStoSeconds, createRecentUserActionListApi, diffFromNow, ellipsisText, encodeParams, formatDataMyAnswer, formatDateTime, formatRole, formatTextbookDataMyAnswer, formatTime, formatTimeSecond, getAcademyDomain, getAccessToken, getErrorMessage, getLanguage, getLearningSpace, getLocalDayOfWeek, getOrdinalSuffix, getRecentUserActionListApi, getRedirectUrl, getRemainTime, getRole, getUtcDayOfWeek, i18n, isLocalHost, minutesToTimeSpan, pushTo, reset, setAcademies, setAcademy, setAlert, setConcurrentConnectionPusher, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, timAgo, timeSpanToLocalMoment, toISOString, toLocalTime, totalSolveTimeCategories, totalTextbookSolveTimeCategories, useAutoAcademyDomain, useChatContainer, useCountDownTimer, useGoogleSignOut, useLanguage, useList, useLoadMore, useLogin, useNotes, usePusherConversation, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
34517
+ export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AcceptNoAcademy, ActionButtons, AnswerCountSelector, ArticleCategorySelector, ArticleDialog, ArticleGroupView, BASE_URL, _ChapterBox as ChapterBox, ChatContainer, types as ChatTypes, ClassDetail, ClassList, ClassNoteDialog, ClassSelector, CommonDialog, ConfirmDeleteDialog, ConfirmDialog, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_NOTE_FILTER, DEFAULT_PAGING_RESPONSE, DefaultErrorMessage, ELEMENTARY_GRADES, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, ExamDetailView, ExamEvent, ExamNoteDialog, ExamResultV2, ExamStatus, GOOGLE_CLIENT_ID, GOOGLE_RECAPTCHA_ID, GOOGLE_RECAPTCHA_KEY, GOOGLE_RECAPTCHA_SECRET, HIGH_GRADES, Header, InputText, LANGUAGE, LEARNING_SPACE, Language, LanguageHeaders, LayoutContext, ListView, Loading, LoadingComponent, Login, LoginQRCode, LoginWithEmail, SignIn as LoginWithPassword, MIDDLE_GRADES, MathJaxContainer, MathTinyEditor, NewNoteButton, NoAcademyHeaders, NotFound, NotesContainer, NotificationDetail, NotificationList, OrderBy, OrderType, PRE_REDIRECT_URL, PUSHER_CONFIG, PassCodeCheck, PassCodeDialog, PreparedItem, PreparedTextbookList, PreparedTextbookView, PreparedType, PrintContainerClassName, PrintContentClassName, PrintExamResultView, PrintExamView2, PrintHeaderClassName, PrintTitleClassName, QRCodeConfirmation, QuestionAnswerType, QuestionCountSelector, REDIRECT_URL, RELEASE_DATE, RecentUserAction, RecentUserActionNames, RecentUserActionSortBy, ReleaseAlert, Role, SCHOOL_OPTIONS, SUPER_ADMIN_BASE_URL, SchoolType, ScoreSelector, SearchInput, ShareToTeacherDialog, StudentSelector, SubjectSelector, TextbookActionButtons, TextbookViewDetail as TextbookDetail, TextbookDrawer, TextbookList, TheAcademyDropdown, TheLanguageDropdown, TinyEditor, UserList, UserSortColumn, VirtualListView, VirtualTableView, api, apiUpload, canAccess as canAccessRoute, checkSuperUrl, convertHHMMSStoSeconds, createRecentUserActionListApi, diffFromNow, ellipsisText, encodeParams, formatDataMyAnswer, formatDateTime, formatRole, formatTextbookDataMyAnswer, formatTime, formatTimeSecond, getAcademyDomain, getAccessToken, getErrorMessage, getLanguage, getLearningSpace, getLocalDayOfWeek, getOrdinalSuffix, getRecentUserActionListApi, getRedirectUrl, getRemainTime, getRole, getUtcDayOfWeek, i18n, isLocalHost, minutesToTimeSpan, pushTo, reset, setAcademies, setAcademy, setAlert, setConcurrentConnectionPusher, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, timAgo, timeSpanToLocalMoment, toISOString, toLocalTime, totalSolveTimeCategories, totalTextbookSolveTimeCategories, useAutoAcademyDomain, useChatContainer, useCountDownTimer, useGoogleSignOut, useLanguage, useList, useLoadMore, useLogin, useNotes, usePusherConversation, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
34359
34518
  //# sourceMappingURL=index.modern.js.map