touchstudy-core 0.1.33 → 0.1.35

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.
@@ -9,7 +9,7 @@ import { useDispatch, useSelector } from 'react-redux';
9
9
  import axios from 'axios';
10
10
  import { useTranslation, initReactI18next } from 'react-i18next';
11
11
  export { I18nextProvider, useTranslation } from 'react-i18next';
12
- import { Grid, Dialog, DialogTitle, IconButton, DialogContent, TextField, DialogActions, Button, Box, Typography, Pagination, styled, Tooltip, tooltipClasses, Stack, ClickAwayListener, useMediaQuery, CircularProgress, FormControl, RadioGroup, FormControlLabel, Radio, FormGroup, FormLabel, InputLabel, Container, Table, TableBody, TableRow, TableCell, TableHead, Paper, InputBase } from '@mui/material';
12
+ import { Grid, Dialog, DialogTitle, IconButton, DialogContent, TextField, DialogActions, Button, Box, Typography, Pagination, styled, Tooltip, tooltipClasses, Stack, ClickAwayListener, useTheme, useMediaQuery, CircularProgress, FormControl, RadioGroup, FormControlLabel, Radio, FormGroup, FormLabel, Checkbox, InputLabel, Container, Table, TableBody, TableRow, TableCell, TableHead, Paper, InputBase } from '@mui/material';
13
13
  import { gapi } from 'gapi-script';
14
14
  import Pusher from 'pusher-js';
15
15
  import { IoClose, IoCloseOutline, IoSearch } from 'react-icons/io5';
@@ -24,9 +24,9 @@ import { GoArrowSwitch } from 'react-icons/go';
24
24
  import { toast } from 'react-toastify';
25
25
  export { ToastContainer, toast } from 'react-toastify';
26
26
  import Select, { components } from 'react-select';
27
- import { FaCaretDown, FaTrash, FaPlus, FaSave, FaPencilAlt, FaSortUp, FaSortDown, FaEye, FaPlusCircle } from 'react-icons/fa';
27
+ import { FaCaretDown, FaTrash, FaPlus, FaSave, FaPencilAlt, FaPlusCircle, FaTimes, FaSortUp, FaSortDown, FaEye } from 'react-icons/fa';
28
28
  import { PiDotsNineLight } from 'react-icons/pi';
29
- import { IoMdArrowBack } from 'react-icons/io';
29
+ import { IoMdArrowBack, IoIosLogOut } from 'react-icons/io';
30
30
  import _ from 'lodash';
31
31
  import { FaPencil } from 'react-icons/fa6';
32
32
  import CreatableSelect from 'react-select/creatable';
@@ -37,6 +37,7 @@ import DialogTitle$1 from '@mui/material/DialogTitle';
37
37
  import DialogContent$1 from '@mui/material/DialogContent';
38
38
  import DialogActions$1 from '@mui/material/DialogActions';
39
39
  import Typography$1 from '@mui/material/Typography';
40
+ import { useLocation, Link } from 'react-router-dom';
40
41
 
41
42
  var setLoading = createAction("common/setLoading");
42
43
  var setAlert = createAction("common/setAlert");
@@ -136,7 +137,7 @@ function _objectWithoutPropertiesLoose(source, excluded) {
136
137
  return target;
137
138
  }
138
139
 
139
- var styleGlobal = {"btn-login-google":"_2HqmH","block-login":"_wWIyO","box-login":"_38Lo1","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"};
140
+ var styles = {"btn-login-google":"_2HqmH","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","image-academy--item":"_3RDWF","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"};
140
141
 
141
142
  var AuthenticationMessage;
142
143
  (function (AuthenticationMessage) {
@@ -463,18 +464,18 @@ var BlockLogin = function BlockLogin(_ref) {
463
464
  var handleSubmit = formikProps.handleSubmit;
464
465
  return React.createElement(Grid, {
465
466
  container: true,
466
- className: "" + styleGlobal["box-login"]
467
+ className: "" + styles["box-login"]
467
468
  }, React.createElement(Grid, {
468
469
  item: true,
469
470
  className: "p-0 d-flex justify-content-center"
470
471
  }, React.createElement("form", {
471
- className: "" + styleGlobal["block-login"],
472
+ className: "" + styles["block-login"],
472
473
  onSubmit: handleSubmit
473
474
  }, React.createElement("div", {
474
- className: "" + styleGlobal["block-form"]
475
+ className: "" + styles["block-form"]
475
476
  }, React.createElement("img", {
476
477
  src: "/images/logo.jpeg",
477
- className: "" + styleGlobal["img-login-rectangle"]
478
+ className: "" + styles["img-login-rectangle"]
478
479
  }), React.createElement("div", {
479
480
  className: "p-0 mt-1 mb-4"
480
481
  }, React.createElement(GoogleLogin, {
@@ -483,7 +484,7 @@ var BlockLogin = function BlockLogin(_ref) {
483
484
  onSuccess: onSuccessGoogle,
484
485
  onFailure: onFailureGoogle,
485
486
  cookiePolicy: "single_host_origin",
486
- className: "" + styleGlobal["btn-login-google"],
487
+ className: "" + styles["btn-login-google"],
487
488
  isSignedIn: true
488
489
  }))))));
489
490
  });
@@ -547,7 +548,7 @@ var Login = function Login(_ref) {
547
548
  var _useLogin = useLogin$1(onNavigate),
548
549
  defaultInfo = _useLogin.defaultInfo;
549
550
  return React.createElement("div", {
550
- className: styleGlobal["login"] + " container-fluid font-family-lato"
551
+ className: styles["login"] + " container-fluid font-family-lato"
551
552
  }, React.createElement(Grid, {
552
553
  container: true,
553
554
  spacing: 3,
@@ -880,6 +881,7 @@ var switchAcademy = function switchAcademy(academyId) {
880
881
  };
881
882
 
882
883
  var LayoutContext = function LayoutContext(_ref) {
884
+ var _currentPusher$connec, _currentPusher$connec3;
883
885
  var children = _ref.children,
884
886
  role = _ref.role,
885
887
  _ref$pusherRegisterUr = _ref.pusherRegisterUrls,
@@ -904,6 +906,7 @@ var LayoutContext = function LayoutContext(_ref) {
904
906
  var _state$common3;
905
907
  return state === null || state === void 0 ? void 0 : (_state$common3 = state.common) === null || _state$common3 === void 0 ? void 0 : _state$common3.concurrentConnectionPusher;
906
908
  });
909
+ var currentPusher = concurrentConnectionPusher === null || concurrentConnectionPusher === void 0 ? void 0 : concurrentConnectionPusher.pusher;
907
910
  var roles = (user === null || user === void 0 ? void 0 : user.roles) || [];
908
911
  var academyDomain = user === null || user === void 0 ? void 0 : user.academyDomain;
909
912
  var pathname = window.location.pathname;
@@ -970,31 +973,41 @@ var LayoutContext = function LayoutContext(_ref) {
970
973
  return Promise.reject(e);
971
974
  }
972
975
  };
976
+ console.log({
977
+ connection: currentPusher === null || currentPusher === void 0 ? void 0 : (_currentPusher$connec = currentPusher.connection) === null || _currentPusher$connec === void 0 ? void 0 : _currentPusher$connec.state,
978
+ pusherRegisterUrls: pusherRegisterUrls,
979
+ pathname: pathname
980
+ });
973
981
  var registerPusher = useCallback(function () {
974
- if (pusherRegisterUrls.includes(pathname.toLocaleLowerCase()) && academyDomain && academyDomain !== (concurrentConnectionPusher === null || concurrentConnectionPusher === void 0 ? void 0 : concurrentConnectionPusher.academyDomain) && isReadyRegisterPusher) {
975
- var _headers;
976
- if (concurrentConnectionPusher.pusher) {
977
- concurrentConnectionPusher.pusher.disconnect();
978
- }
979
- var token = getAccessToken();
980
- var pusher = new Pusher(PUSHER_CONFIG.key, {
981
- cluster: PUSHER_CONFIG.cluster,
982
- authEndpoint: BASE_URL + "/api/auth/pusher",
983
- auth: {
984
- params: {},
985
- headers: (_headers = {
986
- Authorization: "Bearer " + token
987
- }, _headers[AcademyHeaders] = academyDomain, _headers)
982
+ if (pusherRegisterUrls.includes(pathname.toLocaleLowerCase())) {
983
+ var _currentPusher$connec2;
984
+ if (academyDomain && academyDomain !== (concurrentConnectionPusher === null || concurrentConnectionPusher === void 0 ? void 0 : concurrentConnectionPusher.academyDomain) && isReadyRegisterPusher) {
985
+ var _headers;
986
+ if (currentPusher) {
987
+ currentPusher.disconnect();
988
988
  }
989
- });
990
- dispatch(setConcurrentConnectionPusher({
991
- pusher: pusher,
992
- academyDomain: academyDomain
993
- }));
989
+ var token = getAccessToken();
990
+ var pusher = new Pusher(PUSHER_CONFIG.key, {
991
+ cluster: PUSHER_CONFIG.cluster,
992
+ authEndpoint: BASE_URL + "/api/auth/pusher",
993
+ auth: {
994
+ params: {},
995
+ headers: (_headers = {
996
+ Authorization: "Bearer " + token
997
+ }, _headers[AcademyHeaders] = academyDomain, _headers)
998
+ }
999
+ });
1000
+ dispatch(setConcurrentConnectionPusher({
1001
+ pusher: pusher,
1002
+ academyDomain: academyDomain
1003
+ }));
1004
+ } else if ((currentPusher === null || currentPusher === void 0 ? void 0 : (_currentPusher$connec2 = currentPusher.connection) === null || _currentPusher$connec2 === void 0 ? void 0 : _currentPusher$connec2.state) === "disconnected") {
1005
+ currentPusher.connect();
1006
+ }
994
1007
  }
995
- if ((!pusherRegisterUrls.includes(pathname.toLocaleLowerCase()) || !isReadyRegisterPusher) && !!(concurrentConnectionPusher !== null && concurrentConnectionPusher !== void 0 && concurrentConnectionPusher.pusher)) {
996
- if (concurrentConnectionPusher.pusher) {
997
- concurrentConnectionPusher.pusher.disconnect();
1008
+ if (!pusherRegisterUrls.includes(pathname.toLocaleLowerCase()) && !!currentPusher) {
1009
+ if (currentPusher) {
1010
+ currentPusher.disconnect();
998
1011
  }
999
1012
  dispatch(setConcurrentConnectionPusher({
1000
1013
  pusher: null,
@@ -1004,7 +1017,7 @@ var LayoutContext = function LayoutContext(_ref) {
1004
1017
  if (!pusherRegisterUrls.includes(pathname.toLocaleLowerCase()) && isReadyRegisterPusher) {
1005
1018
  dispatch(setReadyRegisterPusher(false));
1006
1019
  }
1007
- }, [pusherRegisterUrls.join(","), academyDomain, pathname, isReadyRegisterPusher]);
1020
+ }, [pusherRegisterUrls.join(","), academyDomain, pathname, isReadyRegisterPusher, currentPusher === null || currentPusher === void 0 ? void 0 : (_currentPusher$connec3 = currentPusher.connection) === null || _currentPusher$connec3 === void 0 ? void 0 : _currentPusher$connec3.state]);
1008
1021
  useEffect(function () {
1009
1022
  !user && loadInfo();
1010
1023
  !!user && checkRoleUser();
@@ -1015,8 +1028,8 @@ var LayoutContext = function LayoutContext(_ref) {
1015
1028
  useEffect(function () {
1016
1029
  registerPusher();
1017
1030
  return function () {
1018
- if (concurrentConnectionPusher.pusher) {
1019
- concurrentConnectionPusher.pusher.disconnect();
1031
+ if (currentPusher) {
1032
+ currentPusher.disconnect();
1020
1033
  }
1021
1034
  };
1022
1035
  }, [registerPusher]);
@@ -1305,6 +1318,7 @@ var recent_exam_results = "최근 시험 결과";
1305
1318
  var instructor_name = "강사이름";
1306
1319
  var academy_name = "학원 이름";
1307
1320
  var total_students = "총 학생수";
1321
+ var total_class = "반 수";
1308
1322
  var total_number_students = "총 학생수";
1309
1323
  var student = "학생";
1310
1324
  var students = "재학생";
@@ -1321,8 +1335,9 @@ var mins_mins_seconds_seconds = "{{mins}}분 {{seconds}}초";
1321
1335
  var mins_mins = "{{mins}}분";
1322
1336
  var class_name = "반 이름";
1323
1337
  var create_new_exam = "새 시험 생성";
1338
+ var live_exam = "시험 생성";
1324
1339
  var there_are_no_recent_exams = "최근 시험이 없습니다";
1325
- var you_have_created_a_exam_with_code_code_do_you_want_to_continue = "코드가 {{code}} 시험을 생성했습니다. 계속하시겠습니까?";
1340
+ var you_have_started_an_exam_with_code_code_do_you_want_to_continue = "{{code}} 코드로 시험을 시작했습니다. 계속하시겠습니까?";
1326
1341
  var here = "여기";
1327
1342
  var do_you_want_to_complete_the_exam = "시험을 완료처리 하시겠습니까?";
1328
1343
  var are_you_sure_you_want_to_delete_the_exam = "시험을 삭제하시겠습니까?";
@@ -1561,6 +1576,7 @@ var course = "진로";
1561
1576
  var etc = "그 외";
1562
1577
  var consultation_category = "상담 카테고리";
1563
1578
  var points = "{{number}} 점";
1579
+ var noun_number_of_people = "인원 수";
1564
1580
  var number_of_people = "{{ number }} 명";
1565
1581
  var total_classes = "반수";
1566
1582
  var number_of_classes = "{{ number }} 개";
@@ -1579,6 +1595,30 @@ var comparison_of_top_rankings_and_problem_solving_order = "상위권과 문제
1579
1595
  var my_answers = "내 해답";
1580
1596
  var request_for_consultation = "상담요청";
1581
1597
  var ask_a_question_with_a_problem = "문제로 질문하기";
1598
+ var live = "살다";
1599
+ var user_email = "사용자 이메일";
1600
+ var user_academy = {
1601
+ add: "사용자 추가",
1602
+ update_user_roles: "사용자 역할 업데이트",
1603
+ add_failed: "아카데미에 사용자 추가 실패",
1604
+ add_successfully: "사용자를 아카데미에 추가했습니다",
1605
+ remove_failed: "아카데미에서 사용자를 제거하지 못했습니다",
1606
+ remove_successfully: "아카데미에서 사용자를 성공적으로 제거했습니다",
1607
+ update_user_roles_failed: "아카데미 사용자 역할 업데이트에 실패했습니다",
1608
+ update_user_roles__successfully: "아카데미 사용자 역할을 성공적으로 제거했습니다",
1609
+ get_failed: "아카데미 사용자 가져오기 실패"
1610
+ };
1611
+ var get_users_failed = "사용자 가져오기 실패";
1612
+ var status_of_each_class = "각 반별 현황";
1613
+ var attendance_rate = "출석률";
1614
+ var select_article_create_exam = "시험을 만들 기사를 선택하세요.";
1615
+ var comprehensive_analysis = "내 해답";
1616
+ var solution_order = "풀이 순서";
1617
+ var compare_solution = "풀이 비교";
1618
+ var problem_analysis = "문제 분석";
1619
+ var class_information = "수업정보";
1620
+ var teachers = "교사";
1621
+ var lessons = "수업";
1582
1622
  var lang_ko = {
1583
1623
  problem_solving: problem_solving,
1584
1624
  my_story: my_story,
@@ -1596,6 +1636,7 @@ var lang_ko = {
1596
1636
  instructor_name: instructor_name,
1597
1637
  academy_name: academy_name,
1598
1638
  total_students: total_students,
1639
+ total_class: total_class,
1599
1640
  total_number_students: total_number_students,
1600
1641
  student: student,
1601
1642
  students: students,
@@ -1614,8 +1655,9 @@ var lang_ko = {
1614
1655
  mins_mins: mins_mins,
1615
1656
  class_name: class_name,
1616
1657
  create_new_exam: create_new_exam,
1658
+ live_exam: live_exam,
1617
1659
  there_are_no_recent_exams: there_are_no_recent_exams,
1618
- you_have_created_a_exam_with_code_code_do_you_want_to_continue: you_have_created_a_exam_with_code_code_do_you_want_to_continue,
1660
+ you_have_started_an_exam_with_code_code_do_you_want_to_continue: you_have_started_an_exam_with_code_code_do_you_want_to_continue,
1619
1661
  here: here,
1620
1662
  do_you_want_to_complete_the_exam: do_you_want_to_complete_the_exam,
1621
1663
  are_you_sure_you_want_to_delete_the_exam: are_you_sure_you_want_to_delete_the_exam,
@@ -1851,6 +1893,7 @@ var lang_ko = {
1851
1893
  etc: etc,
1852
1894
  consultation_category: consultation_category,
1853
1895
  points: points,
1896
+ noun_number_of_people: noun_number_of_people,
1854
1897
  number_of_people: number_of_people,
1855
1898
  total_classes: total_classes,
1856
1899
  number_of_classes: number_of_classes,
@@ -1868,7 +1911,21 @@ var lang_ko = {
1868
1911
  comparison_of_top_rankings_and_problem_solving_order: comparison_of_top_rankings_and_problem_solving_order,
1869
1912
  my_answers: my_answers,
1870
1913
  request_for_consultation: request_for_consultation,
1871
- ask_a_question_with_a_problem: ask_a_question_with_a_problem
1914
+ ask_a_question_with_a_problem: ask_a_question_with_a_problem,
1915
+ live: live,
1916
+ user_email: user_email,
1917
+ user_academy: user_academy,
1918
+ get_users_failed: get_users_failed,
1919
+ status_of_each_class: status_of_each_class,
1920
+ attendance_rate: attendance_rate,
1921
+ select_article_create_exam: select_article_create_exam,
1922
+ comprehensive_analysis: comprehensive_analysis,
1923
+ solution_order: solution_order,
1924
+ compare_solution: compare_solution,
1925
+ problem_analysis: problem_analysis,
1926
+ class_information: class_information,
1927
+ teachers: teachers,
1928
+ lessons: lessons
1872
1929
  };
1873
1930
 
1874
1931
  var problem_solving$1 = "Problem Solving";
@@ -1887,6 +1944,7 @@ var recent_exam_results$1 = "Recent exam";
1887
1944
  var instructor_name$1 = "Instructor name";
1888
1945
  var academy_name$1 = "Academy name";
1889
1946
  var total_students$1 = "Total students";
1947
+ var total_class$1 = "Total Class";
1890
1948
  var total_number_students$1 = "Total number of students";
1891
1949
  var students$1 = "Students";
1892
1950
  var student$1 = "Student";
@@ -1903,8 +1961,9 @@ var mins_mins_seconds_seconds$1 = "{{mins}}m {{seconds}}s";
1903
1961
  var mins_mins$1 = "{{mins}}m";
1904
1962
  var class_name$1 = "Class name";
1905
1963
  var create_new_exam$1 = "Create exam";
1964
+ var live_exam$1 = "Live exam";
1906
1965
  var there_are_no_recent_exams$1 = "There are no recent exams";
1907
- var you_have_created_a_exam_with_code_code_do_you_want_to_continue$1 = "You have created a exam with code {{code}}, do you want to continue?";
1966
+ var you_have_started_an_exam_with_code_code_do_you_want_to_continue$1 = "You have started an exam with code {{code}}, do you want to continue?";
1908
1967
  var here$1 = "here";
1909
1968
  var do_you_want_to_complete_the_exam$1 = "Do you want to complete the exam?";
1910
1969
  var are_you_sure_you_want_to_delete_the_exam$1 = "Are you sure you want to delete the exam?";
@@ -2178,6 +2237,7 @@ var course$1 = "Course";
2178
2237
  var etc$1 = "Etc";
2179
2238
  var consultation_category$1 = "Consultation Category";
2180
2239
  var points$1 = "{{number}} points";
2240
+ var noun_number_of_people$1 = "Number of people";
2181
2241
  var number_of_people$1 = "{{ number }} students";
2182
2242
  var total_classes$1 = "Total classes";
2183
2243
  var number_of_classes$1 = "{{ number }} classes";
@@ -2196,6 +2256,30 @@ var comparison_of_top_rankings_and_problem_solving_order$1 = "Comparison of top
2196
2256
  var my_answers$1 = "My answers";
2197
2257
  var request_for_consultation$1 = "Request for consultation";
2198
2258
  var ask_a_question_with_a_problem$1 = "Ask a question with a problem";
2259
+ var live$1 = "live";
2260
+ var user_email$1 = "User email";
2261
+ var user_academy$1 = {
2262
+ add: "Add user",
2263
+ update_user_roles: "Update user roles",
2264
+ add_failed: "Add user to academy failed",
2265
+ add_successfully: "Add user to academy successfully",
2266
+ remove_failed: "Remove user from academy failed",
2267
+ remove_successfully: "Remove user from academy successfully",
2268
+ update_user_roles_failed: "Update academy user roles failed",
2269
+ update_user_roles_successfully: "Update academy user roles successfully",
2270
+ get_failed: "Get academy users failed"
2271
+ };
2272
+ var get_users_failed$1 = "Get users failed";
2273
+ var status_of_each_class$1 = "Status of each class";
2274
+ var attendance_rate$1 = "Attendance Rate";
2275
+ var select_article_create_exam$1 = "Select article to create exam";
2276
+ var comprehensive_analysis$1 = "Comprehensive analysis";
2277
+ var solution_order$1 = "Solution order";
2278
+ var compare_solution$1 = "Compare solution";
2279
+ var problem_analysis$1 = "Problem analysis";
2280
+ var class_information$1 = "Class Information";
2281
+ var teachers$1 = "Teachers";
2282
+ var lessons$1 = "Lessons";
2199
2283
  var lang_en = {
2200
2284
  problem_solving: problem_solving$1,
2201
2285
  my_story: my_story$1,
@@ -2213,6 +2297,7 @@ var lang_en = {
2213
2297
  instructor_name: instructor_name$1,
2214
2298
  academy_name: academy_name$1,
2215
2299
  total_students: total_students$1,
2300
+ total_class: total_class$1,
2216
2301
  total_number_students: total_number_students$1,
2217
2302
  students: students$1,
2218
2303
  student: student$1,
@@ -2231,8 +2316,9 @@ var lang_en = {
2231
2316
  mins_mins: mins_mins$1,
2232
2317
  class_name: class_name$1,
2233
2318
  create_new_exam: create_new_exam$1,
2319
+ live_exam: live_exam$1,
2234
2320
  there_are_no_recent_exams: there_are_no_recent_exams$1,
2235
- you_have_created_a_exam_with_code_code_do_you_want_to_continue: you_have_created_a_exam_with_code_code_do_you_want_to_continue$1,
2321
+ you_have_started_an_exam_with_code_code_do_you_want_to_continue: you_have_started_an_exam_with_code_code_do_you_want_to_continue$1,
2236
2322
  here: here$1,
2237
2323
  do_you_want_to_complete_the_exam: do_you_want_to_complete_the_exam$1,
2238
2324
  are_you_sure_you_want_to_delete_the_exam: are_you_sure_you_want_to_delete_the_exam$1,
@@ -2503,6 +2589,7 @@ var lang_en = {
2503
2589
  etc: etc$1,
2504
2590
  consultation_category: consultation_category$1,
2505
2591
  points: points$1,
2592
+ noun_number_of_people: noun_number_of_people$1,
2506
2593
  number_of_people: number_of_people$1,
2507
2594
  total_classes: total_classes$1,
2508
2595
  number_of_classes: number_of_classes$1,
@@ -2520,7 +2607,21 @@ var lang_en = {
2520
2607
  comparison_of_top_rankings_and_problem_solving_order: comparison_of_top_rankings_and_problem_solving_order$1,
2521
2608
  my_answers: my_answers$1,
2522
2609
  request_for_consultation: request_for_consultation$1,
2523
- ask_a_question_with_a_problem: ask_a_question_with_a_problem$1
2610
+ ask_a_question_with_a_problem: ask_a_question_with_a_problem$1,
2611
+ live: live$1,
2612
+ user_email: user_email$1,
2613
+ user_academy: user_academy$1,
2614
+ get_users_failed: get_users_failed$1,
2615
+ status_of_each_class: status_of_each_class$1,
2616
+ attendance_rate: attendance_rate$1,
2617
+ select_article_create_exam: select_article_create_exam$1,
2618
+ comprehensive_analysis: comprehensive_analysis$1,
2619
+ solution_order: solution_order$1,
2620
+ compare_solution: compare_solution$1,
2621
+ problem_analysis: problem_analysis$1,
2622
+ class_information: class_information$1,
2623
+ teachers: teachers$1,
2624
+ lessons: lessons$1
2524
2625
  };
2525
2626
 
2526
2627
  i18n.use(initReactI18next).init({
@@ -2801,7 +2902,8 @@ var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
2801
2902
  var role = _ref.role,
2802
2903
  navigate = _ref.navigate,
2803
2904
  homeAcademyUrl = _ref.homeAcademyUrl,
2804
- homeUrl = _ref.homeUrl;
2905
+ homeUrl = _ref.homeUrl,
2906
+ hideAcademyName = _ref.hideAcademyName;
2805
2907
  var _useSwitchAcademy = useSwitchAcademy(role, navigate, homeAcademyUrl, homeUrl),
2806
2908
  academyList = _useSwitchAcademy.academyList,
2807
2909
  handleSwitchAcademy = _useSwitchAcademy.handleSwitchAcademy,
@@ -2835,15 +2937,15 @@ var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
2835
2937
  };
2836
2938
  return React.createElement(Fragment$1, null, React.createElement(Button, {
2837
2939
  onClick: handleOpen,
2838
- className: "" + styleGlobal["academy-btn"],
2940
+ className: "" + styles["academy-btn"],
2839
2941
  sx: _extends({}, popoverStyle)
2840
2942
  }, React.createElement("div", {
2841
- className: "" + styleGlobal["image-academy"]
2943
+ className: styles["image-academy"] + " me-0 me-lg-2"
2842
2944
  }, selectedAcademy !== null && selectedAcademy !== void 0 && selectedAcademy.image ? React.createElement("img", {
2843
2945
  src: selectedAcademy === null || selectedAcademy === void 0 ? void 0 : selectedAcademy.image,
2844
2946
  alt: selectedAcademy === null || selectedAcademy === void 0 ? void 0 : selectedAcademy.name
2845
- }) : React.createElement("span", null, firstLetter)), React.createElement(Typography, {
2846
- className: "text-start",
2947
+ }) : React.createElement("span", null, firstLetter)), !hideAcademyName && React.createElement(Typography, {
2948
+ className: "text-start d-none d-lg-block",
2847
2949
  sx: {
2848
2950
  fontSize: 14,
2849
2951
  fontWeight: 600,
@@ -2851,7 +2953,7 @@ var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
2851
2953
  minWidth: 150
2852
2954
  }
2853
2955
  }, (selectedAcademy === null || selectedAcademy === void 0 ? void 0 : selectedAcademy.name) || t(role === Role.Admin ? "switch_academy_admin" : "switch_academy")), React.createElement("div", {
2854
- className: "" + styleGlobal["switch-icon"]
2956
+ className: styles["switch-icon"] + " d-none d-lg-flex"
2855
2957
  }, React.createElement(GoArrowSwitch, {
2856
2958
  size: 14
2857
2959
  }))), (isSuperAdmin || !isAdmin) && React.createElement(Popover, {
@@ -2872,7 +2974,10 @@ var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
2872
2974
  p: 0.5,
2873
2975
  mt: 1,
2874
2976
  ml: 0.75,
2875
- width: 300,
2977
+ width: {
2978
+ xs: 200,
2979
+ lg: 300
2980
+ },
2876
2981
  minWidth: "unset!important"
2877
2982
  }
2878
2983
  }
@@ -2893,7 +2998,7 @@ var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
2893
2998
  fontWeight: 600
2894
2999
  }
2895
3000
  }, React.createElement("div", {
2896
- className: "" + styleGlobal["image-academy"]
3001
+ className: styles["image-academy"] + " " + styles["image-academy--item"]
2897
3002
  }, option.image ? React.createElement(Box$1, {
2898
3003
  component: "img",
2899
3004
  alt: option.name,
@@ -3003,7 +3108,7 @@ var CustomSelect = function CustomSelect(_ref) {
3003
3108
  }, rest));
3004
3109
  };
3005
3110
 
3006
- var styles = {"header__avatar":"_2oGcJ","header__select":"_2y2XV","body":"_ntGyI","list":"_m7Fwt","list__item__header":"_3BM8N","list__item__avatar":"_1ReOK","list__item__avatar-container":"_2qbld","list__item__message":"_3s01i","list__item__message--reply-from":"_2Qxi3","list__item__message--reply-from-right":"_34Vx4","list__item__message--reply":"_3uheq","list__item__message--reply-right":"_2iBr7","reply-text":"_3ZPjO","container-custom":"_38A9k","student-row-col-1":"_Jt5t0","student-row-col-1-active":"_14DKj","row-col-2":"_qHGiR","inputBox":"_2iY67","inputBoxTable":"_3pCw0","background-chat":"_zILbw","wrap-content":"_38gsM","name-sender":"_Lfzyw","content-chat-sender":"_1X73E","content-chat-receiver":"_32V7T","custom-scroll":"_2Uul2","btn-send":"_395lb","btn-chat":"_gDYwm","input-chat":"_22TX5","btn-cancel":"_1u-eg","btn-register":"_22r6_","form-label-dialog":"_jADIA","form-select-width":"_WncPd","padding-content":"_3hz3H","form-label":"_MMQxP","form-control":"_1mJfc"};
3111
+ var styles$1 = {"header__avatar":"_2oGcJ","header__select":"_2y2XV","body":"_ntGyI","list":"_m7Fwt","list__item__header":"_3BM8N","list__item__avatar":"_1ReOK","list__item__avatar-container":"_2qbld","list__item__message":"_3s01i","list__item__message--reply-from":"_2Qxi3","list__item__message--reply-from-right":"_34Vx4","list__item__message--reply":"_3uheq","list__item__message--reply-right":"_2iBr7","reply-text":"_3ZPjO","container-custom":"_38A9k","student-row-col-1":"_Jt5t0","student-row-col-1-active":"_14DKj","row-col-2":"_qHGiR","inputBox":"_2iY67","inputBoxTable":"_3pCw0","background-chat":"_zILbw","wrap-content":"_38gsM","name-sender":"_Lfzyw","content-chat-sender":"_1X73E","content-chat-receiver":"_32V7T","custom-scroll":"_2Uul2","btn-send":"_395lb","btn-chat":"_gDYwm","input-chat":"_22TX5","btn-cancel":"_1u-eg","btn-register":"_22r6_","form-label-dialog":"_jADIA","form-select-width":"_WncPd","padding-content":"_3hz3H","form-label":"_MMQxP","form-control":"_1mJfc"};
3007
3112
 
3008
3113
  var iconPersonNoActive = function iconPersonNoActive(_ref) {
3009
3114
  var _ref$width = _ref.width,
@@ -3149,7 +3254,7 @@ var ChatRightItem = function ChatRightItem(_ref) {
3149
3254
  padding: "4px 0"
3150
3255
  }, React.createElement(Box, null, showName && isStudent && React.createElement(Box, {
3151
3256
  gap: "8px",
3152
- className: " " + styles["name-sender"],
3257
+ className: " " + styles$1["name-sender"],
3153
3258
  display: "flex",
3154
3259
  alignItems: "center",
3155
3260
  flexDirection: "row"
@@ -3204,7 +3309,7 @@ var ChatRightItem = function ChatRightItem(_ref) {
3204
3309
  objectFit: "contain"
3205
3310
  }
3206
3311
  })) : React.createElement("div", {
3207
- className: styles["wrap-content"] + " " + styles["content-chat-receiver"],
3312
+ className: styles$1["wrap-content"] + " " + styles$1["content-chat-receiver"],
3208
3313
  style: {
3209
3314
  "float": "inline-end"
3210
3315
  }
@@ -3242,7 +3347,7 @@ var ChatLeftItem = function ChatLeftItem(_ref) {
3242
3347
  display: "flex",
3243
3348
  padding: "4px",
3244
3349
  flexDirection: "row",
3245
- className: "" + styles["name-sender"]
3350
+ className: "" + styles$1["name-sender"]
3246
3351
  }, isStudent ? React.createElement(Fragment$1, null, React.createElement(Typography, {
3247
3352
  fontWeight: 500,
3248
3353
  fontSize: 14,
@@ -3282,7 +3387,7 @@ var ChatLeftItem = function ChatLeftItem(_ref) {
3282
3387
  objectFit: "contain"
3283
3388
  }
3284
3389
  })) : React.createElement("div", {
3285
- className: styles["wrap-content"] + " " + styles["content-chat-sender"]
3390
+ className: styles$1["wrap-content"] + " " + styles$1["content-chat-sender"]
3286
3391
  }, React.createElement(Typography, {
3287
3392
  fontWeight: 500,
3288
3393
  fontSize: "14px",
@@ -3495,7 +3600,7 @@ var UpdateMessageDialog = function UpdateMessageDialog(_ref) {
3495
3600
  _objectDestructuringEmpty(_ref2);
3496
3601
  return React.createElement(Form, null, React.createElement("label", {
3497
3602
  htmlFor: "content",
3498
- className: styles['form-label'] + " " + styles['form-label-dialog']
3603
+ className: styles$1['form-label'] + " " + styles$1['form-label-dialog']
3499
3604
  }, "\uC9C8\uBB38\uD560 \uBB38\uC81C"), React.createElement(Field, {
3500
3605
  id: "content",
3501
3606
  style: {
@@ -3504,7 +3609,7 @@ var UpdateMessageDialog = function UpdateMessageDialog(_ref) {
3504
3609
  name: "content",
3505
3610
  validate: validate,
3506
3611
  placeholder: "\uBB38\uC81C\uAC00 \uC5B4\uB824\uC6CC\uC694",
3507
- className: styles['form-control']
3612
+ className: styles$1['form-control']
3508
3613
  }), React.createElement(DialogActions, {
3509
3614
  sx: {
3510
3615
  display: 'flex',
@@ -3513,14 +3618,14 @@ var UpdateMessageDialog = function UpdateMessageDialog(_ref) {
3513
3618
  padding: '12px'
3514
3619
  }
3515
3620
  }, React.createElement(Button, {
3516
- className: styles['btn-cancel'],
3621
+ className: styles$1['btn-cancel'],
3517
3622
  onClick: onClose
3518
3623
  }, React.createElement(Typography, {
3519
3624
  fontWeight: 700,
3520
3625
  fontSize: '14px',
3521
3626
  lineHeight: '16.71px'
3522
3627
  }, "\uCDE8\uC18C")), React.createElement(Button, {
3523
- className: styles['btn-register'],
3628
+ className: styles$1['btn-register'],
3524
3629
  type: "submit"
3525
3630
  }, React.createElement(Typography, {
3526
3631
  fontWeight: 700,
@@ -3569,14 +3674,14 @@ var UpdateMessageDialog = function UpdateMessageDialog(_ref) {
3569
3674
  padding: '12px'
3570
3675
  }
3571
3676
  }, React.createElement(Button, {
3572
- className: styles['btn-cancel'],
3677
+ className: styles$1['btn-cancel'],
3573
3678
  onClick: onClose
3574
3679
  }, React.createElement(Typography, {
3575
3680
  fontWeight: 700,
3576
3681
  fontSize: '14px',
3577
3682
  lineHeight: '16.71px'
3578
3683
  }, "\uCDE8\uC18C")), React.createElement(Button, {
3579
- className: styles['btn-register'],
3684
+ className: styles$1['btn-register'],
3580
3685
  sx: {
3581
3686
  bgcolor: !(selectedFile !== null && selectedFile !== void 0 && selectedFile.content) ? "#EBEBFF !important" : "#5458D5 !important"
3582
3687
  },
@@ -3750,7 +3855,7 @@ var ChatList = function ChatList(_ref) {
3750
3855
  var isStudent = roles === null || roles === void 0 ? void 0 : roles.includes(Roles$1.Student);
3751
3856
  return React.createElement("ul", {
3752
3857
  ref: listItemRef,
3753
- className: styles["list"] + " " + styles["padding-content"] + " d-flex h-100 flex-column mb-0 " + (!(filterMessage !== null && filterMessage !== void 0 && filterMessage.length) ? 'justify-content-center' : '')
3858
+ className: styles$1["list"] + " " + styles$1["padding-content"] + " d-flex h-100 flex-column mb-0 " + (!(filterMessage !== null && filterMessage !== void 0 && filterMessage.length) ? 'justify-content-center' : '')
3754
3859
  }, !(filterMessage !== null && filterMessage !== void 0 && filterMessage.length) && React.createElement("li", {
3755
3860
  className: "text-muted text-center fst-italic fs-6"
3756
3861
  }, "No message"), !!(filterMessage !== null && filterMessage !== void 0 && filterMessage.length) && filterMessage.map(function (message) {
@@ -3857,7 +3962,7 @@ var InputChat = function InputChat(_ref) {
3857
3962
  color: "#fff",
3858
3963
  size: 30
3859
3964
  }))), React.createElement("input", {
3860
- className: styles["input-chat"],
3965
+ className: styles$1["input-chat"],
3861
3966
  style: {
3862
3967
  border: "none"
3863
3968
  },
@@ -3884,7 +3989,7 @@ var InputChat = function InputChat(_ref) {
3884
3989
  sx: {
3885
3990
  bgcolor: isCompleted ? "#EBEBFF !important" : "#5458D5 !important"
3886
3991
  },
3887
- className: styles["btn-send"],
3992
+ className: styles$1["btn-send"],
3888
3993
  disabled: isCompleted,
3889
3994
  onClick: handleSubmit
3890
3995
  }, React.createElement(iconSendMessage, null), React.createElement(Typography, {
@@ -3939,7 +4044,8 @@ var iconChecked = function iconChecked(_ref) {
3939
4044
  };
3940
4045
 
3941
4046
  var ellipsisText = function ellipsisText(text, maxLength) {
3942
- return text.length > maxLength ? text.slice(0, maxLength) + " ..." : text;
4047
+ if (!text) return text;
4048
+ return (text === null || text === void 0 ? void 0 : text.length) > maxLength ? text.slice(0, maxLength) + " ..." : text;
3943
4049
  };
3944
4050
  var formatDataMyAnswer = function formatDataMyAnswer(inputData, categories) {
3945
4051
  var uniqueCategories = new Set();
@@ -3988,7 +4094,8 @@ var ChatHeader = function ChatHeader(_ref) {
3988
4094
  handleConfirm = _useDialog.handleConfirm;
3989
4095
  var _useTranslation = useTranslation(),
3990
4096
  t = _useTranslation.t;
3991
- var isTabletUp = useMediaQuery('(min-width:900px)');
4097
+ var theme = useTheme();
4098
+ var isTabletUp = useMediaQuery(theme.breakpoints.up('lg'));
3992
4099
  var isStudent = roles === null || roles === void 0 ? void 0 : roles.includes(Roles$1.Student);
3993
4100
  var filterDurationExam = useMemo(function () {
3994
4101
  if (!durationExam) return;
@@ -4037,7 +4144,7 @@ var ChatHeader = function ChatHeader(_ref) {
4037
4144
  fontWeight: 600,
4038
4145
  fontSize: "12px",
4039
4146
  lineHeight: "14.32px"
4040
- }, ellipsisText(examTitle, 15)), React.createElement(Box, {
4147
+ }, ellipsisText(examTitle || "", 15)), React.createElement(Box, {
4041
4148
  display: "flex",
4042
4149
  flexDirection: "row",
4043
4150
  gap: "4px"
@@ -4117,7 +4224,7 @@ var ChatHeader = function ChatHeader(_ref) {
4117
4224
  alignItems: "center",
4118
4225
  gap: "24px",
4119
4226
  color: "#5458D5"
4120
- }, React.createElement(Box, {
4227
+ }, isTabletUp && React.createElement(Box, {
4121
4228
  display: "flex",
4122
4229
  justifyContent: "space-between",
4123
4230
  alignItems: "center",
@@ -4130,7 +4237,7 @@ var ChatHeader = function ChatHeader(_ref) {
4130
4237
  fontWeight: 700,
4131
4238
  fontSize: "14px",
4132
4239
  lineHeight: "16.71px"
4133
- }, fullName)), React.createElement(Box, {
4240
+ }, ellipsisText(fullName || "", 10))), React.createElement(Box, {
4134
4241
  display: "flex",
4135
4242
  alignItems: "center",
4136
4243
  gap: "24px",
@@ -4139,7 +4246,7 @@ var ChatHeader = function ChatHeader(_ref) {
4139
4246
  fontWeight: 600,
4140
4247
  fontSize: "12px",
4141
4248
  lineHeight: "14.32px"
4142
- }, examTitle) : React.createElement(Box, {
4249
+ }, ellipsisText(examTitle || "", 10)) : React.createElement(Box, {
4143
4250
  display: "flex",
4144
4251
  alignItems: "end",
4145
4252
  gap: "16px",
@@ -4284,7 +4391,7 @@ var ChatContainer = function ChatContainer(_ref) {
4284
4391
  container: true
4285
4392
  }, React.createElement(ChatHeader, Object.assign({}, chatHeaderProps)), React.createElement("div", {
4286
4393
  ref: listRef,
4287
- className: "flex-grow-1 " + styles["body"],
4394
+ className: "flex-grow-1 " + styles$1["body"],
4288
4395
  style: {
4289
4396
  height: "60vh",
4290
4397
  overflowY: "scroll",
@@ -4789,7 +4896,7 @@ var InputText = function InputText(props) {
4789
4896
  }, props));
4790
4897
  };
4791
4898
 
4792
- var styles$1 = {"question":"_2uc_W","question-article":"_2p7kY","question-title":"_2tHmc","question--active":"_3IHYm","question-label":"_26ATj","question-input":"_3R8PR","question-btn":"_1VZac"};
4899
+ var styles$2 = {"question":"_2uc_W","question-article":"_2p7kY","question-title":"_2tHmc","question--active":"_3IHYm","question-label":"_26ATj","question-input":"_3R8PR","question-btn":"_1VZac"};
4793
4900
 
4794
4901
  var SCORE_OPTIONS = Array.from({
4795
4902
  length: 10
@@ -4846,12 +4953,15 @@ var QuestionView = function QuestionView(_ref) {
4846
4953
  var handleChangeCorrectAnswer = function handleChangeCorrectAnswer(e) {
4847
4954
  return onChangeCorrectAnswers(e.target.value, index);
4848
4955
  };
4849
- return React.createElement("div", {
4850
- className: "d-flex justify-content-between"
4851
- }, React.createElement("div", {
4852
- className: "d-flex flex-grow-1"
4956
+ return React.createElement(Grid, {
4957
+ container: true,
4958
+ spacing: "16px"
4959
+ }, React.createElement(Grid, {
4960
+ item: true,
4961
+ xs: 12,
4962
+ lg: 9
4853
4963
  }, React.createElement("div", {
4854
- className: styles$1["question-title"] + " me-2 text-nowrap"
4964
+ className: styles$2["question-title"] + " me-2 text-nowrap"
4855
4965
  }, t("problem_number_question", {
4856
4966
  number: question.questionOrder + 1
4857
4967
  })), React.createElement(FormControl, {
@@ -4867,7 +4977,7 @@ var QuestionView = function QuestionView(_ref) {
4867
4977
  }).map(function (i) {
4868
4978
  return React.createElement(FormControlLabel, {
4869
4979
  key: i,
4870
- className: styles$1["question-label"] + " w-fit",
4980
+ className: styles$2["question-label"] + " w-fit",
4871
4981
  labelPlacement: "top",
4872
4982
  value: i,
4873
4983
  onChange: handleChangeCorrectAnswer,
@@ -4879,10 +4989,12 @@ var QuestionView = function QuestionView(_ref) {
4879
4989
  number: i
4880
4990
  })
4881
4991
  });
4882
- })))), React.createElement("div", {
4883
- className: "d-flex align-items-center"
4992
+ })))), React.createElement(Grid, {
4993
+ item: true,
4994
+ xs: 12,
4995
+ lg: 3,
4996
+ mb: "16px"
4884
4997
  }, React.createElement(FormControl, {
4885
- className: "mx-3",
4886
4998
  style: {
4887
4999
  width: "140px"
4888
5000
  }
@@ -5086,6 +5198,8 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
5086
5198
  subjectId: defaultCategoryOptions === undefined ? selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id : undefined
5087
5199
  }),
5088
5200
  categoryOptions = _useCategorySelect.categoryOptions;
5201
+ var theme = useTheme();
5202
+ var isTabletUp = useMediaQuery(theme.breakpoints.up('lg'));
5089
5203
  var handleChangeQuestionCount = function handleChangeQuestionCount(value) {
5090
5204
  onChangeQuestionCount(article, value === null || value === void 0 ? void 0 : value.value, answerCount);
5091
5205
  };
@@ -5105,7 +5219,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
5105
5219
  onDelete === null || onDelete === void 0 ? void 0 : onDelete(article);
5106
5220
  };
5107
5221
  return React.createElement("div", {
5108
- className: "d-flex " + styles$1["question"] + " " + (isActive ? styles$1["question--active"] : "")
5222
+ className: "d-flex " + styles$2["question"] + " " + (isActive ? styles$2["question--active"] : "")
5109
5223
  }, React.createElement("div", {
5110
5224
  className: "py-1"
5111
5225
  }, React.createElement(PiDotsNineLight, {
@@ -5113,20 +5227,30 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
5113
5227
  })), React.createElement("div", {
5114
5228
  className: "px-4"
5115
5229
  }, React.createElement("p", {
5116
- className: "mb-0 " + styles$1["question-article"]
5230
+ className: "mb-0 " + styles$2["question-article"]
5117
5231
  }, t("article_number")), React.createElement("p", {
5118
- className: "text-center " + styles$1["question-article"]
5232
+ className: "text-center " + styles$2["question-article"]
5119
5233
  }, article)), React.createElement("div", {
5120
5234
  className: "flex-grow-1"
5121
5235
  }, React.createElement(Grid, {
5122
5236
  container: true,
5123
5237
  spacing: 3
5124
- }, React.createElement(Grid, {
5238
+ }, !isTabletUp && React.createElement(Grid, {
5239
+ item: true,
5240
+ xs: 12,
5241
+ className: "d-flex justify-content-end"
5242
+ }, isDeletable && !isDisabled && React.createElement("div", null, React.createElement(IconButton, {
5243
+ onClick: handleDelete
5244
+ }, React.createElement(FaTrash, {
5245
+ size: 16,
5246
+ className: "text-danger"
5247
+ })))), React.createElement(Grid, {
5125
5248
  item: true,
5126
- xs: 3
5249
+ xs: 12,
5250
+ lg: 3
5127
5251
  }, React.createElement(FormGroup, null, React.createElement(FormLabel, {
5128
5252
  htmlFor: "question_count",
5129
- className: styles$1["question-label"] + " form-label"
5253
+ className: styles$2["question-label"] + " form-label"
5130
5254
  }, t("question_count")), React.createElement(QuestionCountSelector, {
5131
5255
  id: "question_count",
5132
5256
  value: questionCount,
@@ -5134,10 +5258,11 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
5134
5258
  isDisabled: isDisabled
5135
5259
  }))), React.createElement(Grid, {
5136
5260
  item: true,
5137
- xs: 3
5261
+ xs: 12,
5262
+ lg: 3
5138
5263
  }, React.createElement(FormGroup, null, React.createElement(FormLabel, {
5139
5264
  htmlFor: "category",
5140
- className: styles$1["question-label"] + " form-label"
5265
+ className: styles$2["question-label"] + " form-label"
5141
5266
  }, t("category")), React.createElement(ArticleCategorySelector, {
5142
5267
  id: "category",
5143
5268
  value: categoryId,
@@ -5147,16 +5272,17 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
5147
5272
  placeholder: t("select_category")
5148
5273
  }))), React.createElement(Grid, {
5149
5274
  item: true,
5150
- xs: 3
5275
+ xs: 12,
5276
+ lg: 3
5151
5277
  }, React.createElement(FormGroup, null, React.createElement(FormLabel, {
5152
5278
  htmlFor: "answer_count",
5153
- className: styles$1["question-label"] + " form-label"
5279
+ className: styles$2["question-label"] + " form-label"
5154
5280
  }, t("answer_count")), React.createElement(AnswerCountSelector, {
5155
5281
  id: "answer_count",
5156
5282
  value: answerCount,
5157
5283
  onChange: handleChangeAnswerCount,
5158
5284
  isDisabled: isDisabled
5159
- }))), React.createElement(Grid, {
5285
+ }))), isTabletUp && React.createElement(Grid, {
5160
5286
  item: true,
5161
5287
  xs: 3,
5162
5288
  className: "d-flex justify-content-end"
@@ -5193,6 +5319,7 @@ var ChapterBox = function ChapterBox(_ref) {
5193
5319
  onChangePageTo = _ref.onChangePageTo,
5194
5320
  onAddArticle = _ref.onAddArticle,
5195
5321
  onRemoveArticle = _ref.onRemoveArticle,
5322
+ handleCheckArticle = _ref.handleCheckArticle,
5196
5323
  onUpdateArticleQuestionCount = _ref.onUpdateArticleQuestionCount,
5197
5324
  onUpdateArticleCategory = _ref.onUpdateArticleCategory,
5198
5325
  onUpdateArticleQuestionAnswerCount = _ref.onUpdateArticleQuestionAnswerCount,
@@ -5248,6 +5375,8 @@ var ChapterBox = function ChapterBox(_ref) {
5248
5375
  var handleUpdateArticleQuestionScore = function handleUpdateArticleQuestionScore(article, index, score) {
5249
5376
  onUpdateArticleQuestion === null || onUpdateArticleQuestion === void 0 ? void 0 : onUpdateArticleQuestion(article, index, score, "score", data.articles, data.id, parentChapterId);
5250
5377
  };
5378
+ var theme = useTheme();
5379
+ var isTabletUp = useMediaQuery(theme.breakpoints.up('lg'));
5251
5380
  var handleChangeName = function handleChangeName(e) {
5252
5381
  var text = e.target.value;
5253
5382
  onChangeName === null || onChangeName === void 0 ? void 0 : onChangeName(text, data.id, parentChapterId);
@@ -5295,17 +5424,52 @@ var ChapterBox = function ChapterBox(_ref) {
5295
5424
  className: "text-danger"
5296
5425
  }))), React.createElement("div", {
5297
5426
  className: "p-3 d-flex justify-content-between"
5427
+ }, React.createElement(Grid, {
5428
+ container: true
5429
+ }, React.createElement(Grid, {
5430
+ item: true,
5431
+ xs: 12
5432
+ }, React.createElement(Grid, {
5433
+ container: true,
5434
+ spacing: 2
5435
+ }, !isTabletUp && React.createElement(Grid, {
5436
+ item: true,
5437
+ xs: 12
5298
5438
  }, React.createElement(Stack, {
5299
- spacing: 2,
5300
- direction: "row"
5301
- }, React.createElement(Box, {
5439
+ direction: "row",
5440
+ justifyContent: "end",
5441
+ spacing: 2
5442
+ }, !parentChapterId && !data.articles.length && React.createElement(Button, {
5443
+ className: "mx-1",
5444
+ variant: "contained",
5445
+ color: "primary",
5446
+ disabled: isReadonly,
5447
+ startIcon: React.createElement(FaPlus, {
5448
+ size: 12
5449
+ }),
5450
+ onClick: handleClickAddSubchapter
5451
+ }, t("add_subchapter")), data.subChapters.length === 0 && React.createElement(Button, {
5452
+ className: "mx-1",
5453
+ variant: "contained",
5454
+ color: "success",
5455
+ disabled: isReadonly,
5456
+ startIcon: React.createElement(FaPlus, {
5457
+ size: 12
5458
+ }),
5459
+ onClick: handleAddArticle
5460
+ }, t("add_article")))), React.createElement(Grid, {
5461
+ item: true,
5462
+ xs: 12,
5463
+ lg: 4,
5302
5464
  sx: {
5303
5465
  display: "flex",
5304
5466
  alignItems: "center",
5305
- marginRight: "16px",
5306
5467
  width: "50%"
5307
5468
  }
5308
5469
  }, React.createElement("label", {
5470
+ style: {
5471
+ minWidth: "90px"
5472
+ },
5309
5473
  className: "fw-bold text-nowrap me-2"
5310
5474
  }, t("page.from"), ":"), React.createElement(InputText, {
5311
5475
  type: "number",
@@ -5315,13 +5479,19 @@ var ChapterBox = function ChapterBox(_ref) {
5315
5479
  onChange: handleChangePageFrom,
5316
5480
  placeholder: t("page.from_placeholder"),
5317
5481
  error: data.pageFrom > data.pageTo || data.pageFrom < 0
5318
- })), React.createElement(Box, {
5482
+ })), React.createElement(Grid, {
5483
+ item: true,
5484
+ xs: 12,
5485
+ lg: 4,
5319
5486
  sx: {
5320
5487
  display: "flex",
5321
5488
  alignItems: "center",
5322
5489
  width: "50%"
5323
5490
  }
5324
5491
  }, React.createElement("label", {
5492
+ style: {
5493
+ minWidth: "90px"
5494
+ },
5325
5495
  className: "fw-bold text-nowrap me-2"
5326
5496
  }, t("page.to"), ":"), React.createElement(InputText, {
5327
5497
  type: "number",
@@ -5331,7 +5501,10 @@ var ChapterBox = function ChapterBox(_ref) {
5331
5501
  onChange: handleChangePageTo,
5332
5502
  placeholder: t("page.to_placeholder"),
5333
5503
  error: data.pageTo < data.pageFrom
5334
- }))), React.createElement(Stack, {
5504
+ })), isTabletUp && React.createElement(Grid, {
5505
+ item: true,
5506
+ lg: 4
5507
+ }, React.createElement(Stack, {
5335
5508
  direction: "row",
5336
5509
  justifyContent: "end",
5337
5510
  spacing: 2
@@ -5353,7 +5526,7 @@ var ChapterBox = function ChapterBox(_ref) {
5353
5526
  size: 12
5354
5527
  }),
5355
5528
  onClick: handleAddArticle
5356
- }, t("add_article")))), React.createElement("div", {
5529
+ }, t("add_article")))))))), React.createElement("div", {
5357
5530
  className: "p-3"
5358
5531
  }, React.createElement(Stack, {
5359
5532
  spacing: 2
@@ -5368,6 +5541,7 @@ var ChapterBox = function ChapterBox(_ref) {
5368
5541
  onChangeName: onChangeName,
5369
5542
  onChangePageFrom: onChangePageFrom,
5370
5543
  onChangePageTo: onChangePageTo,
5544
+ handleCheckArticle: handleCheckArticle,
5371
5545
  onAddArticle: onAddArticle,
5372
5546
  onRemoveArticle: onRemoveArticle,
5373
5547
  onUpdateArticleQuestionCount: onUpdateArticleQuestionCount,
@@ -5378,7 +5552,24 @@ var ChapterBox = function ChapterBox(_ref) {
5378
5552
  });
5379
5553
  }), data.subChapters.length === 0 && data.articles.map(function (article) {
5380
5554
  var _article$category;
5381
- return React.createElement(ArticleGroupView, {
5555
+ return React.createElement(Stack, null, React.createElement(Stack, {
5556
+ display: "flex",
5557
+ flexDirection: "row",
5558
+ gap: "8px",
5559
+ alignItems: "center"
5560
+ }, React.createElement(Checkbox, {
5561
+ id: "textbook",
5562
+ sx: {
5563
+ display: "flex",
5564
+ justifyContent: "start",
5565
+ width: "fit-content"
5566
+ },
5567
+ onChange: function onChange(e) {
5568
+ return handleCheckArticle(e, article);
5569
+ }
5570
+ }), React.createElement("label", {
5571
+ htmlFor: "textbook"
5572
+ }, t("select_article_create_exam"))), React.createElement(ArticleGroupView, {
5382
5573
  key: article.id,
5383
5574
  categoryOptions: categoryOptions,
5384
5575
  article: article.articleNumber,
@@ -5395,7 +5586,7 @@ var ChapterBox = function ChapterBox(_ref) {
5395
5586
  onChangeScoreAnswer: handleUpdateArticleQuestionScore,
5396
5587
  onDelete: handleRemoveArticle,
5397
5588
  isDeletable: true
5398
- });
5589
+ }));
5399
5590
  }))));
5400
5591
  };
5401
5592
 
@@ -5455,6 +5646,25 @@ var TextbookSortBy;
5455
5646
  TextbookSortBy["Title"] = "Name";
5456
5647
  TextbookSortBy["SubjectName"] = "Subject.Name";
5457
5648
  })(TextbookSortBy || (TextbookSortBy = {}));
5649
+ var ExamType;
5650
+ (function (ExamType) {
5651
+ ExamType["Normal"] = "Normal";
5652
+ ExamType["Standard"] = "Standard";
5653
+ })(ExamType || (ExamType = {}));
5654
+ var ExamStatus$1;
5655
+ (function (ExamStatus) {
5656
+ ExamStatus["Default"] = "Default";
5657
+ ExamStatus["Pending"] = "Pending";
5658
+ ExamStatus["InProgress"] = "InProgress";
5659
+ ExamStatus["Completed"] = "Completed";
5660
+ })(ExamStatus$1 || (ExamStatus$1 = {}));
5661
+ var ExamStatusNumber;
5662
+ (function (ExamStatusNumber) {
5663
+ ExamStatusNumber[ExamStatusNumber["Default"] = 0] = "Default";
5664
+ ExamStatusNumber[ExamStatusNumber["Pending"] = 1] = "Pending";
5665
+ ExamStatusNumber[ExamStatusNumber["InProgress"] = 2] = "InProgress";
5666
+ ExamStatusNumber[ExamStatusNumber["Completed"] = 3] = "Completed";
5667
+ })(ExamStatusNumber || (ExamStatusNumber = {}));
5458
5668
 
5459
5669
  var TEXTBOOK_HEADERS = [{
5460
5670
  title: "#"
@@ -5472,6 +5682,19 @@ var TEXTBOOK_HEADERS = [{
5472
5682
  }, {
5473
5683
  title: "actions"
5474
5684
  }];
5685
+ var DEFAULT_ANSWER_COUNT = 5;
5686
+ var DEFAULT_EXAM_REQUEST = {
5687
+ questions: [{
5688
+ article: 1,
5689
+ correctAnswers: [1],
5690
+ numberOfAnswers: DEFAULT_ANSWER_COUNT,
5691
+ score: 2,
5692
+ questionOrder: 0
5693
+ }],
5694
+ title: "",
5695
+ duration: 10,
5696
+ subjectId: 0
5697
+ };
5475
5698
  var TEXTBOOK_PAGE_TITLE = "textbooks";
5476
5699
  var TEXT_BOOK_SEARCH_PLACEHOLDER = "enter_student_name_to_search";
5477
5700
  var TextbookDefaultQuery = {
@@ -5538,6 +5761,133 @@ var deleteArticleApi = function deleteArticleApi(articleId, role) {
5538
5761
  });
5539
5762
  };
5540
5763
 
5764
+ var EXAM_URL = BASE_URL + "/api/exam";
5765
+ var createExam = function createExam(data) {
5766
+ return api.post("" + EXAM_URL, data, {
5767
+ params: {
5768
+ roles: [Role.Teacher]
5769
+ }
5770
+ });
5771
+ };
5772
+ var apiCreateExamSession = function apiCreateExamSession(examId) {
5773
+ return api.post(EXAM_URL + "/" + examId);
5774
+ };
5775
+
5776
+ var useExam = function useExam(props) {
5777
+ var callback = props.callback,
5778
+ navigate = props.navigate;
5779
+ var dispatch = useDispatch();
5780
+ var _useState = useState(false),
5781
+ isOpenDialog = _useState[0],
5782
+ setOpenDialog = _useState[1];
5783
+ var _useState2 = useState(DEFAULT_EXAM_REQUEST),
5784
+ examRequest = _useState2[0],
5785
+ setExamRequest = _useState2[1];
5786
+ var isTeacher = useSelector(function (state) {
5787
+ var _state$common, _state$common$user;
5788
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.roles.includes(Roles.Teacher);
5789
+ });
5790
+ var _useTranslation = useTranslation(),
5791
+ t = _useTranslation.t;
5792
+ var handleChangeExamRequest = function handleChangeExamRequest(value) {
5793
+ setExamRequest(value);
5794
+ };
5795
+ var handleOpenCreateExamDialog = function handleOpenCreateExamDialog() {
5796
+ setOpenDialog(true);
5797
+ };
5798
+ var handleCloseDialog = function handleCloseDialog() {
5799
+ setExamRequest(DEFAULT_EXAM_REQUEST);
5800
+ setOpenDialog(false);
5801
+ callback === null || callback === void 0 ? void 0 : callback();
5802
+ };
5803
+ var validateExam = function validateExam(exam) {
5804
+ if (!exam.subjectId) return t("Please select an exam subject");
5805
+ if (!exam.title.trim().length) return t("Please enter exam title");
5806
+ if (!exam.questions.length) return t("Exam required at least one question");
5807
+ for (var i = 0; i < exam.questions.length; i++) {
5808
+ var question = exam.questions[i];
5809
+ if (!question.categoryId) return t("Please select category for article " + question.article);
5810
+ }
5811
+ return false;
5812
+ };
5813
+ var handleCreateExam = function handleCreateExam() {
5814
+ try {
5815
+ var _temp3 = function _temp3() {
5816
+ dispatch(setLoading(false));
5817
+ };
5818
+ if (!examRequest) return Promise.resolve();
5819
+ var errorMessage = validateExam(examRequest);
5820
+ if (errorMessage) {
5821
+ toast.error(errorMessage);
5822
+ return Promise.resolve();
5823
+ }
5824
+ dispatch(setLoading(true));
5825
+ var _temp2 = _catch(function () {
5826
+ return Promise.resolve(createExam(_extends({}, examRequest, {
5827
+ duration: minutesToTimeSpan(examRequest.duration || 0)
5828
+ }))).then(function (res) {
5829
+ var _temp = function (_res$data, _res$data$data) {
5830
+ if (!((_res$data = res.data) !== null && _res$data !== void 0 && (_res$data$data = _res$data.data) !== null && _res$data$data !== void 0 && _res$data$data.id)) {
5831
+ toast.error("Create exam failed");
5832
+ } else {
5833
+ var _res$data2, _res$data2$data;
5834
+ return Promise.resolve(apiCreateExamSession((_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : (_res$data2$data = _res$data2.data) === null || _res$data2$data === void 0 ? void 0 : _res$data2$data.id)).then(function () {
5835
+ setExamRequest(DEFAULT_EXAM_REQUEST);
5836
+ toast.success("Create exam successfully");
5837
+ });
5838
+ }
5839
+ }();
5840
+ if (_temp && _temp.then) return _temp.then(function () {});
5841
+ });
5842
+ }, function (error) {
5843
+ var _error$response;
5844
+ toast.error((error === null || error === void 0 ? void 0 : (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data) || "Create exam failed");
5845
+ });
5846
+ return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2));
5847
+ } catch (e) {
5848
+ return Promise.reject(e);
5849
+ }
5850
+ };
5851
+ var handleSaveExam = function handleSaveExam() {
5852
+ try {
5853
+ var _temp5 = function _temp5() {
5854
+ dispatch(setLoading(false));
5855
+ };
5856
+ if (!examRequest) return Promise.resolve();
5857
+ var errorMessage = validateExam(examRequest);
5858
+ if (errorMessage) {
5859
+ toast.error(errorMessage);
5860
+ return Promise.resolve();
5861
+ }
5862
+ dispatch(setLoading(true));
5863
+ var _temp4 = _catch(function () {
5864
+ return Promise.resolve(createExam(_extends({}, examRequest, {
5865
+ duration: minutesToTimeSpan(examRequest.duration || 0)
5866
+ }))).then(function () {
5867
+ handleCloseDialog();
5868
+ toast.success("Save exam successfully");
5869
+ isTeacher ? navigate('/teacher/exam-list') : navigate('/exams');
5870
+ });
5871
+ }, function (error) {
5872
+ var _error$response2;
5873
+ toast.error((error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data) || "Save exam failed");
5874
+ });
5875
+ return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
5876
+ } catch (e) {
5877
+ return Promise.reject(e);
5878
+ }
5879
+ };
5880
+ return {
5881
+ isOpenDialog: isOpenDialog,
5882
+ examRequest: examRequest,
5883
+ handleChangeExamRequest: handleChangeExamRequest,
5884
+ handleOpenCreateExamDialog: handleOpenCreateExamDialog,
5885
+ handleSaveExam: handleSaveExam,
5886
+ handleCloseDialog: handleCloseDialog,
5887
+ handleCreateExam: handleCreateExam
5888
+ };
5889
+ };
5890
+
5541
5891
  var useTextbookDetail = function useTextbookDetail(props) {
5542
5892
  var role = props.role,
5543
5893
  isReadonlyParam = props.isReadonlyParam,
@@ -5561,18 +5911,31 @@ var useTextbookDetail = function useTextbookDetail(props) {
5561
5911
  var _useState5 = useState(),
5562
5912
  parentChapter = _useState5[0],
5563
5913
  setParentChapter = _useState5[1];
5564
- var _useState6 = useState(),
5565
- selectedChapter = _useState6[0],
5566
- setSelectedChapter = _useState6[1];
5914
+ var _useState6 = useState([]),
5915
+ articlesSelected = _useState6[0],
5916
+ setArticlesSelected = _useState6[1];
5567
5917
  var _useState7 = useState(),
5568
- selectedDeleteItem = _useState7[0],
5569
- setSelectedDeleteItem = _useState7[1];
5918
+ selectedChapter = _useState7[0],
5919
+ setSelectedChapter = _useState7[1];
5920
+ var _useState8 = useState(),
5921
+ selectedDeleteItem = _useState8[0],
5922
+ setSelectedDeleteItem = _useState8[1];
5570
5923
  var updateChapterRef = useRef();
5571
5924
  var updateArticleRef = useRef();
5572
- var _useState8 = useState(false),
5573
- isEditedTitle = _useState8[0],
5574
- setEditedTitle = _useState8[1];
5925
+ var _useState9 = useState(false),
5926
+ isEditedTitle = _useState9[0],
5927
+ setEditedTitle = _useState9[1];
5575
5928
  var textbookUrl = role === Role.Teacher ? TEXTBOOK_URL$1 : ADMIN_TEXTBOOK_URL;
5929
+ var _useExam = useExam({
5930
+ navigate: navigate
5931
+ }),
5932
+ isOpenDialog = _useExam.isOpenDialog,
5933
+ examRequest = _useExam.examRequest,
5934
+ handleChangeExamRequest = _useExam.handleChangeExamRequest,
5935
+ handleOpenCreateExamDialog = _useExam.handleOpenCreateExamDialog,
5936
+ handleSaveExam = _useExam.handleSaveExam,
5937
+ handleCloseDialog = _useExam.handleCloseDialog,
5938
+ handleCreateExam = _useExam.handleCreateExam;
5576
5939
  var handleOpenAddArticleDialog = function handleOpenAddArticleDialog(chapter) {
5577
5940
  setSelectedChapter(chapter);
5578
5941
  };
@@ -5823,7 +6186,6 @@ var useTextbookDetail = function useTextbookDetail(props) {
5823
6186
  }
5824
6187
  };
5825
6188
  return Promise.resolve(handleCreateArticle(newArticle, function (article) {
5826
- console.log("created article: ", article);
5827
6189
  handleUpdateChapterValue([].concat(articles, [article]), "articles", selectedChapter.id, selectedChapter.parentChapterId);
5828
6190
  setSelectedChapter(undefined);
5829
6191
  })).then(function () {});
@@ -5913,12 +6275,14 @@ var useTextbookDetail = function useTextbookDetail(props) {
5913
6275
  };
5914
6276
  });
5915
6277
  newArticle = _extends({}, thisArticles, {
6278
+ chapterId: chapterId,
5916
6279
  questions: [].concat(thisQuestions, additionalQuestionArticles)
5917
6280
  });
5918
6281
  newArticles = [].concat(articles.slice(0, articleNumber - 1), [newArticle], articles.slice(articleNumber));
5919
6282
  }
5920
6283
  if (questionCount < thisQuestions.length) {
5921
6284
  newArticle = _extends({}, thisArticles, {
6285
+ chapterId: chapterId,
5922
6286
  questions: [].concat(thisQuestions.slice(0, questionCount))
5923
6287
  });
5924
6288
  newArticles = [].concat(articles.slice(0, articleNumber - 1), [newArticle], articles.slice(articleNumber));
@@ -5930,6 +6294,7 @@ var useTextbookDetail = function useTextbookDetail(props) {
5930
6294
  };
5931
6295
  var handleUpdateArticleCategory = function handleUpdateArticleCategory(articleNumber, categoryId, articles, chapterId, parentChapterId) {
5932
6296
  var newArticle = _extends({}, articles[articleNumber - 1], {
6297
+ chapterId: chapterId,
5933
6298
  category: {
5934
6299
  id: categoryId
5935
6300
  }
@@ -5946,6 +6311,7 @@ var useTextbookDetail = function useTextbookDetail(props) {
5946
6311
  if (newAnswerCount > answerCount) {
5947
6312
  newArticle = _extends({}, articles[articleNumber - 1], {
5948
6313
  answerCount: newAnswerCount,
6314
+ chapterId: chapterId,
5949
6315
  questions: articles[articleNumber - 1].questions.map(function (i) {
5950
6316
  return _extends({}, i, {
5951
6317
  numberOfAnswers: newAnswerCount
@@ -5955,6 +6321,7 @@ var useTextbookDetail = function useTextbookDetail(props) {
5955
6321
  } else if (newAnswerCount < answerCount) {
5956
6322
  newArticle = _extends({}, articles[articleNumber - 1], {
5957
6323
  answerCount: newAnswerCount,
6324
+ chapterId: chapterId,
5958
6325
  questions: articles[articleNumber - 1].questions.map(function (i) {
5959
6326
  return _extends({}, i, {
5960
6327
  numberOfAnswers: newAnswerCount,
@@ -5974,6 +6341,7 @@ var useTextbookDetail = function useTextbookDetail(props) {
5974
6341
  var _extends4;
5975
6342
  var thisQuestions = articles[articleNumber - 1].questions;
5976
6343
  var newArticle = _extends({}, articles[articleNumber - 1], {
6344
+ chapterId: chapterId,
5977
6345
  questions: [].concat(thisQuestions.slice(0, index), [_extends({}, thisQuestions[index], (_extends4 = {}, _extends4[key] = value, _extends4))], thisQuestions.slice(index + 1))
5978
6346
  });
5979
6347
  var newArticles = [].concat(articles.slice(0, articleNumber - 1), [newArticle], articles.slice(articleNumber));
@@ -6134,6 +6502,19 @@ var useTextbookDetail = function useTextbookDetail(props) {
6134
6502
  replace: true
6135
6503
  });
6136
6504
  };
6505
+ var handleCheckArticle = function handleCheckArticle(e, article) {
6506
+ var checked = e.target.checked;
6507
+ if (!(article !== null && article !== void 0 && article.id)) return;
6508
+ if (!checked) {
6509
+ var _newArticles = articlesSelected.filter(function (item) {
6510
+ return item !== article.id;
6511
+ });
6512
+ setArticlesSelected(_newArticles);
6513
+ return;
6514
+ }
6515
+ var newArticles = [].concat(articlesSelected, [article.id]);
6516
+ setArticlesSelected(newArticles);
6517
+ };
6137
6518
  useEffect(function () {
6138
6519
  var getTextbookDetail = function getTextbookDetail() {
6139
6520
  try {
@@ -6158,6 +6539,53 @@ var useTextbookDetail = function useTextbookDetail(props) {
6158
6539
  };
6159
6540
  if (id) getTextbookDetail();
6160
6541
  }, [dispatch, id]);
6542
+ var handleChangeExamRequestBeforeOpenDialog = function handleChangeExamRequestBeforeOpenDialog() {
6543
+ var _textbookSubject$valu;
6544
+ handleOpenCreateExamDialog();
6545
+ var articles = textbook.chapters.map(function (chapter) {
6546
+ var isSubChapters = !!chapter.subChapters.length;
6547
+ if (isSubChapters) {
6548
+ var _articles = chapter.subChapters.map(function (chapter) {
6549
+ return chapter.articles;
6550
+ });
6551
+ return _articles.filter(Boolean).flat();
6552
+ }
6553
+ return chapter.articles;
6554
+ });
6555
+ var articlesAfterFlat = articles.flat();
6556
+ var questionCount = 0;
6557
+ var articleCount = 1;
6558
+ var questions = articlesAfterFlat.map(function (article) {
6559
+ if (articlesSelected.findIndex(function (item) {
6560
+ return item === article.id;
6561
+ }) !== -1) {
6562
+ var _questions = article.questions.map(function (question) {
6563
+ var _article$category3;
6564
+ var newQuestion = {
6565
+ article: articleCount,
6566
+ id: question === null || question === void 0 ? void 0 : question.id,
6567
+ correctAnswers: question.correctAnswers,
6568
+ numberOfAnswers: question.numberOfAnswers,
6569
+ score: question.score,
6570
+ questionOrder: questionCount,
6571
+ categoryId: (_article$category3 = article.category) === null || _article$category3 === void 0 ? void 0 : _article$category3.id
6572
+ };
6573
+ questionCount++;
6574
+ return newQuestion;
6575
+ });
6576
+ articleCount++;
6577
+ return _questions;
6578
+ }
6579
+ return [];
6580
+ });
6581
+ var exam = {
6582
+ title: "",
6583
+ duration: 10,
6584
+ subjectId: (_textbookSubject$valu = textbookSubject === null || textbookSubject === void 0 ? void 0 : textbookSubject.value) != null ? _textbookSubject$valu : 0,
6585
+ questions: questions.flat().filter(Boolean)
6586
+ };
6587
+ handleChangeExamRequest(exam);
6588
+ };
6161
6589
  useEffect(function () {
6162
6590
  document.title = t("textbooks") + " | " + t(id ? "textbook_detail" : "create_textbook");
6163
6591
  }, [id, t]);
@@ -6177,6 +6605,15 @@ var useTextbookDetail = function useTextbookDetail(props) {
6177
6605
  selectedDeleteItem: selectedDeleteItem,
6178
6606
  isEditedTitle: isEditedTitle,
6179
6607
  isReadonlyParam: isReadonlyParam,
6608
+ articlesSelected: articlesSelected,
6609
+ isOpenDialog: isOpenDialog,
6610
+ examRequest: examRequest,
6611
+ handleChangeExamRequest: handleChangeExamRequest,
6612
+ handleCheckArticle: handleCheckArticle,
6613
+ handleOpenCreateExamDialog: handleChangeExamRequestBeforeOpenDialog,
6614
+ handleSaveExam: handleSaveExam,
6615
+ handleCloseDialog: handleCloseDialog,
6616
+ handleCreateExam: handleCreateExam,
6180
6617
  handleChangeTextbookTitle: handleChangeTextbookTitle,
6181
6618
  handleCreateOrUpdateTextbook: handleCreateOrUpdateTextbook,
6182
6619
  handleChangeTextbookSubject: handleChangeTextbookSubject,
@@ -6616,9 +7053,9 @@ var SubjectSelector = function SubjectSelector(_ref) {
6616
7053
  !minimumTextSearchLength && defaultValueAtFirst && options.length && onChange(options[0], subjects[0]);
6617
7054
  }, [JSON.stringify(options), JSON.stringify(subjects), defaultValueAtFirst, minimumTextSearchLength]);
6618
7055
  return React.createElement(FormGroup, {
6619
- className: "" + styleGlobal["filter-item"]
7056
+ className: "" + styles["filter-item"]
6620
7057
  }, !!title && React.createElement("label", {
6621
- className: "" + styleGlobal["title-form"]
7058
+ className: "" + styles["title-form"]
6622
7059
  }, title), React.createElement(CustomSelectOption, {
6623
7060
  options: options,
6624
7061
  inputValue: searchString,
@@ -6634,1036 +7071,1115 @@ var SubjectSelector = function SubjectSelector(_ref) {
6634
7071
  }));
6635
7072
  };
6636
7073
 
6637
- var TextbookViewDetail = function TextbookViewDetail(props) {
6638
- var _textbook$chapters;
6639
- var _useTextbookDetail = useTextbookDetail(props),
6640
- id = _useTextbookDetail.id,
6641
- t = _useTextbookDetail.t,
6642
- textbook = _useTextbookDetail.textbook,
6643
- textbookSubject = _useTextbookDetail.textbookSubject,
6644
- isReadonly = _useTextbookDetail.isReadonly,
6645
- isNotFound = _useTextbookDetail.isNotFound,
6646
- parentChapter = _useTextbookDetail.parentChapter,
6647
- textbookId = _useTextbookDetail.textbookId,
6648
- selectedChapter = _useTextbookDetail.selectedChapter,
6649
- selectedDeleteItem = _useTextbookDetail.selectedDeleteItem,
6650
- isEditedTitle = _useTextbookDetail.isEditedTitle,
6651
- handleChangeTextbookTitle = _useTextbookDetail.handleChangeTextbookTitle,
6652
- handleChangeTextbookSubject = _useTextbookDetail.handleChangeTextbookSubject,
6653
- handleGoToTextbookList = _useTextbookDetail.handleGoToTextbookList,
6654
- handleCreateOrUpdateTextbook = _useTextbookDetail.handleCreateOrUpdateTextbook,
6655
- handleCloseChapterNameDialog = _useTextbookDetail.handleCloseChapterNameDialog,
6656
- handleCreateChapter = _useTextbookDetail.handleCreateChapter,
6657
- handleAddChapterToTextbook = _useTextbookDetail.handleAddChapterToTextbook,
6658
- handleAddChapterToParentSubchapter = _useTextbookDetail.handleAddChapterToParentSubchapter,
6659
- handleChangeChapterName = _useTextbookDetail.handleChangeChapterName,
6660
- handleChangeChapterPageFrom = _useTextbookDetail.handleChangeChapterPageFrom,
6661
- handleChangeChapterPageTo = _useTextbookDetail.handleChangeChapterPageTo,
6662
- handleAddArticleToChapter = _useTextbookDetail.handleAddArticleToChapter,
6663
- handleUpdateArticleQuestionCountFromChapter = _useTextbookDetail.handleUpdateArticleQuestionCountFromChapter,
6664
- handleUpdateArticleCategory = _useTextbookDetail.handleUpdateArticleCategory,
6665
- handleUpdateArticleAnswerCount = _useTextbookDetail.handleUpdateArticleAnswerCount,
6666
- handleUpdateArticleQuestion = _useTextbookDetail.handleUpdateArticleQuestion,
6667
- handleCloseArticleDialog = _useTextbookDetail.handleCloseArticleDialog,
6668
- handleOpenAddArticleDialog = _useTextbookDetail.handleOpenAddArticleDialog,
6669
- handleOpenRemoveArticleConfirmDialog = _useTextbookDetail.handleOpenRemoveArticleConfirmDialog,
6670
- handleCloseConfirmDeleteDialog = _useTextbookDetail.handleCloseConfirmDeleteDialog,
6671
- handleRemoveSelectedItem = _useTextbookDetail.handleRemoveSelectedItem,
6672
- handleOpenRemoveChapterConfirmDialog = _useTextbookDetail.handleOpenRemoveChapterConfirmDialog;
6673
- var _useCategorySelect = useCategorySelect({
6674
- subjectId: id ? textbookSubject === null || textbookSubject === void 0 ? void 0 : textbookSubject.value : undefined
6675
- }),
6676
- categoryOptions = _useCategorySelect.categoryOptions;
6677
- if (isNotFound) return React.createElement(NotFound, null);
6678
- return React.createElement(Container, {
6679
- maxWidth: "xl",
6680
- className: "bg-white py-5 p-4 rounded-4 h-100 d-flex flex-column"
6681
- }, React.createElement(Stack, {
6682
- direction: "row",
6683
- alignItems: "center",
6684
- justifyContent: "space-between",
6685
- mb: 2
6686
- }, React.createElement(Typography, {
6687
- variant: "h3"
6688
- }, t(id ? isReadonly ? "view_textbook" : "update_textbook" : "create_textbook"))), React.createElement(Grid, {
6689
- container: true,
6690
- spacing: 3
6691
- }, React.createElement(Grid, {
6692
- item: true,
6693
- xs: 4,
6694
- className: "d-flex align-items-center"
6695
- }, React.createElement(Table, null, React.createElement(TableBody, null, React.createElement(TableRow, {
6696
- sx: {
6697
- "& td": {
6698
- border: 0
6699
- }
6700
- }
6701
- }, React.createElement(TableCell, {
6702
- className: "p-2 pe-0",
6703
- sx: {
6704
- width: "15%"
6705
- }
6706
- }, React.createElement(InputLabel, null, React.createElement("span", {
6707
- className: "fw-bold"
6708
- }, t("name")), React.createElement("span", {
6709
- className: "text-danger"
6710
- }, "*"))), React.createElement(TableCell, {
6711
- sx: {
6712
- width: 0,
6713
- px: 1
6714
- }
6715
- }, ":"), React.createElement(TableCell, {
6716
- className: "p-2"
6717
- }, React.createElement(InputText, {
6718
- className: "w-100",
6719
- value: textbook === null || textbook === void 0 ? void 0 : textbook.name,
6720
- placeholder: t("enter_textbook_title"),
6721
- onChange: handleChangeTextbookTitle,
6722
- disabled: isReadonly
6723
- }))), React.createElement(TableRow, {
6724
- sx: {
6725
- "& td": {
6726
- border: 0
6727
- }
6728
- }
6729
- }, React.createElement(TableCell, {
6730
- className: "p-2 pe-0"
6731
- }, React.createElement(InputLabel, null, React.createElement("span", {
6732
- className: "fw-bold"
6733
- }, t("subject")), React.createElement("span", {
6734
- className: "text-danger"
6735
- }, "*"))), React.createElement(TableCell, {
6736
- sx: {
6737
- width: 0,
6738
- px: 1
6739
- }
6740
- }, ":"), React.createElement(TableCell, {
6741
- className: "p-2"
6742
- }, React.createElement(SubjectSelector, {
6743
- value: textbookSubject,
6744
- onChange: handleChangeTextbookSubject,
6745
- isDisabled: isReadonly || !!id
6746
- })))))), React.createElement(Grid, {
6747
- item: true,
6748
- xs: 8,
6749
- className: "d-flex justify-content-end"
6750
- }, React.createElement("div", null, React.createElement(TextbookActionButtons, {
6751
- isReadonly: isReadonly,
6752
- textbook: textbook,
6753
- onBack: handleGoToTextbookList,
6754
- onSave: handleCreateOrUpdateTextbook,
6755
- hideSave: !isEditedTitle && !!id && !isReadonly || textbook.isCreatedByAdmin
6756
- }))), React.createElement(Grid, {
6757
- item: true,
6758
- xs: 12,
6759
- className: "d-flex justify-content-end"
6760
- }, !!id && React.createElement(Button, {
6761
- className: "mx-1",
6762
- variant: "contained",
6763
- color: "primary",
6764
- startIcon: React.createElement(FaPlus, {
6765
- size: 12
6766
- }),
6767
- onClick: handleAddChapterToTextbook,
6768
- disabled: isReadonly
6769
- }, t("add_chapter"))), React.createElement(Grid, {
6770
- item: true,
6771
- xs: 12
6772
- }, React.createElement(Stack, {
6773
- spacing: 3
6774
- }, !!(textbook !== null && textbook !== void 0 && textbook.subject) && (textbook === null || textbook === void 0 ? void 0 : (_textbook$chapters = textbook.chapters) === null || _textbook$chapters === void 0 ? void 0 : _textbook$chapters.map(function (chapter) {
6775
- return React.createElement(ChapterBox, {
6776
- key: chapter.id,
6777
- subject: textbook.subject,
6778
- data: chapter,
6779
- categoryOptions: categoryOptions || [],
6780
- onClickAddSubchapter: handleAddChapterToParentSubchapter,
6781
- onChangeName: handleChangeChapterName,
6782
- onChangePageFrom: handleChangeChapterPageFrom,
6783
- onChangePageTo: handleChangeChapterPageTo,
6784
- onAddArticle: handleOpenAddArticleDialog,
6785
- onRemoveArticle: handleOpenRemoveArticleConfirmDialog,
6786
- onUpdateArticleQuestionCount: handleUpdateArticleQuestionCountFromChapter,
6787
- onUpdateArticleCategory: handleUpdateArticleCategory,
6788
- onUpdateArticleQuestionAnswerCount: handleUpdateArticleAnswerCount,
6789
- onUpdateArticleQuestion: handleUpdateArticleQuestion,
6790
- onRemoveChapter: handleOpenRemoveChapterConfirmDialog,
6791
- isReadonly: isReadonly
6792
- });
6793
- }))))), React.createElement(ChapterNameDialog, {
6794
- open: !!(parentChapter !== null && parentChapter !== void 0 && parentChapter.id) || !!textbookId,
6795
- chapter: parentChapter,
6796
- onClose: handleCloseChapterNameDialog,
6797
- onSubmitForm: handleCreateChapter
6798
- }), React.createElement(ArticleDialog, {
6799
- open: !!selectedChapter,
6800
- chapter: selectedChapter,
6801
- categoryOptions: categoryOptions || [],
6802
- onClose: handleCloseArticleDialog,
6803
- onSubmitForm: handleAddArticleToChapter
6804
- }), selectedDeleteItem && React.createElement(ConfirmDialog, {
6805
- open: true,
6806
- toggle: handleCloseConfirmDeleteDialog,
6807
- text: selectedDeleteItem.confirmText,
6808
- confirmText: selectedDeleteItem.name,
6809
- onConfirm: handleRemoveSelectedItem,
6810
- isDelete: true
6811
- }));
6812
- };
7074
+ var styles$3 = {"drawer":"_11aYm","open":"_3Ydwm","drawer-overlay":"_3SQDf","drawer-header":"_2BwOx","drawer-form":"_2Zo7R","dropdown-content-academy":"_1lzjD","dropdown-change":"_1y7K9","dropdown-academy-item":"_1Y-55","dropdown-content-language":"_1fBXY","dropdown-item-language":"_3Szun","dropdown-item-language-active":"_2HhLb","item-address":"_3WYHC","item-logout":"_2-9ix","title-address":"_1r4pn","image-academy":"_2ZozT"};
6813
7075
 
6814
- var useAutoAcademyDomain = function useAutoAcademyDomain(logout, history, superUrls, homeUrl, homeAcademyUrl) {
6815
- var searchParams = new URLSearchParams(window.location.search);
6816
- var user = useSelector(function (state) {
6817
- var _state$common;
6818
- return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
6819
- });
6820
- var initialAcademySearchParam = function initialAcademySearchParam() {
6821
- var paramAcademyDomain = searchParams.get("domain");
6822
- var domain = getAcademyDomain();
6823
- var pathname = window.location.pathname.toLowerCase();
6824
- if (!user) return;
6825
- var academyDomain = user.academyDomain;
6826
- if (!academyDomain) {
6827
- if (!superUrls.some(function (i) {
6828
- return pathname.startsWith(i);
6829
- })) {
6830
- pushTo({
6831
- pathname: homeUrl,
6832
- search: ""
6833
- });
6834
- }
6835
- if (domain) {
6836
- searchParams.append("domain", domain);
6837
- pushTo({
6838
- pathname: homeUrl,
6839
- search: ""
7076
+ var DURATION_OPTIONS = Array.from({
7077
+ length: 120
7078
+ }, function (_, i) {
7079
+ return i + 1;
7080
+ });
7081
+ var DEFAULT_ANSWER_COUNT$1 = 5;
7082
+
7083
+ var useExamDetailView = function useExamDetailView(props) {
7084
+ var exam = props.exam,
7085
+ selectedSubject = props.selectedSubject,
7086
+ onChangeExam = props.onChangeExam;
7087
+ var _useTranslation = useTranslation(),
7088
+ t = _useTranslation.t;
7089
+ var handleChangeQuestionCount = function handleChangeQuestionCount(article, questionCount, answerCount) {
7090
+ if (!exam) return;
7091
+ var examQuestions = exam.questions;
7092
+ var questions = examQuestions.filter(function (i) {
7093
+ return i.article === +article;
7094
+ });
7095
+ var prevQuestions = examQuestions.filter(function (i) {
7096
+ return i.article < +article;
7097
+ });
7098
+ var nextQuestions = examQuestions.filter(function (i) {
7099
+ return i.article > +article;
7100
+ });
7101
+ var lastOrder = questions[questions.length - 1].questionOrder;
7102
+ if (questions.length === questionCount) return;
7103
+ if (questions.length < questionCount) {
7104
+ var additionalQuestions = Array.from({
7105
+ length: questionCount - questions.length
7106
+ }).map(function (_, index) {
7107
+ var _questions$;
7108
+ return {
7109
+ article: +article,
7110
+ correctAnswers: [1],
7111
+ numberOfAnswers: answerCount,
7112
+ categoryId: (_questions$ = questions[0]) === null || _questions$ === void 0 ? void 0 : _questions$.categoryId,
7113
+ score: DEFAULT_SCORE,
7114
+ questionOrder: lastOrder + index + 1
7115
+ };
7116
+ });
7117
+ var newQuestions = [].concat(prevQuestions, questions, additionalQuestions, nextQuestions.map(function (i) {
7118
+ return _extends({}, i, {
7119
+ questionOrder: i.questionOrder + questionCount - questions.length
6840
7120
  });
6841
- }
7121
+ }));
7122
+ onChangeExam(_extends({}, exam, {
7123
+ questions: [].concat(newQuestions)
7124
+ }));
6842
7125
  } else {
6843
- if (superUrls.some(function (i) {
6844
- return pathname.startsWith(i);
6845
- })) {
6846
- pushTo({
6847
- pathname: homeAcademyUrl,
6848
- search: ""
7126
+ var remainQuestions = questions.slice(0, questionCount);
7127
+ var _newQuestions = [].concat(prevQuestions, remainQuestions, nextQuestions.map(function (i) {
7128
+ return _extends({}, i, {
7129
+ questionOrder: i.questionOrder - questions.length + questionCount
6849
7130
  });
6850
- }
6851
- if (paramAcademyDomain && academyDomain.trim().toLocaleLowerCase() != (paramAcademyDomain === null || paramAcademyDomain === void 0 ? void 0 : paramAcademyDomain.trim().toLocaleLowerCase())) {
6852
- logout();
6853
- }
6854
- if (!paramAcademyDomain && academyDomain) {
6855
- searchParams.append("domain", academyDomain);
6856
- pushTo(_extends({}, window.location, {
6857
- search: searchParams.toString()
6858
- }));
6859
- }
7131
+ }));
7132
+ onChangeExam(_extends({}, exam, {
7133
+ questions: [].concat(_newQuestions)
7134
+ }));
6860
7135
  }
6861
7136
  };
6862
- var pushTo = function pushTo(data) {
6863
- if (history.push) history.push(data);else history(data);
6864
- };
6865
- useEffect(function () {
6866
- initialAcademySearchParam();
6867
- }, [window.location.pathname, user === null || user === void 0 ? void 0 : user.academyDomain]);
6868
- };
6869
-
6870
- var useList = function useList(fetchData, defaultQuery) {
6871
- var dispatch = useDispatch();
6872
- var _useState = useState(defaultQuery),
6873
- filter = _useState[0],
6874
- setFilter = _useState[1];
6875
- var _useState2 = useState(0),
6876
- totalPages = _useState2[0],
6877
- setTotalPages = _useState2[1];
6878
- var _useState3 = useState([]),
6879
- data = _useState3[0],
6880
- setData = _useState3[1];
6881
- var _useState4 = useState(),
6882
- selectedItem = _useState4[0],
6883
- setSelectedItem = _useState4[1];
6884
- var textSearchRef = useRef(null);
6885
- var isFirstLoadRef = useRef(true);
6886
- var handleChangeSelectedItem = function handleChangeSelectedItem(item) {
6887
- setSelectedItem(item);
7137
+ var handleChangeCategory = function handleChangeCategory(article, categoryId) {
7138
+ if (!exam) return;
7139
+ var examQuestions = exam.questions;
7140
+ var questions = examQuestions.filter(function (i) {
7141
+ return i.article === +article;
7142
+ });
7143
+ var otherQuestions = examQuestions.filter(function (i) {
7144
+ return i.article !== +article;
7145
+ });
7146
+ onChangeExam(_extends({}, exam, {
7147
+ questions: [].concat(otherQuestions, questions.map(function (q) {
7148
+ return _extends({}, q, {
7149
+ categoryId: categoryId
7150
+ });
7151
+ }))
7152
+ }));
6888
7153
  };
6889
- var getData = function getData(isLoading) {
6890
- if (isLoading === void 0) {
6891
- isLoading = false;
6892
- }
6893
- try {
6894
- var _temp2 = function _temp2() {
6895
- isLoading && dispatch(setLoading(false));
6896
- };
6897
- if (isFirstLoadRef.current) isFirstLoadRef.current = false;
6898
- isLoading && dispatch(setLoading(true));
6899
- var _temp = _catch(function () {
6900
- return Promise.resolve(fetchData(filter)).then(function (res) {
6901
- var _res$data = res.data,
6902
- _res$data$items = _res$data.items,
6903
- items = _res$data$items === void 0 ? [] : _res$data$items,
6904
- _res$data$totalPages = _res$data.totalPages,
6905
- totalPages = _res$data$totalPages === void 0 ? 0 : _res$data$totalPages;
6906
- setTotalPages(totalPages);
6907
- setData(items);
6908
- });
6909
- }, function (error) {
6910
- var _error$response, _error$response$data;
6911
- setTotalPages(0);
6912
- setData([]);
6913
- toast.error((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) || "Get data failed");
7154
+ var handleDeleteArticle = function handleDeleteArticle(article) {
7155
+ if (!exam) return;
7156
+ var removedQuestions = exam.questions.filter(function (i) {
7157
+ return i.article === +article;
7158
+ }).map(function (i) {
7159
+ return i.questionOrder;
7160
+ });
7161
+ var max = Math.max.apply(Math, removedQuestions);
7162
+ var examQuestions = exam.questions.filter(function (i) {
7163
+ return i.article !== +article;
7164
+ }).map(function (i) {
7165
+ return _extends({}, i, {
7166
+ article: i.article > article ? i.article - 1 : i.article,
7167
+ questionOrder: i.questionOrder > max ? i.questionOrder - removedQuestions.length : i.questionOrder
6914
7168
  });
6915
- return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
6916
- } catch (e) {
6917
- return Promise.reject(e);
7169
+ });
7170
+ onChangeExam(_extends({}, exam, {
7171
+ questions: [].concat(examQuestions)
7172
+ }));
7173
+ };
7174
+ var handleChangeAnswerCount = function handleChangeAnswerCount(article, newAnswerCount, answerCount) {
7175
+ if (!exam) return;
7176
+ if (newAnswerCount === answerCount) return;
7177
+ var examQuestions = exam.questions;
7178
+ var questions = examQuestions.filter(function (i) {
7179
+ return i.article === +article;
7180
+ });
7181
+ var otherQuestions = examQuestions.filter(function (i) {
7182
+ return i.article !== +article;
7183
+ });
7184
+ if (answerCount < newAnswerCount) {
7185
+ onChangeExam(_extends({}, exam, {
7186
+ questions: [].concat(otherQuestions, questions.map(function (q) {
7187
+ return _extends({}, q, {
7188
+ numberOfAnswers: newAnswerCount
7189
+ });
7190
+ }))
7191
+ }));
7192
+ } else {
7193
+ onChangeExam(_extends({}, exam, {
7194
+ questions: [].concat(otherQuestions, questions.map(function (q) {
7195
+ var _q$correctAnswers;
7196
+ return _extends({}, q, {
7197
+ numberOfAnswers: newAnswerCount,
7198
+ correctAnswers: (_q$correctAnswers = q.correctAnswers) === null || _q$correctAnswers === void 0 ? void 0 : _q$correctAnswers.filter(function (i) {
7199
+ return i <= newAnswerCount;
7200
+ })
7201
+ });
7202
+ }))
7203
+ }));
6918
7204
  }
6919
7205
  };
6920
- var handleSort = function handleSort(sortColumnName) {
6921
- var sortColumnDirection = OrderType.ASC;
6922
- console.log({
6923
- sortColumnName: typeof sortColumnName,
6924
- filter: typeof filter.sortColumnName
7206
+ var handleChangeCorrectAnswers = function handleChangeCorrectAnswers(article, index, answer) {
7207
+ if (!exam) return;
7208
+ var examQuestions = exam.questions;
7209
+ var questions = examQuestions.filter(function (i) {
7210
+ return i.article === +article;
6925
7211
  });
6926
- if (filter.sortColumnName == sortColumnName && filter.sortColumnDirection === OrderType.ASC) sortColumnDirection = OrderType.DESC;
6927
- setFilter(_extends({}, filter, {
6928
- sortColumnName: sortColumnName,
6929
- sortColumnDirection: sortColumnDirection,
6930
- currentPage: 1
7212
+ var otherQuestions = examQuestions.filter(function (i) {
7213
+ return i.article !== +article;
7214
+ });
7215
+ var selectedQuestion = questions[index];
7216
+ onChangeExam(_extends({}, exam, {
7217
+ questions: [].concat(otherQuestions, questions.slice(0, index), [_extends({}, selectedQuestion, {
7218
+ correctAnswers: [answer]
7219
+ })], questions.slice(index + 1))
6931
7220
  }));
6932
7221
  };
6933
- var handleChangeSearchText = function handleChangeSearchText(e) {
6934
- if (!textSearchRef.current) return;
6935
- textSearchRef.current.value = e.target.value.trim();
6936
- debounceSearch();
7222
+ var handleChangeScoreAnswer = function handleChangeScoreAnswer(article, index, score) {
7223
+ if (!exam) return;
7224
+ var examQuestions = exam.questions;
7225
+ var questions = examQuestions.filter(function (i) {
7226
+ return i.article === +article;
7227
+ });
7228
+ var otherQuestions = examQuestions.filter(function (i) {
7229
+ return i.article !== +article;
7230
+ });
7231
+ var selectedQuestion = questions[index];
7232
+ if (score === selectedQuestion.score) return;
7233
+ onChangeExam(_extends({}, exam, {
7234
+ questions: [].concat(otherQuestions, questions.slice(0, index), [_extends({}, selectedQuestion, {
7235
+ score: score
7236
+ })], questions.slice(index + 1))
7237
+ }));
6937
7238
  };
6938
- var handleChangePage = function handleChangePage(_, page) {
6939
- setFilter(_extends({}, filter, {
6940
- currentPage: page
7239
+ var handleChangeDuration = function handleChangeDuration(value) {
7240
+ if (!exam) return;
7241
+ onChangeExam(_extends({}, exam, {
7242
+ duration: value === null || value === void 0 ? void 0 : value.value
6941
7243
  }));
6942
7244
  };
6943
- var calcOrderNumber = function calcOrderNumber(index) {
6944
- var _filter$currentPage, _filter$pageSize;
6945
- return (((_filter$currentPage = filter.currentPage) != null ? _filter$currentPage : 0) - 1) * ((_filter$pageSize = filter.pageSize) != null ? _filter$pageSize : 0) + index + 1;
7245
+ var handleChangeTitle = function handleChangeTitle(e) {
7246
+ if (!exam) return;
7247
+ onChangeExam(_extends({}, exam, {
7248
+ title: e.target.value
7249
+ }));
6946
7250
  };
6947
- var debounceSearch = _.debounce(function () {
6948
- var _textSearchRef$curren;
6949
- setFilter(_extends({}, filter, {
6950
- currentPage: 1,
6951
- textSearch: (_textSearchRef$curren = textSearchRef.current) === null || _textSearchRef$curren === void 0 ? void 0 : _textSearchRef$curren.value
7251
+ var handleAddArticle = function handleAddArticle() {
7252
+ var _$maxBy, _$maxBy2;
7253
+ if (!exam) return;
7254
+ var maxArticle = ((_$maxBy = _.maxBy(exam.questions, "article")) === null || _$maxBy === void 0 ? void 0 : _$maxBy.article) || 0;
7255
+ var maxOrder = ((_$maxBy2 = _.maxBy(exam.questions, "questionOrder")) === null || _$maxBy2 === void 0 ? void 0 : _$maxBy2.questionOrder) || 0;
7256
+ onChangeExam(_extends({}, exam, {
7257
+ questions: [].concat(exam.questions, [{
7258
+ article: maxArticle + 1,
7259
+ correctAnswers: [1],
7260
+ numberOfAnswers: DEFAULT_ANSWER_COUNT$1,
7261
+ score: DEFAULT_SCORE,
7262
+ questionOrder: maxOrder + 1
7263
+ }])
6952
7264
  }));
6953
- }, 500);
7265
+ };
7266
+ var examGroupByArticle = useMemo(function () {
7267
+ if (!exam) return [];
7268
+ var articles = [];
7269
+ var groupedArticle = _.groupBy(exam.questions, "article");
7270
+ for (var key in groupedArticle) {
7271
+ if (Object.prototype.hasOwnProperty.call(groupedArticle, key)) {
7272
+ var _questions$find, _$maxBy3;
7273
+ var questions = groupedArticle[key];
7274
+ articles.push({
7275
+ article: +key,
7276
+ categoryId: (_questions$find = questions.find(function (i) {
7277
+ return !!i.categoryId;
7278
+ })) === null || _questions$find === void 0 ? void 0 : _questions$find.categoryId,
7279
+ answerCount: ((_$maxBy3 = _.maxBy(questions, "numberOfAnswers")) === null || _$maxBy3 === void 0 ? void 0 : _$maxBy3.numberOfAnswers) || DEFAULT_ANSWER_COUNT$1,
7280
+ questionCount: questions.length,
7281
+ questions: questions
7282
+ });
7283
+ }
7284
+ }
7285
+ return _.sortBy(articles, "article");
7286
+ }, [JSON.stringify(exam)]);
7287
+ var durationOptions = useMemo(function () {
7288
+ var options = DURATION_OPTIONS.map(function (i) {
7289
+ return {
7290
+ label: i + "\uBD84",
7291
+ value: i
7292
+ };
7293
+ });
7294
+ if (!!exam.duration && exam.duration > DURATION_OPTIONS[DURATION_OPTIONS.length - 1]) return [].concat(options, [{
7295
+ label: exam.duration + "\uBD84",
7296
+ value: exam.duration
7297
+ }]);
7298
+ return options;
7299
+ }, [exam.duration]);
6954
7300
  useEffect(function () {
6955
- getData(isFirstLoadRef.current);
6956
- }, [JSON.stringify(filter)]);
7301
+ if ((selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) !== exam.subjectId) onChangeExam(_extends({}, exam, {
7302
+ subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
7303
+ }));
7304
+ }, [selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id, exam.subjectId]);
6957
7305
  return {
6958
- filter: filter,
6959
- textSearchRef: textSearchRef,
6960
- totalPages: totalPages,
6961
- data: data,
6962
- selectedItem: selectedItem,
6963
- handleSort: handleSort,
6964
- handleChangeSearchText: handleChangeSearchText,
6965
- handleChangePage: handleChangePage,
6966
- calcOrderNumber: calcOrderNumber,
6967
- handleChangeSelectedItem: handleChangeSelectedItem,
6968
- getData: getData
7306
+ t: t,
7307
+ durationOptions: durationOptions,
7308
+ examGroupByArticle: examGroupByArticle,
7309
+ handleAddArticle: handleAddArticle,
7310
+ handleChangeScoreAnswer: handleChangeScoreAnswer,
7311
+ handleChangeTitle: handleChangeTitle,
7312
+ handleChangeDuration: handleChangeDuration,
7313
+ handleChangeCorrectAnswers: handleChangeCorrectAnswers,
7314
+ handleChangeAnswerCount: handleChangeAnswerCount,
7315
+ handleChangeQuestionCount: handleChangeQuestionCount,
7316
+ handleChangeCategory: handleChangeCategory,
7317
+ handleDeleteArticle: handleDeleteArticle
6969
7318
  };
6970
7319
  };
6971
7320
 
6972
-
6973
-
6974
- var index$1 = {
6975
- __proto__: null,
6976
- useLogin: useLogin,
6977
- useAutoAcademyDomain: useAutoAcademyDomain,
6978
- useList: useList
6979
- };
6980
-
6981
- var useTextbookList = function useTextbookList(props) {
6982
- var role = props.role,
6983
- navigate = props.navigate;
6984
- var _useList = useList(function (search) {
6985
- return getTextbookListApi(search, role);
6986
- }, TextbookDefaultQuery),
6987
- filter = _useList.filter,
6988
- textSearchRef = _useList.textSearchRef,
6989
- totalPages = _useList.totalPages,
6990
- textbooks = _useList.data,
6991
- selectedTextbook = _useList.selectedItem,
6992
- handleSort = _useList.handleSort,
6993
- handleChangeSearchText = _useList.handleChangeSearchText,
6994
- handleChangePage = _useList.handleChangePage,
6995
- calcOrderNumber = _useList.calcOrderNumber,
6996
- handleChangeSelectedItem = _useList.handleChangeSelectedItem,
6997
- getData = _useList.getData;
6998
- var textbookUrl = role === Role.Teacher ? TEXTBOOK_URL$1 : ADMIN_TEXTBOOK_URL;
6999
- var dispatch = useDispatch();
7000
- var handleViewTextbook = function handleViewTextbook(id) {
7001
- navigate(textbookUrl + "/" + id + "?readonly=true", {
7002
- replace: true
7003
- });
7004
- };
7005
- var handleUpdateTextbook = function handleUpdateTextbook(id) {
7006
- navigate(textbookUrl + "/" + id, {
7007
- replace: true
7008
- });
7009
- };
7010
- var handleCreateTextbook = function handleCreateTextbook() {
7011
- navigate(textbookUrl + "/create", {
7012
- replace: true
7013
- });
7014
- };
7015
- var toggleConfirmDialog = function toggleConfirmDialog() {
7016
- handleChangeSelectedItem(undefined);
7017
- };
7018
- var handleSelectDeleteTextbook = function handleSelectDeleteTextbook(textbook) {
7019
- return [handleChangeSelectedItem(textbook)];
7020
- };
7021
- var handleDeleteTextbook = function handleDeleteTextbook() {
7022
- try {
7023
- var _temp2 = function _temp2() {
7024
- dispatch(setLoading(false));
7025
- };
7026
- if (!(selectedTextbook !== null && selectedTextbook !== void 0 && selectedTextbook.id)) return Promise.resolve();
7027
- dispatch(setLoading(true));
7028
- var _temp = _catch(function () {
7029
- return Promise.resolve(deleteTextbookApi(selectedTextbook.id, role)).then(function () {
7030
- return Promise.resolve(getData(false)).then(function () {
7031
- toggleConfirmDialog();
7032
- });
7033
- });
7034
- }, function (error) {
7035
- var _error$response, _error$response$data;
7036
- toast.error((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) || "Textbook deleted failed");
7037
- });
7038
- return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
7039
- } catch (e) {
7040
- return Promise.reject(e);
7041
- }
7042
- };
7043
- return {
7044
- filter: filter,
7045
- textSearchRef: textSearchRef,
7046
- totalPages: totalPages,
7047
- textbooks: textbooks,
7048
- selectedTextbook: selectedTextbook,
7049
- handleSort: handleSort,
7050
- handleChangeSearchText: handleChangeSearchText,
7051
- handleChangePage: handleChangePage,
7052
- calcOrderNumber: calcOrderNumber,
7053
- handleViewTextbook: handleViewTextbook,
7054
- handleUpdateTextbook: handleUpdateTextbook,
7055
- handleCreateTextbook: handleCreateTextbook,
7056
- toggleConfirmDialog: toggleConfirmDialog,
7057
- handleDeleteTextbook: handleDeleteTextbook,
7058
- handleSelectDeleteTextbook: handleSelectDeleteTextbook
7059
- };
7321
+ var ExamDetailView = function ExamDetailView(_ref) {
7322
+ var _ref$className = _ref.className,
7323
+ className = _ref$className === void 0 ? "" : _ref$className,
7324
+ exam = _ref.exam,
7325
+ isDisabled = _ref.isDisabled,
7326
+ isEdit = _ref.isEdit,
7327
+ onChangeExam = _ref.onChangeExam;
7328
+ var _useSubjectSelect = useSubjectSelect(),
7329
+ subjectOptions = _useSubjectSelect.subjectOptions,
7330
+ selectedSubject = _useSubjectSelect.selectedSubject,
7331
+ handleChangeSubject = _useSubjectSelect.handleChangeSubject;
7332
+ var _useExamDetailView = useExamDetailView({
7333
+ exam: exam,
7334
+ onChangeExam: onChangeExam,
7335
+ selectedSubject: selectedSubject
7336
+ }),
7337
+ t = _useExamDetailView.t,
7338
+ durationOptions = _useExamDetailView.durationOptions,
7339
+ examGroupByArticle = _useExamDetailView.examGroupByArticle,
7340
+ handleAddArticle = _useExamDetailView.handleAddArticle,
7341
+ handleChangeScoreAnswer = _useExamDetailView.handleChangeScoreAnswer,
7342
+ handleChangeTitle = _useExamDetailView.handleChangeTitle,
7343
+ handleChangeDuration = _useExamDetailView.handleChangeDuration,
7344
+ handleChangeCorrectAnswers = _useExamDetailView.handleChangeCorrectAnswers,
7345
+ handleChangeAnswerCount = _useExamDetailView.handleChangeAnswerCount,
7346
+ handleChangeQuestionCount = _useExamDetailView.handleChangeQuestionCount,
7347
+ handleChangeCategory = _useExamDetailView.handleChangeCategory,
7348
+ handleDeleteArticle = _useExamDetailView.handleDeleteArticle;
7349
+ return React.createElement(Grid, {
7350
+ container: true,
7351
+ spacing: 3,
7352
+ className: className + " " + styles["custom-row"]
7353
+ }, React.createElement(Grid, {
7354
+ item: true,
7355
+ xs: 5,
7356
+ className: 'mb-2'
7357
+ }, React.createElement("label", {
7358
+ className: styles["form-label"] + " " + styles$2["question-label"],
7359
+ htmlFor: "title"
7360
+ }, t("title")), React.createElement("input", {
7361
+ disabled: isDisabled,
7362
+ className: "" + styles["form-control"],
7363
+ value: exam.title,
7364
+ id: "title",
7365
+ placeholder: t("enter_title"),
7366
+ onChange: handleChangeTitle
7367
+ })), React.createElement(Grid, {
7368
+ item: true,
7369
+ xs: 3,
7370
+ className: 'mb-2'
7371
+ }, React.createElement("label", {
7372
+ className: styles["form-label"] + " " + styles$2["question-label"],
7373
+ htmlFor: "duration"
7374
+ }, t("duration")), React.createElement(CustomSelect, {
7375
+ inputId: "duration",
7376
+ value: exam.duration,
7377
+ options: durationOptions,
7378
+ onChange: handleChangeDuration,
7379
+ isDisabled: isDisabled
7380
+ })), React.createElement(Grid, {
7381
+ item: true,
7382
+ xs: 3,
7383
+ className: 'mb-2'
7384
+ }, React.createElement("label", {
7385
+ className: styles["form-label"] + " " + styles$2["question-label"],
7386
+ htmlFor: "duration"
7387
+ }, t("subject"), " ", selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.name), React.createElement(CustomSelect, {
7388
+ inputId: "subject",
7389
+ value: selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id,
7390
+ options: subjectOptions,
7391
+ onChange: handleChangeSubject,
7392
+ isDisabled: isDisabled || isEdit
7393
+ })), examGroupByArticle.map(function (i, index) {
7394
+ return React.createElement(Grid, {
7395
+ item: true,
7396
+ key: i.article,
7397
+ xs: 12,
7398
+ className: index === examGroupByArticle.length - 1 ? "mb-2" : ''
7399
+ }, React.createElement(ArticleGroupView, Object.assign({}, i, {
7400
+ isActive: index === examGroupByArticle.length - 1,
7401
+ onChangeQuestionCount: handleChangeQuestionCount,
7402
+ onChangeCategory: handleChangeCategory,
7403
+ onChangeAnswerCount: handleChangeAnswerCount,
7404
+ onChangeCorrectAnswers: handleChangeCorrectAnswers,
7405
+ onChangeScoreAnswer: handleChangeScoreAnswer,
7406
+ onDelete: handleDeleteArticle,
7407
+ isDisabled: isDisabled,
7408
+ selectedSubject: selectedSubject,
7409
+ isDeletable: examGroupByArticle.length > 1
7410
+ })));
7411
+ }), React.createElement(Grid, {
7412
+ item: true,
7413
+ xs: 12
7414
+ }, React.createElement("button", {
7415
+ disabled: isDisabled,
7416
+ className: styles["btn-outline-primary"] + " w-100 d-flex justify-content-center align-items-center " + styles$2["question-btn"] + " mt-3",
7417
+ onClick: handleAddArticle
7418
+ }, React.createElement(FaPlusCircle, {
7419
+ className: "me-2"
7420
+ }), "\uBB38\uD56D \uCD94\uAC00\uD558\uAE30")));
7060
7421
  };
7061
7422
 
7062
- var EmptyRow = function EmptyRow() {
7423
+ var _excluded$4 = ["isOpen", "onClose", "handleSaveExam"];
7424
+ var CreateExamDrawer = function CreateExamDrawer(props) {
7425
+ var isOpen = props.isOpen,
7426
+ onClose = props.onClose,
7427
+ handleSaveExam = props.handleSaveExam,
7428
+ examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$4);
7063
7429
  var _useTranslation = useTranslation(),
7064
7430
  t = _useTranslation.t;
7065
- return React.createElement(TableRow, null, React.createElement(TableCell, {
7066
- colSpan: 12,
7067
- className: "text-center text-muted"
7068
- }, t("no_data")));
7431
+ var theme = useTheme();
7432
+ var isTabletUp = useMediaQuery(theme.breakpoints.up('lg'));
7433
+ return React.createElement("div", null, React.createElement("div", {
7434
+ className: styles$3["drawer-overlay"] + " " + (isOpen && styles$3["open"]),
7435
+ onClick: function onClick() {
7436
+ return onClose();
7437
+ }
7438
+ }), React.createElement("div", {
7439
+ className: styles$3["drawer"] + " bg-white " + (isOpen && styles$3["open"]),
7440
+ style: {
7441
+ width: "" + (isTabletUp ? "70vw" : "100vw")
7442
+ }
7443
+ }, React.createElement("div", {
7444
+ className: styles$3["drawer-header"] + " d-flex justify-content-between align-items-center"
7445
+ }, React.createElement("div", {
7446
+ style: {
7447
+ color: "#5458D5",
7448
+ cursor: "pointer",
7449
+ padding: "0.5rem 1rem",
7450
+ border: "1px solid #5458D5",
7451
+ backgroundColor: "white",
7452
+ justifyContent: "center",
7453
+ alignItems: "center",
7454
+ borderRadius: "6px"
7455
+ },
7456
+ onClick: handleSaveExam
7457
+ }, t("live_exam")), React.createElement("span", {
7458
+ className: "p-1 pointer",
7459
+ onClick: function onClick() {
7460
+ return onClose();
7461
+ }
7462
+ }, React.createElement(FaTimes, {
7463
+ size: 18
7464
+ }))), React.createElement("div", {
7465
+ className: "" + styles$3["drawer-form"]
7466
+ }, React.createElement(ExamDetailView, Object.assign({}, examDetailViewProps)))));
7069
7467
  };
7070
7468
 
7071
- var LayoutList = function LayoutList(_ref) {
7072
- var children = _ref.children,
7073
- title = _ref.title;
7074
- return React.createElement(Box, {
7075
- className: 'bg-white p-5'
7469
+ var TextbookViewDetail = function TextbookViewDetail(props) {
7470
+ var _textbook$chapters;
7471
+ var _useTextbookDetail = useTextbookDetail(props),
7472
+ id = _useTextbookDetail.id,
7473
+ t = _useTextbookDetail.t,
7474
+ textbook = _useTextbookDetail.textbook,
7475
+ textbookSubject = _useTextbookDetail.textbookSubject,
7476
+ isReadonly = _useTextbookDetail.isReadonly,
7477
+ isNotFound = _useTextbookDetail.isNotFound,
7478
+ parentChapter = _useTextbookDetail.parentChapter,
7479
+ textbookId = _useTextbookDetail.textbookId,
7480
+ selectedChapter = _useTextbookDetail.selectedChapter,
7481
+ articlesSelected = _useTextbookDetail.articlesSelected,
7482
+ selectedDeleteItem = _useTextbookDetail.selectedDeleteItem,
7483
+ isEditedTitle = _useTextbookDetail.isEditedTitle,
7484
+ isOpenDialog = _useTextbookDetail.isOpenDialog,
7485
+ examRequest = _useTextbookDetail.examRequest,
7486
+ handleChangeExamRequest = _useTextbookDetail.handleChangeExamRequest,
7487
+ handleSaveExam = _useTextbookDetail.handleSaveExam,
7488
+ handleCloseDialog = _useTextbookDetail.handleCloseDialog,
7489
+ handleCreateExam = _useTextbookDetail.handleCreateExam,
7490
+ handleCheckArticle = _useTextbookDetail.handleCheckArticle,
7491
+ handleChangeTextbookTitle = _useTextbookDetail.handleChangeTextbookTitle,
7492
+ handleOpenCreateExamDialog = _useTextbookDetail.handleOpenCreateExamDialog,
7493
+ handleChangeTextbookSubject = _useTextbookDetail.handleChangeTextbookSubject,
7494
+ handleGoToTextbookList = _useTextbookDetail.handleGoToTextbookList,
7495
+ handleCreateOrUpdateTextbook = _useTextbookDetail.handleCreateOrUpdateTextbook,
7496
+ handleCloseChapterNameDialog = _useTextbookDetail.handleCloseChapterNameDialog,
7497
+ handleCreateChapter = _useTextbookDetail.handleCreateChapter,
7498
+ handleAddChapterToTextbook = _useTextbookDetail.handleAddChapterToTextbook,
7499
+ handleAddChapterToParentSubchapter = _useTextbookDetail.handleAddChapterToParentSubchapter,
7500
+ handleChangeChapterName = _useTextbookDetail.handleChangeChapterName,
7501
+ handleChangeChapterPageFrom = _useTextbookDetail.handleChangeChapterPageFrom,
7502
+ handleChangeChapterPageTo = _useTextbookDetail.handleChangeChapterPageTo,
7503
+ handleAddArticleToChapter = _useTextbookDetail.handleAddArticleToChapter,
7504
+ handleUpdateArticleQuestionCountFromChapter = _useTextbookDetail.handleUpdateArticleQuestionCountFromChapter,
7505
+ handleUpdateArticleCategory = _useTextbookDetail.handleUpdateArticleCategory,
7506
+ handleUpdateArticleAnswerCount = _useTextbookDetail.handleUpdateArticleAnswerCount,
7507
+ handleUpdateArticleQuestion = _useTextbookDetail.handleUpdateArticleQuestion,
7508
+ handleCloseArticleDialog = _useTextbookDetail.handleCloseArticleDialog,
7509
+ handleOpenAddArticleDialog = _useTextbookDetail.handleOpenAddArticleDialog,
7510
+ handleOpenRemoveArticleConfirmDialog = _useTextbookDetail.handleOpenRemoveArticleConfirmDialog,
7511
+ handleCloseConfirmDeleteDialog = _useTextbookDetail.handleCloseConfirmDeleteDialog,
7512
+ handleRemoveSelectedItem = _useTextbookDetail.handleRemoveSelectedItem,
7513
+ handleOpenRemoveChapterConfirmDialog = _useTextbookDetail.handleOpenRemoveChapterConfirmDialog;
7514
+ var _useCategorySelect = useCategorySelect({
7515
+ subjectId: id ? textbookSubject === null || textbookSubject === void 0 ? void 0 : textbookSubject.value : undefined
7516
+ }),
7517
+ categoryOptions = _useCategorySelect.categoryOptions;
7518
+ if (isNotFound) return React.createElement(NotFound, null);
7519
+ return React.createElement(Container, {
7520
+ maxWidth: "xl",
7521
+ className: "bg-white py-5 p-4 rounded-4 h-100 d-flex flex-column"
7076
7522
  }, React.createElement(Stack, {
7077
7523
  direction: "row",
7078
7524
  alignItems: "center",
7079
7525
  justifyContent: "space-between",
7080
7526
  mb: 2
7081
7527
  }, React.createElement(Typography, {
7082
- variant: 'h4'
7083
- }, title)), React.createElement(Box, null, children));
7084
- };
7085
-
7086
- var SortIcon = function SortIcon(_ref) {
7087
- var isAscending = _ref.isAscending,
7088
- onClick = _ref.onClick;
7089
- return React.createElement("div", {
7090
- className: "d-flex flex-column " + styleGlobal["sort-icons"],
7091
- onClick: onClick
7092
- }, React.createElement(FaSortUp, {
7093
- className: isAscending === true ? styleGlobal["active"] : ""
7094
- }), React.createElement(FaSortDown, {
7095
- className: isAscending === false ? styleGlobal["active"] : ""
7096
- }));
7097
- };
7098
-
7099
- var TableHeader = function TableHeader(_ref) {
7100
- var headerTemplates = _ref.headerTemplates,
7101
- filter = _ref.filter,
7102
- onSort = _ref.onSort;
7103
- var _useTranslation = useTranslation(),
7104
- t = _useTranslation.t;
7105
- return React.createElement(TableHead, null, React.createElement(TableRow, null, headerTemplates.map(function (i, index$1) {
7106
- return React.createElement(TableCell, {
7107
- key: index$1,
7108
- className: "" + (!!i.sortKey && "pointer"),
7109
- onClick: !!i.sortKey ? function () {
7110
- return onSort === null || onSort === void 0 ? void 0 : onSort(i.sortKey);
7111
- } : undefined
7112
- }, React.createElement("div", {
7113
- className: "d-flex justify-content-between align-items-center text-nowrap"
7114
- }, t(i.title), !!i.sortKey && React.createElement(SortIcon, {
7115
- isAscending: filter.sortColumnName !== i.sortKey ? undefined : filter.sortColumnDirection === OrderType.ASC
7116
- })));
7117
- })));
7118
- };
7119
-
7120
- var SearchInput = function SearchInput(_ref) {
7121
- var textSearchRef = _ref.textSearchRef,
7122
- _ref$placeholder = _ref.placeholder,
7123
- placeholder = _ref$placeholder === void 0 ? "Search for..." : _ref$placeholder,
7124
- onChange = _ref.onChange,
7125
- _ref$fit = _ref.fit,
7126
- fit = _ref$fit === void 0 ? true : _ref$fit;
7127
- return React.createElement(Paper, {
7128
- component: "div",
7129
- className: "bg-light w-100 " + (fit && "h-100"),
7528
+ variant: "h3"
7529
+ }, t(id ? isReadonly ? "view_textbook" : "update_textbook" : "create_textbook"))), React.createElement(Grid, {
7530
+ container: true,
7531
+ spacing: 3
7532
+ }, React.createElement(Grid, {
7533
+ item: true,
7534
+ xs: 4,
7535
+ className: "d-flex align-items-center"
7536
+ }, React.createElement(Table, null, React.createElement(TableBody, null, React.createElement(TableRow, {
7130
7537
  sx: {
7131
- p: "2px 4px",
7132
- display: "flex",
7133
- alignItems: "center",
7134
- width: 400,
7135
- transition: "border 0.2s ease",
7136
- outline: "1px solid transparent",
7137
- ":focus-within": {
7138
- outlineColor: function outlineColor(theme) {
7139
- return theme.palette.primary.main;
7140
- }
7538
+ "& td": {
7539
+ border: 0
7141
7540
  }
7142
7541
  }
7143
- }, React.createElement(Box, {
7542
+ }, React.createElement(TableCell, {
7543
+ className: "p-2 pe-0",
7144
7544
  sx: {
7145
- p: "10px"
7146
- },
7147
- "aria-label": "search"
7148
- }, React.createElement(IoSearch, {
7149
- size: 24,
7150
- className: "pb-1"
7151
- })), React.createElement(InputBase, {
7152
- id: "searchText",
7153
- className: "" + (fit && "h-100"),
7545
+ width: "15%"
7546
+ }
7547
+ }, React.createElement(InputLabel, null, React.createElement("span", {
7548
+ className: "fw-bold"
7549
+ }, t("name")), React.createElement("span", {
7550
+ className: "text-danger"
7551
+ }, "*"))), React.createElement(TableCell, {
7154
7552
  sx: {
7155
- ml: 1,
7156
- flex: 1,
7157
- lineHeight: 1
7158
- },
7159
- placeholder: placeholder,
7160
- ref: textSearchRef,
7161
- onChange: onChange
7162
- }));
7163
- };
7164
-
7165
- var TextbookList = function TextbookList(props) {
7166
- var _useTranslation = useTranslation(),
7167
- t = _useTranslation.t;
7168
- var _useTextbookList = useTextbookList(props),
7169
- filter = _useTextbookList.filter,
7170
- textbooks = _useTextbookList.textbooks,
7171
- totalPages = _useTextbookList.totalPages,
7172
- textSearchRef = _useTextbookList.textSearchRef,
7173
- selectedTextbook = _useTextbookList.selectedTextbook,
7174
- handleChangeSearchText = _useTextbookList.handleChangeSearchText,
7175
- handleSort = _useTextbookList.handleSort,
7176
- handleChangePage = _useTextbookList.handleChangePage,
7177
- calcOrderNumber = _useTextbookList.calcOrderNumber,
7178
- handleViewTextbook = _useTextbookList.handleViewTextbook,
7179
- handleUpdateTextbook = _useTextbookList.handleUpdateTextbook,
7180
- handleCreateTextbook = _useTextbookList.handleCreateTextbook,
7181
- toggleConfirmDialog = _useTextbookList.toggleConfirmDialog,
7182
- handleDeleteTextbook = _useTextbookList.handleDeleteTextbook,
7183
- handleSelectDeleteTextbook = _useTextbookList.handleSelectDeleteTextbook;
7184
- return React.createElement(LayoutList, {
7185
- title: t(TEXTBOOK_PAGE_TITLE)
7186
- }, React.createElement(Grid, {
7187
- container: true
7188
- }, React.createElement(Grid, {
7553
+ width: 0,
7554
+ px: 1
7555
+ }
7556
+ }, ":"), React.createElement(TableCell, {
7557
+ className: "p-2"
7558
+ }, React.createElement(InputText, {
7559
+ className: "w-100",
7560
+ value: textbook === null || textbook === void 0 ? void 0 : textbook.name,
7561
+ placeholder: t("enter_textbook_title"),
7562
+ onChange: handleChangeTextbookTitle,
7563
+ disabled: isReadonly
7564
+ }))), React.createElement(TableRow, {
7565
+ sx: {
7566
+ "& td": {
7567
+ border: 0
7568
+ }
7569
+ }
7570
+ }, React.createElement(TableCell, {
7571
+ className: "p-2 pe-0"
7572
+ }, React.createElement(InputLabel, null, React.createElement("span", {
7573
+ className: "fw-bold"
7574
+ }, t("subject")), React.createElement("span", {
7575
+ className: "text-danger"
7576
+ }, "*"))), React.createElement(TableCell, {
7577
+ sx: {
7578
+ width: 0,
7579
+ px: 1
7580
+ }
7581
+ }, ":"), React.createElement(TableCell, {
7582
+ className: "p-2"
7583
+ }, React.createElement(SubjectSelector, {
7584
+ value: textbookSubject,
7585
+ onChange: handleChangeTextbookSubject,
7586
+ isDisabled: isReadonly || !!id
7587
+ })))))), React.createElement(Grid, {
7189
7588
  item: true,
7190
- xs: 6
7191
- }, React.createElement(SearchInput, {
7192
- textSearchRef: textSearchRef,
7193
- onChange: handleChangeSearchText,
7194
- placeholder: t(TEXT_BOOK_SEARCH_PLACEHOLDER)
7195
- })), React.createElement(Grid, {
7589
+ xs: 8,
7590
+ className: "d-flex justify-content-end"
7591
+ }, React.createElement("div", null, React.createElement(TextbookActionButtons, {
7592
+ isReadonly: isReadonly,
7593
+ textbook: textbook,
7594
+ onBack: handleGoToTextbookList,
7595
+ onSave: handleCreateOrUpdateTextbook,
7596
+ hideSave: !isEditedTitle && !!id && !isReadonly || textbook.isCreatedByAdmin
7597
+ }))), React.createElement(Grid, {
7196
7598
  item: true,
7197
- xs: 6
7198
- }, React.createElement(Stack, {
7199
- alignItems: "end"
7599
+ xs: 12,
7600
+ gap: "8px",
7601
+ className: "d-flex justify-content-end"
7200
7602
  }, React.createElement(Button, {
7603
+ variant: "outlined",
7604
+ sx: {
7605
+ borderColor: "#5458D5",
7606
+ color: "#5458D5"
7607
+ },
7608
+ onClick: function onClick() {
7609
+ return handleOpenCreateExamDialog();
7610
+ },
7611
+ disabled: isReadonly || !articlesSelected.length,
7201
7612
  startIcon: React.createElement(FaPlus, {
7202
7613
  size: 12
7203
- }),
7614
+ })
7615
+ }, React.createElement(Typography, null, t("create_new_exam"))), !!id && React.createElement(Button, {
7616
+ className: "mx-1",
7204
7617
  variant: "contained",
7205
7618
  color: "primary",
7206
- onClick: handleCreateTextbook
7207
- }, t("create_textbook")))), React.createElement(Grid, {
7208
- item: true,
7209
- xs: 12,
7210
- className: "mt-3"
7211
- }, React.createElement(Table, null, React.createElement(TableHeader, {
7212
- headerTemplates: TEXTBOOK_HEADERS,
7213
- filter: filter,
7214
- onSort: handleSort
7215
- }), React.createElement(TableBody, null, textbooks.map(function (i, index) {
7216
- return React.createElement(TableRow, {
7217
- key: i.id
7218
- }, React.createElement(TableCell, null, calcOrderNumber(index)), React.createElement(TableCell, null, i.name), React.createElement(TableCell, null, i.subject.name), React.createElement(TableCell, null, utcToLocalTime(i.createdAt, t("date_format"))), React.createElement(TableCell, null, i.totalChapters), React.createElement(TableCell, null, React.createElement(Stack, {
7219
- direction: "row",
7220
- spacing: 1,
7221
- alignItems: "center"
7222
- }, !i.isCreatedByAdmin && React.createElement(IconButton, {
7223
- color: "default",
7224
- className: "bg-warning text-white",
7225
- onClick: function onClick() {
7226
- return handleUpdateTextbook(i.id);
7227
- }
7228
- }, React.createElement(FaPencil, {
7229
- size: 12
7230
- })), React.createElement(IconButton, {
7231
- color: "default",
7232
- className: "bg-primary text-white",
7233
- onClick: function onClick() {
7234
- return handleViewTextbook(i.id);
7235
- }
7236
- }, React.createElement(FaEye, {
7237
- size: 12
7238
- })), !i.isCreatedByAdmin && React.createElement(IconButton, {
7239
- color: "default",
7240
- className: "bg-danger text-white",
7241
- onClick: function onClick() {
7242
- return handleSelectDeleteTextbook(i);
7243
- }
7244
- }, React.createElement(FaTrash, {
7619
+ startIcon: React.createElement(FaPlus, {
7245
7620
  size: 12
7246
- })))));
7247
- }), !textbooks.length && React.createElement(EmptyRow, null))), React.createElement("div", {
7248
- className: "d-flex justify-content-end mt-3"
7249
- }, !!totalPages && React.createElement(Pagination, {
7250
- count: totalPages,
7251
- page: filter.currentPage,
7252
- onChange: handleChangePage
7253
- })))), React.createElement(ConfirmDialog, {
7254
- open: !!(selectedTextbook !== null && selectedTextbook !== void 0 && selectedTextbook.id),
7255
- toggle: toggleConfirmDialog,
7256
- text: "" + t("are_you_sure_you_want_to_delete_the_textbook"),
7257
- onConfirm: handleDeleteTextbook,
7258
- confirmText: selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.name,
7621
+ }),
7622
+ onClick: handleAddChapterToTextbook,
7623
+ disabled: isReadonly
7624
+ }, t("add_chapter"))), React.createElement(Grid, {
7625
+ item: true,
7626
+ xs: 12
7627
+ }, React.createElement(Stack, {
7628
+ spacing: 3
7629
+ }, !!(textbook !== null && textbook !== void 0 && textbook.subject) && (textbook === null || textbook === void 0 ? void 0 : (_textbook$chapters = textbook.chapters) === null || _textbook$chapters === void 0 ? void 0 : _textbook$chapters.map(function (chapter) {
7630
+ return React.createElement(ChapterBox, {
7631
+ key: chapter.id,
7632
+ subject: textbook.subject,
7633
+ data: chapter,
7634
+ categoryOptions: categoryOptions || [],
7635
+ onClickAddSubchapter: handleAddChapterToParentSubchapter,
7636
+ onChangeName: handleChangeChapterName,
7637
+ onChangePageFrom: handleChangeChapterPageFrom,
7638
+ onChangePageTo: handleChangeChapterPageTo,
7639
+ handleCheckArticle: handleCheckArticle,
7640
+ onAddArticle: handleOpenAddArticleDialog,
7641
+ onRemoveArticle: handleOpenRemoveArticleConfirmDialog,
7642
+ onUpdateArticleQuestionCount: handleUpdateArticleQuestionCountFromChapter,
7643
+ onUpdateArticleCategory: handleUpdateArticleCategory,
7644
+ onUpdateArticleQuestionAnswerCount: handleUpdateArticleAnswerCount,
7645
+ onUpdateArticleQuestion: handleUpdateArticleQuestion,
7646
+ onRemoveChapter: handleOpenRemoveChapterConfirmDialog,
7647
+ isReadonly: isReadonly
7648
+ });
7649
+ }))))), React.createElement(ChapterNameDialog, {
7650
+ open: !!(parentChapter !== null && parentChapter !== void 0 && parentChapter.id) || !!textbookId,
7651
+ chapter: parentChapter,
7652
+ onClose: handleCloseChapterNameDialog,
7653
+ onSubmitForm: handleCreateChapter
7654
+ }), React.createElement(CreateExamDrawer, {
7655
+ isOpen: isOpenDialog,
7656
+ onClose: handleCloseDialog,
7657
+ onSubmit: handleCreateExam,
7658
+ handleSaveExam: handleSaveExam,
7659
+ exam: examRequest,
7660
+ onChangeExam: handleChangeExamRequest
7661
+ }), React.createElement(ArticleDialog, {
7662
+ open: !!selectedChapter,
7663
+ chapter: selectedChapter,
7664
+ categoryOptions: categoryOptions || [],
7665
+ onClose: handleCloseArticleDialog,
7666
+ onSubmitForm: handleAddArticleToChapter
7667
+ }), selectedDeleteItem && React.createElement(ConfirmDialog, {
7668
+ open: true,
7669
+ toggle: handleCloseConfirmDeleteDialog,
7670
+ text: selectedDeleteItem.confirmText,
7671
+ confirmText: selectedDeleteItem.name,
7672
+ onConfirm: handleRemoveSelectedItem,
7259
7673
  isDelete: true
7260
7674
  }));
7261
7675
  };
7262
7676
 
7263
-
7264
-
7265
- var index$2 = {
7266
- __proto__: null,
7267
- TextbookList: TextbookList,
7268
- TextbookDetail: TextbookViewDetail
7269
- };
7270
-
7271
- var _excluded$4 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
7272
- var CustomCreatable = function CustomCreatable(_ref) {
7273
- var options = _ref.options,
7274
- isDisabled = _ref.isDisabled,
7275
- scrollBottom = _ref.scrollBottom,
7276
- value = _ref.value,
7277
- isMulti = _ref.isMulti,
7278
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
7279
- var initialValues = Array.isArray(value) ? options.filter(function (i) {
7280
- return value.includes(i.value);
7281
- }) : isMulti ? options.filter(function (i) {
7282
- return i.value == value;
7283
- }) : options.find(function (i) {
7284
- return i.value == value;
7677
+ var useAutoAcademyDomain = function useAutoAcademyDomain(logout, history, superUrls, homeUrl, homeAcademyUrl) {
7678
+ var searchParams = new URLSearchParams(window.location.search);
7679
+ var user = useSelector(function (state) {
7680
+ var _state$common;
7681
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
7285
7682
  });
7286
- return React.createElement(CreatableSelect, Object.assign({
7287
- isClearable: true,
7288
- isDisabled: isDisabled,
7289
- options: options,
7290
- value: initialValues,
7291
- menuPlacement: scrollBottom ? "top" : "auto",
7292
- isMulti: isMulti
7293
- }, rest));
7294
- };
7295
-
7296
- var _excluded$5 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
7297
- var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
7298
- var isDefault = _ref.isDefault,
7299
- options = _ref.options,
7300
- isDisabled = _ref.isDisabled,
7301
- scrollBottom = _ref.scrollBottom,
7302
- value = _ref.value,
7303
- isMulti = _ref.isMulti,
7304
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
7305
- var initialValues = Array.isArray(value) ? options.filter(function (i) {
7306
- return value.includes(i.value);
7307
- }) : isMulti ? options.filter(function (i) {
7308
- return i.value == value;
7309
- }) : options.find(function (i) {
7310
- return i.value == value;
7311
- });
7312
- return React.createElement(Select, Object.assign({
7313
- isDisabled: isDisabled,
7314
- options: options,
7315
- value: !isDefault ? initialValues : undefined,
7316
- defaultValue: isDefault ? initialValues : undefined,
7317
- menuPlacement: scrollBottom ? "top" : "auto",
7318
- isMulti: isMulti
7319
- }, rest));
7320
- };
7321
-
7322
- var DURATION_OPTIONS = Array.from({
7323
- length: 120
7324
- }, function (_, i) {
7325
- return i + 1;
7326
- });
7327
- var DEFAULT_ANSWER_COUNT = 5;
7328
-
7329
- var useExamDetailView = function useExamDetailView(props) {
7330
- var exam = props.exam,
7331
- selectedSubject = props.selectedSubject,
7332
- onChangeExam = props.onChangeExam;
7333
- var _useTranslation = useTranslation(),
7334
- t = _useTranslation.t;
7335
- var handleChangeQuestionCount = function handleChangeQuestionCount(article, questionCount, answerCount) {
7336
- if (!exam) return;
7337
- var examQuestions = exam.questions;
7338
- var questions = examQuestions.filter(function (i) {
7339
- return i.article === +article;
7340
- });
7341
- var prevQuestions = examQuestions.filter(function (i) {
7342
- return i.article < +article;
7343
- });
7344
- var nextQuestions = examQuestions.filter(function (i) {
7345
- return i.article > +article;
7346
- });
7347
- var lastOrder = questions[questions.length - 1].questionOrder;
7348
- if (questions.length === questionCount) return;
7349
- if (questions.length < questionCount) {
7350
- var additionalQuestions = Array.from({
7351
- length: questionCount - questions.length
7352
- }).map(function (_, index) {
7353
- var _questions$;
7354
- return {
7355
- article: +article,
7356
- correctAnswers: [1],
7357
- numberOfAnswers: answerCount,
7358
- categoryId: (_questions$ = questions[0]) === null || _questions$ === void 0 ? void 0 : _questions$.categoryId,
7359
- score: DEFAULT_SCORE,
7360
- questionOrder: lastOrder + index + 1
7361
- };
7362
- });
7363
- var newQuestions = [].concat(prevQuestions, questions, additionalQuestions, nextQuestions.map(function (i) {
7364
- return _extends({}, i, {
7365
- questionOrder: i.questionOrder + questionCount - questions.length
7683
+ var initialAcademySearchParam = function initialAcademySearchParam() {
7684
+ var paramAcademyDomain = searchParams.get("domain");
7685
+ var domain = getAcademyDomain();
7686
+ var pathname = window.location.pathname.toLowerCase();
7687
+ if (!user) return;
7688
+ var academyDomain = user.academyDomain;
7689
+ if (!academyDomain) {
7690
+ if (!superUrls.some(function (i) {
7691
+ return pathname.startsWith(i);
7692
+ })) {
7693
+ pushTo({
7694
+ pathname: homeUrl,
7695
+ search: ""
7366
7696
  });
7367
- }));
7368
- onChangeExam(_extends({}, exam, {
7369
- questions: [].concat(newQuestions)
7370
- }));
7697
+ }
7698
+ if (domain) {
7699
+ searchParams.append("domain", domain);
7700
+ pushTo({
7701
+ pathname: homeUrl,
7702
+ search: ""
7703
+ });
7704
+ }
7371
7705
  } else {
7372
- var remainQuestions = questions.slice(0, questionCount);
7373
- var _newQuestions = [].concat(prevQuestions, remainQuestions, nextQuestions.map(function (i) {
7374
- return _extends({}, i, {
7375
- questionOrder: i.questionOrder - questions.length + questionCount
7706
+ if (superUrls.some(function (i) {
7707
+ return pathname.startsWith(i);
7708
+ })) {
7709
+ pushTo({
7710
+ pathname: homeAcademyUrl,
7711
+ search: ""
7376
7712
  });
7377
- }));
7378
- onChangeExam(_extends({}, exam, {
7379
- questions: [].concat(_newQuestions)
7380
- }));
7713
+ }
7714
+ if (paramAcademyDomain && academyDomain.trim().toLocaleLowerCase() != (paramAcademyDomain === null || paramAcademyDomain === void 0 ? void 0 : paramAcademyDomain.trim().toLocaleLowerCase())) {
7715
+ logout();
7716
+ }
7717
+ if (!paramAcademyDomain && academyDomain) {
7718
+ searchParams.append("domain", academyDomain);
7719
+ pushTo(_extends({}, window.location, {
7720
+ search: searchParams.toString()
7721
+ }));
7722
+ }
7381
7723
  }
7382
7724
  };
7383
- var handleChangeCategory = function handleChangeCategory(article, categoryId) {
7384
- if (!exam) return;
7385
- var examQuestions = exam.questions;
7386
- var questions = examQuestions.filter(function (i) {
7387
- return i.article === +article;
7388
- });
7389
- var otherQuestions = examQuestions.filter(function (i) {
7390
- return i.article !== +article;
7391
- });
7392
- onChangeExam(_extends({}, exam, {
7393
- questions: [].concat(otherQuestions, questions.map(function (q) {
7394
- return _extends({}, q, {
7395
- categoryId: categoryId
7396
- });
7397
- }))
7398
- }));
7725
+ var pushTo = function pushTo(data) {
7726
+ if (history.push) history.push(data);else history(data);
7399
7727
  };
7400
- var handleDeleteArticle = function handleDeleteArticle(article) {
7401
- if (!exam) return;
7402
- var removedQuestions = exam.questions.filter(function (i) {
7403
- return i.article === +article;
7404
- }).map(function (i) {
7405
- return i.questionOrder;
7406
- });
7407
- var max = Math.max.apply(Math, removedQuestions);
7408
- var examQuestions = exam.questions.filter(function (i) {
7409
- return i.article !== +article;
7410
- }).map(function (i) {
7411
- return _extends({}, i, {
7412
- article: i.article > article ? i.article - 1 : i.article,
7413
- questionOrder: i.questionOrder > max ? i.questionOrder - removedQuestions.length : i.questionOrder
7728
+ useEffect(function () {
7729
+ initialAcademySearchParam();
7730
+ }, [window.location.pathname, user === null || user === void 0 ? void 0 : user.academyDomain]);
7731
+ };
7732
+
7733
+ var useList = function useList(fetchData, defaultQuery) {
7734
+ var dispatch = useDispatch();
7735
+ var _useState = useState(defaultQuery),
7736
+ filter = _useState[0],
7737
+ setFilter = _useState[1];
7738
+ var _useState2 = useState(0),
7739
+ totalPages = _useState2[0],
7740
+ setTotalPages = _useState2[1];
7741
+ var _useState3 = useState([]),
7742
+ data = _useState3[0],
7743
+ setData = _useState3[1];
7744
+ var _useState4 = useState(),
7745
+ selectedItem = _useState4[0],
7746
+ setSelectedItem = _useState4[1];
7747
+ var textSearchRef = useRef(null);
7748
+ var isFirstLoadRef = useRef(true);
7749
+ var handleChangeSelectedItem = function handleChangeSelectedItem(item) {
7750
+ setSelectedItem(item);
7751
+ };
7752
+ var getData = function getData(isLoading) {
7753
+ if (isLoading === void 0) {
7754
+ isLoading = false;
7755
+ }
7756
+ try {
7757
+ var _temp2 = function _temp2() {
7758
+ isLoading && dispatch(setLoading(false));
7759
+ };
7760
+ if (isFirstLoadRef.current) isFirstLoadRef.current = false;
7761
+ isLoading && dispatch(setLoading(true));
7762
+ var _temp = _catch(function () {
7763
+ return Promise.resolve(fetchData(filter)).then(function (res) {
7764
+ var _res$data = res.data,
7765
+ _res$data$items = _res$data.items,
7766
+ items = _res$data$items === void 0 ? [] : _res$data$items,
7767
+ _res$data$totalPages = _res$data.totalPages,
7768
+ totalPages = _res$data$totalPages === void 0 ? 0 : _res$data$totalPages;
7769
+ setTotalPages(totalPages);
7770
+ setData(items);
7771
+ });
7772
+ }, function (error) {
7773
+ var _error$response, _error$response$data;
7774
+ setTotalPages(0);
7775
+ setData([]);
7776
+ toast.error((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) || "Get data failed");
7414
7777
  });
7778
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
7779
+ } catch (e) {
7780
+ return Promise.reject(e);
7781
+ }
7782
+ };
7783
+ var handleSort = function handleSort(sortColumnName) {
7784
+ var sortColumnDirection = OrderType.ASC;
7785
+ console.log({
7786
+ sortColumnName: typeof sortColumnName,
7787
+ filter: typeof filter.sortColumnName
7415
7788
  });
7416
- onChangeExam(_extends({}, exam, {
7417
- questions: [].concat(examQuestions)
7789
+ if (filter.sortColumnName == sortColumnName && filter.sortColumnDirection === OrderType.ASC) sortColumnDirection = OrderType.DESC;
7790
+ setFilter(_extends({}, filter, {
7791
+ sortColumnName: sortColumnName,
7792
+ sortColumnDirection: sortColumnDirection,
7793
+ currentPage: 1
7418
7794
  }));
7419
7795
  };
7420
- var handleChangeAnswerCount = function handleChangeAnswerCount(article, newAnswerCount, answerCount) {
7421
- if (!exam) return;
7422
- if (newAnswerCount === answerCount) return;
7423
- var examQuestions = exam.questions;
7424
- var questions = examQuestions.filter(function (i) {
7425
- return i.article === +article;
7426
- });
7427
- var otherQuestions = examQuestions.filter(function (i) {
7428
- return i.article !== +article;
7429
- });
7430
- if (answerCount < newAnswerCount) {
7431
- onChangeExam(_extends({}, exam, {
7432
- questions: [].concat(otherQuestions, questions.map(function (q) {
7433
- return _extends({}, q, {
7434
- numberOfAnswers: newAnswerCount
7435
- });
7436
- }))
7437
- }));
7438
- } else {
7439
- onChangeExam(_extends({}, exam, {
7440
- questions: [].concat(otherQuestions, questions.map(function (q) {
7441
- var _q$correctAnswers;
7442
- return _extends({}, q, {
7443
- numberOfAnswers: newAnswerCount,
7444
- correctAnswers: (_q$correctAnswers = q.correctAnswers) === null || _q$correctAnswers === void 0 ? void 0 : _q$correctAnswers.filter(function (i) {
7445
- return i <= newAnswerCount;
7446
- })
7447
- });
7448
- }))
7449
- }));
7450
- }
7796
+ var handleChangeSearchText = function handleChangeSearchText(e) {
7797
+ if (!textSearchRef.current) return;
7798
+ textSearchRef.current.value = e.target.value.trim();
7799
+ debounceSearch();
7451
7800
  };
7452
- var handleChangeCorrectAnswers = function handleChangeCorrectAnswers(article, index, answer) {
7453
- if (!exam) return;
7454
- var examQuestions = exam.questions;
7455
- var questions = examQuestions.filter(function (i) {
7456
- return i.article === +article;
7457
- });
7458
- var otherQuestions = examQuestions.filter(function (i) {
7459
- return i.article !== +article;
7460
- });
7461
- var selectedQuestion = questions[index];
7462
- onChangeExam(_extends({}, exam, {
7463
- questions: [].concat(otherQuestions, questions.slice(0, index), [_extends({}, selectedQuestion, {
7464
- correctAnswers: [answer]
7465
- })], questions.slice(index + 1))
7801
+ var handleChangePage = function handleChangePage(_, page) {
7802
+ setFilter(_extends({}, filter, {
7803
+ currentPage: page
7466
7804
  }));
7467
7805
  };
7468
- var handleChangeScoreAnswer = function handleChangeScoreAnswer(article, index, score) {
7469
- if (!exam) return;
7470
- var examQuestions = exam.questions;
7471
- var questions = examQuestions.filter(function (i) {
7472
- return i.article === +article;
7806
+ var calcOrderNumber = function calcOrderNumber(index) {
7807
+ var _filter$currentPage, _filter$pageSize;
7808
+ return (((_filter$currentPage = filter.currentPage) != null ? _filter$currentPage : 0) - 1) * ((_filter$pageSize = filter.pageSize) != null ? _filter$pageSize : 0) + index + 1;
7809
+ };
7810
+ var debounceSearch = _.debounce(function () {
7811
+ var _textSearchRef$curren;
7812
+ setFilter(_extends({}, filter, {
7813
+ currentPage: 1,
7814
+ textSearch: (_textSearchRef$curren = textSearchRef.current) === null || _textSearchRef$curren === void 0 ? void 0 : _textSearchRef$curren.value
7815
+ }));
7816
+ }, 500);
7817
+ useEffect(function () {
7818
+ getData(isFirstLoadRef.current);
7819
+ }, [JSON.stringify(filter)]);
7820
+ return {
7821
+ filter: filter,
7822
+ textSearchRef: textSearchRef,
7823
+ totalPages: totalPages,
7824
+ data: data,
7825
+ selectedItem: selectedItem,
7826
+ handleSort: handleSort,
7827
+ handleChangeSearchText: handleChangeSearchText,
7828
+ handleChangePage: handleChangePage,
7829
+ calcOrderNumber: calcOrderNumber,
7830
+ handleChangeSelectedItem: handleChangeSelectedItem,
7831
+ getData: getData
7832
+ };
7833
+ };
7834
+
7835
+
7836
+
7837
+ var index$1 = {
7838
+ __proto__: null,
7839
+ useLogin: useLogin,
7840
+ useAutoAcademyDomain: useAutoAcademyDomain,
7841
+ useList: useList
7842
+ };
7843
+
7844
+ var useTextbookList = function useTextbookList(props) {
7845
+ var role = props.role,
7846
+ navigate = props.navigate;
7847
+ var _useList = useList(function (search) {
7848
+ return getTextbookListApi(search, role);
7849
+ }, TextbookDefaultQuery),
7850
+ filter = _useList.filter,
7851
+ textSearchRef = _useList.textSearchRef,
7852
+ totalPages = _useList.totalPages,
7853
+ textbooks = _useList.data,
7854
+ selectedTextbook = _useList.selectedItem,
7855
+ handleSort = _useList.handleSort,
7856
+ handleChangeSearchText = _useList.handleChangeSearchText,
7857
+ handleChangePage = _useList.handleChangePage,
7858
+ calcOrderNumber = _useList.calcOrderNumber,
7859
+ handleChangeSelectedItem = _useList.handleChangeSelectedItem,
7860
+ getData = _useList.getData;
7861
+ var textbookUrl = role === Role.Teacher ? TEXTBOOK_URL$1 : ADMIN_TEXTBOOK_URL;
7862
+ var dispatch = useDispatch();
7863
+ var handleViewTextbook = function handleViewTextbook(id) {
7864
+ navigate(textbookUrl + "/" + id + "?readonly=true", {
7865
+ replace: true
7473
7866
  });
7474
- var otherQuestions = examQuestions.filter(function (i) {
7475
- return i.article !== +article;
7867
+ };
7868
+ var handleUpdateTextbook = function handleUpdateTextbook(id) {
7869
+ navigate(textbookUrl + "/" + id, {
7870
+ replace: true
7476
7871
  });
7477
- var selectedQuestion = questions[index];
7478
- if (score === selectedQuestion.score) return;
7479
- onChangeExam(_extends({}, exam, {
7480
- questions: [].concat(otherQuestions, questions.slice(0, index), [_extends({}, selectedQuestion, {
7481
- score: score
7482
- })], questions.slice(index + 1))
7483
- }));
7484
7872
  };
7485
- var handleChangeDuration = function handleChangeDuration(value) {
7486
- if (!exam) return;
7487
- onChangeExam(_extends({}, exam, {
7488
- duration: value === null || value === void 0 ? void 0 : value.value
7489
- }));
7873
+ var handleCreateTextbook = function handleCreateTextbook() {
7874
+ navigate(textbookUrl + "/create", {
7875
+ replace: true
7876
+ });
7490
7877
  };
7491
- var handleChangeTitle = function handleChangeTitle(e) {
7492
- if (!exam) return;
7493
- onChangeExam(_extends({}, exam, {
7494
- title: e.target.value
7495
- }));
7878
+ var toggleConfirmDialog = function toggleConfirmDialog() {
7879
+ handleChangeSelectedItem(undefined);
7496
7880
  };
7497
- var handleAddArticle = function handleAddArticle() {
7498
- var _$maxBy, _$maxBy2;
7499
- if (!exam) return;
7500
- var maxArticle = ((_$maxBy = _.maxBy(exam.questions, "article")) === null || _$maxBy === void 0 ? void 0 : _$maxBy.article) || 0;
7501
- var maxOrder = ((_$maxBy2 = _.maxBy(exam.questions, "questionOrder")) === null || _$maxBy2 === void 0 ? void 0 : _$maxBy2.questionOrder) || 0;
7502
- onChangeExam(_extends({}, exam, {
7503
- questions: [].concat(exam.questions, [{
7504
- article: maxArticle + 1,
7505
- correctAnswers: [1],
7506
- numberOfAnswers: DEFAULT_ANSWER_COUNT,
7507
- score: DEFAULT_SCORE,
7508
- questionOrder: maxOrder + 1
7509
- }])
7510
- }));
7881
+ var handleSelectDeleteTextbook = function handleSelectDeleteTextbook(textbook) {
7882
+ return [handleChangeSelectedItem(textbook)];
7511
7883
  };
7512
- var examGroupByArticle = useMemo(function () {
7513
- if (!exam) return [];
7514
- var articles = [];
7515
- var groupedArticle = _.groupBy(exam.questions, "article");
7516
- for (var key in groupedArticle) {
7517
- if (Object.prototype.hasOwnProperty.call(groupedArticle, key)) {
7518
- var _questions$find, _$maxBy3;
7519
- var questions = groupedArticle[key];
7520
- articles.push({
7521
- article: +key,
7522
- categoryId: (_questions$find = questions.find(function (i) {
7523
- return !!i.categoryId;
7524
- })) === null || _questions$find === void 0 ? void 0 : _questions$find.categoryId,
7525
- answerCount: ((_$maxBy3 = _.maxBy(questions, "numberOfAnswers")) === null || _$maxBy3 === void 0 ? void 0 : _$maxBy3.numberOfAnswers) || DEFAULT_ANSWER_COUNT,
7526
- questionCount: questions.length,
7527
- questions: questions
7884
+ var handleDeleteTextbook = function handleDeleteTextbook() {
7885
+ try {
7886
+ var _temp2 = function _temp2() {
7887
+ dispatch(setLoading(false));
7888
+ };
7889
+ if (!(selectedTextbook !== null && selectedTextbook !== void 0 && selectedTextbook.id)) return Promise.resolve();
7890
+ dispatch(setLoading(true));
7891
+ var _temp = _catch(function () {
7892
+ return Promise.resolve(deleteTextbookApi(selectedTextbook.id, role)).then(function () {
7893
+ return Promise.resolve(getData(false)).then(function () {
7894
+ toggleConfirmDialog();
7895
+ });
7528
7896
  });
7529
- }
7897
+ }, function (error) {
7898
+ var _error$response, _error$response$data;
7899
+ toast.error((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) || "Textbook deleted failed");
7900
+ });
7901
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
7902
+ } catch (e) {
7903
+ return Promise.reject(e);
7530
7904
  }
7531
- return _.sortBy(articles, "article");
7532
- }, [JSON.stringify(exam)]);
7533
- var durationOptions = useMemo(function () {
7534
- var options = DURATION_OPTIONS.map(function (i) {
7535
- return {
7536
- label: i + "\uBD84",
7537
- value: i
7538
- };
7539
- });
7540
- if (!!exam.duration && exam.duration > DURATION_OPTIONS[DURATION_OPTIONS.length - 1]) return [].concat(options, [{
7541
- label: exam.duration + "\uBD84",
7542
- value: exam.duration
7543
- }]);
7544
- return options;
7545
- }, [exam.duration]);
7546
- useEffect(function () {
7547
- if ((selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) !== exam.subjectId) onChangeExam(_extends({}, exam, {
7548
- subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
7549
- }));
7550
- }, [selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id, exam.subjectId]);
7905
+ };
7551
7906
  return {
7552
- t: t,
7553
- durationOptions: durationOptions,
7554
- examGroupByArticle: examGroupByArticle,
7555
- handleAddArticle: handleAddArticle,
7556
- handleChangeScoreAnswer: handleChangeScoreAnswer,
7557
- handleChangeTitle: handleChangeTitle,
7558
- handleChangeDuration: handleChangeDuration,
7559
- handleChangeCorrectAnswers: handleChangeCorrectAnswers,
7560
- handleChangeAnswerCount: handleChangeAnswerCount,
7561
- handleChangeQuestionCount: handleChangeQuestionCount,
7562
- handleChangeCategory: handleChangeCategory,
7563
- handleDeleteArticle: handleDeleteArticle
7907
+ filter: filter,
7908
+ textSearchRef: textSearchRef,
7909
+ totalPages: totalPages,
7910
+ textbooks: textbooks,
7911
+ selectedTextbook: selectedTextbook,
7912
+ handleSort: handleSort,
7913
+ handleChangeSearchText: handleChangeSearchText,
7914
+ handleChangePage: handleChangePage,
7915
+ calcOrderNumber: calcOrderNumber,
7916
+ handleViewTextbook: handleViewTextbook,
7917
+ handleUpdateTextbook: handleUpdateTextbook,
7918
+ handleCreateTextbook: handleCreateTextbook,
7919
+ toggleConfirmDialog: toggleConfirmDialog,
7920
+ handleDeleteTextbook: handleDeleteTextbook,
7921
+ handleSelectDeleteTextbook: handleSelectDeleteTextbook
7564
7922
  };
7565
7923
  };
7566
7924
 
7567
- var ExamDetailView = function ExamDetailView(_ref) {
7568
- var _ref$className = _ref.className,
7569
- className = _ref$className === void 0 ? "" : _ref$className,
7570
- exam = _ref.exam,
7925
+ var EmptyRow = function EmptyRow() {
7926
+ var _useTranslation = useTranslation(),
7927
+ t = _useTranslation.t;
7928
+ return React.createElement(TableRow, null, React.createElement(TableCell, {
7929
+ colSpan: 12,
7930
+ className: "text-center text-muted"
7931
+ }, t("no_data")));
7932
+ };
7933
+
7934
+ var LayoutList = function LayoutList(_ref) {
7935
+ var children = _ref.children,
7936
+ title = _ref.title;
7937
+ return React.createElement(Box, {
7938
+ className: 'bg-white p-3'
7939
+ }, React.createElement(Stack, {
7940
+ direction: "row",
7941
+ alignItems: "center",
7942
+ justifyContent: "space-between",
7943
+ mb: 2
7944
+ }, React.createElement(Typography, {
7945
+ variant: 'h4'
7946
+ }, title)), React.createElement(Box, null, children));
7947
+ };
7948
+
7949
+ var SortIcon = function SortIcon(_ref) {
7950
+ var isAscending = _ref.isAscending,
7951
+ onClick = _ref.onClick;
7952
+ return React.createElement("div", {
7953
+ className: "d-flex flex-column " + styles["sort-icons"],
7954
+ onClick: onClick
7955
+ }, React.createElement(FaSortUp, {
7956
+ className: isAscending === true ? styles["active"] : ""
7957
+ }), React.createElement(FaSortDown, {
7958
+ className: isAscending === false ? styles["active"] : ""
7959
+ }));
7960
+ };
7961
+
7962
+ var TableHeader = function TableHeader(_ref) {
7963
+ var headerTemplates = _ref.headerTemplates,
7964
+ filter = _ref.filter,
7965
+ onSort = _ref.onSort;
7966
+ var _useTranslation = useTranslation(),
7967
+ t = _useTranslation.t;
7968
+ return React.createElement(TableHead, null, React.createElement(TableRow, null, headerTemplates.map(function (i, index$1) {
7969
+ return React.createElement(TableCell, {
7970
+ key: index$1,
7971
+ className: "" + (!!i.sortKey && "pointer"),
7972
+ onClick: !!i.sortKey ? function () {
7973
+ return onSort === null || onSort === void 0 ? void 0 : onSort(i.sortKey);
7974
+ } : undefined
7975
+ }, React.createElement("div", {
7976
+ className: "d-flex justify-content-between align-items-center text-nowrap"
7977
+ }, t(i.title), !!i.sortKey && React.createElement(SortIcon, {
7978
+ isAscending: filter.sortColumnName !== i.sortKey ? undefined : filter.sortColumnDirection === OrderType.ASC
7979
+ })));
7980
+ })));
7981
+ };
7982
+
7983
+ var SearchInput = function SearchInput(_ref) {
7984
+ var textSearchRef = _ref.textSearchRef,
7985
+ _ref$placeholder = _ref.placeholder,
7986
+ placeholder = _ref$placeholder === void 0 ? "Search for..." : _ref$placeholder,
7987
+ onChange = _ref.onChange,
7988
+ _ref$fit = _ref.fit,
7989
+ fit = _ref$fit === void 0 ? true : _ref$fit;
7990
+ return React.createElement(Paper, {
7991
+ component: "div",
7992
+ className: "bg-light w-100 " + (fit && "h-100"),
7993
+ sx: {
7994
+ p: "2px 4px",
7995
+ display: "flex",
7996
+ alignItems: "center",
7997
+ width: 400,
7998
+ transition: "border 0.2s ease",
7999
+ outline: "1px solid transparent",
8000
+ ":focus-within": {
8001
+ outlineColor: function outlineColor(theme) {
8002
+ return theme.palette.primary.main;
8003
+ }
8004
+ }
8005
+ }
8006
+ }, React.createElement(Box, {
8007
+ sx: {
8008
+ p: "10px"
8009
+ },
8010
+ "aria-label": "search"
8011
+ }, React.createElement(IoSearch, {
8012
+ size: 24,
8013
+ className: "pb-1"
8014
+ })), React.createElement(InputBase, {
8015
+ id: "searchText",
8016
+ className: "" + (fit && "h-100"),
8017
+ sx: {
8018
+ ml: 1,
8019
+ flex: 1,
8020
+ lineHeight: 1
8021
+ },
8022
+ placeholder: placeholder,
8023
+ ref: textSearchRef,
8024
+ onChange: onChange
8025
+ }));
8026
+ };
8027
+
8028
+ var TextbookList = function TextbookList(props) {
8029
+ var _useTranslation = useTranslation(),
8030
+ t = _useTranslation.t;
8031
+ var _useTextbookList = useTextbookList(props),
8032
+ filter = _useTextbookList.filter,
8033
+ textbooks = _useTextbookList.textbooks,
8034
+ totalPages = _useTextbookList.totalPages,
8035
+ textSearchRef = _useTextbookList.textSearchRef,
8036
+ selectedTextbook = _useTextbookList.selectedTextbook,
8037
+ handleChangeSearchText = _useTextbookList.handleChangeSearchText,
8038
+ handleSort = _useTextbookList.handleSort,
8039
+ handleChangePage = _useTextbookList.handleChangePage,
8040
+ calcOrderNumber = _useTextbookList.calcOrderNumber,
8041
+ handleViewTextbook = _useTextbookList.handleViewTextbook,
8042
+ handleUpdateTextbook = _useTextbookList.handleUpdateTextbook,
8043
+ handleCreateTextbook = _useTextbookList.handleCreateTextbook,
8044
+ toggleConfirmDialog = _useTextbookList.toggleConfirmDialog,
8045
+ handleDeleteTextbook = _useTextbookList.handleDeleteTextbook,
8046
+ handleSelectDeleteTextbook = _useTextbookList.handleSelectDeleteTextbook;
8047
+ return React.createElement(LayoutList, {
8048
+ title: t(TEXTBOOK_PAGE_TITLE)
8049
+ }, React.createElement(Grid, {
8050
+ container: true
8051
+ }, React.createElement(Grid, {
8052
+ item: true,
8053
+ xs: 6
8054
+ }, React.createElement(SearchInput, {
8055
+ textSearchRef: textSearchRef,
8056
+ onChange: handleChangeSearchText,
8057
+ placeholder: t(TEXT_BOOK_SEARCH_PLACEHOLDER)
8058
+ })), React.createElement(Grid, {
8059
+ item: true,
8060
+ xs: 6
8061
+ }, React.createElement(Stack, {
8062
+ alignItems: "end"
8063
+ }, React.createElement(Button, {
8064
+ startIcon: React.createElement(FaPlus, {
8065
+ size: 12
8066
+ }),
8067
+ variant: "contained",
8068
+ color: "primary",
8069
+ onClick: handleCreateTextbook
8070
+ }, t("create_textbook")))), React.createElement(Grid, {
8071
+ item: true,
8072
+ xs: 12,
8073
+ className: "mt-3"
8074
+ }, React.createElement(Table, null, React.createElement(TableHeader, {
8075
+ headerTemplates: TEXTBOOK_HEADERS,
8076
+ filter: filter,
8077
+ onSort: handleSort
8078
+ }), React.createElement(TableBody, null, textbooks.map(function (i, index) {
8079
+ return React.createElement(TableRow, {
8080
+ key: i.id
8081
+ }, React.createElement(TableCell, null, calcOrderNumber(index)), React.createElement(TableCell, null, i.name), React.createElement(TableCell, null, i.subject.name), React.createElement(TableCell, null, utcToLocalTime(i.createdAt, t("date_format"))), React.createElement(TableCell, null, i.totalChapters), React.createElement(TableCell, null, React.createElement(Stack, {
8082
+ direction: "row",
8083
+ spacing: 1,
8084
+ alignItems: "center"
8085
+ }, !i.isCreatedByAdmin && React.createElement(IconButton, {
8086
+ color: "default",
8087
+ className: "bg-warning text-white",
8088
+ onClick: function onClick() {
8089
+ return handleUpdateTextbook(i.id);
8090
+ }
8091
+ }, React.createElement(FaPencil, {
8092
+ size: 12
8093
+ })), React.createElement(IconButton, {
8094
+ color: "default",
8095
+ className: "bg-primary text-white",
8096
+ onClick: function onClick() {
8097
+ return handleViewTextbook(i.id);
8098
+ }
8099
+ }, React.createElement(FaEye, {
8100
+ size: 12
8101
+ })), !i.isCreatedByAdmin && React.createElement(IconButton, {
8102
+ color: "default",
8103
+ className: "bg-danger text-white",
8104
+ onClick: function onClick() {
8105
+ return handleSelectDeleteTextbook(i);
8106
+ }
8107
+ }, React.createElement(FaTrash, {
8108
+ size: 12
8109
+ })))));
8110
+ }), !textbooks.length && React.createElement(EmptyRow, null))), React.createElement("div", {
8111
+ className: "d-flex justify-content-end mt-3"
8112
+ }, !!totalPages && React.createElement(Pagination, {
8113
+ count: totalPages,
8114
+ page: filter.currentPage,
8115
+ onChange: handleChangePage
8116
+ })))), React.createElement(ConfirmDialog, {
8117
+ open: !!(selectedTextbook !== null && selectedTextbook !== void 0 && selectedTextbook.id),
8118
+ toggle: toggleConfirmDialog,
8119
+ text: "" + t("are_you_sure_you_want_to_delete_the_textbook"),
8120
+ onConfirm: handleDeleteTextbook,
8121
+ confirmText: selectedTextbook === null || selectedTextbook === void 0 ? void 0 : selectedTextbook.name,
8122
+ isDelete: true
8123
+ }));
8124
+ };
8125
+
8126
+
8127
+
8128
+ var index$2 = {
8129
+ __proto__: null,
8130
+ TextbookList: TextbookList,
8131
+ TextbookDetail: TextbookViewDetail
8132
+ };
8133
+
8134
+ var _excluded$5 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
8135
+ var CustomCreatable = function CustomCreatable(_ref) {
8136
+ var options = _ref.options,
7571
8137
  isDisabled = _ref.isDisabled,
7572
- isEdit = _ref.isEdit,
7573
- onChangeExam = _ref.onChangeExam;
7574
- var _useSubjectSelect = useSubjectSelect(),
7575
- subjectOptions = _useSubjectSelect.subjectOptions,
7576
- selectedSubject = _useSubjectSelect.selectedSubject,
7577
- handleChangeSubject = _useSubjectSelect.handleChangeSubject;
7578
- var _useExamDetailView = useExamDetailView({
7579
- exam: exam,
7580
- onChangeExam: onChangeExam,
7581
- selectedSubject: selectedSubject
7582
- }),
7583
- t = _useExamDetailView.t,
7584
- durationOptions = _useExamDetailView.durationOptions,
7585
- examGroupByArticle = _useExamDetailView.examGroupByArticle,
7586
- handleAddArticle = _useExamDetailView.handleAddArticle,
7587
- handleChangeScoreAnswer = _useExamDetailView.handleChangeScoreAnswer,
7588
- handleChangeTitle = _useExamDetailView.handleChangeTitle,
7589
- handleChangeDuration = _useExamDetailView.handleChangeDuration,
7590
- handleChangeCorrectAnswers = _useExamDetailView.handleChangeCorrectAnswers,
7591
- handleChangeAnswerCount = _useExamDetailView.handleChangeAnswerCount,
7592
- handleChangeQuestionCount = _useExamDetailView.handleChangeQuestionCount,
7593
- handleChangeCategory = _useExamDetailView.handleChangeCategory,
7594
- handleDeleteArticle = _useExamDetailView.handleDeleteArticle;
7595
- return React.createElement(Grid, {
7596
- container: true,
7597
- spacing: 3,
7598
- className: className + " " + styleGlobal["custom-row"]
7599
- }, React.createElement(Grid, {
7600
- item: true,
7601
- xs: 5,
7602
- className: 'mb-2'
7603
- }, React.createElement("label", {
7604
- className: styleGlobal["form-label"] + " " + styles$1["question-label"],
7605
- htmlFor: "title"
7606
- }, t("title")), React.createElement("input", {
7607
- disabled: isDisabled,
7608
- className: "" + styleGlobal["form-control"],
7609
- value: exam.title,
7610
- id: "title",
7611
- placeholder: t("enter_title"),
7612
- onChange: handleChangeTitle
7613
- })), React.createElement(Grid, {
7614
- item: true,
7615
- xs: 3,
7616
- className: 'mb-2'
7617
- }, React.createElement("label", {
7618
- className: styleGlobal["form-label"] + " " + styles$1["question-label"],
7619
- htmlFor: "duration"
7620
- }, t("duration")), React.createElement(CustomSelect, {
7621
- inputId: "duration",
7622
- value: exam.duration,
7623
- options: durationOptions,
7624
- onChange: handleChangeDuration,
7625
- isDisabled: isDisabled
7626
- })), React.createElement(Grid, {
7627
- item: true,
7628
- xs: 3,
7629
- className: 'mb-2'
7630
- }, React.createElement("label", {
7631
- className: styleGlobal["form-label"] + " " + styles$1["question-label"],
7632
- htmlFor: "duration"
7633
- }, t("subject"), " ", selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.name), React.createElement(CustomSelect, {
7634
- inputId: "subject",
7635
- value: selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id,
7636
- options: subjectOptions,
7637
- onChange: handleChangeSubject,
7638
- isDisabled: isDisabled || isEdit
7639
- })), examGroupByArticle.map(function (i, index) {
7640
- return React.createElement(Grid, {
7641
- item: true,
7642
- key: i.article,
7643
- xs: 12,
7644
- className: index === examGroupByArticle.length - 1 ? "mb-2" : ''
7645
- }, React.createElement(ArticleGroupView, Object.assign({}, i, {
7646
- isActive: index === examGroupByArticle.length - 1,
7647
- onChangeQuestionCount: handleChangeQuestionCount,
7648
- onChangeCategory: handleChangeCategory,
7649
- onChangeAnswerCount: handleChangeAnswerCount,
7650
- onChangeCorrectAnswers: handleChangeCorrectAnswers,
7651
- onChangeScoreAnswer: handleChangeScoreAnswer,
7652
- onDelete: handleDeleteArticle,
7653
- isDisabled: isDisabled,
7654
- selectedSubject: selectedSubject,
7655
- isDeletable: examGroupByArticle.length > 1
7656
- })));
7657
- }), React.createElement(Grid, {
7658
- item: true,
7659
- xs: 12
7660
- }, React.createElement("button", {
7661
- disabled: isDisabled,
7662
- className: styleGlobal["btn-outline-primary"] + " w-100 d-flex justify-content-center align-items-center " + styles$1["question-btn"] + " mt-3",
7663
- onClick: handleAddArticle
7664
- }, React.createElement(FaPlusCircle, {
7665
- className: "me-2"
7666
- }), "\uBB38\uD56D \uCD94\uAC00\uD558\uAE30")));
8138
+ scrollBottom = _ref.scrollBottom,
8139
+ value = _ref.value,
8140
+ isMulti = _ref.isMulti,
8141
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$5);
8142
+ var initialValues = Array.isArray(value) ? options.filter(function (i) {
8143
+ return value.includes(i.value);
8144
+ }) : isMulti ? options.filter(function (i) {
8145
+ return i.value == value;
8146
+ }) : options.find(function (i) {
8147
+ return i.value == value;
8148
+ });
8149
+ return React.createElement(CreatableSelect, Object.assign({
8150
+ isClearable: true,
8151
+ isDisabled: isDisabled,
8152
+ options: options,
8153
+ value: initialValues,
8154
+ menuPlacement: scrollBottom ? "top" : "auto",
8155
+ isMulti: isMulti
8156
+ }, rest));
8157
+ };
8158
+
8159
+ var _excluded$6 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
8160
+ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
8161
+ var isDefault = _ref.isDefault,
8162
+ options = _ref.options,
8163
+ isDisabled = _ref.isDisabled,
8164
+ scrollBottom = _ref.scrollBottom,
8165
+ value = _ref.value,
8166
+ isMulti = _ref.isMulti,
8167
+ rest = _objectWithoutPropertiesLoose(_ref, _excluded$6);
8168
+ var initialValues = Array.isArray(value) ? options.filter(function (i) {
8169
+ return value.includes(i.value);
8170
+ }) : isMulti ? options.filter(function (i) {
8171
+ return i.value == value;
8172
+ }) : options.find(function (i) {
8173
+ return i.value == value;
8174
+ });
8175
+ return React.createElement(Select, Object.assign({
8176
+ isDisabled: isDisabled,
8177
+ options: options,
8178
+ value: !isDefault ? initialValues : undefined,
8179
+ defaultValue: isDefault ? initialValues : undefined,
8180
+ menuPlacement: scrollBottom ? "top" : "auto",
8181
+ isMulti: isMulti
8182
+ }, rest));
7667
8183
  };
7668
8184
 
7669
8185
  var EXAM_SESSION_URL = BASE_URL + "/api/examSession";
@@ -7721,16 +8237,16 @@ var ORDER_NUMBERS = {
7721
8237
  10: "the_tenth"
7722
8238
  };
7723
8239
  var TabList = [{
7724
- label: "종합 분석",
8240
+ label: "comprehensive_analysis",
7725
8241
  value: 0
7726
8242
  }, {
7727
- label: "풀이 순서",
8243
+ label: "solution_order",
7728
8244
  value: 1
7729
8245
  }, {
7730
- label: "풀이 비교",
8246
+ label: "compare_solution",
7731
8247
  value: 2
7732
8248
  }, {
7733
- label: "문제 분석",
8249
+ label: "problem_analysis",
7734
8250
  value: 3
7735
8251
  }];
7736
8252
  var Roles$2;
@@ -8592,7 +9108,7 @@ var useExamResult = function useExamResult(searchParam, navigate, examSessionId,
8592
9108
  var questions = ((_timelyOrderQuestion$ = timelyOrderQuestion[dataChartIndex]) === null || _timelyOrderQuestion$ === void 0 ? void 0 : _timelyOrderQuestion$.questions) || null;
8593
9109
  var questionLength = (_questions$length = questions === null || questions === void 0 ? void 0 : questions.length) != null ? _questions$length : 0;
8594
9110
  return val != null ? t("problem_number_question", {
8595
- number: questions !== null ? ((_questions = questions[questionLength - val]) === null || _questions === void 0 ? void 0 : _questions.questionOrder) + 1 : val
9111
+ number: questions !== null ? (((_questions = questions[questionLength - val]) === null || _questions === void 0 ? void 0 : _questions.questionOrder) || 0) + 1 : val
8596
9112
  }) : t("no_data");
8597
9113
  }
8598
9114
  return null;
@@ -8659,7 +9175,7 @@ var useExamResult = function useExamResult(searchParam, navigate, examSessionId,
8659
9175
  var questions = ((_timelyOrderQuestion$2 = timelyOrderQuestion[dataChartIndex]) === null || _timelyOrderQuestion$2 === void 0 ? void 0 : _timelyOrderQuestion$2.questions) || null;
8660
9176
  var questionLength = (_questions$length2 = questions === null || questions === void 0 ? void 0 : questions.length) != null ? _questions$length2 : 0;
8661
9177
  return val != null ? t("problem_number_question", {
8662
- number: questions !== null ? ((_questions2 = questions[questionLength - val]) === null || _questions2 === void 0 ? void 0 : _questions2.questionOrder) + 1 : val
9178
+ number: questions !== null ? (((_questions2 = questions[questionLength - val]) === null || _questions2 === void 0 ? void 0 : _questions2.questionOrder) || 0) + 1 : val
8663
9179
  }) : t("no_data");
8664
9180
  },
8665
9181
  style: {
@@ -8687,15 +9203,23 @@ var useExamResult = function useExamResult(searchParam, navigate, examSessionId,
8687
9203
  topAnswerOrder: i.topAnswerOrder == null ? 0 : i.topAnswerOrder
8688
9204
  });
8689
9205
  });
8690
- var mySeriesData = [null].concat(questionsData.sort(function (a, b) {
8691
- return b.answerOrder === 0 ? -1 : a.answerOrder > b.answerOrder ? 1 : b.answerOrder > a.answerOrder ? -1 : 0;
8692
- }).map(function (item) {
8693
- return item.answerOrder === 0 ? null : data.questions.length - item.questionOrder;
9206
+ var mySeriesData = [null].concat(_.sortBy(questionsData.filter(function (i) {
9207
+ return i.answerOrder !== 0;
9208
+ }), ["answerOrder", "questionOrder"]).map(function (item) {
9209
+ return data.questions.length - item.questionOrder;
9210
+ }), questionsData.filter(function (i) {
9211
+ return i.answerOrder === 0;
9212
+ }).map(function () {
9213
+ return null;
8694
9214
  }), [null]);
8695
- var topSeriesData = [null].concat(questionsData.sort(function (a, b) {
8696
- return b.topAnswerOrder === 0 ? -1 : a.topAnswerOrder > b.topAnswerOrder ? 1 : b.topAnswerOrder > a.topAnswerOrder ? -1 : 0;
8697
- }).map(function (item) {
8698
- return item.topAnswerOrder === 0 ? null : data.questions.length - item.questionOrder;
9215
+ var topSeriesData = [null].concat(_.sortBy(questionsData.filter(function (i) {
9216
+ return i.topAnswerOrder !== 0;
9217
+ }), ["topAnswerOrder", "questionOrder"]).map(function (item) {
9218
+ return data.questions.length - item.questionOrder;
9219
+ }), questionsData.filter(function (i) {
9220
+ return i.topAnswerOrder === 0;
9221
+ }).map(function () {
9222
+ return null;
8699
9223
  }), [null]);
8700
9224
  return [{
8701
9225
  name: t("my_problem_solving_order"),
@@ -9861,7 +10385,7 @@ Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==t
9861
10385
 
9862
10386
  var ReactApexChart = unwrapExports(reactApexcharts_min);
9863
10387
 
9864
- var styles$2 = {"titleBox":"_1dveO","title":"_mxRxf","point":"_2fD-F","buttonGroup":"_2DGl3","btnFeedback":"_xGW1x","btnTerminate":"_3mLu2","myanswer":"_eDBpS","titleMyAnswer1":"_2fMq3","titleMyAnswer2":"_3gEYh","contentMyAnswer":"_2K_sx","myAnswerItem":"_2qiLh","time":"_6TCOK","timeCol":"_hmseC","answer-response":"_3GfJt","answer-response-0":"_3ut64","answer-response-1":"_2VtpD","answer-response-2":"_58lQU","answer-response-3":"_1ucMY","answer-response-4":"_1qkxy","answerCorrect":"_2jIeT","answerIncorrect":"_to2v0","answerNograss":"_1JSte","answerEasy":"_2_uTU","answerDiscrimination":"_1DBoA","answerTrap":"_1q3tD","answerNoTime":"_3iItu","questionOrder":"_1fNkS","myTimeLabel":"_1Z_F3","myPoolTime":"_4KwG0","topTimeLabel":"_245H-","topTime":"_3tZqw","meanTimeLabel":"_PlPLY","meanTime":"_12a7R","compareChart":"_3MW16","prevChart":"_1fNkb","chart":"_3K4oY","nextChart":"_3YKBp","titleChart":"_13BVP","compareGrass":"_1_fJu","titleCompareGrass":"_o1txm","tableCompareGrass":"_bT5nf","thcolumn1":"_3Umg0","tdcolumn1":"_3dRMF","tdcolumn3":"_2tcBP","classification":"_1AFeb","wrapperProblem":"_oTqG7","titleProblem":"_35eIx","titleProblemClose":"_3t4HO","titleTrickyProblem":"_1-oxK","wrongQuestions":"_2dpMR","question":"_1lSOX","assignedQuestions":"_1ONUt","wrapperContent":"_nPoR0","content":"_2zmZn","contentColumn1":"_334SY","span1":"_3Lf-U","span2":"_ZpMot","contentColumn2":"_16P3l","duration":"_1kT28","topDuration":"_1fVRi","overallCorrectRate":"_3jLGe","answer":"_VsZ0K","contentVulnerable":"_QxKMy","wrappContentProblem":"_nnqpW","contentProblem":"_3Z1nV","labelProblem":"_36Xpx","name":"_3ZJQW","percent":"_2J3MK","slider":"_1MPdO","track":"_3CV_y","noData":"__g-ff","loading":"_3j485","table-responsive":"_2O6RX","form-label":"_1RYOQ","form-control":"_3VRVT","form-label-dialog":"_3oCSh","btn-cancel":"_3USKq","btn-register":"_3y_iD","pdfBtnBox":"_3xZHo","pdfBtn":"_1DtWq","form-select":"_1a_vw"};
10388
+ var styles$4 = {"titleBox":"_1dveO","title":"_mxRxf","point":"_2fD-F","buttonGroup":"_2DGl3","btnFeedback":"_xGW1x","btnTerminate":"_3mLu2","myanswer":"_eDBpS","titleMyAnswer1":"_2fMq3","titleMyAnswer2":"_3gEYh","contentMyAnswer":"_2K_sx","myAnswerItem":"_2qiLh","time":"_6TCOK","timeCol":"_hmseC","answer-response":"_3GfJt","answer-response-0":"_3ut64","answer-response-1":"_2VtpD","answer-response-2":"_58lQU","answer-response-3":"_1ucMY","answer-response-4":"_1qkxy","answerCorrect":"_2jIeT","answerIncorrect":"_to2v0","answerNograss":"_1JSte","answerEasy":"_2_uTU","answerDiscrimination":"_1DBoA","answerTrap":"_1q3tD","answerNoTime":"_3iItu","questionOrder":"_1fNkS","myTimeLabel":"_1Z_F3","myPoolTime":"_4KwG0","topTimeLabel":"_245H-","topTime":"_3tZqw","meanTimeLabel":"_PlPLY","meanTime":"_12a7R","compareChart":"_3MW16","prevChart":"_1fNkb","chart":"_3K4oY","nextChart":"_3YKBp","titleChart":"_13BVP","compareGrass":"_1_fJu","titleCompareGrass":"_o1txm","tableCompareGrass":"_bT5nf","thcolumn1":"_3Umg0","tdcolumn1":"_3dRMF","tdcolumn3":"_2tcBP","classification":"_1AFeb","wrapperProblem":"_oTqG7","titleProblem":"_35eIx","titleProblemClose":"_3t4HO","titleTrickyProblem":"_1-oxK","wrongQuestions":"_2dpMR","question":"_1lSOX","assignedQuestions":"_1ONUt","wrapperContent":"_nPoR0","content":"_2zmZn","contentColumn1":"_334SY","span1":"_3Lf-U","span2":"_ZpMot","contentColumn2":"_16P3l","duration":"_1kT28","topDuration":"_1fVRi","overallCorrectRate":"_3jLGe","answer":"_VsZ0K","contentVulnerable":"_QxKMy","wrappContentProblem":"_nnqpW","contentProblem":"_3Z1nV","labelProblem":"_36Xpx","name":"_3ZJQW","percent":"_2J3MK","slider":"_1MPdO","track":"_3CV_y","noData":"__g-ff","loading":"_3j485","table-responsive":"_2O6RX","form-label":"_1RYOQ","form-control":"_3VRVT","form-label-dialog":"_3oCSh","btn-cancel":"_3USKq","btn-register":"_3y_iD","pdfBtnBox":"_3xZHo","pdfBtn":"_1DtWq","form-select":"_1a_vw"};
9865
10389
 
9866
10390
  var iconStarQuestion = function iconStarQuestion(_ref) {
9867
10391
  var _ref$width = _ref.width,
@@ -10152,7 +10676,7 @@ function CreateNewQuestionDialog(_ref) {
10152
10676
  padding: "24px 24px 40px 24px"
10153
10677
  }, React.createElement(Stack, null, React.createElement("label", {
10154
10678
  htmlFor: "questions",
10155
- className: styleGlobal['form-label'] + " " + styles$2['form-label-dialog']
10679
+ className: styles['form-label'] + " " + styles$4['form-label-dialog']
10156
10680
  }, "\uC9C8\uBB38\uD560 \uBB38\uC81C"), React.createElement(Field, {
10157
10681
  as: "select",
10158
10682
  id: "questions",
@@ -10160,7 +10684,7 @@ function CreateNewQuestionDialog(_ref) {
10160
10684
  style: {
10161
10685
  width: "100%"
10162
10686
  },
10163
- className: "" + styleGlobal['form-select']
10687
+ className: "" + styles['form-select']
10164
10688
  }, questions === null || questions === void 0 ? void 0 : questions.map(function (question) {
10165
10689
  return React.createElement("option", {
10166
10690
  value: question === null || question === void 0 ? void 0 : question.id
@@ -10169,7 +10693,7 @@ function CreateNewQuestionDialog(_ref) {
10169
10693
  }));
10170
10694
  }))), React.createElement(Stack, null, React.createElement("label", {
10171
10695
  htmlFor: "content-question",
10172
- className: styleGlobal['form-label'] + " " + styles$2['form-label-dialog']
10696
+ className: styles['form-label'] + " " + styles$4['form-label-dialog']
10173
10697
  }, "\uC9C8\uBB38 \uB0B4\uC6A9"), React.createElement(Box, {
10174
10698
  position: 'relative',
10175
10699
  display: 'flex',
@@ -10182,7 +10706,7 @@ function CreateNewQuestionDialog(_ref) {
10182
10706
  },
10183
10707
  name: "content",
10184
10708
  placeholder: "\uBB38\uC81C\uAC00 \uC5B4\uB824\uC6CC\uC694",
10185
- className: styleGlobal['form-control']
10709
+ className: styles['form-control']
10186
10710
  }), (errors === null || errors === void 0 ? void 0 : errors.content) && React.createElement(Box, {
10187
10711
  position: 'absolute',
10188
10712
  right: 0,
@@ -10205,14 +10729,14 @@ function CreateNewQuestionDialog(_ref) {
10205
10729
  borderTop: "1px solid #CED2DA"
10206
10730
  }
10207
10731
  }, React.createElement(Button$1, {
10208
- className: styles$2['btn-cancel'],
10732
+ className: styles$4['btn-cancel'],
10209
10733
  onClick: toggleCreateQuestion
10210
10734
  }, React.createElement(Typography$1, {
10211
10735
  fontWeight: 700,
10212
10736
  fontSize: '14px',
10213
10737
  lineHeight: '16.71px'
10214
10738
  }, "\uCDE8\uC18C")), React.createElement(Button$1, {
10215
- className: styles$2['btn-register'],
10739
+ className: styles$4['btn-register'],
10216
10740
  type: "submit"
10217
10741
  }, React.createElement(Typography$1, {
10218
10742
  fontWeight: 700,
@@ -10244,7 +10768,7 @@ function MyAnswer(_ref) {
10244
10768
  toggleCreateQuestion();
10245
10769
  };
10246
10770
  return React.createElement("div", {
10247
- className: styles$2["myanswer"]
10771
+ className: styles$4["myanswer"]
10248
10772
  }, formattedData && formattedData.length > 0 && formattedData.map(function (item) {
10249
10773
  return React.createElement("div", {
10250
10774
  key: item.category.id
@@ -10252,9 +10776,9 @@ function MyAnswer(_ref) {
10252
10776
  bgcolor: "#F9FAFB",
10253
10777
  flexDirection: "row",
10254
10778
  padding: "12px",
10255
- className: styles$2["myAnswerItem"] + " " + styleGlobal["noGutters"]
10779
+ className: styles$4["myAnswerItem"] + " " + styles["noGutters"]
10256
10780
  }, React.createElement("div", {
10257
- className: styleGlobal["custom-col-2"],
10781
+ className: styles["custom-col-2"],
10258
10782
  style: {
10259
10783
  display: "flex",
10260
10784
  gap: "4px"
@@ -10266,7 +10790,7 @@ function MyAnswer(_ref) {
10266
10790
  color: "#97A1AF"
10267
10791
  }
10268
10792
  }, "\uBB38\uC81C \uBC88\uD638")), React.createElement("div", {
10269
- className: styleGlobal["custom-col-2"],
10793
+ className: styles["custom-col-2"],
10270
10794
  style: {
10271
10795
  display: "flex",
10272
10796
  gap: "4px"
@@ -10278,7 +10802,7 @@ function MyAnswer(_ref) {
10278
10802
  color: "#97A1AF"
10279
10803
  }
10280
10804
  }, "\uC815\uB2F5")), React.createElement("div", {
10281
- className: styleGlobal["custom-col-2"],
10805
+ className: styles["custom-col-2"],
10282
10806
  style: {
10283
10807
  display: "flex",
10284
10808
  gap: "4px"
@@ -10290,7 +10814,7 @@ function MyAnswer(_ref) {
10290
10814
  color: "#97A1AF"
10291
10815
  }
10292
10816
  }, "\uD480\uC774 \uC2DC\uAC04")), React.createElement("div", {
10293
- className: styleGlobal["custom-col-2"],
10817
+ className: styles["custom-col-2"],
10294
10818
  style: {
10295
10819
  display: "flex",
10296
10820
  alignItems: "center",
@@ -10303,7 +10827,7 @@ function MyAnswer(_ref) {
10303
10827
  color: "#97A1AF"
10304
10828
  }
10305
10829
  }, "\uC0C1\uC704\uAD8C \uBE44\uAD50")), React.createElement("div", {
10306
- className: styleGlobal["custom-col-2"],
10830
+ className: styles["custom-col-2"],
10307
10831
  style: {
10308
10832
  display: "flex",
10309
10833
  alignItems: "center",
@@ -10316,7 +10840,7 @@ function MyAnswer(_ref) {
10316
10840
  color: "#97A1AF"
10317
10841
  }
10318
10842
  }, "\uC804\uCCB4 \uC815\uB2F5\uB960"))), React.createElement("div", {
10319
- className: styles$2["titleMyAnswer2"]
10843
+ className: styles$4["titleMyAnswer2"]
10320
10844
  }, React.createElement(Typography, {
10321
10845
  sx: {
10322
10846
  color: "#97A1AF",
@@ -10329,7 +10853,7 @@ function MyAnswer(_ref) {
10329
10853
  fontWeight: 700
10330
10854
  }
10331
10855
  }, item.category.name)), React.createElement("div", {
10332
- className: styles$2["contentMyAnswer"]
10856
+ className: styles$4["contentMyAnswer"]
10333
10857
  }, item.questions.map(function (question, index) {
10334
10858
  return React.createElement("div", {
10335
10859
  style: isOpenTime[question.id] ? {
@@ -10338,9 +10862,9 @@ function MyAnswer(_ref) {
10338
10862
  } : {},
10339
10863
  key: question.id
10340
10864
  }, React.createElement("div", {
10341
- className: styles$2["myAnswerItem"] + " " + styleGlobal["noGutters"]
10865
+ className: styles$4["myAnswerItem"] + " " + styles["noGutters"]
10342
10866
  }, React.createElement("div", {
10343
- className: styleGlobal["custom-col-2"],
10867
+ className: styles["custom-col-2"],
10344
10868
  style: {
10345
10869
  display: "flex",
10346
10870
  alignItems: "center",
@@ -10348,22 +10872,22 @@ function MyAnswer(_ref) {
10348
10872
  padding: "4px 8px"
10349
10873
  }
10350
10874
  }, question.isStar ? React.createElement(iconStarQuestion, null) : React.createElement(iconNoStarQuestion, null), React.createElement("span", {
10351
- className: styles$2["questionOrder"]
10875
+ className: styles$4["questionOrder"]
10352
10876
  }, question.questionOrder + 1, "\uBC88")), React.createElement("div", {
10353
- className: styleGlobal["custom-col-2"],
10877
+ className: styles["custom-col-2"],
10354
10878
  style: {
10355
10879
  display: "flex",
10356
10880
  alignItems: "center",
10357
10881
  gap: "4px"
10358
10882
  }
10359
10883
  }, question.isCorrect && question.selectedAnswers !== "" && React.createElement(Fragment$1, null, React.createElement(iconCorrectAnswer, null), React.createElement("span", {
10360
- className: styles$2["answerCorrect"]
10884
+ className: styles$4["answerCorrect"]
10361
10885
  }, "\uC815\uB2F5")), !question.isCorrect && question.selectedAnswers !== "" && React.createElement(Fragment$1, null, React.createElement(iconCorrectAnswer$1, null), React.createElement("span", {
10362
- className: styles$2["answerIncorrect"]
10886
+ className: styles$4["answerIncorrect"]
10363
10887
  }, "\uC624\uB2F5")), question.selectedAnswers === "" && React.createElement(Fragment$1, null, React.createElement(iconNoGrass, null), React.createElement("span", {
10364
- className: styles$2["answerNograss"]
10888
+ className: styles$4["answerNograss"]
10365
10889
  }, "\uD480\uC774 \uC5C6\uC74C"))), React.createElement("div", {
10366
- className: styleGlobal["custom-col-2"],
10890
+ className: styles["custom-col-2"],
10367
10891
  style: {
10368
10892
  display: "flex",
10369
10893
  alignItems: "center"
@@ -10372,14 +10896,14 @@ function MyAnswer(_ref) {
10372
10896
  style: {
10373
10897
  margin: 0
10374
10898
  },
10375
- className: styles$2["answer-response"] + " " + styles$2["answer-response-" + question.answerResponseSignal]
10899
+ className: styles$4["answer-response"] + " " + styles$4["answer-response-" + question.answerResponseSignal]
10376
10900
  }, formatTimeSecond(Math.round(question.duration), t)) : React.createElement("p", {
10377
10901
  style: {
10378
10902
  margin: 0
10379
10903
  },
10380
- className: styles$2["answerNoTime"]
10904
+ className: styles$4["answerNoTime"]
10381
10905
  }, "\uC2DC\uAC04 \uC5C6\uC74C")), React.createElement("div", {
10382
- className: styleGlobal["custom-col-2"],
10906
+ className: styles["custom-col-2"],
10383
10907
  style: {
10384
10908
  display: "flex",
10385
10909
  alignItems: "center"
@@ -10388,15 +10912,15 @@ function MyAnswer(_ref) {
10388
10912
  style: {
10389
10913
  margin: 0
10390
10914
  },
10391
- className: styles$2["answer-response"] + " " + styles$2["answer-response-" + question.answerResponseSignal]
10915
+ className: styles$4["answer-response"] + " " + styles$4["answer-response-" + question.answerResponseSignal]
10392
10916
  }, formatTimeSecond(Math.round(question.topDuration - question.duration), t)) : React.createElement("p", {
10393
10917
  style: {
10394
10918
  margin: 0,
10395
10919
  textAlign: "center"
10396
10920
  },
10397
- className: styles$2["answerNoTime"]
10921
+ className: styles$4["answerNoTime"]
10398
10922
  }, "-")), React.createElement("div", {
10399
- className: styleGlobal["custom-col-2"],
10923
+ className: styles["custom-col-2"],
10400
10924
  style: {
10401
10925
  display: "flex",
10402
10926
  alignItems: "center"
@@ -10405,14 +10929,14 @@ function MyAnswer(_ref) {
10405
10929
  style: {
10406
10930
  margin: 0
10407
10931
  },
10408
- className: styles$2["answer-response"] + " " + styles$2["answer-response-" + question.answerResponseSignal]
10409
- }, question.overallCorrectRate + "%") : React.createElement("p", {
10932
+ className: styles$4["answer-response"] + " " + styles$4["answer-response-" + question.answerResponseSignal]
10933
+ }, question.overallCorrectRate.toFixed(2) + "%") : React.createElement("p", {
10410
10934
  style: {
10411
10935
  margin: 0
10412
10936
  },
10413
- className: styles$2["answerNoTime"]
10937
+ className: styles$4["answerNoTime"]
10414
10938
  }, "\uC2DC\uAC04 \uC5C6\uC74C")), isStudent && React.createElement("div", {
10415
- className: styleGlobal["custom-col-2"],
10939
+ className: styles["custom-col-2"],
10416
10940
  style: {
10417
10941
  display: "flex",
10418
10942
  alignItems: "center",
@@ -10481,11 +11005,11 @@ var iconBtnNextChart = function iconBtnNextChart(_ref) {
10481
11005
  function CompareGrass(_ref) {
10482
11006
  var effectSize = _ref.effectSize;
10483
11007
  return React.createElement("div", {
10484
- className: styles$2["compareGrass"]
11008
+ className: styles$4["compareGrass"]
10485
11009
  }, React.createElement("div", {
10486
- className: styles$2["tableCompareGrass"]
11010
+ className: styles$4["tableCompareGrass"]
10487
11011
  }, React.createElement("div", {
10488
- className: styles$2["table-responsive"]
11012
+ className: styles$4["table-responsive"]
10489
11013
  }, React.createElement(Table, {
10490
11014
  style: {
10491
11015
  width: "100%"
@@ -10495,7 +11019,7 @@ function CompareGrass(_ref) {
10495
11019
  borderBottom: "1px solid #E4E7EC"
10496
11020
  }
10497
11021
  }, React.createElement("tr", null, React.createElement("th", {
10498
- className: styles$2["thcolumn1"]
11022
+ className: styles$4["thcolumn1"]
10499
11023
  }, "\uBB38\uC81C \uBC88\uD638"), React.createElement("th", {
10500
11024
  style: {
10501
11025
  textAlign: "center"
@@ -10519,14 +11043,14 @@ function CompareGrass(_ref) {
10519
11043
  borderBottom: "1px solid #e4e7ec"
10520
11044
  } : {}
10521
11045
  }, React.createElement("td", {
10522
- className: styles$2["tdcolumn1"]
11046
+ className: styles$4["tdcolumn1"]
10523
11047
  }, "\uBB38\uC81C ", item.questionOrder + 1), React.createElement("td", {
10524
11048
  style: {
10525
11049
  textAlign: "center",
10526
11050
  color: "#202B37"
10527
11051
  }
10528
11052
  }, item.correctAnswers, "\uBC88"), React.createElement("td", {
10529
- className: styles$2["tdcolumn3"],
11053
+ className: styles$4["tdcolumn3"],
10530
11054
  style: {
10531
11055
  color: item.isCorrect ? "#1EE288" : "#F34B4B"
10532
11056
  }
@@ -10536,7 +11060,7 @@ function CompareGrass(_ref) {
10536
11060
  color: "#414E62"
10537
11061
  }
10538
11062
  }, item.mostSelectedAnswers ? item.mostSelectedAnswers + "\uBC88" : ""), React.createElement("td", null, React.createElement("div", {
10539
- className: styles$2["classification"]
11063
+ className: styles$4["classification"]
10540
11064
  }, item.problemCategories.map(function (problem, index) {
10541
11065
  return React.createElement("div", {
10542
11066
  key: index
@@ -10663,9 +11187,9 @@ function TrickyProblem(_ref) {
10663
11187
  return i.isStar && i.isCorrect;
10664
11188
  });
10665
11189
  return React.createElement("div", {
10666
- className: styles$2["wrapperProblem"]
11190
+ className: styles$4["wrapperProblem"]
10667
11191
  }, React.createElement("div", {
10668
- className: !openProblem.problem1 ? styles$2["titleProblemClose"] : styles$2["titleProblem"],
11192
+ className: !openProblem.problem1 ? styles$4["titleProblemClose"] : styles$4["titleProblem"],
10669
11193
  onClick: function onClick() {
10670
11194
  return changeOpen(_extends({}, openProblem, {
10671
11195
  problem1: !openProblem.problem1
@@ -10678,27 +11202,27 @@ function TrickyProblem(_ref) {
10678
11202
  fontWeight: 700
10679
11203
  }
10680
11204
  }, "\uAE4C\uB2E4\uB85C\uC6E0\uB358 \uBB38\uC81C"), openProblem.problem1 ? React.createElement(iconUpArrow, null) : React.createElement(iconDownArrow, null)), openProblem.problem1 && React.createElement(Fragment$1, null, React.createElement("div", {
10681
- className: styles$2["titleTrickyProblem"]
11205
+ className: styles$4["titleTrickyProblem"]
10682
11206
  }, React.createElement(iconX, null), React.createElement("span", null, "\uBCC4\uD45C \uCE5C \uBB38\uC81C \uC911 \uD2C0\uB9B0 \uBB38\uC81C")), React.createElement("div", {
10683
- className: styles$2["wrongQuestions"]
11207
+ className: styles$4["wrongQuestions"]
10684
11208
  }, !!inCorrectQuestions.length && inCorrectQuestions.map(function (question) {
10685
11209
  return React.createElement("span", {
10686
11210
  key: question.id,
10687
- className: styles$2["question"]
11211
+ className: styles$4["question"]
10688
11212
  }, question.questionOrder + 1, "\uBC88");
10689
11213
  }), !data.questions.length && React.createElement("div", {
10690
- className: styles$2["noData"]
11214
+ className: styles$4["noData"]
10691
11215
  }, "\uB370\uC774\uD130 \uC5C6\uC74C")), React.createElement("div", {
10692
- className: styles$2["titleTrickyProblem"]
11216
+ className: styles$4["titleTrickyProblem"]
10693
11217
  }, React.createElement(iconAssignedQuestions, null), React.createElement("span", null, "\uBCC4\uD45C \uCE5C \uBB38\uC81C \uC911 \uB9DE\uCD98 \uBB38\uC81C")), React.createElement("div", {
10694
- className: styles$2["assignedQuestions"]
11218
+ className: styles$4["assignedQuestions"]
10695
11219
  }, !!correctQuestions.length && correctQuestions.map(function (question) {
10696
11220
  return React.createElement("div", {
10697
11221
  key: question.id,
10698
- className: styles$2["question"]
11222
+ className: styles$4["question"]
10699
11223
  }, question.questionOrder + 1, "\uBC88");
10700
11224
  }), !data.questions.length && React.createElement("div", {
10701
- className: styles$2["noData"]
11225
+ className: styles$4["noData"]
10702
11226
  }, "\uB370\uC774\uD130 \uC5C6\uC74C"))));
10703
11227
  }
10704
11228
 
@@ -10709,9 +11233,9 @@ function ProtractedProblem(_ref) {
10709
11233
  var _useTranslation = useTranslation(),
10710
11234
  t = _useTranslation.t;
10711
11235
  return React.createElement("div", {
10712
- className: styles$2["wrapperProblem"]
11236
+ className: styles$4["wrapperProblem"]
10713
11237
  }, React.createElement("div", {
10714
- className: !openProblem.problem2 ? styles$2["titleProblemClose"] : styles$2["titleProblem"],
11238
+ className: !openProblem.problem2 ? styles$4["titleProblemClose"] : styles$4["titleProblem"],
10715
11239
  onClick: function onClick() {
10716
11240
  return changeOpen(_extends({}, openProblem, {
10717
11241
  problem2: !openProblem.problem2
@@ -10724,30 +11248,30 @@ function ProtractedProblem(_ref) {
10724
11248
  fontWeight: 700
10725
11249
  }
10726
11250
  }, "\uC2DC\uAC04\uC774 \uC624\uB798 \uAC78\uB9B0 \uBB38\uC81C"), openProblem.problem2 ? React.createElement(iconUpArrow, null) : React.createElement(iconDownArrow, null)), openProblem.problem2 && React.createElement(Fragment$1, null, React.createElement("div", {
10727
- className: styles$2["wrapperContent"]
11251
+ className: styles$4["wrapperContent"]
10728
11252
  }, data.length ? data.map(function (item) {
10729
11253
  return React.createElement("div", {
10730
- className: styles$2["content"],
11254
+ className: styles$4["content"],
10731
11255
  key: item.id
10732
11256
  }, React.createElement("div", {
10733
- className: styles$2["contentColumn1"]
11257
+ className: styles$4["contentColumn1"]
10734
11258
  }, React.createElement("div", null, React.createElement("span", {
10735
- className: styles$2["span1"]
11259
+ className: styles$4["span1"]
10736
11260
  }, "\uBB38\uC81C"), React.createElement("span", {
10737
- className: styles$2["span2"]
11261
+ className: styles$4["span2"]
10738
11262
  }, item.questionOrder + 1, "\uBC88"))), React.createElement("div", {
10739
- className: styles$2["contentColumn2"]
11263
+ className: styles$4["contentColumn2"]
10740
11264
  }, React.createElement("div", null, React.createElement("span", {
10741
- className: styles$2["span1"]
11265
+ className: styles$4["span1"]
10742
11266
  }, "\uB098\uC758 \uC2DC\uAC04"), React.createElement("span", {
10743
- className: styles$2["span2"]
11267
+ className: styles$4["span2"]
10744
11268
  }, "\uC0C1\uC704\uAD8C \uC2DC\uAC04")), React.createElement("div", null, React.createElement("span", {
10745
- className: styles$2["duration"]
11269
+ className: styles$4["duration"]
10746
11270
  }, formatTimeSecond(item.duration, t)), React.createElement("span", {
10747
- className: styles$2["topDuration"]
11271
+ className: styles$4["topDuration"]
10748
11272
  }, formatTimeSecond(item.topDuration, t)))));
10749
11273
  }) : React.createElement("div", {
10750
- className: styles$2["noData"]
11274
+ className: styles$4["noData"]
10751
11275
  }, "\uB370\uC774\uD130 \uC5C6\uC74C"))));
10752
11276
  }
10753
11277
 
@@ -10761,9 +11285,9 @@ function Vulnerable(_ref) {
10761
11285
  return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
10762
11286
  });
10763
11287
  return React.createElement("div", {
10764
- className: styles$2["wrapperProblem"]
11288
+ className: styles$4["wrapperProblem"]
10765
11289
  }, React.createElement("div", {
10766
- className: !openProblem.problem3 ? styles$2["titleProblemClose"] : styles$2["titleProblem"],
11290
+ className: !openProblem.problem3 ? styles$4["titleProblemClose"] : styles$4["titleProblem"],
10767
11291
  onClick: function onClick() {
10768
11292
  return changeOpen(_extends({}, openProblem, {
10769
11293
  problem3: !openProblem.problem3
@@ -10776,30 +11300,30 @@ function Vulnerable(_ref) {
10776
11300
  fontWeight: 700
10777
11301
  }
10778
11302
  }, "\uB0B4\uAC00 \uCDE8\uC57D\uD55C \uBB38\uC81C"), openProblem.problem3 ? React.createElement(iconUpArrow, null) : React.createElement(iconDownArrow, null)), openProblem.problem3 && React.createElement(Fragment$1, null, React.createElement("div", {
10779
- className: styles$2["wrapperContent"]
11303
+ className: styles$4["wrapperContent"]
10780
11304
  }, incorrectQuestions.length ? React.createElement(Fragment$1, null, incorrectQuestions.map(function (question) {
10781
11305
  return React.createElement("div", {
10782
- className: styles$2["content"],
11306
+ className: styles$4["content"],
10783
11307
  key: question.id
10784
11308
  }, React.createElement("div", {
10785
- className: styles$2["contentColumn1"]
11309
+ className: styles$4["contentColumn1"]
10786
11310
  }, React.createElement("div", null, React.createElement("span", {
10787
- className: styles$2["span1"]
11311
+ className: styles$4["span1"]
10788
11312
  }, "\uBB38\uC81C"), React.createElement("span", {
10789
- className: styles$2["span2"]
11313
+ className: styles$4["span2"]
10790
11314
  }, question.questionOrder + 1, "\uBC88"))), React.createElement("div", {
10791
- className: styles$2["contentColumn2"]
11315
+ className: styles$4["contentColumn2"]
10792
11316
  }, React.createElement("div", null, React.createElement("span", {
10793
- className: styles$2["span1"]
11317
+ className: styles$4["span1"]
10794
11318
  }, "\uC804\uCCB4 \uC815\uB2F5\uB960"), React.createElement("span", {
10795
- className: styles$2["span2"]
11319
+ className: styles$4["span2"]
10796
11320
  }, "\uB098\uC758 \uC624\uB2F5")), React.createElement("div", null, React.createElement("span", {
10797
- className: styles$2["overallCorrectRate"]
11321
+ className: styles$4["overallCorrectRate"]
10798
11322
  }, question.overallCorrectRate.toFixed(2), "%"), React.createElement("span", {
10799
- className: styles$2["answer"]
11323
+ className: styles$4["answer"]
10800
11324
  }, question.selectedAnswers, "\uBC88 (\uC815\uB2F5", " ", question.correctAnswers, "\uBC88)"))));
10801
11325
  })) : React.createElement("div", {
10802
- className: styles$2["noData"]
11326
+ className: styles$4["noData"]
10803
11327
  }, "\uB370\uC774\uD130 \uC5C6\uC74C"))));
10804
11328
  }
10805
11329
 
@@ -10808,9 +11332,9 @@ function GradesByTerritory(_ref) {
10808
11332
  openProblem = _ref.openProblem,
10809
11333
  changeOpen = _ref.changeOpen;
10810
11334
  return React.createElement("div", {
10811
- className: styles$2["wrapperProblem"]
11335
+ className: styles$4["wrapperProblem"]
10812
11336
  }, React.createElement("div", {
10813
- className: !openProblem.problem4 ? styles$2["titleProblemClose"] : styles$2["titleProblem"],
11337
+ className: !openProblem.problem4 ? styles$4["titleProblemClose"] : styles$4["titleProblem"],
10814
11338
  onClick: function onClick() {
10815
11339
  return changeOpen(_extends({}, openProblem, {
10816
11340
  problem4: !openProblem.problem4
@@ -10823,27 +11347,27 @@ function GradesByTerritory(_ref) {
10823
11347
  fontWeight: 700
10824
11348
  }
10825
11349
  }, "\uC601\uC5ED\uBCC4 \uC131\uC801"), openProblem.problem4 ? React.createElement(iconUpArrow, null) : React.createElement(iconDownArrow, null)), openProblem.problem4 && React.createElement("div", {
10826
- className: styles$2["wrappContentProblem"]
11350
+ className: styles$4["wrappContentProblem"]
10827
11351
  }, data.length && data.map(function (item) {
10828
11352
  return React.createElement("div", {
10829
- className: styles$2["contentProblem"],
11353
+ className: styles$4["contentProblem"],
10830
11354
  key: item.id
10831
11355
  }, React.createElement("div", {
10832
- className: styles$2["labelProblem"]
11356
+ className: styles$4["labelProblem"]
10833
11357
  }, React.createElement("span", {
10834
- className: styles$2["name"]
11358
+ className: styles$4["name"]
10835
11359
  }, item.name), React.createElement("div", {
10836
- className: styles$2["percent"]
11360
+ className: styles$4["percent"]
10837
11361
  }, React.createElement("span", null, item.percentageAmongStudents.toFixed(2), "%"), React.createElement("span", null, item.totalCorrectQuestions, "/", item.totalQuestions, "\uBB38\uC81C"))), React.createElement("div", {
10838
- className: styles$2["slider"]
11362
+ className: styles$4["slider"]
10839
11363
  }, React.createElement("span", {
10840
- className: styles$2["track"],
11364
+ className: styles$4["track"],
10841
11365
  style: {
10842
11366
  left: item.percentageAmongStudents + "%"
10843
11367
  }
10844
11368
  })));
10845
11369
  }), openProblem.problem4 && !data.length && React.createElement("div", {
10846
- className: styles$2["noData"]
11370
+ className: styles$4["noData"]
10847
11371
  }, "\uB370\uC774\uD130 \uC5C6\uC74C")));
10848
11372
  }
10849
11373
 
@@ -10936,7 +11460,7 @@ function CreateNewQuestionDialog$1(_ref) {
10936
11460
  var errors = _ref2.errors;
10937
11461
  return React.createElement(Form, null, React.createElement("label", {
10938
11462
  htmlFor: "content-question",
10939
- className: styleGlobal['form-label'] + " " + styles$2['form-label-dialog']
11463
+ className: styles['form-label'] + " " + styles$4['form-label-dialog']
10940
11464
  }, "\uC9C8\uBB38 \uB0B4\uC6A9"), React.createElement(Box, {
10941
11465
  position: 'relative',
10942
11466
  display: 'flex',
@@ -10949,7 +11473,7 @@ function CreateNewQuestionDialog$1(_ref) {
10949
11473
  },
10950
11474
  name: "content",
10951
11475
  placeholder: "\uBB38\uC81C\uAC00 \uC5B4\uB824\uC6CC\uC694",
10952
- className: styleGlobal['form-control']
11476
+ className: styles['form-control']
10953
11477
  }), (errors === null || errors === void 0 ? void 0 : errors.content) && React.createElement(Box, {
10954
11478
  position: 'absolute',
10955
11479
  right: 0,
@@ -10971,14 +11495,14 @@ function CreateNewQuestionDialog$1(_ref) {
10971
11495
  padding: '12px'
10972
11496
  }
10973
11497
  }, React.createElement(Button$1, {
10974
- className: styles$2['btn-cancel'],
11498
+ className: styles$4['btn-cancel'],
10975
11499
  onClick: toggleCreateQuestion
10976
11500
  }, React.createElement(Typography$1, {
10977
11501
  fontWeight: 700,
10978
11502
  fontSize: '14px',
10979
11503
  lineHeight: '16.71px'
10980
11504
  }, "\uCDE8\uC18C")), React.createElement(Button$1, {
10981
- className: styles$2['btn-register'],
11505
+ className: styles$4['btn-register'],
10982
11506
  type: "submit"
10983
11507
  }, React.createElement(Typography$1, {
10984
11508
  fontWeight: 700,
@@ -10989,12 +11513,12 @@ function CreateNewQuestionDialog$1(_ref) {
10989
11513
  })));
10990
11514
  }
10991
11515
 
10992
- var _excluded$6 = ["children", "value", "index"];
11516
+ var _excluded$7 = ["children", "value", "index"];
10993
11517
  var CustomTabPanel = function CustomTabPanel(props) {
10994
11518
  var children = props.children,
10995
11519
  value = props.value,
10996
11520
  index = props.index,
10997
- other = _objectWithoutPropertiesLoose(props, _excluded$6);
11521
+ other = _objectWithoutPropertiesLoose(props, _excluded$7);
10998
11522
  return React.createElement("div", Object.assign({
10999
11523
  role: "tabpanel",
11000
11524
  hidden: value !== index,
@@ -11067,6 +11591,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
11067
11591
  var _useTab = useTab(),
11068
11592
  selected = _useTab.selected,
11069
11593
  handleChangeTab = _useTab.handleChangeTab;
11594
+ var isTabletUp = useMediaQuery('(min-width:900px)');
11070
11595
  return React.createElement(Fragment$1, null, timelyOrderQuestion[dataChartIndex] && longTimeSpend && resultDatas && effectSize ? React.createElement("div", {
11071
11596
  style: {
11072
11597
  width: "100%"
@@ -11164,7 +11689,28 @@ var ExamResultV2 = function ExamResultV2(_ref) {
11164
11689
  container: true,
11165
11690
  padding: "24px",
11166
11691
  className: "position-relative overflow-hidden"
11167
- }, React.createElement(Grid, {
11692
+ }, !isTabletUp && React.createElement(Grid, {
11693
+ item: true,
11694
+ xs: 12
11695
+ }, React.createElement(Box, {
11696
+ padding: "16px 24px",
11697
+ flexDirection: "row",
11698
+ justifyContent: "end",
11699
+ alignItems: "center",
11700
+ display: "flex",
11701
+ bgcolor: "#F9FAFB",
11702
+ borderTop: "1px solid #E4E7EC",
11703
+ borderBottom: "1px solid #E4E7EC"
11704
+ }, React.createElement(Stack, {
11705
+ padding: '12px 24px',
11706
+ alignItems: "end",
11707
+ bgcolor: "#F9FAFB"
11708
+ }, React.createElement("div", {
11709
+ className: styles$4["pdfBtnBox"]
11710
+ }, React.createElement("button", {
11711
+ className: styles$4["pdfBtn"] + " " + styles["truncate"],
11712
+ onClick: handleExportPdf
11713
+ }, React.createElement(iconPrintFill, null), React.createElement("p", null, t("print"))))))), React.createElement(Grid, {
11168
11714
  item: true,
11169
11715
  xs: 12
11170
11716
  }, React.createElement(Box, {
@@ -11184,7 +11730,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
11184
11730
  var label = _ref2.label,
11185
11731
  value = _ref2.value;
11186
11732
  return React.createElement(Button, {
11187
- className: styleGlobal["truncate"],
11733
+ className: styles["truncate"],
11188
11734
  disableTouchRipple: true,
11189
11735
  sx: {
11190
11736
  fontSize: "14px",
@@ -11197,14 +11743,14 @@ var ExamResultV2 = function ExamResultV2(_ref) {
11197
11743
  return handleChangeTab(value);
11198
11744
  }
11199
11745
  }, label);
11200
- })), React.createElement(Stack, {
11746
+ })), isTabletUp && React.createElement(Stack, {
11201
11747
  padding: '12px 24px',
11202
11748
  alignItems: "end",
11203
11749
  bgcolor: "#F9FAFB"
11204
11750
  }, React.createElement("div", {
11205
- className: styles$2["pdfBtnBox"]
11751
+ className: styles$4["pdfBtnBox"]
11206
11752
  }, React.createElement("button", {
11207
- className: styles$2["pdfBtn"] + " " + styleGlobal["truncate"],
11753
+ className: styles$4["pdfBtn"] + " " + styles["truncate"],
11208
11754
  onClick: handleExportPdf
11209
11755
  }, React.createElement(iconPrintFill, null), React.createElement("p", null, t("print"))))))), React.createElement(Grid, {
11210
11756
  item: true,
@@ -11220,18 +11766,18 @@ var ExamResultV2 = function ExamResultV2(_ref) {
11220
11766
  value: selected,
11221
11767
  index: 1
11222
11768
  }, React.createElement("div", {
11223
- className: styles$2["compareChart"]
11769
+ className: styles$4["compareChart"]
11224
11770
  }, React.createElement("div", {
11225
- className: styles$2["prevChart"] + " " + (dataChartIndex > 0 && "pointer"),
11771
+ className: styles$4["prevChart"] + " " + (dataChartIndex > 0 && "pointer"),
11226
11772
  onClick: handlePrevChart
11227
11773
  }, React.createElement(iconBtnPrevChart, null)), React.createElement("div", {
11228
- className: styles$2["chart"] + " sr-line-chart"
11774
+ className: styles$4["chart"] + " sr-line-chart"
11229
11775
  }, React.createElement("div", null, React.createElement(ReactApexChart, {
11230
11776
  height: 389,
11231
11777
  options: chartOptions,
11232
11778
  series: series
11233
11779
  }))), React.createElement("div", {
11234
- className: styles$2["nextChart"] + " " + (dataChartIndex < timelyOrderQuestion.length - 1 && "pointer"),
11780
+ className: styles$4["nextChart"] + " " + (dataChartIndex < timelyOrderQuestion.length - 1 && "pointer"),
11235
11781
  onClick: handleNextChart
11236
11782
  }, React.createElement(iconBtnNextChart, null)))), React.createElement(CustomTabPanel, {
11237
11783
  value: selected,
@@ -11266,39 +11812,70 @@ var ExamResultV2 = function ExamResultV2(_ref) {
11266
11812
  width: "100%"
11267
11813
  },
11268
11814
  id: "canvas"
11269
- }, React.createElement(CustomTabPanel, {
11270
- value: selected,
11271
- index: 0
11272
- }, React.createElement(MyAnswer, {
11815
+ }, React.createElement(Stack, {
11816
+ display: "flex",
11817
+ flexDirection: "column",
11818
+ gap: "12px"
11819
+ }, React.createElement(Typography, {
11820
+ sx: {
11821
+ fontSize: "16px",
11822
+ fontWeight: 700,
11823
+ color: "#414E62"
11824
+ }
11825
+ }, t(TabList[0].label)), React.createElement(MyAnswer, {
11273
11826
  data: resultDatas,
11274
11827
  categories: categoryResponses,
11275
11828
  isStudent: isStudent
11276
- })), React.createElement(CustomTabPanel, {
11277
- value: selected,
11278
- index: 1
11279
- }, React.createElement("div", {
11280
- className: styles$2["compareChart"]
11829
+ })), React.createElement(Stack, {
11830
+ display: "flex",
11831
+ flexDirection: "column",
11832
+ gap: "12px",
11833
+ marginTop: "24px"
11834
+ }, React.createElement(Typography, {
11835
+ sx: {
11836
+ fontSize: "16px",
11837
+ fontWeight: 700,
11838
+ color: "#414E62"
11839
+ }
11840
+ }, t(TabList[1].label)), React.createElement("div", {
11841
+ className: styles$4["compareChart"]
11281
11842
  }, React.createElement("div", {
11282
- className: styles$2["prevChart"] + " " + (dataChartIndex > 0 && "pointer"),
11843
+ className: styles$4["prevChart"] + " " + (dataChartIndex > 0 && "pointer"),
11283
11844
  onClick: handlePrevChart
11284
11845
  }, React.createElement(iconBtnPrevChart, null)), React.createElement("div", {
11285
- className: styles$2["chart"] + " sr-line-chart"
11846
+ className: styles$4["chart"] + " sr-line-chart"
11286
11847
  }, React.createElement("div", null, React.createElement(ReactApexChart, {
11287
11848
  height: 389,
11288
11849
  options: chartOptions,
11289
11850
  series: series
11290
11851
  }))), React.createElement("div", {
11291
- className: styles$2["nextChart"] + " " + (dataChartIndex < timelyOrderQuestion.length - 1 && "pointer"),
11852
+ className: styles$4["nextChart"] + " " + (dataChartIndex < timelyOrderQuestion.length - 1 && "pointer"),
11292
11853
  onClick: handleNextChart
11293
- }, React.createElement(iconBtnNextChart, null)))), React.createElement(CustomTabPanel, {
11294
- value: selected,
11295
- index: 2
11296
- }, React.createElement(CompareGrass, {
11854
+ }, React.createElement(iconBtnNextChart, null)))), React.createElement(Stack, {
11855
+ display: "flex",
11856
+ flexDirection: "column",
11857
+ gap: "12px",
11858
+ marginTop: "24px"
11859
+ }, React.createElement(Typography, {
11860
+ sx: {
11861
+ fontSize: "16px",
11862
+ fontWeight: 700,
11863
+ color: "#414E62"
11864
+ }
11865
+ }, t(TabList[2].label)), React.createElement(CompareGrass, {
11297
11866
  effectSize: effectSize
11298
- })), React.createElement(CustomTabPanel, {
11299
- value: selected,
11300
- index: 3
11301
- }, React.createElement(TrickyProblem, {
11867
+ })), React.createElement(Stack, {
11868
+ display: "flex",
11869
+ flexDirection: "column",
11870
+ gap: "12px",
11871
+ marginTop: "24px"
11872
+ }, React.createElement(Typography, {
11873
+ sx: {
11874
+ fontSize: "16px",
11875
+ fontWeight: 700,
11876
+ color: "#414E62"
11877
+ }
11878
+ }, t(TabList[3].label)), React.createElement(TrickyProblem, {
11302
11879
  data: resultDatas,
11303
11880
  openProblem: _extends({}, openProblem, {
11304
11881
  problem1: true
@@ -11364,5 +11941,100 @@ var times = {
11364
11941
  timeSpanToLocalMoment: timeSpanToLocalMoment
11365
11942
  };
11366
11943
 
11367
- export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AnswerCountSelector, ArticleCategorySelector, ArticleGroupView, BASE_URL, ChatContainer, ChatItemType, types as ChatTypes, CommonDialog, ConfirmDialog, index$1 as CoreHooks, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, index as Enums, ExamDetailView, ExamEvent, ExamResultV2, InputText, LANGUAGES, LayoutContext, Loading, Login, NotFound, PUSHER_CONFIG, QuestionCountSelector, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SubjectSelector, index$2 as Textbook, TextbookViewDetail as TextbookDetail, TextbookList, TheAcademyDropdown, TheLanguageDropdown, index$3 as Types, api, apiUpload, canAccess as canAccessRoute, diffFromNow, formatTime, getAcademyDomain, getAccessToken$1 as getAccessToken, i18n, minutesToTimeSpan, setAlert, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, times as timeUtils, toISOString, useAutoAcademyDomain, useCategorySelect, useChatContainer, useGoogleSignOut, useLanguage, useLogin, usePusherConversation, useSubjectSelect, useSwitchAcademy, utcToLocalTime };
11944
+ var Header = function Header(_ref) {
11945
+ var academyListRoute = _ref.academyListRoute,
11946
+ homeRoute = _ref.homeRoute,
11947
+ headerTabs = _ref.headerTabs,
11948
+ role = _ref.role,
11949
+ navigate = _ref.navigate,
11950
+ onSignOut = _ref.onSignOut;
11951
+ var _useTranslation = useTranslation(),
11952
+ t = _useTranslation.t;
11953
+ var location = useLocation();
11954
+ var theme = useTheme();
11955
+ var user = useSelector(function (state) {
11956
+ var _state$common;
11957
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
11958
+ });
11959
+ var isLargerThanXL = useMediaQuery(theme.breakpoints.up("xl"));
11960
+ var academyDomain = useSelector(function (state) {
11961
+ var _state$common2, _state$common2$user;
11962
+ return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.academyDomain;
11963
+ });
11964
+ var pathname = location.pathname.toLowerCase();
11965
+ return React.createElement("div", {
11966
+ className: "col-sm-12 col-xl-12 " + styles["tabBox"] + " " + styles["headers"]
11967
+ }, React.createElement(Link, {
11968
+ "aria-current": "page",
11969
+ to: homeRoute.path,
11970
+ className: "border-none " + styles["logo-container"]
11971
+ }, React.createElement("img", {
11972
+ className: styles["logo"] + " d-none d-lg-block",
11973
+ src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKoAAABNCAYAAAA2N/+4AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAfmSURBVHgB7ZzLktvGFYbPaZBKNOWKmSpnG3GfVHm09UbUE5hDJ4usTD2BrU22op5gRvtUifI20Qz0BKKfINQThHbWqWA2li0SfXwamJFBEAABojkX6/+qKIq4dJPA36fPpTFEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAatHrjXsEgAeY9kSnM54QyRNmWojwnJlD/fxmuZzOCYCG7EWolyIt2R1ptzMV8Ez//y2EC+rgXahbRFqEE65aXApF6M1qNZ0RADm8CnUHkZaQWNy5CvfVRx/RPIqmEYEPGm9C9SfSdZhlvFx+84LAB02HPBAE46mK9EvyjkwgUuBobVGdSNXq7UWkq9U3TwkAJaAW1BHpwcEn9Oc//Y0+/t0f6eDuH6jbPaDV6geydllxFkQK1tnZotYV6Wef/V0F+snGvqWK9Tz6byLa8/Pvk9fbt/+j6Pz7aRy/eEQAZNhJqG1FWoWQGZyd8bfkib8O3x0K8UaF7F9hd0Z7YKj9GTKH2W2WlrMwvLugHRkOpWcoHma36Y2LXoadkPZAk/6+OLKvhWSQ3VZ2D0fD1Ti/7TTsTKkGjYOpfYrUN3rB+zHbf2/sEJrqv7OK83oByxk1wBKf6M15ZSj4XO/qJLsvkO5Y3xajYXysFbrDJu2+PDMP9a2n6Y/n2e2i7elbpVCb9ici89MweFzV33C4GhriTzPb+/l2WOxY+x5cfrZknoUhR/k2L5hSDRoJ9TaJ1BEYOdZc7Bruggu92+b/9vJWYhtG7HTbMU40TdttQ9P+hGTrMSpSNxDH2bM2O87u13M4EWOrXHhtoWqe9HhbCuomidRNM2ohhvntum3SZhoG14Ope6CWNh+vVvx7PWWgQ2aim2Zqrd6PkpskUjd1E5uN4oOzpmHYQV72FtLQR51GqxU5J9m9kumz2x0fWsv3VKThTRCpwxj7taqyn9+uAUFvdGT/k9kwPz01RwVNRHr+hBoQk31Du5D6ywvaAyL2hStH1z6+xvewJK+McHKcMA94I5DiOYus+c5W6Jxa0roydbH6aX5w9x/lBzGHOuWeq1D2UBhYxwVQJLaglOsuru4j+SUDoGJ2wUFYGD3Ld9SIeCcfTNhMfWY5srhIvY7fmfk2W3/zxbVKrtdoFPfzzRuR6csweEae8VJC3Ya6CH0RtVwsn+oIbBT1NqUogHJY+ekh82+e5y2ABhzHKu5ZEpX+Qq8kQi3vVyP7vwyXfVsQBV8bbL6iBsEUC82Gw7cLTU0NamUuhQf5YCqmeC+DrraP2gYnTp2On4jwUWrZ9kNZAKVTTxJAicRPN7+bE5b1spjGsnmdj3hvG4buPKkzSJOZK5mh8ucHX2lq6rl7kUeuRKgJQmMV69gKu7zgfpbtlQZQQSLQUJP8UuCzafrka5eoJ1Cb1OoW4AbqxcvnNb2Sqf89Qk8M2ciKPDLMjRLq21B/aaI+Rn+jS01HrX/mR5oLdkWAtWoVc0fTb/SQyomoYoBZDiLWUOMWsCjbwWQiquvTGn6w7dCAggf65uUJjqsVqoPpWIOd+1aCieFmkXUZZQGU+qrzfDpKfVFXITrJV4+c76qB1Zdl6StXtTkLO1VCptFRTDcdLW+Oq4K32lN2gX+62Ze/eOTqpv5spxy8Jnr3Qn/JCXnA+b9F27UCVZR6Skp6VGAd1cqfJDnYHXE1buJ6JcGbSkDxM/0dw6pjyvzTDdiJ2Q9Xb1FTesx3Xlsx98MzfkwtGA6XA7HJRZtltztftKwC5SJ8dRWe6nmfb+51vlew03TlLFVS497bs73755/hnbkKMeKK31CUFVCXaqYulbOg2YHedwM/l1HZiesSahptpws/HlILwnQV1IwacnoaOGteaNFTi1FNanl/7AXU1Xq6uzl8z5JtlZpxbXbJpbhM37XnFnxcLBLZG5qO6neoo31yn4k/dr9FPe3q6l2Bf2pIQm2DNtN/5PzUV9SSaxOqI/UL4+Owxc24FAx547eFo98t8PhiZM/U7z1MiwZWX3fW7lcgPG6SXk8Qe6LVst5lm/HmWnbPQpVJ2p8bXOmAvAwBL777Qv9TLdSS/KmRQI0PDbLbWaz7fLuF6nCpIZ0uv1PLsZO/2qHVoVU3gnwhdqIWrehG9YpytG1Ri3NYO9L20V/L1VvpbGP7uc1RqC6D5rEPN1yChssay7iWYGoDzQQ4X5PAjacwfyppbtpSMMvv8lWJ9CZUtTazba+q8w2bM+cv0e1k4VJhceP1AdvarL5mnnEuj077W/p0/mkOFWNyjkv90WY2pTcayT1qibepn7ev0nF+0aBqv8sE6NRy30eU6BEnQk3mJ4taFpwkzE1kmRbu72qdnvKaONWNeVCjzbR4IDzPthnT8o0x3f/n2/RApj/r/jKN9mkW+htcdD+3ls6z17wymNxS31dffpZ3kdgmVrjV8kovQk2ehfGQvE8zAeQec6gdPa+oM+fqAdAIvQVOJJGWY/u7CMb5t5zLQmiwkiwBjNO1DrTDQIySHG32e8py69K5ffSnab9x3g/VYPh9Oi+2/FjFuhZv2PSaUr7NJnjJ+KVrPGskgGvg++E+8OugtY+aPlnoR6QAlNFaqMxm74uhAWglVOd0X+VTleDDpZVQyxaDAOCbVlG/iJkS+V0t5P6YLwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC/Yn4G8GJySAUVr9kAAAAASUVORK5CYII=",
11974
+ alt: ""
11975
+ }), React.createElement("img", {
11976
+ className: styles["logo"] + " d-block d-lg-none",
11977
+ src: "/images/logo-sm.png",
11978
+ alt: ""
11979
+ })), React.createElement("div", {
11980
+ className: styles["routerBox"] + " d-flex flex-grow-1 flex-nowrap px-3"
11981
+ }, headerTabs.map(function (_ref2) {
11982
+ var path = _ref2.path,
11983
+ icon = _ref2.icon,
11984
+ label = _ref2.label,
11985
+ isMain = _ref2.isMain,
11986
+ activePaths = _ref2.activePaths;
11987
+ return React.createElement(Link, {
11988
+ key: path,
11989
+ "aria-current": "page",
11990
+ to: !academyDomain && !isMain ? "#" : path,
11991
+ className: "text-decoration-none " + ((activePaths !== null && activePaths !== void 0 && activePaths.length ? activePaths.some(function (a) {
11992
+ return pathname.startsWith(a);
11993
+ }) : pathname.startsWith(path)) ? styles["router-link-active"] + " " + styles["router-link-exact-active"] : "") + " " + styles["tabText"] + " " + (!academyDomain && !isMain ? styles["disabled-link"] : "")
11994
+ }, React.createElement(Stack, {
11995
+ sx: {
11996
+ justifyContent: "center",
11997
+ flexDirection: "row",
11998
+ alignItems: "center",
11999
+ textOverflow: "ellipsis",
12000
+ overflow: "hidden",
12001
+ display: "flex",
12002
+ flexWrap: "nowrap"
12003
+ }
12004
+ }, icon, React.createElement("span", {
12005
+ className: "text-nowrap"
12006
+ }, isLargerThanXL || headerTabs.length < 4 ? t(label) : ellipsisText(t(label), 4))));
12007
+ })), React.createElement(Stack, {
12008
+ direction: "row",
12009
+ alignItems: "center"
12010
+ }, React.createElement(Typography, {
12011
+ className: "fw-bold text-primary me-2 text-nowrap",
12012
+ sx: {
12013
+ maxWidth: "120px",
12014
+ overflow: "hidden",
12015
+ textOverflow: "ellipsis"
12016
+ }
12017
+ }, user === null || user === void 0 ? void 0 : user.fullName), React.createElement("div", null, React.createElement(TheAcademyDropdown, {
12018
+ homeAcademyUrl: academyListRoute.path,
12019
+ homeUrl: homeRoute.path,
12020
+ role: role,
12021
+ navigate: navigate,
12022
+ hideAcademyName: !isLargerThanXL && headerTabs.length > 6
12023
+ })), React.createElement("div", {
12024
+ className: "me-2"
12025
+ }, React.createElement(TheLanguageDropdown, null)), React.createElement("div", {
12026
+ className: styles["userImg"] + " d-none d-md-none d-lg-block",
12027
+ onClick: onSignOut
12028
+ }, React.createElement("p", {
12029
+ className: "text-nowrap mb-0"
12030
+ }, t("logout"))), React.createElement("div", {
12031
+ className: styles["userImg"] + " d-block d-md-block d-lg-none",
12032
+ onClick: onSignOut
12033
+ }, React.createElement(IoIosLogOut, {
12034
+ size: 24,
12035
+ color: "#959595"
12036
+ }))));
12037
+ };
12038
+
12039
+ export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AnswerCountSelector, ArticleCategorySelector, ArticleGroupView, BASE_URL, ChatContainer, ChatItemType, types as ChatTypes, CommonDialog, ConfirmDialog, index$1 as CoreHooks, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, index as Enums, ExamDetailView, ExamEvent, ExamResultV2, Header, InputText, LANGUAGES, LayoutContext, Loading, Login, NotFound, PUSHER_CONFIG, QuestionCountSelector, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SubjectSelector, index$2 as Textbook, TextbookViewDetail as TextbookDetail, TextbookList, TheAcademyDropdown, TheLanguageDropdown, index$3 as Types, api, apiUpload, canAccess as canAccessRoute, diffFromNow, formatTime, getAcademyDomain, getAccessToken$1 as getAccessToken, i18n, minutesToTimeSpan, setAlert, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, times as timeUtils, toISOString, useAutoAcademyDomain, useCategorySelect, useChatContainer, useGoogleSignOut, useLanguage, useLogin, usePusherConversation, useSubjectSelect, useSwitchAcademy, utcToLocalTime };
11368
12040
  //# sourceMappingURL=index.modern.js.map