touchstudy-core 0.1.52 → 0.1.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Selectors/SubjectSelector.d.ts +0 -1
- package/dist/containers/Academies/apiClients/academyService.d.ts +2 -0
- package/dist/containers/Academies/components/AcademyCard.d.ts +9 -0
- package/dist/containers/Academies/configs/types.d.ts +6 -0
- package/dist/containers/Academies/hooks/useAcademyList.d.ts +7 -0
- package/dist/containers/Academies/views/AcademyList.d.ts +12 -0
- package/dist/containers/ExamResult/hooks/useExamResult.d.ts +1 -1
- package/dist/containers/ExamResult/views/ExamResultV2.d.ts +1 -1
- package/dist/containers/Exams/hooks/useExamDetailView.d.ts +1 -1
- package/dist/containers/Login/hooks/useLogin.d.ts +1 -1
- package/dist/containers/Login/hooks/useLoginWithPassword.d.ts +2 -2
- package/dist/containers/Login/views/LoginWithPassword.d.ts +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +657 -118
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +658 -120
- package/dist/index.modern.js.map +1 -1
- package/dist/layouts/Header.d.ts +1 -1
- package/dist/layouts/LayoutContext.d.ts +0 -1
- package/dist/layouts/TheAcademyDropdown.d.ts +1 -1
- package/dist/utils/hooks/useGoogleSignOut.d.ts +0 -1
- package/dist/utils/hooks/useLogin.d.ts +1 -1
- package/dist/utils/hooks/useSwitchAcademy.d.ts +1 -1
- package/dist/utils/pusherTo.d.ts +1 -0
- package/dist/utils/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { createAction, createReducer, configureStore } from '@reduxjs/toolkit';
|
2
2
|
import moment from 'moment';
|
3
3
|
export { default as moment } from 'moment';
|
4
|
-
import React__default, { useState, useEffect, useMemo,
|
4
|
+
import React__default, { useState, useCallback, useEffect, useMemo, Fragment as Fragment$1, useRef, createElement } from 'react';
|
5
5
|
import { Formik, Form, Field } from 'formik';
|
6
6
|
import { object, string, boolean } from 'yup';
|
7
7
|
import GoogleLogin, { useGoogleLogout } from '@leecheuk/react-google-login';
|
@@ -42,6 +42,10 @@ import TextField$1 from '@mui/material/TextField';
|
|
42
42
|
import Paper$1 from '@mui/material/Paper';
|
43
43
|
import Grid$1 from '@mui/material/Grid';
|
44
44
|
import { useLocation, Link } from 'react-router-dom';
|
45
|
+
import Card$1 from '@mui/material/Card';
|
46
|
+
import CardActions from '@mui/material/CardActions';
|
47
|
+
import CardContent from '@mui/material/CardContent';
|
48
|
+
import CardMedia from '@mui/material/CardMedia';
|
45
49
|
|
46
50
|
var setLoading = createAction("common/setLoading");
|
47
51
|
var setAlert = createAction("common/setAlert");
|
@@ -482,14 +486,16 @@ var useGoogleSignOut = function useGoogleSignOut(props) {
|
|
482
486
|
};
|
483
487
|
};
|
484
488
|
|
489
|
+
var pushTo = function pushTo(history, data) {
|
490
|
+
if (history.push) history.push(data);else history(data);
|
491
|
+
};
|
492
|
+
|
485
493
|
var ERROR_MESSAGE = "request_login_fail";
|
486
|
-
var useLogin = function useLogin(
|
494
|
+
var useLogin = function useLogin(history, homeAcademyUrl, homeUrl, registerUrl) {
|
487
495
|
var dispatch = useDispatch();
|
488
496
|
var _useTranslation = useTranslation(),
|
489
497
|
t = _useTranslation.t;
|
490
|
-
var _useGoogleSignOut = useGoogleSignOut({
|
491
|
-
onNavigate: onNavigate
|
492
|
-
}),
|
498
|
+
var _useGoogleSignOut = useGoogleSignOut({}),
|
493
499
|
handleSignOut = _useGoogleSignOut.handleSignOut;
|
494
500
|
var searchParams = new URLSearchParams(window.location.search);
|
495
501
|
var paramDomain = searchParams.get('domain');
|
@@ -585,9 +591,7 @@ var useLogin = function useLogin(onNavigate, homeAcademyUrl, homeUrl, registerUr
|
|
585
591
|
!data.academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
586
592
|
!!data.academyDomain && localStorage.setItem(ACADEMY_DOMAIN, data.academyDomain);
|
587
593
|
dispatch(setUser(_extends({}, data)));
|
588
|
-
if (redirectUrl)
|
589
|
-
onNavigate(redirectUrl);
|
590
|
-
}
|
594
|
+
if (redirectUrl) pushTo(history, redirectUrl);
|
591
595
|
};
|
592
596
|
return {
|
593
597
|
handleLoginGoogle: handleLoginGoogle,
|
@@ -820,6 +824,8 @@ var LANGUAGES = [{
|
|
820
824
|
}];
|
821
825
|
|
822
826
|
var useLanguage = function useLanguage() {
|
827
|
+
var searchParams = new URLSearchParams(window.location.search);
|
828
|
+
var langParam = searchParams.get("lang");
|
823
829
|
var defaultLanguage = !!localStorage.getItem("language") ? localStorage.getItem("language") : navigator.language || LANGUAGES[DEFAULT_LANGUAGE_INDEX].code;
|
824
830
|
var dispatch = useDispatch();
|
825
831
|
var _useTranslation = useTranslation(),
|
@@ -843,12 +849,23 @@ var useLanguage = function useLanguage() {
|
|
843
849
|
i18n.changeLanguage(language.code);
|
844
850
|
moment.locale(language.momentLangCode);
|
845
851
|
localStorage.setItem("language", language.code);
|
846
|
-
setItemLanguage(language.code);
|
847
852
|
dispatch(setLanguage(language.code));
|
853
|
+
searchParams.set("lang", language.code);
|
848
854
|
};
|
855
|
+
var handleChangeLangParam = useCallback(function () {
|
856
|
+
if (!langParam) return;
|
857
|
+
var languageItem = LANGUAGES.find(function (i) {
|
858
|
+
return i.code === langParam.toLowerCase();
|
859
|
+
});
|
860
|
+
if (!languageItem) languageItem = LANGUAGES[DEFAULT_LANGUAGE_INDEX];
|
861
|
+
setItemLanguage(languageItem.code);
|
862
|
+
}, [searchParams.toString(), language]);
|
849
863
|
useEffect(function () {
|
850
864
|
changeLanguageApp(language);
|
851
865
|
}, [language]);
|
866
|
+
useEffect(function () {
|
867
|
+
handleChangeLangParam();
|
868
|
+
}, [langParam]);
|
852
869
|
var currentLanguage = useMemo(function () {
|
853
870
|
var currentLang = LANGUAGES.find(function (i) {
|
854
871
|
return i.code === language;
|
@@ -872,7 +889,7 @@ var schema = object({
|
|
872
889
|
});
|
873
890
|
var BlockLogin = function BlockLogin(_ref) {
|
874
891
|
var defaultInfo = _ref.defaultInfo,
|
875
|
-
|
892
|
+
history = _ref.history,
|
876
893
|
_ref$role = _ref.role,
|
877
894
|
role = _ref$role === void 0 ? Role.Student : _ref$role,
|
878
895
|
homeAcademyUrl = _ref.homeAcademyUrl,
|
@@ -882,7 +899,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
882
899
|
currentLanguage = _useLanguage.currentLanguage;
|
883
900
|
var _useTranslation = useTranslation(),
|
884
901
|
t = _useTranslation.t;
|
885
|
-
var _useLogin = useLogin(
|
902
|
+
var _useLogin = useLogin(history, homeAcademyUrl, homeUrl, registerUrl),
|
886
903
|
handleLoginGoogle = _useLogin.handleLoginGoogle;
|
887
904
|
var onSuccessGoogle = function onSuccessGoogle(res) {
|
888
905
|
try {
|
@@ -910,7 +927,7 @@ var BlockLogin = function BlockLogin(_ref) {
|
|
910
927
|
};
|
911
928
|
var onFailureGoogle = function onFailureGoogle(err) {
|
912
929
|
console.log("error: login google", err);
|
913
|
-
|
930
|
+
pushTo(history, "/login");
|
914
931
|
};
|
915
932
|
return React__default.createElement(Paper, {
|
916
933
|
elevation: 3,
|
@@ -970,7 +987,7 @@ var defaultInfo = {
|
|
970
987
|
captcha: "",
|
971
988
|
rememberMe: false
|
972
989
|
};
|
973
|
-
var useLogin$1 = function useLogin(
|
990
|
+
var useLogin$1 = function useLogin(history) {
|
974
991
|
var _useState = useState(false),
|
975
992
|
openLogin = _useState[0],
|
976
993
|
setOpenLogin = _useState[1];
|
@@ -987,14 +1004,14 @@ var useLogin$1 = function useLogin(onNavigate) {
|
|
987
1004
|
var start = function start() {
|
988
1005
|
gapi.client.init({
|
989
1006
|
clientId: GOOGLE_CLIENT_ID,
|
990
|
-
scope:
|
1007
|
+
scope: "email"
|
991
1008
|
});
|
992
1009
|
};
|
993
|
-
!!gapi && gapi.load(
|
1010
|
+
!!gapi && gapi.load("client:auth2", start);
|
994
1011
|
}, [gapi]);
|
995
1012
|
useEffect(function () {
|
996
1013
|
var token = getAccessToken$1();
|
997
|
-
if (!!token)
|
1014
|
+
if (!!token) pushTo(history, "/");
|
998
1015
|
}, []);
|
999
1016
|
return {
|
1000
1017
|
defaultInfo: defaultInfo,
|
@@ -1007,11 +1024,11 @@ var useLogin$1 = function useLogin(onNavigate) {
|
|
1007
1024
|
};
|
1008
1025
|
};
|
1009
1026
|
|
1010
|
-
var _excluded = ["
|
1027
|
+
var _excluded = ["history"];
|
1011
1028
|
var Login = function Login(_ref) {
|
1012
|
-
var
|
1029
|
+
var history = _ref.history,
|
1013
1030
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
1014
|
-
var _useLogin = useLogin$1(
|
1031
|
+
var _useLogin = useLogin$1(history),
|
1015
1032
|
defaultInfo = _useLogin.defaultInfo;
|
1016
1033
|
return React__default.createElement("div", {
|
1017
1034
|
className: styles["login"] + " font-family-lato"
|
@@ -1025,7 +1042,7 @@ var Login = function Login(_ref) {
|
|
1025
1042
|
className: "d-flex justify-content-center h-100 align-items-center"
|
1026
1043
|
}, React__default.createElement(BlockLogin, Object.assign({
|
1027
1044
|
defaultInfo: defaultInfo,
|
1028
|
-
|
1045
|
+
history: history
|
1029
1046
|
}, rest)))));
|
1030
1047
|
};
|
1031
1048
|
|
@@ -1278,6 +1295,8 @@ var store = configureStore({
|
|
1278
1295
|
|
1279
1296
|
var TITLE = "Not found";
|
1280
1297
|
var NotFound = function NotFound() {
|
1298
|
+
var _useTranslation = useTranslation(),
|
1299
|
+
t = _useTranslation.t;
|
1281
1300
|
useEffect(function () {
|
1282
1301
|
document.title = TITLE;
|
1283
1302
|
});
|
@@ -1291,9 +1310,9 @@ var NotFound = function NotFound() {
|
|
1291
1310
|
className: "float-left"
|
1292
1311
|
}, React__default.createElement("h4", {
|
1293
1312
|
className: "pt-3"
|
1294
|
-
},
|
1313
|
+
}, t('oops')), React__default.createElement("p", {
|
1295
1314
|
className: "text-muted mb-2"
|
1296
|
-
},
|
1315
|
+
}, t('the_page_you_are_looking_for_was_not_found')), React__default.createElement("div", null))));
|
1297
1316
|
};
|
1298
1317
|
|
1299
1318
|
var loadingStyle = {
|
@@ -1351,11 +1370,8 @@ var LayoutContext = function LayoutContext(_ref) {
|
|
1351
1370
|
var children = _ref.children,
|
1352
1371
|
role = _ref.role,
|
1353
1372
|
_ref$pusherRegisterUr = _ref.pusherRegisterUrls,
|
1354
|
-
pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr
|
1355
|
-
|
1356
|
-
var _useGoogleSignOut = useGoogleSignOut({
|
1357
|
-
onNavigate: onNavigate
|
1358
|
-
}),
|
1373
|
+
pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr;
|
1374
|
+
var _useGoogleSignOut = useGoogleSignOut({}),
|
1359
1375
|
handleSignOut = _useGoogleSignOut.handleSignOut;
|
1360
1376
|
var _useTranslation = useTranslation(),
|
1361
1377
|
t = _useTranslation.t;
|
@@ -1504,13 +1520,10 @@ var LayoutContext = function LayoutContext(_ref) {
|
|
1504
1520
|
var ConfirmDialog = function ConfirmDialog(_ref) {
|
1505
1521
|
var open = _ref.open,
|
1506
1522
|
text = _ref.text,
|
1507
|
-
|
1508
|
-
|
1509
|
-
_ref$okText = _ref.okText,
|
1510
|
-
okText = _ref$okText === void 0 ? "예" : _ref$okText,
|
1523
|
+
cancelText = _ref.cancelText,
|
1524
|
+
okText = _ref.okText,
|
1511
1525
|
isDelete = _ref.isDelete,
|
1512
|
-
|
1513
|
-
title = _ref$title === void 0 ? "확인" : _ref$title,
|
1526
|
+
title = _ref.title,
|
1514
1527
|
confirmText = _ref.confirmText,
|
1515
1528
|
titleClassName = _ref.titleClassName,
|
1516
1529
|
toggle = _ref.toggle,
|
@@ -1518,6 +1531,10 @@ var ConfirmDialog = function ConfirmDialog(_ref) {
|
|
1518
1531
|
var _useState = useState(),
|
1519
1532
|
confirmTextValue = _useState[0],
|
1520
1533
|
setConfirmTextValue = _useState[1];
|
1534
|
+
var _useTranslation = useTranslation(),
|
1535
|
+
t = _useTranslation.t;
|
1536
|
+
var _useLanguage = useLanguage(),
|
1537
|
+
currentLanguage = _useLanguage.currentLanguage;
|
1521
1538
|
var handleConfirm = function handleConfirm() {
|
1522
1539
|
onConfirm();
|
1523
1540
|
};
|
@@ -1542,7 +1559,7 @@ var ConfirmDialog = function ConfirmDialog(_ref) {
|
|
1542
1559
|
sx: {
|
1543
1560
|
fontSize: "16px!important"
|
1544
1561
|
}
|
1545
|
-
}, title), React__default.createElement(IconButton, {
|
1562
|
+
}, title || t('confirmation')), React__default.createElement(IconButton, {
|
1546
1563
|
"aria-label": "close",
|
1547
1564
|
onClick: toggle,
|
1548
1565
|
sx: {
|
@@ -1557,7 +1574,7 @@ var ConfirmDialog = function ConfirmDialog(_ref) {
|
|
1557
1574
|
className: "pt-2"
|
1558
1575
|
}, React__default.createElement("p", null, React__default.createElement("strong", null, text)), !!confirmText && React__default.createElement("div", {
|
1559
1576
|
className: "w-100"
|
1560
|
-
}, React__default.createElement("p", null, "Enter
|
1577
|
+
}, (currentLanguage === null || currentLanguage === void 0 ? void 0 : currentLanguage.code) === 'en' ? React__default.createElement("p", null, "Enter ", React__default.createElement("strong", null, confirmText), " to confirm delete") : React__default.createElement("p", null, "\uC785\uB825\uD558\uB2E4 ", React__default.createElement("strong", null, confirmText), " \uC0AD\uC81C\uB97C \uD655\uC778\uD558\uB824\uBA74"), React__default.createElement(TextField, {
|
1561
1578
|
className: "w-100",
|
1562
1579
|
sx: {
|
1563
1580
|
"& input": {
|
@@ -1566,7 +1583,7 @@ var ConfirmDialog = function ConfirmDialog(_ref) {
|
|
1566
1583
|
},
|
1567
1584
|
value: confirmTextValue,
|
1568
1585
|
onChange: handleChangeConfirmText,
|
1569
|
-
placeholder:
|
1586
|
+
placeholder: t('please_enter'),
|
1570
1587
|
onPaste: handlePaste,
|
1571
1588
|
error: !isValid && confirmTextValue !== undefined,
|
1572
1589
|
color: isValid ? "success" : confirmTextValue !== undefined ? "error" : undefined
|
@@ -1577,13 +1594,13 @@ var ConfirmDialog = function ConfirmDialog(_ref) {
|
|
1577
1594
|
color: "secondary",
|
1578
1595
|
className: "px-3 bg-secondary",
|
1579
1596
|
onClick: toggle
|
1580
|
-
}, cancelText), React__default.createElement(Button, {
|
1597
|
+
}, cancelText || t("no")), React__default.createElement(Button, {
|
1581
1598
|
variant: "contained",
|
1582
1599
|
color: isDelete ? "error" : "primary",
|
1583
1600
|
className: "px-3",
|
1584
1601
|
disabled: !!confirmText && (confirmTextValue === null || confirmTextValue === void 0 ? void 0 : confirmTextValue.trim()) !== confirmText.trim(),
|
1585
1602
|
onClick: handleConfirm
|
1586
|
-
}, okText)));
|
1603
|
+
}, okText || t('yes'))));
|
1587
1604
|
};
|
1588
1605
|
|
1589
1606
|
var CommonDialog = function CommonDialog(_ref) {
|
@@ -2194,6 +2211,95 @@ var update_category = "카테고리 업데이트";
|
|
2194
2211
|
var create_new_category = "새 카테고리 만들기";
|
2195
2212
|
var parent_category = "상위 카테고리:";
|
2196
2213
|
var enter_category_name = "카테고리 이름을 입력하세요";
|
2214
|
+
var new_class = "새로운 수업";
|
2215
|
+
var classes = "클래스";
|
2216
|
+
var confirm_delete_class = "수업을 삭제하시겠습니까:";
|
2217
|
+
var new_exam = "새로운 시험";
|
2218
|
+
var are_you_sure_to_delete_exam = "시험을 삭제하시겠습니까:";
|
2219
|
+
var question_type = "질문 유형";
|
2220
|
+
var question_category = "질문 카테고리";
|
2221
|
+
var select_article = "기사 선택";
|
2222
|
+
var create_social = "소셜 만들기";
|
2223
|
+
var update_social = "소셜 업데이트";
|
2224
|
+
var new_social = "뉴소셜";
|
2225
|
+
var are_you_sure_to_delete_social_link = "소셜 링크를 삭제하시겠습니까:";
|
2226
|
+
var update_subject = "업데이트 제목";
|
2227
|
+
var create_new_subject = "새 주제 만들기";
|
2228
|
+
var subject_name = "주체 이름";
|
2229
|
+
var are_you_sure_to_delete_subject = "제목을 삭제하시겠습니까:";
|
2230
|
+
var drop_a_file_here_or_click_to_browse = "여기에 파일을 놓거나 클릭하여 찾아보세요.";
|
2231
|
+
var delete_users_csv = "사용자 CSV 삭제";
|
2232
|
+
var are_you_sure_to_delete_user = "사용자를 삭제하시겠습니까:";
|
2233
|
+
var enter_phone_number = "전화번호를 입력하세요";
|
2234
|
+
var enter_school_name = "학교 이름을 입력하세요";
|
2235
|
+
var enter_grade = "성적 입력";
|
2236
|
+
var enter_major_name = "주요 이름을 입력하세요";
|
2237
|
+
var enter_parent_name = "부모 이름을 입력하세요";
|
2238
|
+
var enter_parent_phone_number = "부모 전화번호를 입력하세요";
|
2239
|
+
var select_role = "역할 선택";
|
2240
|
+
var import_users = "사용자 가져오기";
|
2241
|
+
var remove_users = "사용자 제거";
|
2242
|
+
var download_template = "템플릿 다운로드";
|
2243
|
+
var export_csv = "CSV 내보내기";
|
2244
|
+
var select_type = "유형 선택";
|
2245
|
+
var no_message = "메시지 없음";
|
2246
|
+
var this_is_the_guidance_text = "안내 텍스트입니다.";
|
2247
|
+
var oops = "이런! 당신이졌다.";
|
2248
|
+
var please_enter = "들어 오세요...";
|
2249
|
+
var hint = "힌트";
|
2250
|
+
var save_and_add_next_question = "저장하고 다음 질문 추가";
|
2251
|
+
var question_text = "질문 텍스트";
|
2252
|
+
var article = "기사";
|
2253
|
+
var notifications = "알림";
|
2254
|
+
var exams = "시험";
|
2255
|
+
var questions = "질문";
|
2256
|
+
var dashboard = "계기반";
|
2257
|
+
var question_bank = "문제 은행";
|
2258
|
+
var exam_categories = "시험 카테고리";
|
2259
|
+
var social_link = "소셜 링크";
|
2260
|
+
var created_date = "생성 날짜";
|
2261
|
+
var are_you_sure_to_delete_academy = "아카데미를 삭제하시겠습니까:";
|
2262
|
+
var action = "행동";
|
2263
|
+
var number_of_questions = "질문 수";
|
2264
|
+
var are_you_sure_to_delete_category = "카테고리를 삭제하시겠습니까:";
|
2265
|
+
var add_new_lesson = "새 강의 추가";
|
2266
|
+
var update_lesson = "강의 업데이트:";
|
2267
|
+
var are_you_sure_to_remove_lesson = "강의를 삭제하시겠습니까:";
|
2268
|
+
var clear = "분명한";
|
2269
|
+
var add_to_list = "목록에 추가";
|
2270
|
+
var add_students = "학생 추가";
|
2271
|
+
var are_you_sure_to_remove_student = "학생을 삭제하시겠습니까:";
|
2272
|
+
var add_teachers = "교사 추가";
|
2273
|
+
var please_enter_a_title = "제목을 입력하세요";
|
2274
|
+
var questions_required_at_least_one_question = "질문에는 하나 이상의 질문이 필요합니다.";
|
2275
|
+
var please_enter_number_of_answers_for_question_number = "질문 번호 {{number}} 에 대한 답변 수를 입력하십시오.";
|
2276
|
+
var number_of_answers_must_be_greater_than_1_for_question_number = "질문 번호 {{number}} 에 대한 답변 수는 1보다 커야 합니다.";
|
2277
|
+
var correct_answer_must_be_less_than_for_question_number = "질문 번호 {{number}} 에 대한 정답은 {{question}} 보다 작아야 합니다.";
|
2278
|
+
var update_exam_successfully = "시험을 성공적으로 업데이트했습니다.";
|
2279
|
+
var create_exam_successfully = "시험을 성공적으로 만들었습니다.";
|
2280
|
+
var create_notification = "알림 생성";
|
2281
|
+
var update_notification = "업데이트 알림";
|
2282
|
+
var new_notification = "새로운 알림";
|
2283
|
+
var are_you_sure_to_delete_notification = "알림을 삭제하시겠습니까:";
|
2284
|
+
var answer_list = "답변 목록";
|
2285
|
+
var are_you_sure_to_delete_question = "질문을 삭제하시겠습니까:";
|
2286
|
+
var school_name_is_required = "학교 이름은 필수 항목입니다.";
|
2287
|
+
var phone_number_is_not_valid = "전화번호가 유효하지 않습니다.";
|
2288
|
+
var role_is_required = "역할은 필수입니다.";
|
2289
|
+
var student_grade_is_required = "학생 성적은 필수 항목입니다.";
|
2290
|
+
var major_is_required = "전공은 필수입니다";
|
2291
|
+
var phone_number_is_required = "전화번호는 필수 항목입니다.";
|
2292
|
+
var parent_name_is_required = "부모 이름이 필요합니다";
|
2293
|
+
var category_name = "카테고리 이름";
|
2294
|
+
var categories = "카테고리";
|
2295
|
+
var teacher = "선생님";
|
2296
|
+
var role = "역할";
|
2297
|
+
var total_uses = "총 사용량";
|
2298
|
+
var create_question = "질문 만들기";
|
2299
|
+
var articles = "조항";
|
2300
|
+
var add_lesson = "레슨 추가";
|
2301
|
+
var date = "날짜";
|
2302
|
+
var the_code_has_been_copied_to_your_clipboard = "코드가 클립보드에 복사되었습니다.";
|
2197
2303
|
var lang_ko = {
|
2198
2304
|
problem_solving: problem_solving,
|
2199
2305
|
my_story: my_story,
|
@@ -2614,7 +2720,98 @@ var lang_ko = {
|
|
2614
2720
|
update_category: update_category,
|
2615
2721
|
create_new_category: create_new_category,
|
2616
2722
|
parent_category: parent_category,
|
2617
|
-
enter_category_name: enter_category_name
|
2723
|
+
enter_category_name: enter_category_name,
|
2724
|
+
new_class: new_class,
|
2725
|
+
classes: classes,
|
2726
|
+
confirm_delete_class: confirm_delete_class,
|
2727
|
+
new_exam: new_exam,
|
2728
|
+
are_you_sure_to_delete_exam: are_you_sure_to_delete_exam,
|
2729
|
+
question_type: question_type,
|
2730
|
+
question_category: question_category,
|
2731
|
+
select_article: select_article,
|
2732
|
+
create_social: create_social,
|
2733
|
+
update_social: update_social,
|
2734
|
+
new_social: new_social,
|
2735
|
+
are_you_sure_to_delete_social_link: are_you_sure_to_delete_social_link,
|
2736
|
+
update_subject: update_subject,
|
2737
|
+
create_new_subject: create_new_subject,
|
2738
|
+
subject_name: subject_name,
|
2739
|
+
are_you_sure_to_delete_subject: are_you_sure_to_delete_subject,
|
2740
|
+
drop_a_file_here_or_click_to_browse: drop_a_file_here_or_click_to_browse,
|
2741
|
+
delete_users_csv: delete_users_csv,
|
2742
|
+
are_you_sure_to_delete_user: are_you_sure_to_delete_user,
|
2743
|
+
enter_phone_number: enter_phone_number,
|
2744
|
+
enter_school_name: enter_school_name,
|
2745
|
+
enter_grade: enter_grade,
|
2746
|
+
enter_major_name: enter_major_name,
|
2747
|
+
enter_parent_name: enter_parent_name,
|
2748
|
+
enter_parent_phone_number: enter_parent_phone_number,
|
2749
|
+
select_role: select_role,
|
2750
|
+
import_users: import_users,
|
2751
|
+
remove_users: remove_users,
|
2752
|
+
download_template: download_template,
|
2753
|
+
export_csv: export_csv,
|
2754
|
+
select_type: select_type,
|
2755
|
+
no_message: no_message,
|
2756
|
+
this_is_the_guidance_text: this_is_the_guidance_text,
|
2757
|
+
"the_page_you_are_looking_for_was_not_found.": "찾으시는 페이지를 찾을 수 없습니다.",
|
2758
|
+
oops: oops,
|
2759
|
+
please_enter: please_enter,
|
2760
|
+
hint: hint,
|
2761
|
+
save_and_add_next_question: save_and_add_next_question,
|
2762
|
+
question_text: question_text,
|
2763
|
+
article: article,
|
2764
|
+
notifications: notifications,
|
2765
|
+
exams: exams,
|
2766
|
+
questions: questions,
|
2767
|
+
dashboard: dashboard,
|
2768
|
+
question_bank: question_bank,
|
2769
|
+
exam_categories: exam_categories,
|
2770
|
+
social_link: social_link,
|
2771
|
+
created_date: created_date,
|
2772
|
+
are_you_sure_to_delete_academy: are_you_sure_to_delete_academy,
|
2773
|
+
action: action,
|
2774
|
+
number_of_questions: number_of_questions,
|
2775
|
+
are_you_sure_to_delete_category: are_you_sure_to_delete_category,
|
2776
|
+
add_new_lesson: add_new_lesson,
|
2777
|
+
update_lesson: update_lesson,
|
2778
|
+
are_you_sure_to_remove_lesson: are_you_sure_to_remove_lesson,
|
2779
|
+
clear: clear,
|
2780
|
+
add_to_list: add_to_list,
|
2781
|
+
add_students: add_students,
|
2782
|
+
are_you_sure_to_remove_student: are_you_sure_to_remove_student,
|
2783
|
+
add_teachers: add_teachers,
|
2784
|
+
please_enter_a_title: please_enter_a_title,
|
2785
|
+
questions_required_at_least_one_question: questions_required_at_least_one_question,
|
2786
|
+
please_enter_number_of_answers_for_question_number: please_enter_number_of_answers_for_question_number,
|
2787
|
+
number_of_answers_must_be_greater_than_1_for_question_number: number_of_answers_must_be_greater_than_1_for_question_number,
|
2788
|
+
"please_choose_at_least_one_answer_for_question_number ": "질문 번호 {{number}}에 대해 하나 이상의 답변을 선택하십시오.",
|
2789
|
+
correct_answer_must_be_less_than_for_question_number: correct_answer_must_be_less_than_for_question_number,
|
2790
|
+
update_exam_successfully: update_exam_successfully,
|
2791
|
+
create_exam_successfully: create_exam_successfully,
|
2792
|
+
create_notification: create_notification,
|
2793
|
+
update_notification: update_notification,
|
2794
|
+
new_notification: new_notification,
|
2795
|
+
are_you_sure_to_delete_notification: are_you_sure_to_delete_notification,
|
2796
|
+
answer_list: answer_list,
|
2797
|
+
are_you_sure_to_delete_question: are_you_sure_to_delete_question,
|
2798
|
+
school_name_is_required: school_name_is_required,
|
2799
|
+
phone_number_is_not_valid: phone_number_is_not_valid,
|
2800
|
+
role_is_required: role_is_required,
|
2801
|
+
student_grade_is_required: student_grade_is_required,
|
2802
|
+
major_is_required: major_is_required,
|
2803
|
+
phone_number_is_required: phone_number_is_required,
|
2804
|
+
parent_name_is_required: parent_name_is_required,
|
2805
|
+
category_name: category_name,
|
2806
|
+
categories: categories,
|
2807
|
+
teacher: teacher,
|
2808
|
+
role: role,
|
2809
|
+
total_uses: total_uses,
|
2810
|
+
create_question: create_question,
|
2811
|
+
articles: articles,
|
2812
|
+
add_lesson: add_lesson,
|
2813
|
+
date: date,
|
2814
|
+
the_code_has_been_copied_to_your_clipboard: the_code_has_been_copied_to_your_clipboard
|
2618
2815
|
};
|
2619
2816
|
|
2620
2817
|
var problem_solving$1 = "Problem Solving";
|
@@ -2688,19 +2885,19 @@ var correct_rate$1 = "Correct rate";
|
|
2688
2885
|
var difficult_level = "Difficult level";
|
2689
2886
|
var difficulty_explain = "(The Difficulty Level provides an indication of the difficulty level of each test question)";
|
2690
2887
|
var explain_your_answer = "Explain your answer";
|
2691
|
-
var hint = "Hint";
|
2692
|
-
var save_and_add_next_question = "Save and add next question";
|
2888
|
+
var hint$1 = "Hint";
|
2889
|
+
var save_and_add_next_question$1 = "Save and add next question";
|
2693
2890
|
var save_and_exit$1 = "Save and exit";
|
2694
|
-
var question_text = "Question text";
|
2891
|
+
var question_text$1 = "Question text";
|
2695
2892
|
var title$1 = "Title";
|
2696
|
-
var create_question = "Create question";
|
2893
|
+
var create_question$1 = "Create question";
|
2697
2894
|
var parent_question = "Parent question";
|
2698
2895
|
var edit_question = "Edit question";
|
2699
2896
|
var edit$1 = "Edit";
|
2700
2897
|
var easy = "Easy";
|
2701
2898
|
var intermediate = "Intermediate";
|
2702
2899
|
var difficult = "Difficult";
|
2703
|
-
var article = "Article";
|
2900
|
+
var article$1 = "Article";
|
2704
2901
|
var correct_answer = "Correct answer";
|
2705
2902
|
var mark = "Mark";
|
2706
2903
|
var answer$1 = "Answer";
|
@@ -2762,11 +2959,11 @@ var friday$1 = "Friday";
|
|
2762
2959
|
var saturday$1 = "Saturday";
|
2763
2960
|
var total_lessons$1 = "Total lessons";
|
2764
2961
|
var is_cancelled = "Is cancelled";
|
2765
|
-
var date = "Date";
|
2962
|
+
var date$1 = "Date";
|
2766
2963
|
var weekly_days_required$1 = "Weekly days are required";
|
2767
2964
|
var main_teacher$1 = "Main teacher";
|
2768
2965
|
var main_teacher_required = "Main teacher is required";
|
2769
|
-
var teacher = "Teacher";
|
2966
|
+
var teacher$1 = "Teacher";
|
2770
2967
|
var the_first$1 = "The first";
|
2771
2968
|
var the_second$1 = "The second";
|
2772
2969
|
var the_third$1 = "The third";
|
@@ -3078,6 +3275,88 @@ var update_category$1 = "Update Category";
|
|
3078
3275
|
var create_new_category$1 = "Create New Category";
|
3079
3276
|
var parent_category$1 = "Parent Category:";
|
3080
3277
|
var enter_category_name$1 = "Enter Category Name";
|
3278
|
+
var new_class$1 = "New class";
|
3279
|
+
var classes$1 = "Classes";
|
3280
|
+
var confirm_delete_class$1 = "Are you sure to delete class:";
|
3281
|
+
var new_exam$1 = "New Exam";
|
3282
|
+
var are_you_sure_to_delete_exam$1 = "Are you sure to delete exam:";
|
3283
|
+
var question_type$1 = "Question Type";
|
3284
|
+
var question_category$1 = "Question Category";
|
3285
|
+
var select_article$1 = "Select Article";
|
3286
|
+
var create_social$1 = "Create Social";
|
3287
|
+
var update_social$1 = "Update Social";
|
3288
|
+
var new_social$1 = "New Social";
|
3289
|
+
var are_you_sure_to_delete_social_link$1 = "Are you sure to delete social link:";
|
3290
|
+
var update_subject$1 = "Update Subject";
|
3291
|
+
var create_new_subject$1 = "Create New Subject";
|
3292
|
+
var subject_name$1 = "Subject name";
|
3293
|
+
var are_you_sure_to_delete_subject$1 = "Are you sure to delete subject:";
|
3294
|
+
var drop_a_file_here_or_click_to_browse$1 = "Drop a file here or click to browse";
|
3295
|
+
var delete_users_csv$1 = "Delete users csv";
|
3296
|
+
var are_you_sure_to_delete_user$1 = "Are you sure to delete user:";
|
3297
|
+
var enter_phone_number$1 = "Enter phone number";
|
3298
|
+
var enter_school_name$1 = "Enter school name";
|
3299
|
+
var enter_grade$1 = "Enter grade";
|
3300
|
+
var enter_major_name$1 = "Enter major name";
|
3301
|
+
var enter_parent_name$1 = "Enter parent name";
|
3302
|
+
var enter_parent_phone_number$1 = "Enter parent phone number";
|
3303
|
+
var select_role$1 = "Select role";
|
3304
|
+
var import_users$1 = "Import users";
|
3305
|
+
var remove_users$1 = "Remove users";
|
3306
|
+
var download_template$1 = "Download template";
|
3307
|
+
var export_csv$1 = "Export csv";
|
3308
|
+
var select_type$1 = "Select type";
|
3309
|
+
var no_message$1 = "No message";
|
3310
|
+
var this_is_the_guidance_text$1 = "This is the guidance text.";
|
3311
|
+
var oops$1 = "Oops! You are lost.";
|
3312
|
+
var please_enter$1 = "Please enter...";
|
3313
|
+
var notifications$1 = "Notifications";
|
3314
|
+
var exams$1 = "Exams";
|
3315
|
+
var questions$1 = "Questions";
|
3316
|
+
var dashboard$1 = "Dashboard";
|
3317
|
+
var question_bank$1 = "Question Bank";
|
3318
|
+
var exam_categories$1 = "Exam Categories";
|
3319
|
+
var social_link$1 = "Social Link";
|
3320
|
+
var created_date$1 = "Created Date";
|
3321
|
+
var are_you_sure_to_delete_academy$1 = "Are you sure to delete academy:";
|
3322
|
+
var action$1 = "Action";
|
3323
|
+
var number_of_questions$1 = "Number Of Questions";
|
3324
|
+
var are_you_sure_to_delete_category$1 = "Are you sure to delete category:";
|
3325
|
+
var add_new_lesson$1 = "Add new lesson";
|
3326
|
+
var update_lesson$1 = "Update lesson:";
|
3327
|
+
var are_you_sure_to_remove_lesson$1 = "Are you sure to remove lesson:";
|
3328
|
+
var clear$1 = "Clear";
|
3329
|
+
var add_to_list$1 = "Add to list";
|
3330
|
+
var add_students$1 = "Add students";
|
3331
|
+
var are_you_sure_to_remove_student$1 = "Are you sure to remove student:";
|
3332
|
+
var add_teachers$1 = "Add teachers";
|
3333
|
+
var please_enter_a_title$1 = "Please enter a title";
|
3334
|
+
var questions_required_at_least_one_question$1 = "Questions required at least one question";
|
3335
|
+
var please_enter_number_of_answers_for_question_number$1 = "Please enter number of answers for question number {{number}}";
|
3336
|
+
var number_of_answers_must_be_greater_than_1_for_question_number$1 = "Number of answers must be greater than 1 for question number {{number}}";
|
3337
|
+
var correct_answer_must_be_less_than_for_question_number$1 = "Correct answer must be less than {{question}} for question number {{number}}";
|
3338
|
+
var update_exam_successfully$1 = "Update exam successfully";
|
3339
|
+
var create_exam_successfully$1 = "Create exam successfully";
|
3340
|
+
var create_notification$1 = "Create Notification";
|
3341
|
+
var update_notification$1 = "Update Notification";
|
3342
|
+
var new_notification$1 = "New Notification";
|
3343
|
+
var are_you_sure_to_delete_notification$1 = "Are you sure to delete notification:";
|
3344
|
+
var answer_list$1 = "Answer List";
|
3345
|
+
var are_you_sure_to_delete_question$1 = "Are you sure to delete question:";
|
3346
|
+
var school_name_is_required$1 = "School name is required";
|
3347
|
+
var phone_number_is_not_valid$1 = "Phone number is not valid";
|
3348
|
+
var role_is_required$1 = "Role is required";
|
3349
|
+
var student_grade_is_required$1 = "Student grade is required";
|
3350
|
+
var major_is_required$1 = "Major is required";
|
3351
|
+
var phone_number_is_required$1 = "Phone number is required";
|
3352
|
+
var parent_name_is_required$1 = "Parent name is required";
|
3353
|
+
var category_name$1 = "Category Name";
|
3354
|
+
var categories$1 = "Categories";
|
3355
|
+
var role$1 = "Role";
|
3356
|
+
var total_uses$1 = "Total Uses";
|
3357
|
+
var articles$1 = "Articles";
|
3358
|
+
var add_lesson$1 = "Add Lesson";
|
3359
|
+
var the_code_has_been_copied_to_your_clipboard$1 = "The code has been copied to your clipboard";
|
3081
3360
|
var lang_en = {
|
3082
3361
|
problem_solving: problem_solving$1,
|
3083
3362
|
my_story: my_story$1,
|
@@ -3152,12 +3431,12 @@ var lang_en = {
|
|
3152
3431
|
difficult_level: difficult_level,
|
3153
3432
|
difficulty_explain: difficulty_explain,
|
3154
3433
|
explain_your_answer: explain_your_answer,
|
3155
|
-
hint: hint,
|
3156
|
-
save_and_add_next_question: save_and_add_next_question,
|
3434
|
+
hint: hint$1,
|
3435
|
+
save_and_add_next_question: save_and_add_next_question$1,
|
3157
3436
|
save_and_exit: save_and_exit$1,
|
3158
|
-
question_text: question_text,
|
3437
|
+
question_text: question_text$1,
|
3159
3438
|
title: title$1,
|
3160
|
-
create_question: create_question,
|
3439
|
+
create_question: create_question$1,
|
3161
3440
|
parent_question: parent_question,
|
3162
3441
|
edit_question: edit_question,
|
3163
3442
|
edit: edit$1,
|
@@ -3165,7 +3444,7 @@ var lang_en = {
|
|
3165
3444
|
easy: easy,
|
3166
3445
|
intermediate: intermediate,
|
3167
3446
|
difficult: difficult,
|
3168
|
-
article: article,
|
3447
|
+
article: article$1,
|
3169
3448
|
correct_answer: correct_answer,
|
3170
3449
|
mark: mark,
|
3171
3450
|
answer: answer$1,
|
@@ -3227,11 +3506,11 @@ var lang_en = {
|
|
3227
3506
|
saturday: saturday$1,
|
3228
3507
|
total_lessons: total_lessons$1,
|
3229
3508
|
is_cancelled: is_cancelled,
|
3230
|
-
date: date,
|
3509
|
+
date: date$1,
|
3231
3510
|
weekly_days_required: weekly_days_required$1,
|
3232
3511
|
main_teacher: main_teacher$1,
|
3233
3512
|
main_teacher_required: main_teacher_required,
|
3234
|
-
teacher: teacher,
|
3513
|
+
teacher: teacher$1,
|
3235
3514
|
the_first: the_first$1,
|
3236
3515
|
the_second: the_second$1,
|
3237
3516
|
the_third: the_third$1,
|
@@ -3532,7 +3811,91 @@ var lang_en = {
|
|
3532
3811
|
update_category: update_category$1,
|
3533
3812
|
create_new_category: create_new_category$1,
|
3534
3813
|
parent_category: parent_category$1,
|
3535
|
-
enter_category_name: enter_category_name$1
|
3814
|
+
enter_category_name: enter_category_name$1,
|
3815
|
+
new_class: new_class$1,
|
3816
|
+
classes: classes$1,
|
3817
|
+
confirm_delete_class: confirm_delete_class$1,
|
3818
|
+
new_exam: new_exam$1,
|
3819
|
+
are_you_sure_to_delete_exam: are_you_sure_to_delete_exam$1,
|
3820
|
+
question_type: question_type$1,
|
3821
|
+
question_category: question_category$1,
|
3822
|
+
select_article: select_article$1,
|
3823
|
+
create_social: create_social$1,
|
3824
|
+
update_social: update_social$1,
|
3825
|
+
new_social: new_social$1,
|
3826
|
+
are_you_sure_to_delete_social_link: are_you_sure_to_delete_social_link$1,
|
3827
|
+
update_subject: update_subject$1,
|
3828
|
+
create_new_subject: create_new_subject$1,
|
3829
|
+
subject_name: subject_name$1,
|
3830
|
+
are_you_sure_to_delete_subject: are_you_sure_to_delete_subject$1,
|
3831
|
+
drop_a_file_here_or_click_to_browse: drop_a_file_here_or_click_to_browse$1,
|
3832
|
+
delete_users_csv: delete_users_csv$1,
|
3833
|
+
are_you_sure_to_delete_user: are_you_sure_to_delete_user$1,
|
3834
|
+
enter_phone_number: enter_phone_number$1,
|
3835
|
+
enter_school_name: enter_school_name$1,
|
3836
|
+
enter_grade: enter_grade$1,
|
3837
|
+
enter_major_name: enter_major_name$1,
|
3838
|
+
enter_parent_name: enter_parent_name$1,
|
3839
|
+
enter_parent_phone_number: enter_parent_phone_number$1,
|
3840
|
+
select_role: select_role$1,
|
3841
|
+
import_users: import_users$1,
|
3842
|
+
remove_users: remove_users$1,
|
3843
|
+
download_template: download_template$1,
|
3844
|
+
export_csv: export_csv$1,
|
3845
|
+
select_type: select_type$1,
|
3846
|
+
no_message: no_message$1,
|
3847
|
+
this_is_the_guidance_text: this_is_the_guidance_text$1,
|
3848
|
+
"the_page_you_are_looking_for_was_not_found.": "The page you are looking for was not found.",
|
3849
|
+
oops: oops$1,
|
3850
|
+
please_enter: please_enter$1,
|
3851
|
+
notifications: notifications$1,
|
3852
|
+
exams: exams$1,
|
3853
|
+
questions: questions$1,
|
3854
|
+
dashboard: dashboard$1,
|
3855
|
+
question_bank: question_bank$1,
|
3856
|
+
exam_categories: exam_categories$1,
|
3857
|
+
social_link: social_link$1,
|
3858
|
+
created_date: created_date$1,
|
3859
|
+
are_you_sure_to_delete_academy: are_you_sure_to_delete_academy$1,
|
3860
|
+
action: action$1,
|
3861
|
+
number_of_questions: number_of_questions$1,
|
3862
|
+
are_you_sure_to_delete_category: are_you_sure_to_delete_category$1,
|
3863
|
+
add_new_lesson: add_new_lesson$1,
|
3864
|
+
update_lesson: update_lesson$1,
|
3865
|
+
are_you_sure_to_remove_lesson: are_you_sure_to_remove_lesson$1,
|
3866
|
+
clear: clear$1,
|
3867
|
+
add_to_list: add_to_list$1,
|
3868
|
+
add_students: add_students$1,
|
3869
|
+
are_you_sure_to_remove_student: are_you_sure_to_remove_student$1,
|
3870
|
+
add_teachers: add_teachers$1,
|
3871
|
+
please_enter_a_title: please_enter_a_title$1,
|
3872
|
+
questions_required_at_least_one_question: questions_required_at_least_one_question$1,
|
3873
|
+
please_enter_number_of_answers_for_question_number: please_enter_number_of_answers_for_question_number$1,
|
3874
|
+
number_of_answers_must_be_greater_than_1_for_question_number: number_of_answers_must_be_greater_than_1_for_question_number$1,
|
3875
|
+
"please_choose_at_least_one_answer_for_question_number ": "Please choose at least one answer for question number {{number}}",
|
3876
|
+
correct_answer_must_be_less_than_for_question_number: correct_answer_must_be_less_than_for_question_number$1,
|
3877
|
+
update_exam_successfully: update_exam_successfully$1,
|
3878
|
+
create_exam_successfully: create_exam_successfully$1,
|
3879
|
+
create_notification: create_notification$1,
|
3880
|
+
update_notification: update_notification$1,
|
3881
|
+
new_notification: new_notification$1,
|
3882
|
+
are_you_sure_to_delete_notification: are_you_sure_to_delete_notification$1,
|
3883
|
+
answer_list: answer_list$1,
|
3884
|
+
are_you_sure_to_delete_question: are_you_sure_to_delete_question$1,
|
3885
|
+
school_name_is_required: school_name_is_required$1,
|
3886
|
+
phone_number_is_not_valid: phone_number_is_not_valid$1,
|
3887
|
+
role_is_required: role_is_required$1,
|
3888
|
+
student_grade_is_required: student_grade_is_required$1,
|
3889
|
+
major_is_required: major_is_required$1,
|
3890
|
+
phone_number_is_required: phone_number_is_required$1,
|
3891
|
+
parent_name_is_required: parent_name_is_required$1,
|
3892
|
+
category_name: category_name$1,
|
3893
|
+
categories: categories$1,
|
3894
|
+
role: role$1,
|
3895
|
+
total_uses: total_uses$1,
|
3896
|
+
articles: articles$1,
|
3897
|
+
add_lesson: add_lesson$1,
|
3898
|
+
the_code_has_been_copied_to_your_clipboard: the_code_has_been_copied_to_your_clipboard$1
|
3536
3899
|
};
|
3537
3900
|
|
3538
3901
|
i18n.use(initReactI18next).init({
|
@@ -3626,12 +3989,12 @@ var TheLanguageDropdown = function TheLanguageDropdown() {
|
|
3626
3989
|
})));
|
3627
3990
|
};
|
3628
3991
|
|
3629
|
-
var useSwitchAcademy = function useSwitchAcademy(role,
|
3992
|
+
var useSwitchAcademy = function useSwitchAcademy(role, history, homeAcademyUrl, homeUrl) {
|
3630
3993
|
if (role === void 0) {
|
3631
3994
|
role = Role.Student;
|
3632
3995
|
}
|
3633
3996
|
var dispatch = useDispatch();
|
3634
|
-
var _useLogin = useLogin(
|
3997
|
+
var _useLogin = useLogin(history, homeAcademyUrl, homeUrl),
|
3635
3998
|
handleLoginAccessToken = _useLogin.handleLoginAccessToken;
|
3636
3999
|
var _useState = useState(false),
|
3637
4000
|
dropdownOpen = _useState[0],
|
@@ -3753,11 +4116,11 @@ var MenuItemCustom = styled(MenuItem)(function () {
|
|
3753
4116
|
var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
|
3754
4117
|
var _user$roles, _selectedAcademy$name, _selectedAcademy$name2;
|
3755
4118
|
var role = _ref.role,
|
3756
|
-
|
4119
|
+
history = _ref.history,
|
3757
4120
|
homeAcademyUrl = _ref.homeAcademyUrl,
|
3758
4121
|
homeUrl = _ref.homeUrl,
|
3759
4122
|
hideAcademyName = _ref.hideAcademyName;
|
3760
|
-
var _useSwitchAcademy = useSwitchAcademy(role,
|
4123
|
+
var _useSwitchAcademy = useSwitchAcademy(role, history, homeAcademyUrl, homeUrl),
|
3761
4124
|
academyList = _useSwitchAcademy.academyList,
|
3762
4125
|
handleSwitchAcademy = _useSwitchAcademy.handleSwitchAcademy,
|
3763
4126
|
selectedAcademy = _useSwitchAcademy.selectedAcademy;
|
@@ -4474,14 +4837,14 @@ var UpdateMessageDialog = function UpdateMessageDialog(_ref) {
|
|
4474
4837
|
return React__default.createElement(Form, null, React__default.createElement("label", {
|
4475
4838
|
htmlFor: "content",
|
4476
4839
|
className: styles$1['form-label'] + " " + styles$1['form-label-dialog']
|
4477
|
-
},
|
4840
|
+
}, t('questions_to_ask')), React__default.createElement(Field, {
|
4478
4841
|
id: "content",
|
4479
4842
|
style: {
|
4480
4843
|
paddingRight: '40px'
|
4481
4844
|
},
|
4482
4845
|
name: "content",
|
4483
4846
|
validate: validate,
|
4484
|
-
placeholder:
|
4847
|
+
placeholder: t('the_problem_is_difficult'),
|
4485
4848
|
className: styles$1['form-control']
|
4486
4849
|
}), React__default.createElement(DialogActions, {
|
4487
4850
|
sx: {
|
@@ -4500,7 +4863,7 @@ var UpdateMessageDialog = function UpdateMessageDialog(_ref) {
|
|
4500
4863
|
fontWeight: 700,
|
4501
4864
|
fontSize: '14px',
|
4502
4865
|
lineHeight: '16.71px'
|
4503
|
-
},
|
4866
|
+
}, t('cancel'))), React__default.createElement(Button, {
|
4504
4867
|
variant: 'contained',
|
4505
4868
|
sx: {
|
4506
4869
|
bgcolor: styles.dark
|
@@ -4512,7 +4875,7 @@ var UpdateMessageDialog = function UpdateMessageDialog(_ref) {
|
|
4512
4875
|
fontSize: '14px',
|
4513
4876
|
lineHeight: '16.71px',
|
4514
4877
|
color: '#FFFFFF'
|
4515
|
-
},
|
4878
|
+
}, t('registration')))));
|
4516
4879
|
}) : React__default.createElement(Box, null, React__default.createElement(Stack, {
|
4517
4880
|
display: "flex",
|
4518
4881
|
flexDirection: "column",
|
@@ -4649,6 +5012,8 @@ var ChatList = function ChatList(_ref) {
|
|
4649
5012
|
handleUpdateMessage = _ref.handleUpdateMessage,
|
4650
5013
|
handleDeleteMessage = _ref.handleDeleteMessage,
|
4651
5014
|
listItemRef = _ref.listItemRef;
|
5015
|
+
var _useTranslation = useTranslation(),
|
5016
|
+
t = _useTranslation.t;
|
4652
5017
|
var filterMessage = useMemo(function () {
|
4653
5018
|
var prevTime = 0;
|
4654
5019
|
var prevSender;
|
@@ -4671,7 +5036,7 @@ var ChatList = function ChatList(_ref) {
|
|
4671
5036
|
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' : '')
|
4672
5037
|
}, !(filterMessage !== null && filterMessage !== void 0 && filterMessage.length) && React__default.createElement("li", {
|
4673
5038
|
className: "text-muted text-center fst-italic fs-6"
|
4674
|
-
},
|
5039
|
+
}, t('no_message')), !!(filterMessage !== null && filterMessage !== void 0 && filterMessage.length) && filterMessage.map(function (message) {
|
4675
5040
|
return React__default.createElement(ChatItem, Object.assign({
|
4676
5041
|
key: message.id
|
4677
5042
|
}, message, {
|
@@ -4791,7 +5156,7 @@ var InputChat = function InputChat(_ref) {
|
|
4791
5156
|
fontSize: "10px",
|
4792
5157
|
lineHeight: "11.93px",
|
4793
5158
|
color: "#97A1AF"
|
4794
|
-
},
|
5159
|
+
}, t('this_is_the_guidance_text'))), React__default.createElement(Box, {
|
4795
5160
|
display: "flex",
|
4796
5161
|
flexDirection: "column",
|
4797
5162
|
justifyContent: "flex-end",
|
@@ -5105,7 +5470,7 @@ var ChatHeader = function ChatHeader(_ref) {
|
|
5105
5470
|
fontSize: "13px",
|
5106
5471
|
lineHeight: "15.51px",
|
5107
5472
|
color: styles.dark
|
5108
|
-
},
|
5473
|
+
}, t('complete_processing')))) : React__default.createElement("div", null));
|
5109
5474
|
};
|
5110
5475
|
return React__default.createElement(Grid, {
|
5111
5476
|
container: true
|
@@ -7842,10 +8207,13 @@ var CustomSelectOption = function CustomSelectOption(_ref) {
|
|
7842
8207
|
var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? options.find(function (option) {
|
7843
8208
|
return option.value === defaultValue;
|
7844
8209
|
}) || null : null;
|
8210
|
+
var optionValue = value !== null && typeof value !== "undefined" ? options.find(function (option) {
|
8211
|
+
return option.value === value;
|
8212
|
+
}) || null : null;
|
7845
8213
|
return React__default.createElement(Select, Object.assign({
|
7846
8214
|
isDisabled: isDisabled,
|
7847
8215
|
options: options,
|
7848
|
-
value:
|
8216
|
+
value: optionValue,
|
7849
8217
|
defaultValue: initialValues,
|
7850
8218
|
menuPlacement: scrollBottom ? "top" : "auto",
|
7851
8219
|
isMulti: isMulti,
|
@@ -7868,7 +8236,6 @@ var SubjectSelector = function SubjectSelector(_ref) {
|
|
7868
8236
|
title = _ref.title,
|
7869
8237
|
isMulti = _ref.isMulti,
|
7870
8238
|
minimumTextSearchLength = _ref.minimumTextSearchLength,
|
7871
|
-
placeholder = _ref.placeholder,
|
7872
8239
|
defaultValueAtFirst = _ref.defaultValueAtFirst,
|
7873
8240
|
isDisabled = _ref.isDisabled;
|
7874
8241
|
var _useState = useState([]),
|
@@ -7954,7 +8321,6 @@ var SubjectSelector = function SubjectSelector(_ref) {
|
|
7954
8321
|
return setSearchString(inputValue);
|
7955
8322
|
},
|
7956
8323
|
isLoading: isLoading,
|
7957
|
-
placeholder: (placeholder != null ? placeholder : minimumTextSearchLength) ? "Type at least " + minimumTextSearchLength + " characters to search" : undefined,
|
7958
8324
|
isMulti: isMulti,
|
7959
8325
|
value: value,
|
7960
8326
|
onChange: handleChange,
|
@@ -8178,12 +8544,16 @@ var useExamDetailView = function useExamDetailView(props) {
|
|
8178
8544
|
var durationOptions = useMemo(function () {
|
8179
8545
|
var options = DURATION_OPTIONS.map(function (i) {
|
8180
8546
|
return {
|
8181
|
-
label:
|
8547
|
+
label: t('mins_mins', {
|
8548
|
+
mins: i
|
8549
|
+
}),
|
8182
8550
|
value: i
|
8183
8551
|
};
|
8184
8552
|
});
|
8185
8553
|
if (!!exam.duration && exam.duration > DURATION_OPTIONS[DURATION_OPTIONS.length - 1]) return [].concat(options, [{
|
8186
|
-
label:
|
8554
|
+
label: t('mins_mins', {
|
8555
|
+
mins: exam.duration
|
8556
|
+
}),
|
8187
8557
|
value: exam.duration
|
8188
8558
|
}]);
|
8189
8559
|
return options;
|
@@ -8313,7 +8683,7 @@ var ExamDetailView = function ExamDetailView(_ref) {
|
|
8313
8683
|
onClick: handleAddArticle
|
8314
8684
|
}, React__default.createElement(FaPlusCircle, {
|
8315
8685
|
className: "me-2"
|
8316
|
-
}),
|
8686
|
+
}), t('add_questions'))));
|
8317
8687
|
};
|
8318
8688
|
|
8319
8689
|
var _excluded$4 = ["isOpen", "onClose", "handleSaveExam"];
|
@@ -8572,18 +8942,28 @@ var useAutoAcademyDomain = function useAutoAcademyDomain(logout, history, superU
|
|
8572
8942
|
var _state$common;
|
8573
8943
|
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
8574
8944
|
});
|
8945
|
+
var language = useSelector(function (state) {
|
8946
|
+
var _state$common2;
|
8947
|
+
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.language;
|
8948
|
+
});
|
8575
8949
|
var initialAcademySearchParam = function initialAcademySearchParam() {
|
8576
8950
|
var paramAcademyDomain = searchParams.get("domain");
|
8951
|
+
var paramLang = searchParams.get("lang");
|
8577
8952
|
var domain = getAcademyDomain();
|
8578
8953
|
var pathname = window.location.pathname.toLowerCase();
|
8954
|
+
var isUpdateSearchParam = false;
|
8955
|
+
if ((!paramLang || paramLang.toLowerCase() !== language) && language) {
|
8956
|
+
searchParams.set("lang", language);
|
8957
|
+
isUpdateSearchParam = true;
|
8958
|
+
}
|
8579
8959
|
if (!!user !== isAuthPage) return;
|
8580
8960
|
var academyDomain = user === null || user === void 0 ? void 0 : user.academyDomain;
|
8581
8961
|
if (!academyDomain) {
|
8582
8962
|
if (!superUrls.some(function (i) {
|
8583
8963
|
return pathname.startsWith(i);
|
8584
8964
|
})) {
|
8585
|
-
!paramAcademyDomain && domain && searchParams.
|
8586
|
-
pushTo({
|
8965
|
+
!paramAcademyDomain && domain && searchParams.set("domain", domain);
|
8966
|
+
pushTo(history, {
|
8587
8967
|
pathname: homeUrl,
|
8588
8968
|
search: searchParams.toString()
|
8589
8969
|
});
|
@@ -8591,16 +8971,17 @@ var useAutoAcademyDomain = function useAutoAcademyDomain(logout, history, superU
|
|
8591
8971
|
}
|
8592
8972
|
if (paramAcademyDomain) {
|
8593
8973
|
searchParams["delete"]("domain");
|
8594
|
-
pushTo(_extends({}, window.location, {
|
8974
|
+
pushTo(history, _extends({}, window.location, {
|
8595
8975
|
search: searchParams.toString()
|
8596
8976
|
}));
|
8977
|
+
return;
|
8597
8978
|
}
|
8598
8979
|
} else {
|
8599
8980
|
if (superUrls.some(function (i) {
|
8600
8981
|
return pathname.startsWith(i);
|
8601
8982
|
})) {
|
8602
8983
|
searchParams["delete"]("domain");
|
8603
|
-
pushTo({
|
8984
|
+
pushTo(history, {
|
8604
8985
|
pathname: homeAcademyUrl,
|
8605
8986
|
search: searchParams.toString()
|
8606
8987
|
});
|
@@ -8611,19 +8992,20 @@ var useAutoAcademyDomain = function useAutoAcademyDomain(logout, history, superU
|
|
8611
8992
|
return;
|
8612
8993
|
}
|
8613
8994
|
if (!paramAcademyDomain) {
|
8614
|
-
!paramAcademyDomain && searchParams.
|
8615
|
-
pushTo(_extends({}, window.location, {
|
8995
|
+
!paramAcademyDomain && searchParams.set("domain", academyDomain);
|
8996
|
+
pushTo(history, _extends({}, window.location, {
|
8616
8997
|
search: searchParams.toString()
|
8617
8998
|
}));
|
8999
|
+
return;
|
8618
9000
|
}
|
8619
9001
|
}
|
8620
|
-
|
8621
|
-
|
8622
|
-
|
9002
|
+
if (isUpdateSearchParam) pushTo(history, _extends({}, window.location, {
|
9003
|
+
search: searchParams.toString()
|
9004
|
+
}));
|
8623
9005
|
};
|
8624
9006
|
useEffect(function () {
|
8625
9007
|
initialAcademySearchParam();
|
8626
|
-
}, [window.location.pathname, user === null || user === void 0 ? void 0 : user.academyDomain,
|
9008
|
+
}, [window.location.pathname, window.location.search, user === null || user === void 0 ? void 0 : user.academyDomain, language]);
|
8627
9009
|
};
|
8628
9010
|
|
8629
9011
|
var DEFAULT_PAGING_RESPONSE = {
|
@@ -9051,6 +9433,8 @@ var CustomCreatable = function CustomCreatable(_ref) {
|
|
9051
9433
|
}) : options.find(function (i) {
|
9052
9434
|
return i.value == value;
|
9053
9435
|
});
|
9436
|
+
var _useTranslation = useTranslation(),
|
9437
|
+
t = _useTranslation.t;
|
9054
9438
|
return React__default.createElement(CreatableSelect, Object.assign({
|
9055
9439
|
isClearable: true,
|
9056
9440
|
isDisabled: isDisabled,
|
@@ -9065,7 +9449,8 @@ var CustomCreatable = function CustomCreatable(_ref) {
|
|
9065
9449
|
DropdownIndicator: DropdownIndicator,
|
9066
9450
|
Option: CustomOption
|
9067
9451
|
},
|
9068
|
-
styles: customStyles
|
9452
|
+
styles: customStyles,
|
9453
|
+
placeholder: t("select_placeholder")
|
9069
9454
|
}, rest));
|
9070
9455
|
};
|
9071
9456
|
|
@@ -9085,6 +9470,8 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
9085
9470
|
}) : options.find(function (i) {
|
9086
9471
|
return i.value == value;
|
9087
9472
|
});
|
9473
|
+
var _useTranslation = useTranslation(),
|
9474
|
+
t = _useTranslation.t;
|
9088
9475
|
return React__default.createElement(Select, Object.assign({
|
9089
9476
|
isDisabled: isDisabled,
|
9090
9477
|
options: options,
|
@@ -9099,7 +9486,8 @@ var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
|
9099
9486
|
DropdownIndicator: DropdownIndicator,
|
9100
9487
|
Option: CustomOption
|
9101
9488
|
},
|
9102
|
-
styles: customStyles
|
9489
|
+
styles: customStyles,
|
9490
|
+
placeholder: t("select_placeholder")
|
9103
9491
|
}, rest));
|
9104
9492
|
};
|
9105
9493
|
|
@@ -9929,7 +10317,7 @@ var defaultSeries = function defaultSeries(t) {
|
|
9929
10317
|
}];
|
9930
10318
|
};
|
9931
10319
|
|
9932
|
-
var useExamResult = function useExamResult(searchParam,
|
10320
|
+
var useExamResult = function useExamResult(searchParam, history, examSessionId, studentId, code, handleChangeTab, selectedTab) {
|
9933
10321
|
var _allSeries$dataChartI;
|
9934
10322
|
if (examSessionId === void 0) {
|
9935
10323
|
examSessionId = 0;
|
@@ -10084,7 +10472,7 @@ var useExamResult = function useExamResult(searchParam, navigate, examSessionId,
|
|
10084
10472
|
}
|
10085
10473
|
};
|
10086
10474
|
var handleExit = function handleExit() {
|
10087
|
-
|
10475
|
+
pushTo(history, "/student/my-story/live-main");
|
10088
10476
|
};
|
10089
10477
|
var totalTime = useMemo(function () {
|
10090
10478
|
var _resultData$questions;
|
@@ -11792,7 +12180,7 @@ function CreateNewQuestionDialog(_ref) {
|
|
11792
12180
|
fontSize: '16px',
|
11793
12181
|
lineHeight: '19.09px',
|
11794
12182
|
color: '#202B37'
|
11795
|
-
},
|
12183
|
+
}, t('ask_a_question'))), React__default.createElement(IconButton$1, {
|
11796
12184
|
"aria-label": "close",
|
11797
12185
|
sx: {
|
11798
12186
|
position: 'absolute',
|
@@ -11829,7 +12217,7 @@ function CreateNewQuestionDialog(_ref) {
|
|
11829
12217
|
}, React__default.createElement(Stack, null, React__default.createElement("label", {
|
11830
12218
|
htmlFor: "questions",
|
11831
12219
|
className: styles['form-label'] + " " + styles$4['form-label-dialog']
|
11832
|
-
},
|
12220
|
+
}, t('questions_to_ask')), React__default.createElement(Field, {
|
11833
12221
|
as: "select",
|
11834
12222
|
id: "questions",
|
11835
12223
|
name: "questionId",
|
@@ -11846,7 +12234,7 @@ function CreateNewQuestionDialog(_ref) {
|
|
11846
12234
|
}))), React__default.createElement(Stack, null, React__default.createElement("label", {
|
11847
12235
|
htmlFor: "content-question",
|
11848
12236
|
className: styles['form-label'] + " " + styles$4['form-label-dialog']
|
11849
|
-
},
|
12237
|
+
}, t('question_content')), React__default.createElement(Box, {
|
11850
12238
|
position: 'relative',
|
11851
12239
|
display: 'flex',
|
11852
12240
|
flexDirection: 'row',
|
@@ -11857,7 +12245,7 @@ function CreateNewQuestionDialog(_ref) {
|
|
11857
12245
|
paddingRight: '40px'
|
11858
12246
|
},
|
11859
12247
|
name: "content",
|
11860
|
-
placeholder:
|
12248
|
+
placeholder: t('the_problem_is_difficult'),
|
11861
12249
|
className: styles['form-control']
|
11862
12250
|
}), (errors === null || errors === void 0 ? void 0 : errors.content) && React__default.createElement(Box, {
|
11863
12251
|
position: 'absolute',
|
@@ -11872,7 +12260,7 @@ function CreateNewQuestionDialog(_ref) {
|
|
11872
12260
|
fontSize: '10px',
|
11873
12261
|
lineHeight: '11.93px',
|
11874
12262
|
color: !(errors !== null && errors !== void 0 && errors.content) ? '#97A1AF' : '#F34B4B'
|
11875
|
-
}, !(errors !== null && errors !== void 0 && errors.content) ? '
|
12263
|
+
}, !(errors !== null && errors !== void 0 && errors.content) ? t('your_questions_will_be_sent_to_the_counselor') : t('please_enter_your_question')))), React__default.createElement(DialogActions$1, {
|
11876
12264
|
sx: {
|
11877
12265
|
display: 'flex',
|
11878
12266
|
justifyContent: 'space-between',
|
@@ -11890,7 +12278,7 @@ function CreateNewQuestionDialog(_ref) {
|
|
11890
12278
|
fontWeight: 700,
|
11891
12279
|
fontSize: '14px',
|
11892
12280
|
lineHeight: '16.71px'
|
11893
|
-
},
|
12281
|
+
}, t('cancel'))), React__default.createElement(Button$1, {
|
11894
12282
|
variant: 'contained',
|
11895
12283
|
sx: {
|
11896
12284
|
bgcolor: styles.dark
|
@@ -11902,7 +12290,7 @@ function CreateNewQuestionDialog(_ref) {
|
|
11902
12290
|
fontSize: '14px',
|
11903
12291
|
lineHeight: '16.71px',
|
11904
12292
|
color: '#FFFFFF'
|
11905
|
-
},
|
12293
|
+
}, t('registration')))));
|
11906
12294
|
})));
|
11907
12295
|
}
|
11908
12296
|
|
@@ -12713,6 +13101,8 @@ function CreateNewQuestionDialog$1(_ref) {
|
|
12713
13101
|
openCreateQuestionDialog = _ref.openCreateQuestionDialog,
|
12714
13102
|
toggleCreateQuestion = _ref.toggleCreateQuestion,
|
12715
13103
|
examSessionId = _ref.examSessionId;
|
13104
|
+
var _useTranslation = useTranslation(),
|
13105
|
+
t = _useTranslation.t;
|
12716
13106
|
return React__default.createElement(Dialog, {
|
12717
13107
|
onClose: toggleCreateQuestion,
|
12718
13108
|
open: openCreateQuestionDialog,
|
@@ -12728,7 +13118,7 @@ function CreateNewQuestionDialog$1(_ref) {
|
|
12728
13118
|
fontSize: '16px',
|
12729
13119
|
lineHeight: '19.09px',
|
12730
13120
|
color: '#202B37'
|
12731
|
-
},
|
13121
|
+
}, t('ask_a_question'))), React__default.createElement(IconButton$1, {
|
12732
13122
|
"aria-label": "close",
|
12733
13123
|
sx: {
|
12734
13124
|
position: 'absolute',
|
@@ -12756,7 +13146,7 @@ function CreateNewQuestionDialog$1(_ref) {
|
|
12756
13146
|
return React__default.createElement(Form, null, React__default.createElement("label", {
|
12757
13147
|
htmlFor: "content-question",
|
12758
13148
|
className: styles['form-label'] + " " + styles$4['form-label-dialog']
|
12759
|
-
},
|
13149
|
+
}, t('question_content')), React__default.createElement(Box, {
|
12760
13150
|
position: 'relative',
|
12761
13151
|
display: 'flex',
|
12762
13152
|
flexDirection: 'row',
|
@@ -12767,7 +13157,7 @@ function CreateNewQuestionDialog$1(_ref) {
|
|
12767
13157
|
paddingRight: '40px'
|
12768
13158
|
},
|
12769
13159
|
name: "content",
|
12770
|
-
placeholder:
|
13160
|
+
placeholder: t('the_problem_is_difficult'),
|
12771
13161
|
className: styles['form-control']
|
12772
13162
|
}), (errors === null || errors === void 0 ? void 0 : errors.content) && React__default.createElement(Box, {
|
12773
13163
|
position: 'absolute',
|
@@ -12782,7 +13172,7 @@ function CreateNewQuestionDialog$1(_ref) {
|
|
12782
13172
|
fontSize: '10px',
|
12783
13173
|
lineHeight: '11.93px',
|
12784
13174
|
color: !(errors !== null && errors !== void 0 && errors.content) ? '#97A1AF' : '#F34B4B'
|
12785
|
-
}, !(errors !== null && errors !== void 0 && errors.content) ? '
|
13175
|
+
}, !(errors !== null && errors !== void 0 && errors.content) ? t('your_questions_will_be_sent_to_the_counselor') : t('please_enter_your_question')), React__default.createElement(DialogActions$1, {
|
12786
13176
|
sx: {
|
12787
13177
|
display: 'flex',
|
12788
13178
|
justifyContent: 'space-between',
|
@@ -12799,7 +13189,7 @@ function CreateNewQuestionDialog$1(_ref) {
|
|
12799
13189
|
fontWeight: 700,
|
12800
13190
|
fontSize: '14px',
|
12801
13191
|
lineHeight: '16.71px'
|
12802
|
-
},
|
13192
|
+
}, t('cancel'))), React__default.createElement(Button$1, {
|
12803
13193
|
variant: 'contained',
|
12804
13194
|
sx: {
|
12805
13195
|
bgcolor: styles.dark
|
@@ -12811,7 +13201,7 @@ function CreateNewQuestionDialog$1(_ref) {
|
|
12811
13201
|
fontSize: '14px',
|
12812
13202
|
lineHeight: '16.71px',
|
12813
13203
|
color: '#FFFFFF'
|
12814
|
-
},
|
13204
|
+
}, t('registration')))));
|
12815
13205
|
})));
|
12816
13206
|
}
|
12817
13207
|
|
@@ -12865,14 +13255,14 @@ var useTab = function useTab() {
|
|
12865
13255
|
|
12866
13256
|
var ExamResultV2 = function ExamResultV2(_ref) {
|
12867
13257
|
var searchParams = _ref.searchParams,
|
12868
|
-
|
13258
|
+
history = _ref.history,
|
12869
13259
|
examSessionId = _ref.examSessionId,
|
12870
13260
|
studentId = _ref.studentId,
|
12871
13261
|
code = _ref.code;
|
12872
13262
|
var _useTab = useTab(),
|
12873
13263
|
selected = _useTab.selected,
|
12874
13264
|
handleChangeTab = _useTab.handleChangeTab;
|
12875
|
-
var _useExamResult = useExamResult(searchParams,
|
13265
|
+
var _useExamResult = useExamResult(searchParams, history, examSessionId, studentId, code, handleChangeTab, selected),
|
12876
13266
|
examTime = _useExamResult.examTime,
|
12877
13267
|
series = _useExamResult.series,
|
12878
13268
|
allSeries = _useExamResult.allSeries,
|
@@ -13380,7 +13770,7 @@ var signInSuperAdminApi = function signInSuperAdminApi(_ref2) {
|
|
13380
13770
|
};
|
13381
13771
|
|
13382
13772
|
var useLogin$2 = function useLogin(_ref) {
|
13383
|
-
var
|
13773
|
+
var history = _ref.history,
|
13384
13774
|
_ref$role = _ref.role,
|
13385
13775
|
role = _ref$role === void 0 ? Role.Student : _ref$role,
|
13386
13776
|
homeAcademyUrl = _ref.homeAcademyUrl,
|
@@ -13400,7 +13790,7 @@ var useLogin$2 = function useLogin(_ref) {
|
|
13400
13790
|
var academyDomain = paramDomain || getAcademyDomain();
|
13401
13791
|
var handleClearAcademyDomain = function handleClearAcademyDomain() {
|
13402
13792
|
localStorage.removeItem(ACADEMY_DOMAIN);
|
13403
|
-
|
13793
|
+
pushTo(history, "/login-with-account");
|
13404
13794
|
};
|
13405
13795
|
var handleValidateForm = function handleValidateForm(_ref2) {
|
13406
13796
|
var email = _ref2.email,
|
@@ -13465,13 +13855,11 @@ var useLogin$2 = function useLogin(_ref) {
|
|
13465
13855
|
!data.academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
13466
13856
|
!!data.academyDomain && localStorage.setItem(ACADEMY_DOMAIN, data.academyDomain);
|
13467
13857
|
dispatch(setUser(_extends({}, data)));
|
13468
|
-
if (redirectUrl)
|
13469
|
-
onNavigate(redirectUrl);
|
13470
|
-
}
|
13858
|
+
if (redirectUrl) pushTo(history, redirectUrl);
|
13471
13859
|
};
|
13472
13860
|
useEffect(function () {
|
13473
13861
|
var token = getAccessToken$1();
|
13474
|
-
if (!!token)
|
13862
|
+
if (!!token) pushTo(history, "/");
|
13475
13863
|
}, []);
|
13476
13864
|
return {
|
13477
13865
|
handleSubmit: handleSubmit,
|
@@ -13483,7 +13871,7 @@ var useLogin$2 = function useLogin(_ref) {
|
|
13483
13871
|
};
|
13484
13872
|
|
13485
13873
|
function SignIn(_ref) {
|
13486
|
-
var
|
13874
|
+
var history = _ref.history,
|
13487
13875
|
role = _ref.role,
|
13488
13876
|
homeAcademyUrl = _ref.homeAcademyUrl,
|
13489
13877
|
homeUrl = _ref.homeUrl,
|
@@ -13492,7 +13880,7 @@ function SignIn(_ref) {
|
|
13492
13880
|
var _useTranslation = useTranslation(),
|
13493
13881
|
t = _useTranslation.t;
|
13494
13882
|
var _useLoginWithPassword = useLogin$2({
|
13495
|
-
|
13883
|
+
history: history,
|
13496
13884
|
role: role,
|
13497
13885
|
homeAcademyUrl: homeAcademyUrl,
|
13498
13886
|
homeUrl: homeUrl,
|
@@ -13597,7 +13985,7 @@ var studentFullLogoEn = function studentFullLogoEn(_ref) {
|
|
13597
13985
|
fill: "none",
|
13598
13986
|
xmlns: "http://www.w3.org/2000/svg"
|
13599
13987
|
}, React__default.createElement("g", {
|
13600
|
-
|
13988
|
+
clipPath: "url(#clip0_3233_11779)"
|
13601
13989
|
}, React__default.createElement("path", {
|
13602
13990
|
d: "M9.24216 15.5417C9.24216 16.4045 9.73435 16.87 11.5816 17.5104C16.6013 19.2835 16.972 20.9321 16.972 24.4278V26.0764C16.972 29.5721 13.9684 30.8263 10.4489 30.8263C6.92944 30.8263 4 29.5721 4 26.0764V23.1973H9.29256V25.2165C9.29256 25.9785 9.83516 26.3729 10.5468 26.3729C11.2584 26.3729 11.8039 25.9785 11.8039 25.2165V24.6028C11.8039 21.9698 11.4096 21.7237 7.51948 20.173C4.69085 19.0374 4.07413 17.1902 4.07413 15.7136V13.3505C4.07413 9.85772 6.97985 8.60352 10.4964 8.60352C14.0129 8.60352 16.9216 9.85772 16.9216 13.3535V15.3964H11.7535V14.1896C11.7535 13.4513 11.2376 13.057 10.523 13.057C9.76103 13.057 9.24216 13.3535 9.24216 14.1392V15.5417Z",
|
13603
13991
|
fill: "#2BBA84"
|
@@ -13659,7 +14047,7 @@ var studentFullLogoKo = function studentFullLogoKo(_ref) {
|
|
13659
14047
|
fill: "none",
|
13660
14048
|
xmlns: "http://www.w3.org/2000/svg"
|
13661
14049
|
}, React__default.createElement("g", {
|
13662
|
-
|
14050
|
+
clipPath: "url(#clip0_3233_7642)"
|
13663
14051
|
}, React__default.createElement("path", {
|
13664
14052
|
d: "M0 24.4625H20.5166V30.0272H0V24.4625ZM0.282173 21.434L5.84688 6.177H12.0777L11.4116 7.97175H16.7729C18.8498 7.97175 19.8505 9.0217 19.8505 11.0494V21.4373H13.6952V13.2805H9.48888L6.53919 21.4373H0.282173V21.434Z",
|
13665
14053
|
fill: "#2BBA84"
|
@@ -13712,7 +14100,7 @@ var teacherFullLogoKo = function teacherFullLogoKo(_ref) {
|
|
13712
14100
|
fill: "none",
|
13713
14101
|
xmlns: "http://www.w3.org/2000/svg"
|
13714
14102
|
}, React__default.createElement("g", {
|
13715
|
-
|
14103
|
+
clipPath: "url(#clip0_3233_7868)"
|
13716
14104
|
}, React__default.createElement("path", {
|
13717
14105
|
d: "M0 38.9726H20.5175V44.5391H0V38.9726ZM0.284008 35.9458L5.85056 20.6865H12.0825L11.4171 22.4798H16.7767C18.8541 22.4798 19.8521 23.5307 19.8521 25.5552V35.9418H13.6973V27.7867H9.48991L6.54029 35.9418H0.284008V35.9458Z",
|
13718
14106
|
fill: "#2BBA84"
|
@@ -13877,32 +14265,32 @@ var singleLogo = function singleLogo(_ref) {
|
|
13877
14265
|
}, React__default.createElement("defs", null, React__default.createElement("clipPath", {
|
13878
14266
|
id: "1"
|
13879
14267
|
}, React__default.createElement("path", {
|
13880
|
-
|
14268
|
+
clipRule: "evenodd",
|
13881
14269
|
d: "M0 0L207 0L207 418L0 418z"
|
13882
14270
|
}))), React__default.createElement("g", {
|
13883
14271
|
transform: "matrix(0.119617224 0 0 0.119617224 0.119617224 -0)"
|
13884
14272
|
}, React__default.createElement("g", {
|
13885
|
-
|
14273
|
+
clipPath: "url(#1)"
|
13886
14274
|
}, React__default.createElement("path", {
|
13887
14275
|
d: "M9.66724 418C 136.043 342.286 179.498 275.873 207.032 138.127L207.032 138.127L207.032 344.635C 207.032 385.143 171.107 418 126.791 418L126.791 418L9.66724 418z",
|
13888
14276
|
stroke: "none",
|
13889
14277
|
fill: "#2BBA84",
|
13890
|
-
|
14278
|
+
fillRule: "nonzero"
|
13891
14279
|
}), React__default.createElement("path", {
|
13892
14280
|
d: "M101.171 163.206L19.845 83.1111L19.845 188.064L101.171 286.159C 148.167 225.175 177.424 148.413 182.497 80.5714L182.497 80.5714L101.171 163.175L101.171 163.206z",
|
13893
14281
|
stroke: "none",
|
13894
14282
|
fill: "#2BBA84",
|
13895
|
-
|
14283
|
+
fillRule: "nonzero"
|
13896
14284
|
}), React__default.createElement("path", {
|
13897
14285
|
d: "M101.171 0L54.1428 68.0317L101.171 112.952L148.167 65.4921L101.171 0z",
|
13898
14286
|
stroke: "none",
|
13899
14287
|
fill: "#2BBA84",
|
13900
|
-
|
14288
|
+
fillRule: "nonzero"
|
13901
14289
|
}), React__default.createElement("path", {
|
13902
14290
|
d: "M0 222.762L80.6879 319.587C 80.6879 319.587 65.2458 342.54 0 376.952L0 376.952L0 222.762z",
|
13903
14291
|
stroke: "none",
|
13904
14292
|
fill: "#2BBA84",
|
13905
|
-
|
14293
|
+
fillRule: "nonzero"
|
13906
14294
|
}))));
|
13907
14295
|
};
|
13908
14296
|
|
@@ -13912,7 +14300,7 @@ var Header = function Header(_ref) {
|
|
13912
14300
|
homeRoute = _ref.homeRoute,
|
13913
14301
|
headerTabs = _ref.headerTabs,
|
13914
14302
|
role = _ref.role,
|
13915
|
-
|
14303
|
+
history = _ref.history,
|
13916
14304
|
onSignOut = _ref.onSignOut;
|
13917
14305
|
var _useTranslation = useTranslation(),
|
13918
14306
|
t = _useTranslation.t;
|
@@ -13998,7 +14386,7 @@ var Header = function Header(_ref) {
|
|
13998
14386
|
homeAcademyUrl: academyListRoute.path,
|
13999
14387
|
homeUrl: homeRoute.path,
|
14000
14388
|
role: role,
|
14001
|
-
|
14389
|
+
history: history,
|
14002
14390
|
hideAcademyName: !isLargerThanXL && headerTabs.length > 6
|
14003
14391
|
})), React__default.createElement("div", {
|
14004
14392
|
className: "me-2"
|
@@ -14016,5 +14404,155 @@ var Header = function Header(_ref) {
|
|
14016
14404
|
}))));
|
14017
14405
|
};
|
14018
14406
|
|
14019
|
-
|
14407
|
+
var ACADEMY_URL$1 = BASE_URL + "/api/academy";
|
14408
|
+
var getAcademyList$1 = function getAcademyList() {
|
14409
|
+
return api.get("" + ACADEMY_URL$1);
|
14410
|
+
};
|
14411
|
+
var switchAcademy$1 = function switchAcademy(academyId) {
|
14412
|
+
return api.post(ACADEMY_URL$1 + "/switch-academy?academyId=" + academyId);
|
14413
|
+
};
|
14414
|
+
|
14415
|
+
var useAcademyList = function useAcademyList(history, role, homeAcademyUrl, homeUrl, registerUrl) {
|
14416
|
+
var dispatch = useDispatch();
|
14417
|
+
var _useLogin = useLogin(history, homeAcademyUrl, homeUrl, registerUrl),
|
14418
|
+
handleLoginAccessToken = _useLogin.handleLoginAccessToken;
|
14419
|
+
var _useState = useState([]),
|
14420
|
+
academyList = _useState[0],
|
14421
|
+
setAcademyList = _useState[1];
|
14422
|
+
var email = useSelector(function (state) {
|
14423
|
+
var _state$common, _state$common$user;
|
14424
|
+
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.email;
|
14425
|
+
});
|
14426
|
+
var getAcademies = function getAcademies() {
|
14427
|
+
try {
|
14428
|
+
var _temp2 = function _temp2() {
|
14429
|
+
dispatch(setLoading(false));
|
14430
|
+
};
|
14431
|
+
dispatch(setLoading(true));
|
14432
|
+
var _temp = _catch(function () {
|
14433
|
+
return Promise.resolve(getAcademyList$1()).then(function (res) {
|
14434
|
+
setAcademyList(res.data.items || []);
|
14435
|
+
});
|
14436
|
+
}, function (error) {
|
14437
|
+
var _error$response, _error$response$data;
|
14438
|
+
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.tile) || "Get user academies failed");
|
14439
|
+
});
|
14440
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
14441
|
+
} catch (e) {
|
14442
|
+
return Promise.reject(e);
|
14443
|
+
}
|
14444
|
+
};
|
14445
|
+
var handleSwitchAcademy = function handleSwitchAcademy(id, domain) {
|
14446
|
+
try {
|
14447
|
+
var _temp4 = function _temp4() {
|
14448
|
+
dispatch(setLoading(false));
|
14449
|
+
};
|
14450
|
+
dispatch(setLoading(true));
|
14451
|
+
var _temp3 = _catch(function () {
|
14452
|
+
return Promise.resolve(switchAcademy$1(id)).then(function (res) {
|
14453
|
+
var data = res.data;
|
14454
|
+
var requestBody = {
|
14455
|
+
accessToken: data.accessToken,
|
14456
|
+
email: email,
|
14457
|
+
academyId: id,
|
14458
|
+
role: role
|
14459
|
+
};
|
14460
|
+
localStorage.setItem(ACADEMY_DOMAIN, domain);
|
14461
|
+
return Promise.resolve(handleLoginAccessToken(requestBody, false)).then(function () {});
|
14462
|
+
});
|
14463
|
+
}, function (error) {
|
14464
|
+
var _error$response2, _error$response2$data;
|
14465
|
+
toast.error((error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.tile) || "Failed");
|
14466
|
+
});
|
14467
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
|
14468
|
+
} catch (e) {
|
14469
|
+
return Promise.reject(e);
|
14470
|
+
}
|
14471
|
+
};
|
14472
|
+
useEffect(function () {
|
14473
|
+
getAcademies();
|
14474
|
+
}, []);
|
14475
|
+
return {
|
14476
|
+
academyList: academyList,
|
14477
|
+
handleSwitchAcademy: handleSwitchAcademy
|
14478
|
+
};
|
14479
|
+
};
|
14480
|
+
|
14481
|
+
var AcademyCard = function AcademyCard(_ref) {
|
14482
|
+
var theme = _ref.theme,
|
14483
|
+
academy = _ref.academy,
|
14484
|
+
onSwitch = _ref.onSwitch;
|
14485
|
+
var _useTranslation = useTranslation(),
|
14486
|
+
t = _useTranslation.t;
|
14487
|
+
var handleSwitchAcademy = function handleSwitchAcademy() {
|
14488
|
+
onSwitch(academy.id, academy.domain);
|
14489
|
+
};
|
14490
|
+
return createElement(Card$1, null, createElement(CardMedia, {
|
14491
|
+
sx: {
|
14492
|
+
width: "100%",
|
14493
|
+
aspectRatio: 4 / 3
|
14494
|
+
},
|
14495
|
+
image: academy.image || "/images/default.jpg",
|
14496
|
+
title: academy.name
|
14497
|
+
}), createElement(CardContent, null, createElement(Typography$1, {
|
14498
|
+
variant: "h6",
|
14499
|
+
component: "div"
|
14500
|
+
}, academy.name)), createElement(CardActions, null, createElement(Button$1, {
|
14501
|
+
sx: {
|
14502
|
+
bgColor: theme.palette.main_theme.dark
|
14503
|
+
},
|
14504
|
+
size: "medium",
|
14505
|
+
variant: "contained",
|
14506
|
+
onClick: handleSwitchAcademy
|
14507
|
+
}, t("switch"))));
|
14508
|
+
};
|
14509
|
+
|
14510
|
+
var AcademyList = function AcademyList(_ref) {
|
14511
|
+
var theme = _ref.theme,
|
14512
|
+
history = _ref.history,
|
14513
|
+
role = _ref.role,
|
14514
|
+
homeAcademyUrl = _ref.homeAcademyUrl,
|
14515
|
+
homeUrl = _ref.homeUrl,
|
14516
|
+
registerUrl = _ref.registerUrl;
|
14517
|
+
var _useTranslation = useTranslation(),
|
14518
|
+
t = _useTranslation.t;
|
14519
|
+
useAutoAcademyDomain(function () {}, history, [], "", window.location.pathname, true);
|
14520
|
+
var _useAcademyList = useAcademyList(history, role, homeAcademyUrl, homeUrl, registerUrl),
|
14521
|
+
academyList = _useAcademyList.academyList,
|
14522
|
+
handleSwitchAcademy = _useAcademyList.handleSwitchAcademy;
|
14523
|
+
return React__default.createElement("div", {
|
14524
|
+
className: "py-3 px-4"
|
14525
|
+
}, React__default.createElement(Grid$1, {
|
14526
|
+
container: true,
|
14527
|
+
spacing: 3
|
14528
|
+
}, React__default.createElement(Grid$1, {
|
14529
|
+
item: true,
|
14530
|
+
xs: 12
|
14531
|
+
}, React__default.createElement(Typography$1, {
|
14532
|
+
fontSize: 24,
|
14533
|
+
fontWeight: 600
|
14534
|
+
}, t("academy_list"))), React__default.createElement(Grid$1, {
|
14535
|
+
item: true,
|
14536
|
+
xs: 12
|
14537
|
+
}, React__default.createElement(Grid$1, {
|
14538
|
+
container: true,
|
14539
|
+
spacing: 2
|
14540
|
+
}, academyList.map(function (i) {
|
14541
|
+
return React__default.createElement(Grid$1, {
|
14542
|
+
item: true,
|
14543
|
+
xs: 6,
|
14544
|
+
lg: 3,
|
14545
|
+
key: i.id
|
14546
|
+
}, React__default.createElement(AcademyCard, {
|
14547
|
+
theme: theme,
|
14548
|
+
academy: i,
|
14549
|
+
onSwitch: handleSwitchAcademy
|
14550
|
+
}));
|
14551
|
+
}), !academyList.length && React__default.createElement(Grid$1, {
|
14552
|
+
item: true,
|
14553
|
+
xs: 3
|
14554
|
+
}, React__default.createElement("span", null, t("no_academy_available"), "."))))));
|
14555
|
+
};
|
14556
|
+
|
14557
|
+
export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AnswerCountSelector, ArticleCategorySelector, ArticleGroupView, BASE_URL, ChatContainer, ChatItemType, types as ChatTypes, CommonDialog, ConfirmDialog, index$1 as CoreHooks, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_PAGING_RESPONSE, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, index as Enums, ExamDetailView, ExamEvent, ExamResultV2, Header, InputText, LANGUAGES, LayoutContext, Loading, Login, SignIn as LoginWithPassword, 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 };
|
14020
14558
|
//# sourceMappingURL=index.modern.js.map
|