touchstudy-core 0.1.120 → 0.1.122
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/CkEditor/CkEditor.d.ts +11 -2
- package/dist/components/MathJax/MathJaxContainer.d.ts +6 -0
- package/dist/components/MathJax/index.d.ts +2 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/containers/ExamResult/configs/types.d.ts +3 -0
- package/dist/containers/PreparedTextbook/configs/constants.d.ts +3 -1
- package/dist/index.css +3 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2183 -2006
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +2189 -2023
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/enums/examStatus.d.ts +5 -0
- package/dist/utils/enums/index.d.ts +2 -2
- package/dist/utils/types/examResults.d.ts +2 -0
- package/dist/utils/types/exams.d.ts +3 -0
- package/package.json +2 -1
package/dist/index.js
CHANGED
@@ -5,26 +5,27 @@ var toolkit = require('@reduxjs/toolkit');
|
|
5
5
|
var i18n = require('i18next');
|
6
6
|
var i18n__default = _interopDefault(i18n);
|
7
7
|
var reactI18next = require('react-i18next');
|
8
|
-
var
|
9
|
-
var moment = _interopDefault(require('moment'));
|
10
|
-
var _ = _interopDefault(require('lodash'));
|
11
|
-
var reactRedux = require('react-redux');
|
12
|
-
var React = require('react');
|
13
|
-
var React__default = _interopDefault(React);
|
14
|
-
var GoogleLogin = require('@leecheuk/react-google-login');
|
15
|
-
var GoogleLogin__default = _interopDefault(GoogleLogin);
|
16
|
-
require('moment/locale/ko.js');
|
17
|
-
require('moment/locale/en-au.js');
|
8
|
+
var betterReactMathjax = require('better-react-mathjax');
|
18
9
|
var xDatePickers = require('@mui/x-date-pickers');
|
19
10
|
var AdapterMoment = require('@mui/x-date-pickers/AdapterMoment');
|
20
11
|
var demo = require('@mui/x-date-pickers/internals/demo');
|
12
|
+
var React = require('react');
|
13
|
+
var React__default = _interopDefault(React);
|
21
14
|
var material = require('@mui/material');
|
15
|
+
var reactRedux = require('react-redux');
|
16
|
+
var moment = _interopDefault(require('moment'));
|
17
|
+
require('moment/locale/ko.js');
|
18
|
+
require('moment/locale/en-au.js');
|
19
|
+
var _ = _interopDefault(require('lodash'));
|
22
20
|
var fa = require('react-icons/fa');
|
23
21
|
var io = require('react-icons/io');
|
24
22
|
var io5 = require('react-icons/io5');
|
25
23
|
var Select = require('react-select');
|
26
24
|
var Select__default = _interopDefault(Select);
|
27
25
|
var CreatableSelect = _interopDefault(require('react-select/creatable'));
|
26
|
+
var axios = _interopDefault(require('axios'));
|
27
|
+
var GoogleLogin = require('@leecheuk/react-google-login');
|
28
|
+
var GoogleLogin__default = _interopDefault(GoogleLogin);
|
28
29
|
var formik = require('formik');
|
29
30
|
var ckeditor4React = require('ckeditor4-react');
|
30
31
|
var reactVirtualized = require('react-virtualized');
|
@@ -1371,6 +1372,12 @@ var today_schedule = "오늘 스케줄";
|
|
1371
1372
|
var schedule_achieved = "달성한 스케줄";
|
1372
1373
|
var i_dont_have_my_phone_number_yet = "휴대폰 번호가 없어요";
|
1373
1374
|
var duplicate_passcode_for_siblings_please_contact_admin_for_assistance = "형제자매의 중복된 비밀번호. 도움이 필요하면 관리자에게 문의하세요";
|
1375
|
+
var textual_answer = "문자 답변";
|
1376
|
+
var question_answer_type = "질문 답변 유형";
|
1377
|
+
var choiceoption = "선택 옵션";
|
1378
|
+
var textual = "텍스트";
|
1379
|
+
var import_student_exam_short_answer_results = "학생 시험 짧은 답변 결과 가져오기";
|
1380
|
+
var file = "파일";
|
1374
1381
|
var lang_ko = {
|
1375
1382
|
problem_solving: problem_solving,
|
1376
1383
|
my_story: my_story,
|
@@ -2385,7 +2392,13 @@ var lang_ko = {
|
|
2385
2392
|
today_schedule: today_schedule,
|
2386
2393
|
schedule_achieved: schedule_achieved,
|
2387
2394
|
i_dont_have_my_phone_number_yet: i_dont_have_my_phone_number_yet,
|
2388
|
-
duplicate_passcode_for_siblings_please_contact_admin_for_assistance: duplicate_passcode_for_siblings_please_contact_admin_for_assistance
|
2395
|
+
duplicate_passcode_for_siblings_please_contact_admin_for_assistance: duplicate_passcode_for_siblings_please_contact_admin_for_assistance,
|
2396
|
+
textual_answer: textual_answer,
|
2397
|
+
question_answer_type: question_answer_type,
|
2398
|
+
choiceoption: choiceoption,
|
2399
|
+
textual: textual,
|
2400
|
+
import_student_exam_short_answer_results: import_student_exam_short_answer_results,
|
2401
|
+
file: file
|
2389
2402
|
};
|
2390
2403
|
|
2391
2404
|
var problem_solving$1 = "Problem Solving";
|
@@ -3419,6 +3432,12 @@ var today_schedule$1 = "Today's schedule";
|
|
3419
3432
|
var schedule_achieved$1 = "Schedule achieved";
|
3420
3433
|
var i_dont_have_my_phone_number_yet$1 = "I don't have my phone number yet";
|
3421
3434
|
var duplicate_passcode_for_siblings_please_contact_admin_for_assistance$1 = "Duplicate passcode for siblings. Please contact admin for assistance";
|
3435
|
+
var textual_answer$1 = "Textual answer";
|
3436
|
+
var question_answer_type$1 = "Question Answer Type";
|
3437
|
+
var choiceoption$1 = "Choice Option";
|
3438
|
+
var textual$1 = "Textual";
|
3439
|
+
var import_student_exam_short_answer_results$1 = "Import Student Exam Short Answer Results";
|
3440
|
+
var file$1 = "File";
|
3422
3441
|
var lang_en = {
|
3423
3442
|
problem_solving: problem_solving$1,
|
3424
3443
|
my_story: my_story$1,
|
@@ -4435,7 +4454,13 @@ var lang_en = {
|
|
4435
4454
|
today_schedule: today_schedule$1,
|
4436
4455
|
schedule_achieved: schedule_achieved$1,
|
4437
4456
|
i_dont_have_my_phone_number_yet: i_dont_have_my_phone_number_yet$1,
|
4438
|
-
duplicate_passcode_for_siblings_please_contact_admin_for_assistance: duplicate_passcode_for_siblings_please_contact_admin_for_assistance$1
|
4457
|
+
duplicate_passcode_for_siblings_please_contact_admin_for_assistance: duplicate_passcode_for_siblings_please_contact_admin_for_assistance$1,
|
4458
|
+
textual_answer: textual_answer$1,
|
4459
|
+
question_answer_type: question_answer_type$1,
|
4460
|
+
choiceoption: choiceoption$1,
|
4461
|
+
textual: textual$1,
|
4462
|
+
import_student_exam_short_answer_results: import_student_exam_short_answer_results$1,
|
4463
|
+
file: file$1
|
4439
4464
|
};
|
4440
4465
|
|
4441
4466
|
i18n__default.use(reactI18next.initReactI18next).init({
|
@@ -4454,6 +4479,103 @@ i18n__default.use(reactI18next.initReactI18next).init({
|
|
4454
4479
|
}
|
4455
4480
|
});
|
4456
4481
|
|
4482
|
+
function _extends() {
|
4483
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
4484
|
+
for (var i = 1; i < arguments.length; i++) {
|
4485
|
+
var source = arguments[i];
|
4486
|
+
for (var key in source) {
|
4487
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
4488
|
+
target[key] = source[key];
|
4489
|
+
}
|
4490
|
+
}
|
4491
|
+
}
|
4492
|
+
return target;
|
4493
|
+
};
|
4494
|
+
return _extends.apply(this, arguments);
|
4495
|
+
}
|
4496
|
+
function _objectDestructuringEmpty(obj) {
|
4497
|
+
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
4498
|
+
}
|
4499
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
4500
|
+
if (source == null) return {};
|
4501
|
+
var target = {};
|
4502
|
+
for (var key in source) {
|
4503
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
4504
|
+
if (excluded.indexOf(key) >= 0) continue;
|
4505
|
+
target[key] = source[key];
|
4506
|
+
}
|
4507
|
+
}
|
4508
|
+
return target;
|
4509
|
+
}
|
4510
|
+
function _taggedTemplateLiteralLoose(strings, raw) {
|
4511
|
+
if (!raw) {
|
4512
|
+
raw = strings.slice(0);
|
4513
|
+
}
|
4514
|
+
strings.raw = raw;
|
4515
|
+
return strings;
|
4516
|
+
}
|
4517
|
+
|
4518
|
+
var LANGUAGES = [{
|
4519
|
+
code: "ko",
|
4520
|
+
fullName: "Korean",
|
4521
|
+
shortName: "Korean",
|
4522
|
+
nativeName: "Korean",
|
4523
|
+
name: "Korean",
|
4524
|
+
image: "/images/korea.png",
|
4525
|
+
momentLangCode: "ko"
|
4526
|
+
}, {
|
4527
|
+
code: "en",
|
4528
|
+
fullName: "English",
|
4529
|
+
shortName: "English",
|
4530
|
+
nativeName: "English",
|
4531
|
+
name: "English",
|
4532
|
+
image: "/images/usa.png",
|
4533
|
+
momentLangCode: "en-au"
|
4534
|
+
}];
|
4535
|
+
var DEFAULT_LANGUAGE = LANGUAGES[0];
|
4536
|
+
var LOGIN_URL = "/login";
|
4537
|
+
|
4538
|
+
var pushTo = function pushTo(history, data, isReplace) {
|
4539
|
+
if (isReplace === void 0) {
|
4540
|
+
isReplace = false;
|
4541
|
+
}
|
4542
|
+
if (history.push && !isReplace || history.replace && isReplace) {
|
4543
|
+
!isReplace && history.push(data);
|
4544
|
+
isReplace && history.replace(data);
|
4545
|
+
} else history(data, {
|
4546
|
+
replace: isReplace
|
4547
|
+
});
|
4548
|
+
};
|
4549
|
+
|
4550
|
+
var canAccess = function canAccess(userRoles, componentRoles) {
|
4551
|
+
if (!Array.isArray(userRoles)) {
|
4552
|
+
return false;
|
4553
|
+
}
|
4554
|
+
if (Array.isArray(componentRoles)) {
|
4555
|
+
var intersects = userRoles.filter(function (i) {
|
4556
|
+
return componentRoles.includes(i);
|
4557
|
+
});
|
4558
|
+
return intersects.length > 0;
|
4559
|
+
}
|
4560
|
+
return true;
|
4561
|
+
};
|
4562
|
+
|
4563
|
+
var checkSuperUrl = function checkSuperUrl(superUrls, pathname) {
|
4564
|
+
return superUrls.some(function (i) {
|
4565
|
+
if (i.includes(":")) {
|
4566
|
+
var urls = i.split("/");
|
4567
|
+
var names = pathname.split("/");
|
4568
|
+
if (urls.length != names.length) return false;
|
4569
|
+
var isMatches = true;
|
4570
|
+
urls.forEach(function (u, index) {
|
4571
|
+
if (u != names[index] && !u.startsWith(":")) isMatches = false;
|
4572
|
+
});
|
4573
|
+
return isMatches;
|
4574
|
+
}
|
4575
|
+
return pathname.startsWith(i);
|
4576
|
+
});
|
4577
|
+
};
|
4578
|
+
|
4457
4579
|
var GOOGLE_RECAPTCHA_KEY = process.env.REACT_APP_GOOGLE_RECAPTCHA_KEY || "";
|
4458
4580
|
var GOOGLE_CLIENT_ID = process.env.REACT_APP_GOOGLE_CLIENT_ID || "";
|
4459
4581
|
var GOOGLE_RECAPTCHA_ID = process.env.REACT_APP_GOOGLE_RECAPTCHA_ID || "";
|
@@ -4523,80 +4645,6 @@ var DEFAULT_PAGING_RESPONSE = {
|
|
4523
4645
|
totalPages: 0
|
4524
4646
|
};
|
4525
4647
|
|
4526
|
-
(function (PreparedType) {
|
4527
|
-
PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
|
4528
|
-
PreparedType[PreparedType["official_mock_exam"] = 2] = "official_mock_exam";
|
4529
|
-
PreparedType[PreparedType["private_mock_exam"] = 3] = "private_mock_exam";
|
4530
|
-
})(exports.PreparedType || (exports.PreparedType = {}));
|
4531
|
-
|
4532
|
-
(function (ExamEvent) {
|
4533
|
-
ExamEvent["StartExam"] = "start-exam";
|
4534
|
-
ExamEvent["TerminateExam"] = "terminate-exam";
|
4535
|
-
ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
|
4536
|
-
ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
|
4537
|
-
})(exports.ExamEvent || (exports.ExamEvent = {}));
|
4538
|
-
|
4539
|
-
(function (ExamStatus) {
|
4540
|
-
ExamStatus[ExamStatus["Default"] = 0] = "Default";
|
4541
|
-
ExamStatus[ExamStatus["Pending"] = 1] = "Pending";
|
4542
|
-
ExamStatus[ExamStatus["InProgress"] = 2] = "InProgress";
|
4543
|
-
ExamStatus[ExamStatus["Completed"] = 3] = "Completed";
|
4544
|
-
})(exports.ExamStatus || (exports.ExamStatus = {}));
|
4545
|
-
|
4546
|
-
(function (OrderType) {
|
4547
|
-
OrderType["ASC"] = "ASC";
|
4548
|
-
OrderType["DESC"] = "DESC";
|
4549
|
-
})(exports.OrderType || (exports.OrderType = {}));
|
4550
|
-
|
4551
|
-
(function (RecentUserAction) {
|
4552
|
-
RecentUserAction["ViewedUser"] = "ViewedUser";
|
4553
|
-
RecentUserAction["ViewedQNA"] = "ViewedQNA";
|
4554
|
-
RecentUserAction["ViewedExamResult"] = "ViewedExamResult";
|
4555
|
-
RecentUserAction["PrintedExamResult"] = "PrintedExamResult";
|
4556
|
-
RecentUserAction["ViewedAttendance"] = "ViewedAttendance";
|
4557
|
-
})(exports.RecentUserAction || (exports.RecentUserAction = {}));
|
4558
|
-
|
4559
|
-
(function (UserSortColumn) {
|
4560
|
-
UserSortColumn["CreatedAt"] = "CreatedAt";
|
4561
|
-
UserSortColumn["FullName"] = "FullName";
|
4562
|
-
UserSortColumn["PhoneNumber"] = "PhoneNumber";
|
4563
|
-
UserSortColumn["Email"] = "Email";
|
4564
|
-
UserSortColumn["SchoolName"] = "SchoolName";
|
4565
|
-
UserSortColumn["Major"] = "Major";
|
4566
|
-
UserSortColumn["ParentName"] = "ParentName";
|
4567
|
-
UserSortColumn["ParentPhoneNumber"] = "ParentPhoneNumber";
|
4568
|
-
UserSortColumn["Grade"] = "Grade";
|
4569
|
-
})(exports.UserSortColumn || (exports.UserSortColumn = {}));
|
4570
|
-
|
4571
|
-
var canAccess = function canAccess(userRoles, componentRoles) {
|
4572
|
-
if (!Array.isArray(userRoles)) {
|
4573
|
-
return false;
|
4574
|
-
}
|
4575
|
-
if (Array.isArray(componentRoles)) {
|
4576
|
-
var intersects = userRoles.filter(function (i) {
|
4577
|
-
return componentRoles.includes(i);
|
4578
|
-
});
|
4579
|
-
return intersects.length > 0;
|
4580
|
-
}
|
4581
|
-
return true;
|
4582
|
-
};
|
4583
|
-
|
4584
|
-
var checkSuperUrl = function checkSuperUrl(superUrls, pathname) {
|
4585
|
-
return superUrls.some(function (i) {
|
4586
|
-
if (i.includes(":")) {
|
4587
|
-
var urls = i.split("/");
|
4588
|
-
var names = pathname.split("/");
|
4589
|
-
if (urls.length != names.length) return false;
|
4590
|
-
var isMatches = true;
|
4591
|
-
urls.forEach(function (u, index) {
|
4592
|
-
if (u != names[index] && !u.startsWith(":")) isMatches = false;
|
4593
|
-
});
|
4594
|
-
return isMatches;
|
4595
|
-
}
|
4596
|
-
return pathname.startsWith(i);
|
4597
|
-
});
|
4598
|
-
};
|
4599
|
-
|
4600
4648
|
var diffFromNow = (function (time, unitOfTime, targetTime) {
|
4601
4649
|
if (time === DATE_MIN_VALUE || targetTime === DATE_MIN_VALUE) return 0;
|
4602
4650
|
try {
|
@@ -4692,18 +4740,6 @@ var minutesToTimeSpan = (function (time) {
|
|
4692
4740
|
return h.toString().padStart(2, "0") + ":" + m.toString().padStart(2, "0") + ":00";
|
4693
4741
|
});
|
4694
4742
|
|
4695
|
-
var pushTo = function pushTo(history, data, isReplace) {
|
4696
|
-
if (isReplace === void 0) {
|
4697
|
-
isReplace = false;
|
4698
|
-
}
|
4699
|
-
if (history.push && !isReplace || history.replace && isReplace) {
|
4700
|
-
!isReplace && history.push(data);
|
4701
|
-
isReplace && history.replace(data);
|
4702
|
-
} else history(data, {
|
4703
|
-
replace: isReplace
|
4704
|
-
});
|
4705
|
-
};
|
4706
|
-
|
4707
4743
|
var timAgo = function timAgo(date, t) {
|
4708
4744
|
if (date === DATE_MIN_VALUE || date === DATE_TIME_MIN_VALUE) return '';
|
4709
4745
|
var time = moment.utc(date).local();
|
@@ -4776,42 +4812,6 @@ var getRemainTime = function getRemainTime(startTime, duration) {
|
|
4776
4812
|
return durationInNumber - timePass;
|
4777
4813
|
};
|
4778
4814
|
|
4779
|
-
function _extends() {
|
4780
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
4781
|
-
for (var i = 1; i < arguments.length; i++) {
|
4782
|
-
var source = arguments[i];
|
4783
|
-
for (var key in source) {
|
4784
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
4785
|
-
target[key] = source[key];
|
4786
|
-
}
|
4787
|
-
}
|
4788
|
-
}
|
4789
|
-
return target;
|
4790
|
-
};
|
4791
|
-
return _extends.apply(this, arguments);
|
4792
|
-
}
|
4793
|
-
function _objectDestructuringEmpty(obj) {
|
4794
|
-
if (obj == null) throw new TypeError("Cannot destructure " + obj);
|
4795
|
-
}
|
4796
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
4797
|
-
if (source == null) return {};
|
4798
|
-
var target = {};
|
4799
|
-
for (var key in source) {
|
4800
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
4801
|
-
if (excluded.indexOf(key) >= 0) continue;
|
4802
|
-
target[key] = source[key];
|
4803
|
-
}
|
4804
|
-
}
|
4805
|
-
return target;
|
4806
|
-
}
|
4807
|
-
function _taggedTemplateLiteralLoose(strings, raw) {
|
4808
|
-
if (!raw) {
|
4809
|
-
raw = strings.slice(0);
|
4810
|
-
}
|
4811
|
-
strings.raw = raw;
|
4812
|
-
return strings;
|
4813
|
-
}
|
4814
|
-
|
4815
4815
|
var formatDateTime = function formatDateTime(inputDate) {
|
4816
4816
|
var date = new Date(inputDate);
|
4817
4817
|
var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
@@ -4954,257 +4954,6 @@ var getRole = function getRole(roles) {
|
|
4954
4954
|
return null;
|
4955
4955
|
};
|
4956
4956
|
|
4957
|
-
var LANGUAGES = [{
|
4958
|
-
code: "ko",
|
4959
|
-
fullName: "Korean",
|
4960
|
-
shortName: "Korean",
|
4961
|
-
nativeName: "Korean",
|
4962
|
-
name: "Korean",
|
4963
|
-
image: "/images/korea.png",
|
4964
|
-
momentLangCode: "ko"
|
4965
|
-
}, {
|
4966
|
-
code: "en",
|
4967
|
-
fullName: "English",
|
4968
|
-
shortName: "English",
|
4969
|
-
nativeName: "English",
|
4970
|
-
name: "English",
|
4971
|
-
image: "/images/usa.png",
|
4972
|
-
momentLangCode: "en-au"
|
4973
|
-
}];
|
4974
|
-
var DEFAULT_LANGUAGE = LANGUAGES[0];
|
4975
|
-
var LOGIN_URL = "/login";
|
4976
|
-
|
4977
|
-
var useAutoAcademyDomain = function useAutoAcademyDomain(_, history, superUrls, homeUrl, homeAcademyUrl, isAuthPage) {
|
4978
|
-
if (isAuthPage === void 0) {
|
4979
|
-
isAuthPage = true;
|
4980
|
-
}
|
4981
|
-
var user = reactRedux.useSelector(function (state) {
|
4982
|
-
var _state$common;
|
4983
|
-
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
4984
|
-
});
|
4985
|
-
var _ref = user || {},
|
4986
|
-
email = _ref.email,
|
4987
|
-
academyDomain = _ref.academyDomain,
|
4988
|
-
isLearningSpace = _ref.isLearningSpace;
|
4989
|
-
var pathname = window.location.pathname;
|
4990
|
-
var changeAcademySearchParams = function changeAcademySearchParams() {
|
4991
|
-
var isLoginPage = LOGIN_URL === pathname;
|
4992
|
-
var search = window.location.search;
|
4993
|
-
var searchParams = new URLSearchParams(search);
|
4994
|
-
var paramAcademyDomain = searchParams.get("domain");
|
4995
|
-
var domain = getAcademyDomain();
|
4996
|
-
if (!!email !== isAuthPage) return;
|
4997
|
-
var isSuperUrl = checkSuperUrl(superUrls, pathname);
|
4998
|
-
if (!academyDomain && !isLearningSpace) {
|
4999
|
-
if (!isSuperUrl) {
|
5000
|
-
if (isLoginPage) searchParams["delete"]("domain");else if (!paramAcademyDomain && domain) searchParams.set("domain", domain);
|
5001
|
-
pushTo(history, {
|
5002
|
-
pathname: homeUrl,
|
5003
|
-
search: searchParams.toString()
|
5004
|
-
});
|
5005
|
-
return;
|
5006
|
-
}
|
5007
|
-
if (paramAcademyDomain) {
|
5008
|
-
searchParams["delete"]("domain");
|
5009
|
-
pushTo(history, _extends({}, window.location, {
|
5010
|
-
search: searchParams.toString()
|
5011
|
-
}), true);
|
5012
|
-
return;
|
5013
|
-
}
|
5014
|
-
} else {
|
5015
|
-
if (isSuperUrl) {
|
5016
|
-
searchParams["delete"]("domain");
|
5017
|
-
pushTo(history, {
|
5018
|
-
pathname: homeAcademyUrl,
|
5019
|
-
search: searchParams.toString()
|
5020
|
-
});
|
5021
|
-
return;
|
5022
|
-
}
|
5023
|
-
if (!paramAcademyDomain || academyDomain.trim().toLocaleLowerCase() !== (paramAcademyDomain === null || paramAcademyDomain === void 0 ? void 0 : paramAcademyDomain.trim().toLocaleLowerCase())) {
|
5024
|
-
if (isLoginPage || isLearningSpace) searchParams["delete"]("domain");else searchParams.set("domain", academyDomain);
|
5025
|
-
pushTo(history, _extends({}, window.location, {
|
5026
|
-
search: searchParams.toString()
|
5027
|
-
}), true);
|
5028
|
-
return;
|
5029
|
-
}
|
5030
|
-
}
|
5031
|
-
};
|
5032
|
-
React.useEffect(function () {
|
5033
|
-
changeAcademySearchParams();
|
5034
|
-
}, [pathname, window.location.search, isAuthPage, email, academyDomain]);
|
5035
|
-
};
|
5036
|
-
|
5037
|
-
// A type of promise-like that resolves synchronously and supports only one observer
|
5038
|
-
|
5039
|
-
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
5040
|
-
|
5041
|
-
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
5042
|
-
|
5043
|
-
// Asynchronously call a function and send errors to recovery continuation
|
5044
|
-
function _catch(body, recover) {
|
5045
|
-
try {
|
5046
|
-
var result = body();
|
5047
|
-
} catch(e) {
|
5048
|
-
return recover(e);
|
5049
|
-
}
|
5050
|
-
if (result && result.then) {
|
5051
|
-
return result.then(void 0, recover);
|
5052
|
-
}
|
5053
|
-
return result;
|
5054
|
-
}
|
5055
|
-
|
5056
|
-
// Asynchronously await a promise and pass the result to a finally continuation
|
5057
|
-
function _finallyRethrows(body, finalizer) {
|
5058
|
-
try {
|
5059
|
-
var result = body();
|
5060
|
-
} catch (e) {
|
5061
|
-
return finalizer(true, e);
|
5062
|
-
}
|
5063
|
-
if (result && result.then) {
|
5064
|
-
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
5065
|
-
}
|
5066
|
-
return finalizer(false, result);
|
5067
|
-
}
|
5068
|
-
|
5069
|
-
// Asynchronously await a promise and invoke a finally continuation that always overrides the result
|
5070
|
-
function _finally(body, finalizer) {
|
5071
|
-
try {
|
5072
|
-
var result = body();
|
5073
|
-
} catch (e) {
|
5074
|
-
return finalizer();
|
5075
|
-
}
|
5076
|
-
if (result && result.then) {
|
5077
|
-
return result.then(finalizer, finalizer);
|
5078
|
-
}
|
5079
|
-
return finalizer();
|
5080
|
-
}
|
5081
|
-
|
5082
|
-
var EXAM_SESSION_URL = BASE_URL + "/api/examSession";
|
5083
|
-
var getCheckStatusExam = function getCheckStatusExam(examCode) {
|
5084
|
-
return api.get(EXAM_SESSION_URL + "/" + examCode + "/status");
|
5085
|
-
};
|
5086
|
-
|
5087
|
-
var ONE_SECOND_IN_MILLISECONDS = 1000;
|
5088
|
-
var useCountDownTimer = function useCountDownTimer(props) {
|
5089
|
-
var startTime = props.startTime,
|
5090
|
-
status = props.status,
|
5091
|
-
code = props.code,
|
5092
|
-
duration = props.duration,
|
5093
|
-
onFinish = props.onFinish;
|
5094
|
-
var dispatch = reactRedux.useDispatch();
|
5095
|
-
var _useState = React.useState(),
|
5096
|
-
remainTime = _useState[0],
|
5097
|
-
setRemainTime = _useState[1];
|
5098
|
-
var checkStatusRef = React.useRef(null);
|
5099
|
-
var requestRef = React.useRef(null);
|
5100
|
-
var checkLiveExamStatus = React.useCallback(function () {
|
5101
|
-
try {
|
5102
|
-
!!checkStatusRef.current && clearTimeout(checkStatusRef.current);
|
5103
|
-
if (!code || status === exports.ExamStatus.Completed) {
|
5104
|
-
return Promise.resolve();
|
5105
|
-
}
|
5106
|
-
var isOk = false;
|
5107
|
-
var _temp = _finallyRethrows(function () {
|
5108
|
-
return _catch(function () {
|
5109
|
-
dispatch(setLoading(true));
|
5110
|
-
return Promise.resolve(getCheckStatusExam(code)).then(function (res) {
|
5111
|
-
if (res.data.data.status === exports.ExamStatus.Completed) {
|
5112
|
-
isOk = true;
|
5113
|
-
clearTimeout(checkStatusRef.current);
|
5114
|
-
dispatch(setLoading(false));
|
5115
|
-
onFinish();
|
5116
|
-
} else {
|
5117
|
-
checkStatusRef.current = setTimeout(checkLiveExamStatus, ONE_SECOND_IN_MILLISECONDS);
|
5118
|
-
}
|
5119
|
-
});
|
5120
|
-
}, function (error) {
|
5121
|
-
console.log({
|
5122
|
-
error: error
|
5123
|
-
});
|
5124
|
-
});
|
5125
|
-
}, function (_wasThrown, _result) {
|
5126
|
-
if (!isOk) checkStatusRef.current = setTimeout(checkLiveExamStatus, ONE_SECOND_IN_MILLISECONDS);
|
5127
|
-
if (_wasThrown) throw _result;
|
5128
|
-
return _result;
|
5129
|
-
});
|
5130
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
5131
|
-
} catch (e) {
|
5132
|
-
return Promise.reject(e);
|
5133
|
-
}
|
5134
|
-
}, [code, status, onFinish]);
|
5135
|
-
React.useEffect(function () {
|
5136
|
-
if (status !== exports.ExamStatus.InProgress) return;
|
5137
|
-
var animate = function animate() {
|
5138
|
-
if (!startTime || !duration) return;
|
5139
|
-
if (typeof remainTime === "number" && remainTime <= 0) {
|
5140
|
-
return;
|
5141
|
-
}
|
5142
|
-
var remain = getRemainTime(startTime, duration);
|
5143
|
-
if (typeof remain !== "number") {
|
5144
|
-
setRemainTime(undefined);
|
5145
|
-
return;
|
5146
|
-
}
|
5147
|
-
setRemainTime(remain || 0);
|
5148
|
-
requestRef.current = requestAnimationFrame(animate);
|
5149
|
-
};
|
5150
|
-
requestRef.current = requestAnimationFrame(animate);
|
5151
|
-
return function () {
|
5152
|
-
!!requestRef.current && cancelAnimationFrame(requestRef.current);
|
5153
|
-
setRemainTime(undefined);
|
5154
|
-
};
|
5155
|
-
}, [startTime, duration]);
|
5156
|
-
React.useEffect(function () {
|
5157
|
-
if (typeof remainTime === "number" && remainTime <= 0) checkLiveExamStatus();
|
5158
|
-
}, [remainTime, checkLiveExamStatus]);
|
5159
|
-
return remainTime;
|
5160
|
-
};
|
5161
|
-
|
5162
|
-
var useGoogleSignOut = function useGoogleSignOut(props) {
|
5163
|
-
var dispatch = reactRedux.useDispatch();
|
5164
|
-
var onLogoutSuccess = props.onLogoutSuccess,
|
5165
|
-
onFailure = props.onFailure;
|
5166
|
-
var handleLogoutSuccess = function handleLogoutSuccess() {
|
5167
|
-
onLogoutSuccess === null || onLogoutSuccess === void 0 ? void 0 : onLogoutSuccess();
|
5168
|
-
};
|
5169
|
-
var handleLogoutFailure = function handleLogoutFailure() {
|
5170
|
-
onFailure === null || onFailure === void 0 ? void 0 : onFailure();
|
5171
|
-
};
|
5172
|
-
var _useGoogleLogout = GoogleLogin.useGoogleLogout({
|
5173
|
-
clientId: GOOGLE_CLIENT_ID,
|
5174
|
-
onLogoutSuccess: handleLogoutSuccess,
|
5175
|
-
onFailure: handleLogoutFailure
|
5176
|
-
}),
|
5177
|
-
signOut = _useGoogleLogout.signOut,
|
5178
|
-
loaded = _useGoogleLogout.loaded;
|
5179
|
-
var handleSignOut = function handleSignOut(isRemoveDomainStorage) {
|
5180
|
-
if (isRemoveDomainStorage === void 0) {
|
5181
|
-
isRemoveDomainStorage = false;
|
5182
|
-
}
|
5183
|
-
localStorage.removeItem("USER_INFORMATION");
|
5184
|
-
localStorage.removeItem(ACCESS_TOKEN);
|
5185
|
-
if (isRemoveDomainStorage) {
|
5186
|
-
localStorage.removeItem(ACADEMY_DOMAIN);
|
5187
|
-
localStorage.removeItem(LEARNING_SPACE);
|
5188
|
-
}
|
5189
|
-
try {
|
5190
|
-
var _window$gapi, _window$gapi$auth, _auth2$signOut;
|
5191
|
-
signOut();
|
5192
|
-
var auth2 = (_window$gapi = window.gapi) === null || _window$gapi === void 0 ? void 0 : (_window$gapi$auth = _window$gapi.auth2) === null || _window$gapi$auth === void 0 ? void 0 : _window$gapi$auth.getAuthInstance();
|
5193
|
-
auth2 === null || auth2 === void 0 ? void 0 : (_auth2$signOut = auth2.signOut) === null || _auth2$signOut === void 0 ? void 0 : _auth2$signOut.call(auth2);
|
5194
|
-
} catch (error) {
|
5195
|
-
console.log({
|
5196
|
-
error: error
|
5197
|
-
});
|
5198
|
-
}
|
5199
|
-
dispatch(reset());
|
5200
|
-
window.location.href = "/login";
|
5201
|
-
};
|
5202
|
-
return {
|
5203
|
-
handleSignOut: handleSignOut,
|
5204
|
-
loaded: loaded
|
5205
|
-
};
|
5206
|
-
};
|
5207
|
-
|
5208
4957
|
var useLanguage = function useLanguage(history) {
|
5209
4958
|
var dispatch = reactRedux.useDispatch();
|
5210
4959
|
var _useTranslation = reactI18next.useTranslation(),
|
@@ -5272,1677 +5021,1976 @@ var useLanguage = function useLanguage(history) {
|
|
5272
5021
|
};
|
5273
5022
|
};
|
5274
5023
|
|
5275
|
-
var
|
5276
|
-
|
5277
|
-
|
5278
|
-
|
5279
|
-
|
5280
|
-
|
5281
|
-
|
5282
|
-
|
5283
|
-
|
5284
|
-
|
5285
|
-
|
5286
|
-
|
5287
|
-
|
5288
|
-
|
5289
|
-
|
5290
|
-
|
5291
|
-
|
5292
|
-
|
5293
|
-
|
5294
|
-
|
5295
|
-
|
5296
|
-
|
5297
|
-
|
5298
|
-
|
5299
|
-
|
5300
|
-
|
5301
|
-
|
5302
|
-
|
5303
|
-
|
5304
|
-
|
5305
|
-
|
5306
|
-
|
5307
|
-
|
5308
|
-
|
5309
|
-
|
5310
|
-
|
5311
|
-
|
5312
|
-
|
5313
|
-
|
5314
|
-
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
|
5321
|
-
|
5322
|
-
|
5024
|
+
var PrintState;
|
5025
|
+
(function (PrintState) {
|
5026
|
+
PrintState[PrintState["Idling"] = 0] = "Idling";
|
5027
|
+
PrintState[PrintState["Stopped"] = 1] = "Stopped";
|
5028
|
+
PrintState[PrintState["Printing"] = 2] = "Printing";
|
5029
|
+
PrintState[PrintState["Paused"] = 3] = "Paused";
|
5030
|
+
})(PrintState || (PrintState = {}));
|
5031
|
+
|
5032
|
+
var TabList = [{
|
5033
|
+
label: "comprehensive_analysis",
|
5034
|
+
value: 0
|
5035
|
+
}, {
|
5036
|
+
label: "solution_order",
|
5037
|
+
value: 1
|
5038
|
+
}, {
|
5039
|
+
label: "compare_solution",
|
5040
|
+
value: 2
|
5041
|
+
}, {
|
5042
|
+
label: "problem_analysis",
|
5043
|
+
value: 3
|
5044
|
+
}];
|
5045
|
+
|
5046
|
+
var TOTAL = 3;
|
5047
|
+
var PrintExamView2 = function PrintExamView2(_ref) {
|
5048
|
+
var history = _ref.history,
|
5049
|
+
role = _ref.role,
|
5050
|
+
dataExamSession = _ref.dataExamSession;
|
5051
|
+
var _useTranslation = reactI18next.useTranslation(),
|
5052
|
+
t = _useTranslation.t;
|
5053
|
+
var isTeacher = exports.Role.Teacher === role;
|
5054
|
+
var dataProps = isTeacher ? dataExamSession.map(function (i) {
|
5055
|
+
return {
|
5056
|
+
studentId: i === null || i === void 0 ? void 0 : i.studentId,
|
5057
|
+
examSessionId: i === null || i === void 0 ? void 0 : i.examSessionId
|
5058
|
+
};
|
5059
|
+
}) : dataExamSession.map(function (i) {
|
5060
|
+
return {
|
5061
|
+
code: i === null || i === void 0 ? void 0 : i.code
|
5062
|
+
};
|
5063
|
+
});
|
5064
|
+
useLanguage(history);
|
5065
|
+
var _useState = React.useState(dataProps),
|
5066
|
+
data = _useState[0],
|
5067
|
+
setData = _useState[1];
|
5068
|
+
var _useState2 = React.useState([]),
|
5069
|
+
completed = _useState2[0],
|
5070
|
+
setCompleted = _useState2[1];
|
5071
|
+
var _useState3 = React.useState([]),
|
5072
|
+
inprogress = _useState3[0],
|
5073
|
+
setInProgress = _useState3[1];
|
5074
|
+
var _useState4 = React.useState(PrintState.Idling),
|
5075
|
+
state = _useState4[0],
|
5076
|
+
setState = _useState4[1];
|
5077
|
+
var _useState5 = React.useState([]),
|
5078
|
+
errorLinks = _useState5[0],
|
5079
|
+
setErrorLinks = _useState5[1];
|
5080
|
+
var _useState6 = React.useState([]),
|
5081
|
+
status = _useState6[0],
|
5082
|
+
setStatus = _useState6[1];
|
5083
|
+
var theme = material.useTheme();
|
5084
|
+
var handleChangeStatus = function handleChangeStatus(event) {
|
5085
|
+
if (event.target.checked) {
|
5086
|
+
setStatus(function (prev) {
|
5087
|
+
var _event$target;
|
5088
|
+
return [].concat(prev, [(_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value]);
|
5089
|
+
});
|
5090
|
+
} else setStatus(function (prev) {
|
5091
|
+
return prev === null || prev === void 0 ? void 0 : prev.filter(function (i) {
|
5092
|
+
var _event$target2;
|
5093
|
+
return i !== ((_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.value);
|
5323
5094
|
});
|
5324
|
-
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
5325
|
-
} catch (e) {
|
5326
|
-
return Promise.reject(e);
|
5327
|
-
}
|
5328
|
-
};
|
5329
|
-
var handleSort = function handleSort(sortColumnName) {
|
5330
|
-
var sortColumnDirection = exports.OrderType.ASC;
|
5331
|
-
console.log({
|
5332
|
-
sortColumnName: typeof sortColumnName,
|
5333
|
-
filter: typeof filter.sortColumnName
|
5334
5095
|
});
|
5335
|
-
if (filter.sortColumnName == sortColumnName && filter.sortColumnDirection === exports.OrderType.ASC) sortColumnDirection = exports.OrderType.DESC;
|
5336
|
-
setFilter(_extends({}, filter, {
|
5337
|
-
sortColumnName: sortColumnName,
|
5338
|
-
sortColumnDirection: sortColumnDirection,
|
5339
|
-
currentPage: 1
|
5340
|
-
}));
|
5341
5096
|
};
|
5342
|
-
var
|
5343
|
-
|
5344
|
-
|
5345
|
-
|
5346
|
-
|
5347
|
-
|
5348
|
-
setFilter(_extends({}, filter, {
|
5349
|
-
currentPage: page
|
5350
|
-
}));
|
5351
|
-
};
|
5352
|
-
var calcOrderNumber = function calcOrderNumber(index) {
|
5353
|
-
var _paging$page, _paging$limit;
|
5354
|
-
return (((_paging$page = paging.page) != null ? _paging$page : 0) - 1) * ((_paging$limit = paging.limit) != null ? _paging$limit : 0) + index + 1;
|
5355
|
-
};
|
5356
|
-
var debounceSearch = _.debounce(function () {
|
5357
|
-
var _textSearchRef$curren;
|
5358
|
-
setFilter(_extends({}, filter, {
|
5359
|
-
currentPage: 1,
|
5360
|
-
textSearch: (_textSearchRef$curren = textSearchRef.current) === null || _textSearchRef$curren === void 0 ? void 0 : _textSearchRef$curren.value
|
5361
|
-
}));
|
5362
|
-
}, 500);
|
5363
|
-
React.useEffect(function () {
|
5364
|
-
getData(isFirstLoadRef.current);
|
5365
|
-
}, [JSON.stringify(filter)]);
|
5366
|
-
return {
|
5367
|
-
filter: filter,
|
5368
|
-
textSearchRef: textSearchRef,
|
5369
|
-
paging: paging,
|
5370
|
-
data: data,
|
5371
|
-
selectedItem: selectedItem,
|
5372
|
-
handleSort: handleSort,
|
5373
|
-
handleChangeSearchText: handleChangeSearchText,
|
5374
|
-
handleChangePage: handleChangePage,
|
5375
|
-
calcOrderNumber: calcOrderNumber,
|
5376
|
-
handleChangeSelectedItem: handleChangeSelectedItem,
|
5377
|
-
getData: getData
|
5097
|
+
var handleProgressPrint = function handleProgressPrint() {
|
5098
|
+
setData(dataProps);
|
5099
|
+
setCompleted([]);
|
5100
|
+
setInProgress([]);
|
5101
|
+
setErrorLinks([]);
|
5102
|
+
setState(PrintState.Printing);
|
5378
5103
|
};
|
5379
|
-
|
5380
|
-
|
5381
|
-
|
5382
|
-
var
|
5383
|
-
|
5384
|
-
|
5385
|
-
|
5386
|
-
var
|
5387
|
-
var
|
5388
|
-
|
5389
|
-
|
5104
|
+
console.log({
|
5105
|
+
status: status
|
5106
|
+
});
|
5107
|
+
var print = function print(_ref2) {
|
5108
|
+
var examSessionId = _ref2.examSessionId,
|
5109
|
+
studentId = _ref2.studentId,
|
5110
|
+
code = _ref2.code;
|
5111
|
+
var width = 200;
|
5112
|
+
var height = 200;
|
5113
|
+
var left = window.screenX + window.outerWidth / 2 - width / 2;
|
5114
|
+
var top = window.screenY + window.outerHeight / 2 - height / 2;
|
5115
|
+
var url = isTeacher ? window.location.origin + "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print?status=" + status.join(",") : window.location.origin + "/student/exam-results/" + code + "/print";
|
5116
|
+
var windowName = isTeacher ? "popup-" + examSessionId + "-" + studentId : "popup-" + code;
|
5117
|
+
var windowSpecs = "left=" + left + ",top=" + top + ",width=" + width + ",height=" + height + ",location=yes,resizable=yes,scrollbars=yes,status=yes";
|
5118
|
+
var childWindow = window.open(url, windowName, windowSpecs);
|
5119
|
+
if (childWindow == null) {
|
5120
|
+
setErrorLinks(function (prev) {
|
5121
|
+
return [].concat(prev, [{
|
5122
|
+
code: code,
|
5123
|
+
examSessionId: "" + examSessionId,
|
5124
|
+
studentId: "" + studentId,
|
5125
|
+
message: isTeacher ? "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print" : "/student/exam-results/" + code + "/print"
|
5126
|
+
}]);
|
5127
|
+
});
|
5128
|
+
if (!isTeacher) {
|
5129
|
+
setData(function (es) {
|
5130
|
+
return [].concat(es.filter(function (i) {
|
5131
|
+
return i.code !== code;
|
5132
|
+
}));
|
5133
|
+
});
|
5134
|
+
} else {
|
5135
|
+
setData(function (es) {
|
5136
|
+
return [].concat(es.filter(function (i) {
|
5137
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5138
|
+
}));
|
5139
|
+
});
|
5390
5140
|
}
|
5391
|
-
|
5392
|
-
threshold: 1
|
5393
|
-
});
|
5394
|
-
if (observerTarget.current) {
|
5395
|
-
observer.observe(observerTarget.current);
|
5141
|
+
return;
|
5396
5142
|
}
|
5397
|
-
|
5398
|
-
|
5399
|
-
|
5143
|
+
if (!isTeacher) {
|
5144
|
+
setInProgress(function (es) {
|
5145
|
+
return [].concat(es.filter(function (i) {
|
5146
|
+
return i.code !== code;
|
5147
|
+
}), [{
|
5148
|
+
code: code
|
5149
|
+
}]);
|
5150
|
+
});
|
5151
|
+
setData(function (es) {
|
5152
|
+
return [].concat(es.filter(function (i) {
|
5153
|
+
return i.code !== code;
|
5154
|
+
}));
|
5155
|
+
});
|
5156
|
+
} else {
|
5157
|
+
setInProgress(function (es) {
|
5158
|
+
return [].concat(es.filter(function (i) {
|
5159
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5160
|
+
}), [{
|
5161
|
+
examSessionId: examSessionId,
|
5162
|
+
studentId: studentId
|
5163
|
+
}]);
|
5164
|
+
});
|
5165
|
+
setData(function (es) {
|
5166
|
+
return [].concat(es.filter(function (i) {
|
5167
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5168
|
+
}));
|
5169
|
+
});
|
5170
|
+
}
|
5171
|
+
window.addEventListener("message", function (event) {
|
5172
|
+
var isCheck = isTeacher ? event.data.examSessionId !== "" + examSessionId || event.data.studentId !== "" + studentId : event.data.code !== "" + code;
|
5173
|
+
if (event.origin !== window.location.origin || isCheck) {
|
5174
|
+
return;
|
5400
5175
|
}
|
5401
|
-
|
5402
|
-
|
5403
|
-
|
5404
|
-
|
5405
|
-
|
5406
|
-
}
|
5407
|
-
|
5408
|
-
|
5409
|
-
|
5410
|
-
|
5411
|
-
|
5412
|
-
|
5413
|
-
|
5414
|
-
|
5415
|
-
|
5416
|
-
|
5417
|
-
|
5418
|
-
|
5419
|
-
|
5420
|
-
|
5176
|
+
if (event.data.succeed) {
|
5177
|
+
if (!isTeacher) {
|
5178
|
+
setCompleted(function (es) {
|
5179
|
+
return [].concat(es.filter(function (i) {
|
5180
|
+
return i.code !== code;
|
5181
|
+
}), [{
|
5182
|
+
code: code
|
5183
|
+
}]);
|
5184
|
+
});
|
5185
|
+
setInProgress(function (es) {
|
5186
|
+
return [].concat(es.filter(function (i) {
|
5187
|
+
return i.code !== code;
|
5188
|
+
}));
|
5189
|
+
});
|
5190
|
+
} else {
|
5191
|
+
setCompleted(function (es) {
|
5192
|
+
return [].concat(es.filter(function (i) {
|
5193
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5194
|
+
}), [{
|
5195
|
+
examSessionId: examSessionId,
|
5196
|
+
studentId: studentId
|
5197
|
+
}]);
|
5198
|
+
});
|
5199
|
+
setInProgress(function (es) {
|
5200
|
+
return [].concat(es.filter(function (i) {
|
5201
|
+
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
5202
|
+
}));
|
5203
|
+
});
|
5204
|
+
}
|
5205
|
+
} else {
|
5206
|
+
setErrorLinks(function (prev) {
|
5207
|
+
var _event$data, _event$data2;
|
5208
|
+
return [].concat(prev, [{
|
5209
|
+
code: (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.code,
|
5210
|
+
examSessionId: (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.examSessionId,
|
5211
|
+
studentId: "" + studentId,
|
5212
|
+
message: isTeacher ? "/teacher/exam-results/" + event.data.examSessionId + "/students/" + event.data.studentId + "/print" : "/student/exam-results/" + event.data.code + "/print"
|
5213
|
+
}]);
|
5214
|
+
});
|
5215
|
+
}
|
5216
|
+
childWindow === null || childWindow === void 0 ? void 0 : childWindow.close();
|
5217
|
+
});
|
5218
|
+
};
|
5219
|
+
React.useEffect(function () {
|
5220
|
+
if (inprogress.length < TOTAL && data.length > 0 && state === PrintState.Printing) {
|
5221
|
+
var item = data[0];
|
5222
|
+
print({
|
5223
|
+
examSessionId: item === null || item === void 0 ? void 0 : item.examSessionId,
|
5224
|
+
studentId: item === null || item === void 0 ? void 0 : item.studentId,
|
5225
|
+
code: item === null || item === void 0 ? void 0 : item.code
|
5226
|
+
});
|
5227
|
+
}
|
5228
|
+
}, [inprogress.length, completed.length, data.length, state, data]);
|
5229
|
+
return React__default.createElement(material.Container, null, state === PrintState.Idling ? React__default.createElement(material.Typography, null, t("total_number_of_selected_results") + ": ", " ", React__default.createElement("span", {
|
5230
|
+
className: "fw-bold"
|
5231
|
+
}, t("number_results", {
|
5232
|
+
number: ("" + data.length).padStart(2, "0")
|
5233
|
+
}))) : React__default.createElement(React.Fragment, null, React__default.createElement(material.Typography, null, t("completed") + ": ", React__default.createElement("span", {
|
5234
|
+
className: "fw-bold"
|
5235
|
+
}, t("number_results", {
|
5236
|
+
number: ("" + completed.length).padStart(2, "0")
|
5237
|
+
}))), React__default.createElement(material.Typography, null, t("in_progress") + ": ", React__default.createElement("span", {
|
5238
|
+
className: "fw-bold"
|
5239
|
+
}, t("number_results", {
|
5240
|
+
number: ("" + inprogress.length).padStart(2, "0")
|
5241
|
+
}))), React__default.createElement(material.Typography, null, t("remaining") + ": ", React__default.createElement("span", {
|
5242
|
+
className: "fw-bold"
|
5243
|
+
}, t("number_results", {
|
5244
|
+
number: ("" + data.length).padStart(2, "0")
|
5245
|
+
})))), !!errorLinks.length && React__default.createElement(material.Stack, {
|
5246
|
+
className: "mt-2"
|
5247
|
+
}, React__default.createElement(material.Typography, {
|
5248
|
+
fontWeight: 700
|
5249
|
+
}, t("download_failed"), ":"), Array.from(new Set(errorLinks)).map(function (i) {
|
5250
|
+
var _info$createdBy;
|
5251
|
+
var info = isTeacher ? dataExamSession.find(function (exam) {
|
5252
|
+
return "" + (exam === null || exam === void 0 ? void 0 : exam.examSessionId) === "" + (i === null || i === void 0 ? void 0 : i.examSessionId) && "" + (exam === null || exam === void 0 ? void 0 : exam.studentId) === "" + (i === null || i === void 0 ? void 0 : i.studentId);
|
5253
|
+
}) : dataExamSession.find(function (exam) {
|
5254
|
+
return (exam === null || exam === void 0 ? void 0 : exam.code) === (i === null || i === void 0 ? void 0 : i.code);
|
5255
|
+
});
|
5256
|
+
return React__default.createElement(material.Stack, {
|
5257
|
+
borderBottom: 1,
|
5258
|
+
borderColor: theme.palette.grey[500]
|
5259
|
+
}, React__default.createElement("a", {
|
5260
|
+
href: i.message,
|
5261
|
+
target: "_blank",
|
5262
|
+
rel: "noopener noreferrer"
|
5263
|
+
}, (info === null || info === void 0 ? void 0 : info.studentName) || (info === null || info === void 0 ? void 0 : (_info$createdBy = info.createdBy) === null || _info$createdBy === void 0 ? void 0 : _info$createdBy.fullName)), (info === null || info === void 0 ? void 0 : info.title) && React__default.createElement(material.Typography, null, t("exam") + ": " + (info === null || info === void 0 ? void 0 : info.title)), (info === null || info === void 0 ? void 0 : info.startTime) && React__default.createElement(material.Typography, null, t("start_time") + ": " + utcToLocalTime(info === null || info === void 0 ? void 0 : info.startTime, t("date_time_format"))));
|
5264
|
+
})), React__default.createElement(material.Stack, {
|
5265
|
+
direction: "column",
|
5266
|
+
className: "mt-3"
|
5267
|
+
}, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
5268
|
+
className: "fw-bold"
|
5269
|
+
}, React__default.createElement("span", {
|
5270
|
+
className: "text-danger me-1"
|
5271
|
+
}, "*"), t("your_browser_must"), ":"), React__default.createElement(material.List, {
|
5272
|
+
className: "ps-3 pt-0"
|
5273
|
+
}, React__default.createElement(material.ListItem, {
|
5274
|
+
disablePadding: true
|
5275
|
+
}, t("allowed_to_send_pop_ups_and_use_redirects")), React__default.createElement(material.ListItem, {
|
5276
|
+
disablePadding: true
|
5277
|
+
}, t("disable_ask_where_to_save_each_file_before_downloading")))), isTeacher && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
5278
|
+
fontWeight: 700
|
5279
|
+
}, t("choose_to_print"), ":"), React__default.createElement(material.FormGroup, {
|
5280
|
+
sx: {
|
5281
|
+
display: "flex",
|
5282
|
+
flexDirection: "row",
|
5283
|
+
gap: 1,
|
5284
|
+
flexWrap: "wrap"
|
5285
|
+
}
|
5286
|
+
}, TabList.map(function (_ref3) {
|
5287
|
+
var label = _ref3.label,
|
5288
|
+
value = _ref3.value;
|
5289
|
+
return React__default.createElement(material.FormControlLabel, {
|
5290
|
+
control: React__default.createElement(material.Checkbox, {
|
5291
|
+
onChange: handleChangeStatus,
|
5292
|
+
value: value,
|
5293
|
+
checked: status.some(function (i) {
|
5294
|
+
return i === value.toString();
|
5295
|
+
})
|
5296
|
+
}),
|
5297
|
+
label: t(label)
|
5298
|
+
});
|
5299
|
+
}))), React__default.createElement(material.Button, {
|
5300
|
+
className: "mt-3",
|
5301
|
+
variant: "contained",
|
5302
|
+
onClick: handleProgressPrint
|
5303
|
+
}, t("print_pdf"))));
|
5421
5304
|
};
|
5422
|
-
|
5423
|
-
|
5424
|
-
|
5425
|
-
|
5426
|
-
|
5305
|
+
|
5306
|
+
var styles = {"lighter":"#F0FFF6","light":"#89F0B2","less_dark":"#3DC674","dark":"#349056","darker":"#18442A","gray_50":"#FBFBF9","gray_100":"#EAEAE5","gray_300":"#D0D0C8","gray_500":"#9A9A98","gray_700":"#5D5D5B","gray_900":"#363634","red_900":"#DB4D4D","green_support_900":"#3ACB46","yellow_900":"#FEAF06","purple_900":"#C3099A","btn-login-google":"_2HqmH","math-jax":"_3Pfdk","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","academy-btn":"_1JMRU","switch-icon":"_N4FNf","dropdown-content-academy":"_31Dr0","dropdown-academy-item":"_3bjcz","noGutters":"_31ZQk","custom-col-2":"_3yXyK","custom-col-3":"_1RsJQ","custom-col-5":"_L42CP","custom-col-10":"_2u6eL","custom-row":"_8x7OP","custom-col":"_1JmTh","custom-col-4":"_3HO1e","custom-col-8":"_Oy31M","custom-col-12":"_3aUKo","custom-container":"_39LRs","form-label":"__Ut-u","form-control":"_2k4dX","btn-outline-primary":"_2PWdX","sort-icons":"_mQvLF","active":"_3oAH-","form-select":"_3W3aw","truncate":"_3NJzN","headers":"_3xnI5","logo-container":"_3YG70","tabBox":"_1CQPn","routerBox":"_3hx2T","tabText":"_3UyhW","router-link-active":"_1TGKA","router-link":"_1AqMh","userImg":"_2RI6G","disabled-link":"_3aVHg","line-clamp":"_3fpky"};
|
5307
|
+
|
5308
|
+
var config = {
|
5309
|
+
loader: {
|
5310
|
+
load: ["input/tex", "output/svg"]
|
5311
|
+
}
|
5427
5312
|
};
|
5428
|
-
var
|
5429
|
-
|
5313
|
+
var MathJaxContainer = function MathJaxContainer(_ref) {
|
5314
|
+
var content = _ref.content;
|
5315
|
+
return React__default.createElement(betterReactMathjax.MathJaxContext, {
|
5316
|
+
config: config,
|
5317
|
+
asyncLoad: true
|
5318
|
+
}, React__default.createElement(betterReactMathjax.MathJax, {
|
5319
|
+
id: "" + styles["math-jax"],
|
5320
|
+
dangerouslySetInnerHTML: {
|
5321
|
+
__html: content
|
5322
|
+
}
|
5323
|
+
}));
|
5430
5324
|
};
|
5431
|
-
|
5432
|
-
|
5433
|
-
|
5434
|
-
|
5435
|
-
|
5436
|
-
|
5437
|
-
|
5438
|
-
|
5325
|
+
|
5326
|
+
var ReleaseAlert = function ReleaseAlert() {
|
5327
|
+
var _useTranslation = reactI18next.useTranslation(),
|
5328
|
+
t = _useTranslation.t;
|
5329
|
+
var releaseDate = RELEASE_DATE;
|
5330
|
+
var isInValidDate = !releaseDate || releaseDate === DATE_MIN_VALUE || releaseDate === DATE_TIME_MIN_VALUE;
|
5331
|
+
var isLoginPage = window.location.pathname === LOGIN_URL;
|
5332
|
+
if (isInValidDate || !moment.utc(releaseDate).isValid()) return null;else {
|
5333
|
+
var version = moment(releaseDate).format("HH.mm.YYYY.MM.DD");
|
5334
|
+
return React__default.createElement(material.Box, {
|
5335
|
+
sx: {
|
5336
|
+
position: "fixed",
|
5337
|
+
right: 10,
|
5338
|
+
bottom: isLoginPage ? undefined : 5,
|
5339
|
+
top: isLoginPage ? 10 : undefined,
|
5340
|
+
userSelect: "none",
|
5341
|
+
zIndex: 1
|
5342
|
+
}
|
5343
|
+
}, React__default.createElement(material.Typography, {
|
5344
|
+
color: "success",
|
5345
|
+
sx: {
|
5346
|
+
fontSize: 10,
|
5347
|
+
color: "#3DC674",
|
5348
|
+
opacity: 0.8
|
5349
|
+
}
|
5350
|
+
}, t("version"), ": ", React__default.createElement("span", null, version)));
|
5351
|
+
}
|
5439
5352
|
};
|
5440
|
-
|
5441
|
-
|
5353
|
+
|
5354
|
+
var ActionButtons = function ActionButtons(_ref) {
|
5355
|
+
var _ref$className = _ref.className,
|
5356
|
+
className = _ref$className === void 0 ? "" : _ref$className,
|
5357
|
+
backText = _ref.backText,
|
5358
|
+
saveText = _ref.saveText,
|
5359
|
+
altSaveText = _ref.altSaveText,
|
5360
|
+
saveDisabled = _ref.saveDisabled,
|
5361
|
+
saveIcon = _ref.saveIcon,
|
5362
|
+
_ref$hideSave = _ref.hideSave,
|
5363
|
+
hideSave = _ref$hideSave === void 0 ? false : _ref$hideSave,
|
5364
|
+
onBack = _ref.onBack,
|
5365
|
+
onSave = _ref.onSave,
|
5366
|
+
onAltSave = _ref.onAltSave,
|
5367
|
+
isReadonly = _ref.isReadonly;
|
5368
|
+
return React__default.createElement(material.Stack, {
|
5369
|
+
direction: "row",
|
5370
|
+
spacing: 1,
|
5371
|
+
className: "" + className
|
5372
|
+
}, React__default.createElement(material.Button, {
|
5373
|
+
variant: "contained",
|
5374
|
+
className: "bg-secondary",
|
5375
|
+
startIcon: React__default.createElement(io.IoMdArrowBack, {
|
5376
|
+
size: 16
|
5377
|
+
}),
|
5378
|
+
onClick: onBack
|
5379
|
+
}, backText), !hideSave && React__default.createElement(material.Button, {
|
5380
|
+
variant: "contained",
|
5381
|
+
color: "success",
|
5382
|
+
startIcon: saveIcon != null ? saveIcon : React__default.createElement(fa.FaSave, {
|
5383
|
+
size: 16
|
5384
|
+
}),
|
5385
|
+
onClick: onSave,
|
5386
|
+
disabled: saveDisabled || isReadonly
|
5387
|
+
}, saveText), !!altSaveText && onAltSave && React__default.createElement(material.Button, {
|
5388
|
+
variant: "contained",
|
5389
|
+
color: "primary",
|
5390
|
+
startIcon: React__default.createElement(fa.FaSave, {
|
5391
|
+
size: 16
|
5392
|
+
}),
|
5393
|
+
onClick: onAltSave,
|
5394
|
+
disabled: saveDisabled
|
5395
|
+
}, altSaveText));
|
5442
5396
|
};
|
5443
5397
|
|
5444
|
-
var
|
5445
|
-
|
5446
|
-
|
5447
|
-
}
|
5448
|
-
var dispatch = reactRedux.useDispatch();
|
5398
|
+
var TITLE = "not_found";
|
5399
|
+
var NotFound = function NotFound(_ref) {
|
5400
|
+
var history = _ref.history;
|
5449
5401
|
var _useTranslation = reactI18next.useTranslation(),
|
5450
5402
|
t = _useTranslation.t;
|
5451
|
-
|
5452
|
-
|
5453
|
-
|
5454
|
-
|
5455
|
-
|
5456
|
-
|
5457
|
-
|
5458
|
-
|
5459
|
-
|
5460
|
-
|
5461
|
-
|
5462
|
-
|
5463
|
-
|
5464
|
-
|
5465
|
-
|
5466
|
-
|
5467
|
-
|
5468
|
-
return Promise.resolve(handleLogin(function () {
|
5469
|
-
return new Promise(function (resolve, reject) {
|
5470
|
-
try {
|
5471
|
-
var _temp3 = _catch(function () {
|
5472
|
-
return Promise.resolve(isAcademy ? apiLoginGoogle(data, isLearningSpace) : apiLoginGoogleSuperAdmin(data)).then(function (loginResponse) {
|
5473
|
-
function _temp2() {
|
5474
|
-
resolve(result);
|
5475
|
-
}
|
5476
|
-
var result = loginResponse.data;
|
5477
|
-
var _temp = function () {
|
5478
|
-
if (loginResponse.status === 204 && academyDomain) {
|
5479
|
-
localStorage.removeItem(ACADEMY_DOMAIN);
|
5480
|
-
localStorage.removeItem(LEARNING_SPACE);
|
5481
|
-
return Promise.resolve(apiLoginGoogleSuperAdmin(data)).then(function (_apiLoginGoogleSuperA) {
|
5482
|
-
loginResponse = _apiLoginGoogleSuperA;
|
5483
|
-
result = loginResponse.data;
|
5484
|
-
});
|
5485
|
-
}
|
5486
|
-
}();
|
5487
|
-
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
5488
|
-
});
|
5489
|
-
}, function (error) {
|
5490
|
-
!!academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
5491
|
-
localStorage.removeItem(LEARNING_SPACE);
|
5492
|
-
reject(error);
|
5493
|
-
});
|
5494
|
-
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {}) : void 0);
|
5495
|
-
} catch (e) {
|
5496
|
-
return Promise.reject(e);
|
5497
|
-
}
|
5498
|
-
});
|
5499
|
-
}, isStudent, isLogout)).then(function () {});
|
5500
|
-
} catch (e) {
|
5501
|
-
return Promise.reject(e);
|
5502
|
-
}
|
5503
|
-
};
|
5504
|
-
var handleLoginAccessToken = function handleLoginAccessToken(data, isLearningSpace, domain, isLogout, superAdminRedirectPath) {
|
5505
|
-
if (isLogout === void 0) {
|
5506
|
-
isLogout = true;
|
5507
|
-
}
|
5508
|
-
try {
|
5509
|
-
var isStudent = data.role === exports.Role.Student;
|
5510
|
-
return Promise.resolve(handleLogin(function () {
|
5511
|
-
return new Promise(function (resolve, reject) {
|
5512
|
-
try {
|
5513
|
-
var _temp4 = _catch(function () {
|
5514
|
-
return Promise.resolve(!isLearningSpace && !domain ? apiLoginSuperAdminWithAccessToken(data) : apiLoginWithAccessToken(data, isLearningSpace, domain)).then(function (loginResponse) {
|
5515
|
-
var result = loginResponse.data;
|
5516
|
-
resolve(result);
|
5517
|
-
});
|
5518
|
-
}, function (error) {
|
5519
|
-
reject(error);
|
5520
|
-
});
|
5521
|
-
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
5522
|
-
} catch (e) {
|
5523
|
-
return Promise.reject(e);
|
5524
|
-
}
|
5525
|
-
});
|
5526
|
-
}, isStudent, isLogout, superAdminRedirectPath)).then(function () {});
|
5527
|
-
} catch (e) {
|
5528
|
-
return Promise.reject(e);
|
5529
|
-
}
|
5530
|
-
};
|
5531
|
-
var handleLogin = function handleLogin(apiLogin, isStudent, isLogout, superAdminRedirectPath) {
|
5532
|
-
if (isLogout === void 0) {
|
5533
|
-
isLogout = true;
|
5534
|
-
}
|
5535
|
-
try {
|
5536
|
-
var _temp6 = function _temp6(_result) {
|
5537
|
-
if (_exit) return _result;
|
5538
|
-
dispatch(setLoading(false));
|
5539
|
-
};
|
5540
|
-
var _exit = false;
|
5541
|
-
dispatch(setLoading(true));
|
5542
|
-
var _temp5 = _catch(function () {
|
5543
|
-
return Promise.resolve(apiLogin()).then(function (loginResponse) {
|
5544
|
-
var isFirstLogin = loginResponse.isFirstLogin,
|
5545
|
-
token = loginResponse.token,
|
5546
|
-
user = loginResponse.user,
|
5547
|
-
isSuperAdmin = loginResponse.isSuperAdmin;
|
5548
|
-
var isAcademy = !!(user !== null && user !== void 0 && user.academyDomain) || !!(user !== null && user !== void 0 && user.isLearningSpace);
|
5549
|
-
var needToRegister = isStudent && isFirstLogin && isAcademy;
|
5550
|
-
var redirectUrl = getRedirectUrl();
|
5551
|
-
if (isStudent && !registerUrl) throw new Error("an_unexpected_error_has_occurred");
|
5552
|
-
if (!redirectUrl) redirectUrl = needToRegister ? registerUrl : isAcademy ? homeAcademyUrl : homeUrl;
|
5553
|
-
if (superAdminRedirectPath) {
|
5554
|
-
redirectUrl = superAdminRedirectPath;
|
5555
|
-
}
|
5556
|
-
if (!redirectAfterLogin) redirectUrl = undefined;
|
5557
|
-
redirectLoginUser(_extends({}, user, {
|
5558
|
-
isNotEnoughStatements: isFirstLogin,
|
5559
|
-
isSuperAdmin: isSuperAdmin
|
5560
|
-
}), token, redirectUrl);
|
5561
|
-
});
|
5562
|
-
}, function (error) {
|
5563
|
-
alert(getErrorMessage(t, error));
|
5564
|
-
isLogout && handleSignOut();
|
5565
|
-
});
|
5566
|
-
return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5));
|
5567
|
-
} catch (e) {
|
5568
|
-
return Promise.reject(e);
|
5569
|
-
}
|
5570
|
-
};
|
5571
|
-
var redirectLoginUser = function redirectLoginUser(data, token, redirectUrl) {
|
5572
|
-
localStorage.setItem(ACCESS_TOKEN, token);
|
5573
|
-
!data.academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
5574
|
-
!!data.academyDomain && localStorage.setItem(ACADEMY_DOMAIN, data.academyDomain);
|
5575
|
-
if (data.roles.includes(exports.Role.Student)) data.isLearningSpace ? localStorage.setItem(LEARNING_SPACE, "true") : localStorage.removeItem(LEARNING_SPACE);
|
5576
|
-
dispatch(setUser(_extends({}, data)));
|
5577
|
-
if (redirectUrl) {
|
5578
|
-
pushTo(history, redirectUrl);
|
5579
|
-
localStorage.removeItem(REDIRECT_URL);
|
5580
|
-
}
|
5581
|
-
};
|
5582
|
-
return {
|
5583
|
-
handleLoginGoogle: handleLoginGoogle,
|
5584
|
-
handleLoginAccessToken: handleLoginAccessToken,
|
5585
|
-
redirectLoginUser: redirectLoginUser
|
5586
|
-
};
|
5403
|
+
history && useLanguage(history);
|
5404
|
+
React.useEffect(function () {
|
5405
|
+
document.title = t("study_peak") + " | " + t(TITLE);
|
5406
|
+
}, [t]);
|
5407
|
+
return React__default.createElement("div", {
|
5408
|
+
className: "not-found d-flex justify-content-center"
|
5409
|
+
}, React__default.createElement("div", {
|
5410
|
+
className: "clearfix pt-5"
|
5411
|
+
}, React__default.createElement("h1", {
|
5412
|
+
className: "float-left display-3 fw-bold mr-4 text-center"
|
5413
|
+
}, "404"), React__default.createElement("div", {
|
5414
|
+
className: "float-left"
|
5415
|
+
}, React__default.createElement("h4", {
|
5416
|
+
className: "pt-3"
|
5417
|
+
}, t('oops')), React__default.createElement("p", {
|
5418
|
+
className: "text-muted mb-2"
|
5419
|
+
}, t('the_page_you_are_looking_for_was_not_found')), React__default.createElement("div", null))));
|
5587
5420
|
};
|
5588
5421
|
|
5589
|
-
var
|
5590
|
-
var
|
5591
|
-
|
5592
|
-
|
5593
|
-
|
5594
|
-
|
5595
|
-
|
5596
|
-
|
5597
|
-
|
5598
|
-
|
5599
|
-
|
5600
|
-
return
|
5601
|
-
|
5602
|
-
|
5422
|
+
var CommonDialog = function CommonDialog(_ref) {
|
5423
|
+
var open = _ref.open,
|
5424
|
+
children = _ref.children,
|
5425
|
+
title = _ref.title,
|
5426
|
+
_ref$size = _ref.size,
|
5427
|
+
size = _ref$size === void 0 ? "xs" : _ref$size,
|
5428
|
+
_ref$isShowHeader = _ref.isShowHeader,
|
5429
|
+
isShowHeader = _ref$isShowHeader === void 0 ? true : _ref$isShowHeader,
|
5430
|
+
titleClassName = _ref.titleClassName,
|
5431
|
+
minWidth = _ref.minWidth,
|
5432
|
+
onClose = _ref.onClose;
|
5433
|
+
return React__default.createElement(material.Dialog, {
|
5434
|
+
open: open,
|
5435
|
+
onClose: onClose,
|
5436
|
+
maxWidth: size,
|
5437
|
+
fullWidth: true,
|
5438
|
+
scroll: "body",
|
5439
|
+
sx: {
|
5440
|
+
zIndex: 1102
|
5603
5441
|
},
|
5604
|
-
|
5605
|
-
|
5606
|
-
|
5607
|
-
|
5608
|
-
|
5609
|
-
params: {
|
5610
|
-
role: role
|
5442
|
+
PaperProps: {
|
5443
|
+
sx: {
|
5444
|
+
overflowY: "unset",
|
5445
|
+
minWidth: minWidth
|
5446
|
+
}
|
5611
5447
|
}
|
5612
|
-
}
|
5448
|
+
}, isShowHeader ? React__default.createElement(React.Fragment, null, React__default.createElement(material.DialogTitle, {
|
5449
|
+
className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
|
5450
|
+
sx: {
|
5451
|
+
fontSize: "16px!important"
|
5452
|
+
}
|
5453
|
+
}, title), React__default.createElement(material.IconButton, {
|
5454
|
+
"aria-label": "close",
|
5455
|
+
onClick: onClose,
|
5456
|
+
sx: {
|
5457
|
+
position: "absolute",
|
5458
|
+
right: 8,
|
5459
|
+
top: 8,
|
5460
|
+
color: function color(theme) {
|
5461
|
+
return theme.palette.grey[500];
|
5462
|
+
}
|
5463
|
+
}
|
5464
|
+
}, React__default.createElement(io5.IoClose, null))) : React__default.createElement(material.Box, {
|
5465
|
+
className: "p-3"
|
5466
|
+
}, React__default.createElement(material.Typography, {
|
5467
|
+
className: "fs-5 text-center fw-bold"
|
5468
|
+
}, title)), children);
|
5613
5469
|
};
|
5614
|
-
|
5615
|
-
|
5470
|
+
|
5471
|
+
var confirmDialogTextStyle = {
|
5472
|
+
color: "#363634",
|
5473
|
+
fontSize: 16,
|
5474
|
+
fontWeight: 700
|
5616
5475
|
};
|
5617
|
-
var
|
5618
|
-
|
5619
|
-
|
5620
|
-
|
5621
|
-
return api.post(ACADEMY_URL + "/" + academyId + "/switch-academy/" + role, undefined, {
|
5622
|
-
params: {
|
5623
|
-
isLearningSpace: isLearningSpace
|
5624
|
-
}
|
5625
|
-
});
|
5476
|
+
var confirmDialogButtonStyle = {
|
5477
|
+
width: "120px",
|
5478
|
+
fontSize: 14,
|
5479
|
+
fontWeight: 700
|
5626
5480
|
};
|
5627
|
-
var
|
5628
|
-
|
5481
|
+
var ConfirmDeleteDialogDefaultProps = {
|
5482
|
+
titleStyle: confirmDialogTextStyle,
|
5483
|
+
contentStyle: {
|
5484
|
+
paddingTop: "36px",
|
5485
|
+
padding: "36px",
|
5486
|
+
width: 363
|
5487
|
+
},
|
5488
|
+
contentTextStyle: _extends({}, confirmDialogTextStyle, {
|
5489
|
+
textAlign: "center"
|
5490
|
+
}),
|
5491
|
+
actionStyle: {
|
5492
|
+
justifyContent: "space-between",
|
5493
|
+
padding: "12px"
|
5494
|
+
},
|
5495
|
+
okButtonStyle: confirmDialogButtonStyle,
|
5496
|
+
cancelButtonStyle: _extends({}, confirmDialogButtonStyle, {
|
5497
|
+
color: "#3dc674"
|
5498
|
+
}),
|
5499
|
+
cancelButtonVariant: "text",
|
5500
|
+
isDelete: true
|
5629
5501
|
};
|
5630
5502
|
|
5631
|
-
var
|
5632
|
-
var
|
5633
|
-
|
5634
|
-
|
5635
|
-
|
5636
|
-
|
5637
|
-
|
5638
|
-
|
5639
|
-
|
5640
|
-
|
5641
|
-
|
5642
|
-
|
5643
|
-
|
5644
|
-
|
5645
|
-
|
5646
|
-
|
5647
|
-
|
5648
|
-
|
5649
|
-
|
5650
|
-
|
5651
|
-
|
5652
|
-
|
5653
|
-
|
5654
|
-
var
|
5655
|
-
|
5656
|
-
|
5657
|
-
});
|
5658
|
-
var isReFetchUserAcademies = reactRedux.useSelector(function (state) {
|
5659
|
-
var _state$common2;
|
5660
|
-
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.isReFetchUserAcademies;
|
5661
|
-
});
|
5503
|
+
var ConfirmDialog = function ConfirmDialog(_ref) {
|
5504
|
+
var open = _ref.open,
|
5505
|
+
text = _ref.text,
|
5506
|
+
cancelText = _ref.cancelText,
|
5507
|
+
okText = _ref.okText,
|
5508
|
+
isDelete = _ref.isDelete,
|
5509
|
+
title = _ref.title,
|
5510
|
+
confirmText = _ref.confirmText,
|
5511
|
+
titleStyle = _ref.titleStyle,
|
5512
|
+
titleClassName = _ref.titleClassName,
|
5513
|
+
contentStyle = _ref.contentStyle,
|
5514
|
+
cancelButtonStyle = _ref.cancelButtonStyle,
|
5515
|
+
contentTextStyle = _ref.contentTextStyle,
|
5516
|
+
okButtonStyle = _ref.okButtonStyle,
|
5517
|
+
actionStyle = _ref.actionStyle,
|
5518
|
+
_ref$okButtonVariant = _ref.okButtonVariant,
|
5519
|
+
okButtonVariant = _ref$okButtonVariant === void 0 ? "contained" : _ref$okButtonVariant,
|
5520
|
+
_ref$cancelButtonVari = _ref.cancelButtonVariant,
|
5521
|
+
cancelButtonVariant = _ref$cancelButtonVari === void 0 ? "contained" : _ref$cancelButtonVari,
|
5522
|
+
_ref$zIndex = _ref.zIndex,
|
5523
|
+
zIndex = _ref$zIndex === void 0 ? 1102 : _ref$zIndex,
|
5524
|
+
toggle = _ref.toggle,
|
5525
|
+
onConfirm = _ref.onConfirm;
|
5526
|
+
var _useState = React.useState(),
|
5527
|
+
confirmTextValue = _useState[0],
|
5528
|
+
setConfirmTextValue = _useState[1];
|
5662
5529
|
var _useTranslation = reactI18next.useTranslation(),
|
5663
5530
|
t = _useTranslation.t;
|
5664
|
-
var
|
5665
|
-
|
5666
|
-
isLoading = true;
|
5667
|
-
}
|
5668
|
-
try {
|
5669
|
-
var _temp3 = function _temp3() {
|
5670
|
-
isLoading && dispatch(setLoading(false));
|
5671
|
-
};
|
5672
|
-
if (!user) return Promise.resolve();
|
5673
|
-
var isSuperAdminUser = user && !user.academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace);
|
5674
|
-
var isSuperAdminRole = user.roles.includes(exports.Role.Admin);
|
5675
|
-
isLoading && dispatch(setLoading(true));
|
5676
|
-
var _temp2 = _catch(function () {
|
5677
|
-
return Promise.resolve(isSuperAdminUser ? getAcademyList(role) : getUserAcademies(role, user === null || user === void 0 ? void 0 : user.isLearningSpace)).then(function (res) {
|
5678
|
-
var items = res.data.items || [];
|
5679
|
-
if (isReFetchUserAcademies) dispatch(setReFetchUserAcademies(false));
|
5680
|
-
dispatch(setAcademies(items));
|
5681
|
-
var _temp = function () {
|
5682
|
-
if (!isSuperAdminRole && isSuperAdminUser && role == exports.Role.Admin && items.length > 0) {
|
5683
|
-
return Promise.resolve(handleSwitchAcademy(false, items[0], false)).then(function () {});
|
5684
|
-
}
|
5685
|
-
}();
|
5686
|
-
if (_temp && _temp.then) return _temp.then(function () {});
|
5687
|
-
});
|
5688
|
-
}, function (error) {
|
5689
|
-
reactToastify.toast.error(getErrorMessage(t, error));
|
5690
|
-
});
|
5691
|
-
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2));
|
5692
|
-
} catch (e) {
|
5693
|
-
return Promise.reject(e);
|
5694
|
-
}
|
5531
|
+
var handleConfirm = function handleConfirm() {
|
5532
|
+
onConfirm();
|
5695
5533
|
};
|
5696
|
-
var
|
5697
|
-
|
5698
|
-
|
5534
|
+
var handleChangeConfirmText = function handleChangeConfirmText(e) {
|
5535
|
+
setConfirmTextValue(e.target.value);
|
5536
|
+
};
|
5537
|
+
var handlePaste = function handlePaste(_) {};
|
5538
|
+
React.useEffect(function () {
|
5539
|
+
!open && setConfirmTextValue(undefined);
|
5540
|
+
}, [open]);
|
5541
|
+
var isValid = !!confirmText && !!confirmTextValue && confirmTextValue.trim() === confirmText.trim();
|
5542
|
+
var isDisableDelete = !!confirmText && (confirmTextValue === null || confirmTextValue === void 0 ? void 0 : confirmTextValue.trim()) !== confirmText.trim();
|
5543
|
+
return React__default.createElement(material.Dialog, {
|
5544
|
+
open: open,
|
5545
|
+
onClose: toggle,
|
5546
|
+
sx: {
|
5547
|
+
zIndex: zIndex
|
5699
5548
|
}
|
5700
|
-
|
5701
|
-
|
5702
|
-
|
5703
|
-
|
5704
|
-
|
5705
|
-
|
5706
|
-
|
5707
|
-
|
5708
|
-
|
5709
|
-
|
5710
|
-
|
5711
|
-
|
5712
|
-
|
5713
|
-
|
5714
|
-
|
5715
|
-
|
5716
|
-
|
5717
|
-
|
5718
|
-
|
5719
|
-
|
5720
|
-
|
5721
|
-
|
5722
|
-
|
5723
|
-
|
5724
|
-
|
5549
|
+
}, React__default.createElement(React.Fragment, null, React__default.createElement(material.DialogTitle, {
|
5550
|
+
className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
|
5551
|
+
sx: _extends({
|
5552
|
+
fontSize: 16
|
5553
|
+
}, titleStyle)
|
5554
|
+
}, title || t('confirmation')), React__default.createElement(material.IconButton, {
|
5555
|
+
"aria-label": "close",
|
5556
|
+
onClick: toggle,
|
5557
|
+
sx: {
|
5558
|
+
position: "absolute",
|
5559
|
+
right: 8,
|
5560
|
+
top: 8,
|
5561
|
+
color: function color(theme) {
|
5562
|
+
return theme.palette.grey[500];
|
5563
|
+
}
|
5564
|
+
}
|
5565
|
+
}, React__default.createElement(io5.IoClose, null))), React__default.createElement(material.DialogContent, {
|
5566
|
+
sx: _extends({
|
5567
|
+
pt: 0.5
|
5568
|
+
}, contentStyle)
|
5569
|
+
}, React__default.createElement(material.Typography, {
|
5570
|
+
className: "mb-1",
|
5571
|
+
sx: _extends({
|
5572
|
+
fontWeight: 700
|
5573
|
+
}, contentTextStyle)
|
5574
|
+
}, text), !!confirmText && React__default.createElement("div", {
|
5575
|
+
className: "w-100"
|
5576
|
+
}, React__default.createElement("p", {
|
5577
|
+
className: "mb-3"
|
5578
|
+
}, t("enter_text_to_confirm_delete", {
|
5579
|
+
text: confirmText
|
5580
|
+
})), React__default.createElement(material.TextField, {
|
5581
|
+
className: "w-100",
|
5582
|
+
sx: {
|
5583
|
+
"& input": {
|
5584
|
+
py: 1
|
5585
|
+
}
|
5586
|
+
},
|
5587
|
+
value: confirmTextValue,
|
5588
|
+
onChange: handleChangeConfirmText,
|
5589
|
+
placeholder: t('please_enter'),
|
5590
|
+
onPaste: handlePaste,
|
5591
|
+
error: !isValid && confirmTextValue !== undefined,
|
5592
|
+
color: isValid ? "success" : confirmTextValue !== undefined ? "error" : undefined
|
5593
|
+
}))), React__default.createElement(material.DialogActions, {
|
5594
|
+
className: "border border-start-0 border-end-0 border-bottom-0 border-1 " + titleClassName,
|
5595
|
+
sx: _extends({
|
5596
|
+
paddingTop: 1
|
5597
|
+
}, actionStyle)
|
5598
|
+
}, React__default.createElement(material.Button, {
|
5599
|
+
variant: cancelButtonVariant,
|
5600
|
+
color: cancelButtonVariant !== "contained" ? "primary" : "secondary",
|
5601
|
+
className: "px-3 " + (cancelButtonVariant !== "contained" ? "primary" : "bg-secondary"),
|
5602
|
+
onClick: toggle,
|
5603
|
+
sx: cancelButtonStyle
|
5604
|
+
}, cancelText || t("no")), React__default.createElement(material.Button, {
|
5605
|
+
variant: okButtonVariant,
|
5606
|
+
color: isDelete ? "error" : "primary",
|
5607
|
+
className: "px-3",
|
5608
|
+
disabled: isDisableDelete,
|
5609
|
+
onClick: handleConfirm,
|
5610
|
+
sx: _extends({}, okButtonStyle, isDelete && {
|
5611
|
+
backgroundColor: "#db4d4d",
|
5612
|
+
color: "#FFFFFF",
|
5613
|
+
"&:hover": {
|
5614
|
+
backgroundColor: "#C41414"
|
5615
|
+
}
|
5616
|
+
})
|
5617
|
+
}, okText || t('yes'))));
|
5618
|
+
};
|
5619
|
+
|
5620
|
+
var ConfirmDeleteDialog = function ConfirmDeleteDialog(props) {
|
5621
|
+
return React__default.createElement(ConfirmDialog, Object.assign({}, ConfirmDeleteDialogDefaultProps, props));
|
5622
|
+
};
|
5623
|
+
|
5624
|
+
var _templateObject;
|
5625
|
+
var BorderedTextField = material.styled(material.TextField)(_templateObject || (_templateObject = _taggedTemplateLiteralLoose(["\n & .MuiOutlinedInput-root {\n &.Mui-focused fieldset {\n border-width: 1px;\n border-color: ", ";\n }\n }\n & .MuiOutlinedInput-root:hover {\n fieldset {\n border-width: 1px;\n border-color: ", ";\n }\n }\n"])), styles.dark, styles.less_dark);
|
5626
|
+
var InputText = function InputText(props) {
|
5627
|
+
return React__default.createElement(BorderedTextField, Object.assign({
|
5628
|
+
sx: {
|
5629
|
+
"& input": {
|
5630
|
+
py: "7.5px",
|
5631
|
+
px: "12px"
|
5632
|
+
},
|
5633
|
+
"& > div": {
|
5634
|
+
borderColor: "#97A1AF",
|
5635
|
+
borderRadius: "4px"
|
5636
|
+
}
|
5725
5637
|
}
|
5638
|
+
}, props));
|
5639
|
+
};
|
5640
|
+
|
5641
|
+
var PassCodeDialog = function PassCodeDialog(_ref) {
|
5642
|
+
var open = _ref.open,
|
5643
|
+
onClose = _ref.onClose,
|
5644
|
+
onSubmit = _ref.onSubmit,
|
5645
|
+
academyDomain = _ref.academyDomain;
|
5646
|
+
var _useTranslation = reactI18next.useTranslation(),
|
5647
|
+
t = _useTranslation.t;
|
5648
|
+
var _useState = React.useState(""),
|
5649
|
+
passCode = _useState[0],
|
5650
|
+
setPassCode = _useState[1];
|
5651
|
+
var handleClose = function handleClose(event, reason) {
|
5652
|
+
onClose(event, reason);
|
5726
5653
|
};
|
5727
|
-
var
|
5654
|
+
var handleSubmit = function handleSubmit() {
|
5728
5655
|
try {
|
5729
|
-
var
|
5730
|
-
|
5731
|
-
|
5656
|
+
var data = {
|
5657
|
+
code: passCode,
|
5658
|
+
academyDomain: academyDomain
|
5732
5659
|
};
|
5733
|
-
|
5734
|
-
var _temp6 = _catch(function () {
|
5735
|
-
return Promise.resolve(switchAcademy(0, role)).then(function (res) {
|
5736
|
-
var data = res.data;
|
5737
|
-
var requestBody = {
|
5738
|
-
accessToken: data.accessToken,
|
5739
|
-
email: user.email,
|
5740
|
-
role: role
|
5741
|
-
};
|
5742
|
-
return Promise.resolve(handleLoginAccessToken(requestBody, undefined, undefined, false)).then(function () {});
|
5743
|
-
});
|
5744
|
-
}, function (error) {
|
5745
|
-
reactToastify.toast.error(getErrorMessage(t, error));
|
5746
|
-
});
|
5747
|
-
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp7) : _temp7(_temp6));
|
5660
|
+
return Promise.resolve(onSubmit(data, handleClose)).then(function () {});
|
5748
5661
|
} catch (e) {
|
5749
5662
|
return Promise.reject(e);
|
5750
5663
|
}
|
5751
5664
|
};
|
5752
|
-
|
5753
|
-
|
5754
|
-
}, [canFetchAcademies, user === null || user === void 0 ? void 0 : user.academyDomain, user === null || user === void 0 ? void 0 : user.email, user === null || user === void 0 ? void 0 : (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.join(",")]);
|
5755
|
-
React.useEffect(function () {
|
5756
|
-
canFetchAcademies && isReFetchUserAcademies && getAcademies(false);
|
5757
|
-
}, [canFetchAcademies, isReFetchUserAcademies]);
|
5758
|
-
var selectedAcademy = React.useMemo(function () {
|
5759
|
-
return academyList.find(function (i) {
|
5760
|
-
var _user$academyDomain;
|
5761
|
-
return i.domain.trim().toLowerCase() === (user === null || user === void 0 ? void 0 : (_user$academyDomain = user.academyDomain) === null || _user$academyDomain === void 0 ? void 0 : _user$academyDomain.trim().toLowerCase());
|
5762
|
-
});
|
5763
|
-
}, [user === null || user === void 0 ? void 0 : user.academyDomain, JSON.stringify(academyList)]);
|
5764
|
-
return {
|
5765
|
-
selectedAcademy: selectedAcademy,
|
5766
|
-
dropdownOpen: dropdownOpen,
|
5767
|
-
academyList: academyList,
|
5768
|
-
toggleDropdown: toggleDropdown,
|
5769
|
-
handleSwitchAcademy: handleSwitchAcademy,
|
5770
|
-
handleLogOutAcademy: handleLogOutAcademy
|
5665
|
+
var handleChangePassCode = function handleChangePassCode(e) {
|
5666
|
+
setPassCode(e.target.value);
|
5771
5667
|
};
|
5668
|
+
var theme = material.useTheme();
|
5669
|
+
return React__default.createElement(CommonDialog, {
|
5670
|
+
open: open,
|
5671
|
+
onClose: handleClose,
|
5672
|
+
size: "xs",
|
5673
|
+
title: t("join_an_academy")
|
5674
|
+
}, React__default.createElement(material.DialogContent, {
|
5675
|
+
sx: {
|
5676
|
+
overflowY: "unset"
|
5677
|
+
}
|
5678
|
+
}, React__default.createElement(material.Stack, {
|
5679
|
+
direction: "column",
|
5680
|
+
spacing: 2,
|
5681
|
+
zIndex: 1,
|
5682
|
+
position: "relative"
|
5683
|
+
}, React__default.createElement(material.FormGroup, null, React__default.createElement(material.FormLabel, {
|
5684
|
+
className: "fw-medium mb-1"
|
5685
|
+
}, t("pass_code"), React__default.createElement("span", {
|
5686
|
+
className: "text-danger"
|
5687
|
+
}, "*")), React__default.createElement(InputText, {
|
5688
|
+
id: "pass-code",
|
5689
|
+
placeholder: t("enter_pass_code"),
|
5690
|
+
value: passCode,
|
5691
|
+
onChange: handleChangePassCode
|
5692
|
+
})))), React__default.createElement(material.DialogActions, {
|
5693
|
+
className: ""
|
5694
|
+
}, React__default.createElement(material.Button, {
|
5695
|
+
variant: "contained",
|
5696
|
+
sx: {
|
5697
|
+
bgcolor: theme.palette.grey[700]
|
5698
|
+
},
|
5699
|
+
onClick: handleClose
|
5700
|
+
}, t("cancel")), React__default.createElement(material.Button, {
|
5701
|
+
variant: "contained",
|
5702
|
+
onClick: handleSubmit,
|
5703
|
+
disabled: !passCode.trim().length
|
5704
|
+
}, t("confirmation"))));
|
5772
5705
|
};
|
5773
5706
|
|
5774
|
-
var
|
5775
|
-
|
5776
|
-
|
5777
|
-
|
5778
|
-
|
5779
|
-
|
5780
|
-
|
5781
|
-
|
5782
|
-
|
5783
|
-
|
5784
|
-
|
5785
|
-
|
5786
|
-
|
5787
|
-
|
5788
|
-
|
5789
|
-
|
5790
|
-
|
5791
|
-
|
5792
|
-
|
5793
|
-
|
5794
|
-
|
5795
|
-
|
5796
|
-
|
5797
|
-
|
5798
|
-
|
5799
|
-
|
5800
|
-
|
5801
|
-
|
5802
|
-
|
5803
|
-
|
5804
|
-
|
5805
|
-
|
5806
|
-
|
5807
|
-
|
5808
|
-
|
5809
|
-
|
5810
|
-
|
5811
|
-
|
5812
|
-
|
5813
|
-
|
5814
|
-
|
5815
|
-
|
5816
|
-
|
5817
|
-
|
5818
|
-
|
5819
|
-
|
5820
|
-
|
5821
|
-
|
5822
|
-
|
5823
|
-
|
5824
|
-
|
5825
|
-
|
5826
|
-
|
5827
|
-
|
5828
|
-
|
5829
|
-
},
|
5830
|
-
|
5831
|
-
|
5832
|
-
|
5833
|
-
|
5834
|
-
|
5835
|
-
|
5836
|
-
|
5837
|
-
|
5838
|
-
|
5839
|
-
|
5840
|
-
handleChangeStartIndex: handleChangeStartIndex,
|
5841
|
-
handleChangeEndIndex: handleChangeEndIndex
|
5707
|
+
var loadingStyle = {
|
5708
|
+
minWidth: "100vw",
|
5709
|
+
minHeight: "100vh",
|
5710
|
+
position: "fixed",
|
5711
|
+
top: 0,
|
5712
|
+
left: 0,
|
5713
|
+
zIndex: 999999999,
|
5714
|
+
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
5715
|
+
display: "flex",
|
5716
|
+
justifyContent: "center",
|
5717
|
+
alignItems: "center"
|
5718
|
+
};
|
5719
|
+
var Loading = function Loading() {
|
5720
|
+
var isLoading = reactRedux.useSelector(function (state) {
|
5721
|
+
return state.common.isLoading;
|
5722
|
+
});
|
5723
|
+
return isLoading ? React__default.createElement("div", {
|
5724
|
+
style: loadingStyle
|
5725
|
+
}, React__default.createElement("div", {
|
5726
|
+
className: "spinner-border text-secondary",
|
5727
|
+
role: "status"
|
5728
|
+
}, React__default.createElement("span", {
|
5729
|
+
className: "sr-only"
|
5730
|
+
}))) : null;
|
5731
|
+
};
|
5732
|
+
|
5733
|
+
var loadingStyle$1 = {
|
5734
|
+
minWidth: "100vw",
|
5735
|
+
minHeight: "100vh",
|
5736
|
+
position: "fixed",
|
5737
|
+
top: 0,
|
5738
|
+
left: 0,
|
5739
|
+
zIndex: 999999999,
|
5740
|
+
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
5741
|
+
display: "flex",
|
5742
|
+
justifyContent: "center",
|
5743
|
+
alignItems: "center"
|
5744
|
+
};
|
5745
|
+
var LoadingComponent = function LoadingComponent(_ref) {
|
5746
|
+
var isLoading = _ref.isLoading,
|
5747
|
+
children = _ref.children,
|
5748
|
+
_ref$spinClassName = _ref.spinClassName,
|
5749
|
+
spinClassName = _ref$spinClassName === void 0 ? "text-secondary" : _ref$spinClassName,
|
5750
|
+
_ref$className = _ref.className,
|
5751
|
+
className = _ref$className === void 0 ? "" : _ref$className;
|
5752
|
+
return isLoading ? React__default.createElement("div", {
|
5753
|
+
style: loadingStyle$1
|
5754
|
+
}, React__default.createElement(material.Stack, {
|
5755
|
+
direction: "column",
|
5756
|
+
justifyContent: "center",
|
5757
|
+
alignItems: "center",
|
5758
|
+
className: className
|
5759
|
+
}, React__default.createElement("div", {
|
5760
|
+
className: "spinner-border " + spinClassName,
|
5761
|
+
role: "status"
|
5762
|
+
}, React__default.createElement("span", {
|
5763
|
+
className: "sr-only"
|
5764
|
+
})), React__default.createElement("div", null, children))) : null;
|
5765
|
+
};
|
5766
|
+
|
5767
|
+
var CustomPagination = function CustomPagination(_ref) {
|
5768
|
+
var currentPage = _ref.currentPage,
|
5769
|
+
totalPage = _ref.totalPage,
|
5770
|
+
onChangePage = _ref.onChangePage;
|
5771
|
+
var handleChangePage = function handleChangePage(_, page) {
|
5772
|
+
onChangePage(page);
|
5842
5773
|
};
|
5774
|
+
return React__default.createElement(material.Pagination, {
|
5775
|
+
className: "w-fit",
|
5776
|
+
count: totalPage,
|
5777
|
+
page: currentPage,
|
5778
|
+
onChange: handleChangePage
|
5779
|
+
});
|
5843
5780
|
};
|
5844
5781
|
|
5845
|
-
|
5846
|
-
|
5847
|
-
|
5848
|
-
|
5849
|
-
|
5850
|
-
|
5851
|
-
|
5782
|
+
var DropdownIndicator = function DropdownIndicator(props) {
|
5783
|
+
return React__default.createElement(Select.components.DropdownIndicator, Object.assign({}, props), React__default.createElement(fa.FaCaretDown, {
|
5784
|
+
size: 20,
|
5785
|
+
color: styles.darker
|
5786
|
+
}));
|
5787
|
+
};
|
5788
|
+
var CustomOption = function CustomOption(props) {
|
5789
|
+
return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement("div", {
|
5790
|
+
style: {
|
5791
|
+
fontSize: "14px",
|
5792
|
+
fontWeight: 500
|
5793
|
+
}
|
5794
|
+
}, props.data.label));
|
5795
|
+
};
|
5852
5796
|
|
5853
|
-
var
|
5854
|
-
|
5855
|
-
|
5856
|
-
|
5857
|
-
|
5797
|
+
var customStyles = {
|
5798
|
+
control: function control(baseStyles, state) {
|
5799
|
+
return _extends({}, baseStyles, {
|
5800
|
+
fontSize: "14px",
|
5801
|
+
fontWeight: 700,
|
5802
|
+
color: styles.darker,
|
5803
|
+
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark,
|
5804
|
+
boxShadow: state.isFocused ? "0 0 0 1px " + styles.dark + "4D" : baseStyles.boxShadow,
|
5805
|
+
"&:active": {
|
5806
|
+
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
|
5807
|
+
},
|
5808
|
+
"&:hover": {
|
5809
|
+
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
|
5810
|
+
}
|
5811
|
+
});
|
5858
5812
|
},
|
5859
|
-
|
5860
|
-
return
|
5813
|
+
input: function input(baseStyles, _) {
|
5814
|
+
return _extends({}, baseStyles, {
|
5815
|
+
fontSize: "14px",
|
5816
|
+
fontWeight: 700,
|
5817
|
+
color: styles.darker
|
5818
|
+
});
|
5819
|
+
},
|
5820
|
+
singleValue: function singleValue(baseStyles) {
|
5821
|
+
return _extends({}, baseStyles, {
|
5822
|
+
fontSize: "14px",
|
5823
|
+
fontWeight: 700,
|
5824
|
+
color: styles.darker
|
5825
|
+
});
|
5826
|
+
},
|
5827
|
+
option: function option(baseStyles, state) {
|
5828
|
+
return _extends({}, baseStyles, {
|
5829
|
+
backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.light : 'white',
|
5830
|
+
"&:active": {
|
5831
|
+
backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.less_dark : baseStyles.backgroundColor
|
5832
|
+
}
|
5833
|
+
});
|
5861
5834
|
}
|
5862
|
-
}
|
5863
|
-
var apiUpload = axios.create({
|
5864
|
-
baseURL: BASE_URL,
|
5865
|
-
timeout: 60000,
|
5866
|
-
headers: {
|
5867
|
-
"Content-Type": "multipart/form-data"
|
5868
|
-
}
|
5869
|
-
});
|
5870
|
-
[api, apiUpload].forEach(function (i) {
|
5871
|
-
return i.interceptors.request.use(function (config) {
|
5872
|
-
var token = getAccessToken();
|
5873
|
-
var searchParams = new URLSearchParams(window.location.search);
|
5874
|
-
var paramLang = searchParams.get('lang');
|
5875
|
-
var academyDomainStorage = getAcademyDomain();
|
5876
|
-
var isLearningSpace = getLearningSpace();
|
5877
|
-
var langStorage = getLanguage();
|
5878
|
-
var academyDomain = academyDomainStorage;
|
5879
|
-
var language = paramLang || langStorage;
|
5880
|
-
if (token) {
|
5881
|
-
config.headers.Authorization = "Bearer " + token;
|
5882
|
-
localStorage.setItem("LAST_TIME_REQUEST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
5883
|
-
}
|
5884
|
-
if (academyDomain && !isLearningSpace && config.headers[AcademyHeaders] == undefined) config.headers[AcademyHeaders] = "" + academyDomain;
|
5885
|
-
if (isLearningSpace && config.headers[NoAcademyHeaders] == undefined) config.headers[NoAcademyHeaders] = "" + isLearningSpace;
|
5886
|
-
if (language) config.headers[LanguageHeaders] = "" + language;
|
5887
|
-
return config;
|
5888
|
-
}, function (error) {
|
5889
|
-
return Promise.reject(error);
|
5890
|
-
});
|
5891
|
-
});
|
5892
|
-
[api, apiUpload].forEach(function (i) {
|
5893
|
-
return i.interceptors.response.use(function (response) {
|
5894
|
-
return response;
|
5895
|
-
}, function (error) {
|
5896
|
-
var _error$response, _error$response2, _error$response3;
|
5897
|
-
console.log({
|
5898
|
-
error: error
|
5899
|
-
});
|
5900
|
-
if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 401) {
|
5901
|
-
var _window$location = window.location,
|
5902
|
-
pathname = _window$location.pathname,
|
5903
|
-
search = _window$location.search;
|
5904
|
-
var preRedirectUrl = localStorage.getItem(PRE_REDIRECT_URL);
|
5905
|
-
var newRedirectUrl = "" + pathname + search;
|
5906
|
-
if (!pathname.startsWith("/login")) {
|
5907
|
-
if (preRedirectUrl !== newRedirectUrl) {
|
5908
|
-
localStorage.setItem(REDIRECT_URL, newRedirectUrl);
|
5909
|
-
localStorage.setItem(PRE_REDIRECT_URL, newRedirectUrl);
|
5910
|
-
}
|
5911
|
-
}
|
5912
|
-
}
|
5913
|
-
if (((_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 401 || ((_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.status) == 403) {
|
5914
|
-
localStorage.removeItem(ACCESS_TOKEN);
|
5915
|
-
window.location.href = "/login";
|
5916
|
-
}
|
5917
|
-
return Promise.reject(error);
|
5918
|
-
});
|
5919
|
-
});
|
5835
|
+
};
|
5920
5836
|
|
5921
|
-
var
|
5922
|
-
|
5923
|
-
|
5924
|
-
|
5925
|
-
|
5926
|
-
|
5927
|
-
|
5837
|
+
var _excluded = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
5838
|
+
var CustomAsyncSelect = function CustomAsyncSelect(_ref) {
|
5839
|
+
var isDefault = _ref.isDefault,
|
5840
|
+
options = _ref.options,
|
5841
|
+
isDisabled = _ref.isDisabled,
|
5842
|
+
scrollBottom = _ref.scrollBottom,
|
5843
|
+
value = _ref.value,
|
5844
|
+
isMulti = _ref.isMulti,
|
5845
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
5846
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
5847
|
+
return value.includes(i.value);
|
5848
|
+
}) : isMulti ? options.filter(function (i) {
|
5849
|
+
return i.value == value;
|
5850
|
+
}) : options.find(function (i) {
|
5851
|
+
return i.value == value;
|
5852
|
+
});
|
5853
|
+
var _useTranslation = reactI18next.useTranslation(),
|
5854
|
+
t = _useTranslation.t;
|
5855
|
+
return React__default.createElement(Select__default, Object.assign({
|
5856
|
+
isDisabled: isDisabled,
|
5857
|
+
options: options,
|
5858
|
+
value: !isDefault ? initialValues : undefined,
|
5859
|
+
defaultValue: isDefault ? initialValues : undefined,
|
5860
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5861
|
+
isMulti: isMulti,
|
5862
|
+
components: {
|
5863
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5864
|
+
return null;
|
5865
|
+
},
|
5866
|
+
DropdownIndicator: DropdownIndicator,
|
5867
|
+
Option: CustomOption
|
5868
|
+
},
|
5869
|
+
styles: customStyles,
|
5870
|
+
placeholder: t("select_placeholder")
|
5871
|
+
}, rest));
|
5872
|
+
};
|
5928
5873
|
|
5929
|
-
var
|
5930
|
-
|
5931
|
-
|
5932
|
-
|
5933
|
-
|
5934
|
-
|
5935
|
-
|
5936
|
-
|
5937
|
-
value
|
5938
|
-
|
5939
|
-
|
5940
|
-
|
5941
|
-
}
|
5874
|
+
var _excluded$1 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
5875
|
+
var CustomCreatable = function CustomCreatable(_ref) {
|
5876
|
+
var options = _ref.options,
|
5877
|
+
isDisabled = _ref.isDisabled,
|
5878
|
+
scrollBottom = _ref.scrollBottom,
|
5879
|
+
value = _ref.value,
|
5880
|
+
isMulti = _ref.isMulti,
|
5881
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
5882
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
5883
|
+
return value.includes(i.value);
|
5884
|
+
}) : isMulti ? options.filter(function (i) {
|
5885
|
+
return i.value == value;
|
5886
|
+
}) : options.find(function (i) {
|
5887
|
+
return i.value == value;
|
5888
|
+
});
|
5889
|
+
var _useTranslation = reactI18next.useTranslation(),
|
5890
|
+
t = _useTranslation.t;
|
5891
|
+
return React__default.createElement(CreatableSelect, Object.assign({
|
5892
|
+
isClearable: true,
|
5893
|
+
isDisabled: isDisabled,
|
5894
|
+
options: options,
|
5895
|
+
value: initialValues,
|
5896
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5897
|
+
isMulti: isMulti,
|
5898
|
+
components: {
|
5899
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5900
|
+
return null;
|
5901
|
+
},
|
5902
|
+
DropdownIndicator: DropdownIndicator,
|
5903
|
+
Option: CustomOption
|
5904
|
+
},
|
5905
|
+
styles: customStyles,
|
5906
|
+
placeholder: t("select_placeholder")
|
5907
|
+
}, rest));
|
5908
|
+
};
|
5942
5909
|
|
5943
|
-
var
|
5944
|
-
var
|
5945
|
-
var
|
5946
|
-
|
5947
|
-
|
5910
|
+
var _excluded$2 = ["isDefault", "defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti"];
|
5911
|
+
var CustomSelect = function CustomSelect(_ref) {
|
5912
|
+
var isDefault = _ref.isDefault,
|
5913
|
+
options = _ref.options,
|
5914
|
+
isDisabled = _ref.isDisabled,
|
5915
|
+
scrollBottom = _ref.scrollBottom,
|
5916
|
+
value = _ref.value,
|
5917
|
+
isMulti = _ref.isMulti,
|
5918
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
5948
5919
|
var _useTranslation = reactI18next.useTranslation(),
|
5949
5920
|
t = _useTranslation.t;
|
5950
|
-
var
|
5951
|
-
|
5952
|
-
|
5953
|
-
|
5954
|
-
|
5955
|
-
|
5956
|
-
}) : dataExamSession.map(function (i) {
|
5957
|
-
return {
|
5958
|
-
code: i === null || i === void 0 ? void 0 : i.code
|
5959
|
-
};
|
5960
|
-
});
|
5961
|
-
useLanguage(history);
|
5962
|
-
var _useState = React.useState(dataProps),
|
5963
|
-
data = _useState[0],
|
5964
|
-
setData = _useState[1];
|
5965
|
-
var _useState2 = React.useState([]),
|
5966
|
-
completed = _useState2[0],
|
5967
|
-
setCompleted = _useState2[1];
|
5968
|
-
var _useState3 = React.useState([]),
|
5969
|
-
inprogress = _useState3[0],
|
5970
|
-
setInProgress = _useState3[1];
|
5971
|
-
var _useState4 = React.useState(PrintState.Idling),
|
5972
|
-
state = _useState4[0],
|
5973
|
-
setState = _useState4[1];
|
5974
|
-
var _useState5 = React.useState([]),
|
5975
|
-
errorLinks = _useState5[0],
|
5976
|
-
setErrorLinks = _useState5[1];
|
5977
|
-
var _useState6 = React.useState([]),
|
5978
|
-
status = _useState6[0],
|
5979
|
-
setStatus = _useState6[1];
|
5980
|
-
var theme = material.useTheme();
|
5981
|
-
var handleChangeStatus = function handleChangeStatus(event) {
|
5982
|
-
if (event.target.checked) {
|
5983
|
-
setStatus(function (prev) {
|
5984
|
-
var _event$target;
|
5985
|
-
return [].concat(prev, [(_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.value]);
|
5986
|
-
});
|
5987
|
-
} else setStatus(function (prev) {
|
5988
|
-
return prev === null || prev === void 0 ? void 0 : prev.filter(function (i) {
|
5989
|
-
var _event$target2;
|
5990
|
-
return i !== ((_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.value);
|
5991
|
-
});
|
5992
|
-
});
|
5993
|
-
};
|
5994
|
-
var handleProgressPrint = function handleProgressPrint() {
|
5995
|
-
setData(dataProps);
|
5996
|
-
setCompleted([]);
|
5997
|
-
setInProgress([]);
|
5998
|
-
setErrorLinks([]);
|
5999
|
-
setState(PrintState.Printing);
|
6000
|
-
};
|
6001
|
-
console.log({
|
6002
|
-
status: status
|
5921
|
+
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
5922
|
+
return value.includes(i.value);
|
5923
|
+
}) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
|
5924
|
+
return i.value == value;
|
5925
|
+
}) : options === null || options === void 0 ? void 0 : options.find(function (i) {
|
5926
|
+
return i.value == value;
|
6003
5927
|
});
|
6004
|
-
|
6005
|
-
|
6006
|
-
|
6007
|
-
|
6008
|
-
|
6009
|
-
|
6010
|
-
|
6011
|
-
|
6012
|
-
|
6013
|
-
|
6014
|
-
|
6015
|
-
|
6016
|
-
|
6017
|
-
|
6018
|
-
|
6019
|
-
|
6020
|
-
|
6021
|
-
studentId: "" + studentId,
|
6022
|
-
message: isTeacher ? "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print" : "/student/exam-results/" + code + "/print"
|
6023
|
-
}]);
|
6024
|
-
});
|
6025
|
-
if (!isTeacher) {
|
6026
|
-
setData(function (es) {
|
6027
|
-
return [].concat(es.filter(function (i) {
|
6028
|
-
return i.code !== code;
|
6029
|
-
}));
|
6030
|
-
});
|
6031
|
-
} else {
|
6032
|
-
setData(function (es) {
|
6033
|
-
return [].concat(es.filter(function (i) {
|
6034
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6035
|
-
}));
|
6036
|
-
});
|
6037
|
-
}
|
6038
|
-
return;
|
6039
|
-
}
|
6040
|
-
if (!isTeacher) {
|
6041
|
-
setInProgress(function (es) {
|
6042
|
-
return [].concat(es.filter(function (i) {
|
6043
|
-
return i.code !== code;
|
6044
|
-
}), [{
|
6045
|
-
code: code
|
6046
|
-
}]);
|
6047
|
-
});
|
6048
|
-
setData(function (es) {
|
6049
|
-
return [].concat(es.filter(function (i) {
|
6050
|
-
return i.code !== code;
|
6051
|
-
}));
|
6052
|
-
});
|
6053
|
-
} else {
|
6054
|
-
setInProgress(function (es) {
|
6055
|
-
return [].concat(es.filter(function (i) {
|
6056
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6057
|
-
}), [{
|
6058
|
-
examSessionId: examSessionId,
|
6059
|
-
studentId: studentId
|
6060
|
-
}]);
|
6061
|
-
});
|
6062
|
-
setData(function (es) {
|
6063
|
-
return [].concat(es.filter(function (i) {
|
6064
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6065
|
-
}));
|
6066
|
-
});
|
6067
|
-
}
|
6068
|
-
window.addEventListener("message", function (event) {
|
6069
|
-
var isCheck = isTeacher ? event.data.examSessionId !== "" + examSessionId || event.data.studentId !== "" + studentId : event.data.code !== "" + code;
|
6070
|
-
if (event.origin !== window.location.origin || isCheck) {
|
6071
|
-
return;
|
6072
|
-
}
|
6073
|
-
if (event.data.succeed) {
|
6074
|
-
if (!isTeacher) {
|
6075
|
-
setCompleted(function (es) {
|
6076
|
-
return [].concat(es.filter(function (i) {
|
6077
|
-
return i.code !== code;
|
6078
|
-
}), [{
|
6079
|
-
code: code
|
6080
|
-
}]);
|
6081
|
-
});
|
6082
|
-
setInProgress(function (es) {
|
6083
|
-
return [].concat(es.filter(function (i) {
|
6084
|
-
return i.code !== code;
|
6085
|
-
}));
|
6086
|
-
});
|
6087
|
-
} else {
|
6088
|
-
setCompleted(function (es) {
|
6089
|
-
return [].concat(es.filter(function (i) {
|
6090
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6091
|
-
}), [{
|
6092
|
-
examSessionId: examSessionId,
|
6093
|
-
studentId: studentId
|
6094
|
-
}]);
|
6095
|
-
});
|
6096
|
-
setInProgress(function (es) {
|
6097
|
-
return [].concat(es.filter(function (i) {
|
6098
|
-
return i.examSessionId !== examSessionId || i.studentId !== studentId;
|
6099
|
-
}));
|
6100
|
-
});
|
6101
|
-
}
|
6102
|
-
} else {
|
6103
|
-
setErrorLinks(function (prev) {
|
6104
|
-
var _event$data, _event$data2;
|
6105
|
-
return [].concat(prev, [{
|
6106
|
-
code: (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.code,
|
6107
|
-
examSessionId: (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.examSessionId,
|
6108
|
-
studentId: "" + studentId,
|
6109
|
-
message: isTeacher ? "/teacher/exam-results/" + event.data.examSessionId + "/students/" + event.data.studentId + "/print" : "/student/exam-results/" + event.data.code + "/print"
|
6110
|
-
}]);
|
6111
|
-
});
|
6112
|
-
}
|
6113
|
-
childWindow === null || childWindow === void 0 ? void 0 : childWindow.close();
|
6114
|
-
});
|
6115
|
-
};
|
6116
|
-
React.useEffect(function () {
|
6117
|
-
if (inprogress.length < TOTAL && data.length > 0 && state === PrintState.Printing) {
|
6118
|
-
var item = data[0];
|
6119
|
-
print({
|
6120
|
-
examSessionId: item === null || item === void 0 ? void 0 : item.examSessionId,
|
6121
|
-
studentId: item === null || item === void 0 ? void 0 : item.studentId,
|
6122
|
-
code: item === null || item === void 0 ? void 0 : item.code
|
6123
|
-
});
|
6124
|
-
}
|
6125
|
-
}, [inprogress.length, completed.length, data.length, state, data]);
|
6126
|
-
return React__default.createElement(material.Container, null, state === PrintState.Idling ? React__default.createElement(material.Typography, null, t("total_number_of_selected_results") + ": ", " ", React__default.createElement("span", {
|
6127
|
-
className: "fw-bold"
|
6128
|
-
}, t("number_results", {
|
6129
|
-
number: ("" + data.length).padStart(2, "0")
|
6130
|
-
}))) : React__default.createElement(React.Fragment, null, React__default.createElement(material.Typography, null, t("completed") + ": ", React__default.createElement("span", {
|
6131
|
-
className: "fw-bold"
|
6132
|
-
}, t("number_results", {
|
6133
|
-
number: ("" + completed.length).padStart(2, "0")
|
6134
|
-
}))), React__default.createElement(material.Typography, null, t("in_progress") + ": ", React__default.createElement("span", {
|
6135
|
-
className: "fw-bold"
|
6136
|
-
}, t("number_results", {
|
6137
|
-
number: ("" + inprogress.length).padStart(2, "0")
|
6138
|
-
}))), React__default.createElement(material.Typography, null, t("remaining") + ": ", React__default.createElement("span", {
|
6139
|
-
className: "fw-bold"
|
6140
|
-
}, t("number_results", {
|
6141
|
-
number: ("" + data.length).padStart(2, "0")
|
6142
|
-
})))), !!errorLinks.length && React__default.createElement(material.Stack, {
|
6143
|
-
className: "mt-2"
|
6144
|
-
}, React__default.createElement(material.Typography, {
|
6145
|
-
fontWeight: 700
|
6146
|
-
}, t("download_failed"), ":"), Array.from(new Set(errorLinks)).map(function (i) {
|
6147
|
-
var _info$createdBy;
|
6148
|
-
var info = isTeacher ? dataExamSession.find(function (exam) {
|
6149
|
-
return "" + (exam === null || exam === void 0 ? void 0 : exam.examSessionId) === "" + (i === null || i === void 0 ? void 0 : i.examSessionId) && "" + (exam === null || exam === void 0 ? void 0 : exam.studentId) === "" + (i === null || i === void 0 ? void 0 : i.studentId);
|
6150
|
-
}) : dataExamSession.find(function (exam) {
|
6151
|
-
return (exam === null || exam === void 0 ? void 0 : exam.code) === (i === null || i === void 0 ? void 0 : i.code);
|
6152
|
-
});
|
6153
|
-
return React__default.createElement(material.Stack, {
|
6154
|
-
borderBottom: 1,
|
6155
|
-
borderColor: theme.palette.grey[500]
|
6156
|
-
}, React__default.createElement("a", {
|
6157
|
-
href: i.message,
|
6158
|
-
target: "_blank",
|
6159
|
-
rel: "noopener noreferrer"
|
6160
|
-
}, (info === null || info === void 0 ? void 0 : info.studentName) || (info === null || info === void 0 ? void 0 : (_info$createdBy = info.createdBy) === null || _info$createdBy === void 0 ? void 0 : _info$createdBy.fullName)), (info === null || info === void 0 ? void 0 : info.title) && React__default.createElement(material.Typography, null, t("exam") + ": " + (info === null || info === void 0 ? void 0 : info.title)), (info === null || info === void 0 ? void 0 : info.startTime) && React__default.createElement(material.Typography, null, t("start_time") + ": " + utcToLocalTime(info === null || info === void 0 ? void 0 : info.startTime, t("date_time_format"))));
|
6161
|
-
})), React__default.createElement(material.Stack, {
|
6162
|
-
direction: "column",
|
6163
|
-
className: "mt-3"
|
6164
|
-
}, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
6165
|
-
className: "fw-bold"
|
6166
|
-
}, React__default.createElement("span", {
|
6167
|
-
className: "text-danger me-1"
|
6168
|
-
}, "*"), t("your_browser_must"), ":"), React__default.createElement(material.List, {
|
6169
|
-
className: "ps-3 pt-0"
|
6170
|
-
}, React__default.createElement(material.ListItem, {
|
6171
|
-
disablePadding: true
|
6172
|
-
}, t("allowed_to_send_pop_ups_and_use_redirects")), React__default.createElement(material.ListItem, {
|
6173
|
-
disablePadding: true
|
6174
|
-
}, t("disable_ask_where_to_save_each_file_before_downloading")))), isTeacher && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
|
6175
|
-
fontWeight: 700
|
6176
|
-
}, t("choose_to_print"), ":"), React__default.createElement(material.FormGroup, {
|
6177
|
-
sx: {
|
6178
|
-
display: "flex",
|
6179
|
-
flexDirection: "row",
|
6180
|
-
gap: 1,
|
6181
|
-
flexWrap: "wrap"
|
6182
|
-
}
|
6183
|
-
}, TabList.map(function (_ref3) {
|
6184
|
-
var label = _ref3.label,
|
6185
|
-
value = _ref3.value;
|
6186
|
-
return React__default.createElement(material.FormControlLabel, {
|
6187
|
-
control: React__default.createElement(material.Checkbox, {
|
6188
|
-
onChange: handleChangeStatus,
|
6189
|
-
value: value,
|
6190
|
-
checked: status.some(function (i) {
|
6191
|
-
return i === value.toString();
|
6192
|
-
})
|
6193
|
-
}),
|
6194
|
-
label: t(label)
|
6195
|
-
});
|
6196
|
-
}))), React__default.createElement(material.Button, {
|
6197
|
-
className: "mt-3",
|
6198
|
-
variant: "contained",
|
6199
|
-
onClick: handleProgressPrint
|
6200
|
-
}, t("print_pdf"))));
|
5928
|
+
return React__default.createElement(Select__default, Object.assign({
|
5929
|
+
isDisabled: isDisabled,
|
5930
|
+
options: options,
|
5931
|
+
value: !isDefault ? initialValues != null ? initialValues : null : undefined,
|
5932
|
+
defaultValue: isDefault ? initialValues : undefined,
|
5933
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5934
|
+
isMulti: isMulti,
|
5935
|
+
components: {
|
5936
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5937
|
+
return null;
|
5938
|
+
},
|
5939
|
+
DropdownIndicator: DropdownIndicator,
|
5940
|
+
Option: CustomOption
|
5941
|
+
},
|
5942
|
+
styles: customStyles,
|
5943
|
+
placeholder: t("select_placeholder")
|
5944
|
+
}, rest));
|
6201
5945
|
};
|
6202
5946
|
|
6203
|
-
var
|
5947
|
+
var _excluded$3 = ["defaultValue", "options", "isDisabled", "scrollBottom", "value", "isMulti", "valueById", "isTextbook"];
|
5948
|
+
var CustomSelectOption = function CustomSelectOption(_ref) {
|
5949
|
+
var defaultValue = _ref.defaultValue,
|
5950
|
+
options = _ref.options,
|
5951
|
+
isDisabled = _ref.isDisabled,
|
5952
|
+
scrollBottom = _ref.scrollBottom,
|
5953
|
+
value = _ref.value,
|
5954
|
+
isMulti = _ref.isMulti,
|
5955
|
+
valueById = _ref.valueById,
|
5956
|
+
isTextbook = _ref.isTextbook,
|
5957
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
|
6204
5958
|
var _useTranslation = reactI18next.useTranslation(),
|
6205
5959
|
t = _useTranslation.t;
|
6206
|
-
var
|
6207
|
-
|
6208
|
-
|
6209
|
-
|
6210
|
-
|
6211
|
-
|
6212
|
-
|
6213
|
-
|
6214
|
-
|
6215
|
-
|
6216
|
-
|
6217
|
-
|
6218
|
-
|
6219
|
-
|
6220
|
-
|
6221
|
-
|
6222
|
-
|
6223
|
-
|
6224
|
-
|
6225
|
-
|
6226
|
-
|
6227
|
-
|
6228
|
-
|
5960
|
+
var initialValues = defaultValue !== null && typeof defaultValue !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
|
5961
|
+
return option.value === defaultValue;
|
5962
|
+
})) || null : null;
|
5963
|
+
var optionValue = valueById !== null && typeof valueById !== "undefined" ? (options === null || options === void 0 ? void 0 : options.find(function (option) {
|
5964
|
+
return option.value == valueById;
|
5965
|
+
})) || {
|
5966
|
+
label: valueById,
|
5967
|
+
value: valueById
|
5968
|
+
} : null;
|
5969
|
+
return isTextbook ? React__default.createElement(CreatableSelect, Object.assign({
|
5970
|
+
isDisabled: isDisabled,
|
5971
|
+
options: options,
|
5972
|
+
value: optionValue || value,
|
5973
|
+
defaultValue: initialValues,
|
5974
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5975
|
+
isMulti: isMulti,
|
5976
|
+
components: {
|
5977
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5978
|
+
return null;
|
5979
|
+
},
|
5980
|
+
DropdownIndicator: DropdownIndicator,
|
5981
|
+
Option: CustomOption
|
5982
|
+
},
|
5983
|
+
styles: customStyles,
|
5984
|
+
placeholder: t("select_placeholder")
|
5985
|
+
}, rest)) : React__default.createElement(Select__default, Object.assign({
|
5986
|
+
isDisabled: isDisabled,
|
5987
|
+
options: options,
|
5988
|
+
value: optionValue || value,
|
5989
|
+
defaultValue: initialValues,
|
5990
|
+
menuPlacement: scrollBottom ? "top" : "auto",
|
5991
|
+
isMulti: isMulti,
|
5992
|
+
components: {
|
5993
|
+
IndicatorSeparator: function IndicatorSeparator() {
|
5994
|
+
return null;
|
5995
|
+
},
|
5996
|
+
DropdownIndicator: DropdownIndicator,
|
5997
|
+
Option: CustomOption
|
5998
|
+
},
|
5999
|
+
styles: customStyles,
|
6000
|
+
placeholder: t("select_placeholder")
|
6001
|
+
}, rest));
|
6229
6002
|
};
|
6230
6003
|
|
6231
|
-
var
|
6232
|
-
|
6233
|
-
|
6234
|
-
|
6235
|
-
|
6236
|
-
|
6237
|
-
|
6238
|
-
|
6239
|
-
|
6240
|
-
|
6241
|
-
|
6242
|
-
|
6243
|
-
|
6244
|
-
|
6245
|
-
|
6246
|
-
|
6247
|
-
spacing: 1,
|
6248
|
-
className: "" + className
|
6249
|
-
}, React__default.createElement(material.Button, {
|
6250
|
-
variant: "contained",
|
6251
|
-
className: "bg-secondary",
|
6252
|
-
startIcon: React__default.createElement(io.IoMdArrowBack, {
|
6253
|
-
size: 16
|
6254
|
-
}),
|
6255
|
-
onClick: onBack
|
6256
|
-
}, backText), !hideSave && React__default.createElement(material.Button, {
|
6257
|
-
variant: "contained",
|
6258
|
-
color: "success",
|
6259
|
-
startIcon: saveIcon != null ? saveIcon : React__default.createElement(fa.FaSave, {
|
6260
|
-
size: 16
|
6261
|
-
}),
|
6262
|
-
onClick: onSave,
|
6263
|
-
disabled: saveDisabled || isReadonly
|
6264
|
-
}, saveText), !!altSaveText && onAltSave && React__default.createElement(material.Button, {
|
6265
|
-
variant: "contained",
|
6266
|
-
color: "primary",
|
6267
|
-
startIcon: React__default.createElement(fa.FaSave, {
|
6268
|
-
size: 16
|
6269
|
-
}),
|
6270
|
-
onClick: onAltSave,
|
6271
|
-
disabled: saveDisabled
|
6272
|
-
}, altSaveText));
|
6273
|
-
};
|
6004
|
+
var SCORE_OPTIONS = Array.from({
|
6005
|
+
length: 10
|
6006
|
+
}, function (_, i) {
|
6007
|
+
return i + 1;
|
6008
|
+
});
|
6009
|
+
var QUESTION_OPTIONS = Array.from({
|
6010
|
+
length: 10
|
6011
|
+
}, function (_, i) {
|
6012
|
+
return i + 1;
|
6013
|
+
});
|
6014
|
+
var ANSWER_OPTIONS = Array.from({
|
6015
|
+
length: 9
|
6016
|
+
}, function (_, i) {
|
6017
|
+
return i + 2;
|
6018
|
+
});
|
6019
|
+
var DEFAULT_SCORE = 2;
|
6274
6020
|
|
6275
|
-
var
|
6276
|
-
var
|
6277
|
-
|
6021
|
+
var AnswerCountSelector = function AnswerCountSelector(_ref) {
|
6022
|
+
var id = _ref.id,
|
6023
|
+
value = _ref.value,
|
6024
|
+
onChange = _ref.onChange,
|
6025
|
+
isDisabled = _ref.isDisabled;
|
6278
6026
|
var _useTranslation = reactI18next.useTranslation(),
|
6279
6027
|
t = _useTranslation.t;
|
6280
|
-
|
6281
|
-
|
6282
|
-
|
6283
|
-
|
6284
|
-
|
6285
|
-
|
6286
|
-
|
6287
|
-
|
6288
|
-
|
6289
|
-
|
6290
|
-
|
6291
|
-
|
6292
|
-
|
6293
|
-
|
6294
|
-
}
|
6295
|
-
className: "text-muted mb-2"
|
6296
|
-
}, t('the_page_you_are_looking_for_was_not_found')), React__default.createElement("div", null))));
|
6028
|
+
var answerOptions = ANSWER_OPTIONS.map(function (i) {
|
6029
|
+
return {
|
6030
|
+
label: t("number_question", {
|
6031
|
+
number: i
|
6032
|
+
}),
|
6033
|
+
value: i
|
6034
|
+
};
|
6035
|
+
});
|
6036
|
+
return React__default.createElement(CustomSelect, {
|
6037
|
+
inputId: id,
|
6038
|
+
value: value,
|
6039
|
+
options: answerOptions,
|
6040
|
+
onChange: onChange,
|
6041
|
+
isDisabled: isDisabled
|
6042
|
+
});
|
6297
6043
|
};
|
6298
6044
|
|
6299
|
-
var
|
6300
|
-
|
6301
|
-
|
6302
|
-
|
6303
|
-
|
6304
|
-
|
6305
|
-
|
6306
|
-
|
6307
|
-
|
6308
|
-
|
6309
|
-
|
6310
|
-
|
6311
|
-
|
6312
|
-
|
6313
|
-
|
6314
|
-
|
6315
|
-
|
6316
|
-
|
6317
|
-
|
6318
|
-
|
6319
|
-
|
6320
|
-
sx: {
|
6321
|
-
overflowY: "unset",
|
6322
|
-
minWidth: minWidth
|
6323
|
-
}
|
6324
|
-
}
|
6325
|
-
}, isShowHeader ? React__default.createElement(React.Fragment, null, React__default.createElement(material.DialogTitle, {
|
6326
|
-
className: "border border-start-0 border-end-0 border-top-0 border-1 " + titleClassName,
|
6327
|
-
sx: {
|
6328
|
-
fontSize: "16px!important"
|
6329
|
-
}
|
6330
|
-
}, title), React__default.createElement(material.IconButton, {
|
6331
|
-
"aria-label": "close",
|
6332
|
-
onClick: onClose,
|
6333
|
-
sx: {
|
6334
|
-
position: "absolute",
|
6335
|
-
right: 8,
|
6336
|
-
top: 8,
|
6337
|
-
color: function color(theme) {
|
6338
|
-
return theme.palette.grey[500];
|
6339
|
-
}
|
6340
|
-
}
|
6341
|
-
}, React__default.createElement(io5.IoClose, null))) : React__default.createElement(material.Box, {
|
6342
|
-
className: "p-3"
|
6343
|
-
}, React__default.createElement(material.Typography, {
|
6344
|
-
className: "fs-5 text-center fw-bold"
|
6345
|
-
}, title)), children);
|
6045
|
+
var _excluded$4 = ["id", "value", "onChange", "isDisabled", "options", "isMulti", "placeholder"];
|
6046
|
+
var ArticleCategorySelector = function ArticleCategorySelector(_ref) {
|
6047
|
+
var id = _ref.id,
|
6048
|
+
value = _ref.value,
|
6049
|
+
onChange = _ref.onChange,
|
6050
|
+
isDisabled = _ref.isDisabled,
|
6051
|
+
options = _ref.options,
|
6052
|
+
isMulti = _ref.isMulti,
|
6053
|
+
placeholder = _ref.placeholder,
|
6054
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
6055
|
+
var _useTranslation = reactI18next.useTranslation(),
|
6056
|
+
t = _useTranslation.t;
|
6057
|
+
return React__default.createElement(CustomSelect, Object.assign({
|
6058
|
+
isMulti: isMulti,
|
6059
|
+
inputId: id,
|
6060
|
+
value: value,
|
6061
|
+
options: options,
|
6062
|
+
onChange: onChange,
|
6063
|
+
isDisabled: isDisabled,
|
6064
|
+
placeholder: placeholder || t("select_category")
|
6065
|
+
}, rest));
|
6346
6066
|
};
|
6347
6067
|
|
6348
|
-
|
6349
|
-
color: "#363634",
|
6350
|
-
fontSize: 16,
|
6351
|
-
fontWeight: 700
|
6352
|
-
};
|
6353
|
-
var confirmDialogButtonStyle = {
|
6354
|
-
width: "120px",
|
6355
|
-
fontSize: 14,
|
6356
|
-
fontWeight: 700
|
6357
|
-
};
|
6358
|
-
var ConfirmDeleteDialogDefaultProps = {
|
6359
|
-
titleStyle: confirmDialogTextStyle,
|
6360
|
-
contentStyle: {
|
6361
|
-
paddingTop: "36px",
|
6362
|
-
padding: "36px",
|
6363
|
-
width: 363
|
6364
|
-
},
|
6365
|
-
contentTextStyle: _extends({}, confirmDialogTextStyle, {
|
6366
|
-
textAlign: "center"
|
6367
|
-
}),
|
6368
|
-
actionStyle: {
|
6369
|
-
justifyContent: "space-between",
|
6370
|
-
padding: "12px"
|
6371
|
-
},
|
6372
|
-
okButtonStyle: confirmDialogButtonStyle,
|
6373
|
-
cancelButtonStyle: _extends({}, confirmDialogButtonStyle, {
|
6374
|
-
color: "#3dc674"
|
6375
|
-
}),
|
6376
|
-
cancelButtonVariant: "text",
|
6377
|
-
isDelete: true
|
6378
|
-
};
|
6068
|
+
// A type of promise-like that resolves synchronously and supports only one observer
|
6379
6069
|
|
6380
|
-
|
6381
|
-
|
6382
|
-
|
6383
|
-
|
6384
|
-
|
6385
|
-
|
6386
|
-
|
6387
|
-
|
6388
|
-
|
6389
|
-
|
6390
|
-
|
6391
|
-
|
6392
|
-
|
6393
|
-
|
6394
|
-
|
6395
|
-
|
6396
|
-
|
6397
|
-
|
6398
|
-
|
6399
|
-
|
6400
|
-
|
6401
|
-
|
6402
|
-
|
6403
|
-
|
6404
|
-
|
6405
|
-
|
6406
|
-
|
6407
|
-
|
6408
|
-
|
6409
|
-
|
6410
|
-
|
6411
|
-
|
6412
|
-
|
6413
|
-
|
6414
|
-
|
6415
|
-
|
6416
|
-
|
6417
|
-
|
6418
|
-
|
6419
|
-
|
6420
|
-
|
6421
|
-
|
6422
|
-
|
6423
|
-
|
6424
|
-
|
6425
|
-
|
6426
|
-
|
6427
|
-
|
6428
|
-
|
6429
|
-
|
6430
|
-
|
6431
|
-
|
6432
|
-
|
6433
|
-
|
6434
|
-
|
6435
|
-
|
6436
|
-
|
6437
|
-
|
6438
|
-
|
6439
|
-
|
6070
|
+
const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
|
6071
|
+
|
6072
|
+
const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
|
6073
|
+
|
6074
|
+
// Asynchronously call a function and send errors to recovery continuation
|
6075
|
+
function _catch(body, recover) {
|
6076
|
+
try {
|
6077
|
+
var result = body();
|
6078
|
+
} catch(e) {
|
6079
|
+
return recover(e);
|
6080
|
+
}
|
6081
|
+
if (result && result.then) {
|
6082
|
+
return result.then(void 0, recover);
|
6083
|
+
}
|
6084
|
+
return result;
|
6085
|
+
}
|
6086
|
+
|
6087
|
+
// Asynchronously await a promise and pass the result to a finally continuation
|
6088
|
+
function _finallyRethrows(body, finalizer) {
|
6089
|
+
try {
|
6090
|
+
var result = body();
|
6091
|
+
} catch (e) {
|
6092
|
+
return finalizer(true, e);
|
6093
|
+
}
|
6094
|
+
if (result && result.then) {
|
6095
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
6096
|
+
}
|
6097
|
+
return finalizer(false, result);
|
6098
|
+
}
|
6099
|
+
|
6100
|
+
// Asynchronously await a promise and invoke a finally continuation that always overrides the result
|
6101
|
+
function _finally(body, finalizer) {
|
6102
|
+
try {
|
6103
|
+
var result = body();
|
6104
|
+
} catch (e) {
|
6105
|
+
return finalizer();
|
6106
|
+
}
|
6107
|
+
if (result && result.then) {
|
6108
|
+
return result.then(finalizer, finalizer);
|
6109
|
+
}
|
6110
|
+
return finalizer();
|
6111
|
+
}
|
6112
|
+
|
6113
|
+
(function (PreparedType) {
|
6114
|
+
PreparedType[PreparedType["csat_past_questions"] = 1] = "csat_past_questions";
|
6115
|
+
PreparedType[PreparedType["official_mock_exam"] = 2] = "official_mock_exam";
|
6116
|
+
PreparedType[PreparedType["private_mock_exam"] = 3] = "private_mock_exam";
|
6117
|
+
})(exports.PreparedType || (exports.PreparedType = {}));
|
6118
|
+
|
6119
|
+
(function (ExamEvent) {
|
6120
|
+
ExamEvent["StartExam"] = "start-exam";
|
6121
|
+
ExamEvent["TerminateExam"] = "terminate-exam";
|
6122
|
+
ExamEvent["AddExtraDuration"] = "add-extra-duration-exam";
|
6123
|
+
ExamEvent["TeacherKickOutStudent"] = "teacher-kick-out-student";
|
6124
|
+
})(exports.ExamEvent || (exports.ExamEvent = {}));
|
6125
|
+
|
6126
|
+
(function (ExamStatus) {
|
6127
|
+
ExamStatus[ExamStatus["Default"] = 0] = "Default";
|
6128
|
+
ExamStatus[ExamStatus["Pending"] = 1] = "Pending";
|
6129
|
+
ExamStatus[ExamStatus["InProgress"] = 2] = "InProgress";
|
6130
|
+
ExamStatus[ExamStatus["Completed"] = 3] = "Completed";
|
6131
|
+
})(exports.ExamStatus || (exports.ExamStatus = {}));
|
6132
|
+
(function (QuestionAnswerType) {
|
6133
|
+
QuestionAnswerType[QuestionAnswerType["SingleChoice"] = 0] = "SingleChoice";
|
6134
|
+
QuestionAnswerType[QuestionAnswerType["MultipleChoice"] = 1] = "MultipleChoice";
|
6135
|
+
QuestionAnswerType[QuestionAnswerType["ShortAnswer"] = 2] = "ShortAnswer";
|
6136
|
+
})(exports.QuestionAnswerType || (exports.QuestionAnswerType = {}));
|
6137
|
+
|
6138
|
+
(function (OrderType) {
|
6139
|
+
OrderType["ASC"] = "ASC";
|
6140
|
+
OrderType["DESC"] = "DESC";
|
6141
|
+
})(exports.OrderType || (exports.OrderType = {}));
|
6142
|
+
|
6143
|
+
(function (RecentUserAction) {
|
6144
|
+
RecentUserAction["ViewedUser"] = "ViewedUser";
|
6145
|
+
RecentUserAction["ViewedQNA"] = "ViewedQNA";
|
6146
|
+
RecentUserAction["ViewedExamResult"] = "ViewedExamResult";
|
6147
|
+
RecentUserAction["PrintedExamResult"] = "PrintedExamResult";
|
6148
|
+
RecentUserAction["ViewedAttendance"] = "ViewedAttendance";
|
6149
|
+
})(exports.RecentUserAction || (exports.RecentUserAction = {}));
|
6150
|
+
|
6151
|
+
(function (UserSortColumn) {
|
6152
|
+
UserSortColumn["CreatedAt"] = "CreatedAt";
|
6153
|
+
UserSortColumn["FullName"] = "FullName";
|
6154
|
+
UserSortColumn["PhoneNumber"] = "PhoneNumber";
|
6155
|
+
UserSortColumn["Email"] = "Email";
|
6156
|
+
UserSortColumn["SchoolName"] = "SchoolName";
|
6157
|
+
UserSortColumn["Major"] = "Major";
|
6158
|
+
UserSortColumn["ParentName"] = "ParentName";
|
6159
|
+
UserSortColumn["ParentPhoneNumber"] = "ParentPhoneNumber";
|
6160
|
+
UserSortColumn["Grade"] = "Grade";
|
6161
|
+
})(exports.UserSortColumn || (exports.UserSortColumn = {}));
|
6162
|
+
|
6163
|
+
var useAutoAcademyDomain = function useAutoAcademyDomain(_, history, superUrls, homeUrl, homeAcademyUrl, isAuthPage) {
|
6164
|
+
if (isAuthPage === void 0) {
|
6165
|
+
isAuthPage = true;
|
6166
|
+
}
|
6167
|
+
var user = reactRedux.useSelector(function (state) {
|
6168
|
+
var _state$common;
|
6169
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
6170
|
+
});
|
6171
|
+
var _ref = user || {},
|
6172
|
+
email = _ref.email,
|
6173
|
+
academyDomain = _ref.academyDomain,
|
6174
|
+
isLearningSpace = _ref.isLearningSpace;
|
6175
|
+
var pathname = window.location.pathname;
|
6176
|
+
var changeAcademySearchParams = function changeAcademySearchParams() {
|
6177
|
+
var isLoginPage = LOGIN_URL === pathname;
|
6178
|
+
var search = window.location.search;
|
6179
|
+
var searchParams = new URLSearchParams(search);
|
6180
|
+
var paramAcademyDomain = searchParams.get("domain");
|
6181
|
+
var domain = getAcademyDomain();
|
6182
|
+
if (!!email !== isAuthPage) return;
|
6183
|
+
var isSuperUrl = checkSuperUrl(superUrls, pathname);
|
6184
|
+
if (!academyDomain && !isLearningSpace) {
|
6185
|
+
if (!isSuperUrl) {
|
6186
|
+
if (isLoginPage) searchParams["delete"]("domain");else if (!paramAcademyDomain && domain) searchParams.set("domain", domain);
|
6187
|
+
pushTo(history, {
|
6188
|
+
pathname: homeUrl,
|
6189
|
+
search: searchParams.toString()
|
6190
|
+
});
|
6191
|
+
return;
|
6192
|
+
}
|
6193
|
+
if (paramAcademyDomain) {
|
6194
|
+
searchParams["delete"]("domain");
|
6195
|
+
pushTo(history, _extends({}, window.location, {
|
6196
|
+
search: searchParams.toString()
|
6197
|
+
}), true);
|
6198
|
+
return;
|
6440
6199
|
}
|
6441
|
-
}
|
6442
|
-
|
6443
|
-
|
6444
|
-
|
6445
|
-
|
6446
|
-
|
6447
|
-
|
6448
|
-
|
6449
|
-
fontWeight: 700
|
6450
|
-
}, contentTextStyle)
|
6451
|
-
}, text), !!confirmText && React__default.createElement("div", {
|
6452
|
-
className: "w-100"
|
6453
|
-
}, React__default.createElement("p", {
|
6454
|
-
className: "mb-3"
|
6455
|
-
}, t("enter_text_to_confirm_delete", {
|
6456
|
-
text: confirmText
|
6457
|
-
})), React__default.createElement(material.TextField, {
|
6458
|
-
className: "w-100",
|
6459
|
-
sx: {
|
6460
|
-
"& input": {
|
6461
|
-
py: 1
|
6200
|
+
} else {
|
6201
|
+
if (isSuperUrl) {
|
6202
|
+
searchParams["delete"]("domain");
|
6203
|
+
pushTo(history, {
|
6204
|
+
pathname: homeAcademyUrl,
|
6205
|
+
search: searchParams.toString()
|
6206
|
+
});
|
6207
|
+
return;
|
6462
6208
|
}
|
6463
|
-
|
6464
|
-
|
6465
|
-
|
6466
|
-
|
6467
|
-
|
6468
|
-
|
6469
|
-
color: isValid ? "success" : confirmTextValue !== undefined ? "error" : undefined
|
6470
|
-
}))), React__default.createElement(material.DialogActions, {
|
6471
|
-
className: "border border-start-0 border-end-0 border-bottom-0 border-1 " + titleClassName,
|
6472
|
-
sx: _extends({
|
6473
|
-
paddingTop: 1
|
6474
|
-
}, actionStyle)
|
6475
|
-
}, React__default.createElement(material.Button, {
|
6476
|
-
variant: cancelButtonVariant,
|
6477
|
-
color: cancelButtonVariant !== "contained" ? "primary" : "secondary",
|
6478
|
-
className: "px-3 " + (cancelButtonVariant !== "contained" ? "primary" : "bg-secondary"),
|
6479
|
-
onClick: toggle,
|
6480
|
-
sx: cancelButtonStyle
|
6481
|
-
}, cancelText || t("no")), React__default.createElement(material.Button, {
|
6482
|
-
variant: okButtonVariant,
|
6483
|
-
color: isDelete ? "error" : "primary",
|
6484
|
-
className: "px-3",
|
6485
|
-
disabled: isDisableDelete,
|
6486
|
-
onClick: handleConfirm,
|
6487
|
-
sx: _extends({}, okButtonStyle, isDelete && {
|
6488
|
-
backgroundColor: "#db4d4d",
|
6489
|
-
color: "#FFFFFF",
|
6490
|
-
"&:hover": {
|
6491
|
-
backgroundColor: "#C41414"
|
6209
|
+
if (!paramAcademyDomain || academyDomain.trim().toLocaleLowerCase() !== (paramAcademyDomain === null || paramAcademyDomain === void 0 ? void 0 : paramAcademyDomain.trim().toLocaleLowerCase())) {
|
6210
|
+
if (isLoginPage || isLearningSpace) searchParams["delete"]("domain");else searchParams.set("domain", academyDomain);
|
6211
|
+
pushTo(history, _extends({}, window.location, {
|
6212
|
+
search: searchParams.toString()
|
6213
|
+
}), true);
|
6214
|
+
return;
|
6492
6215
|
}
|
6493
|
-
}
|
6494
|
-
}
|
6216
|
+
}
|
6217
|
+
};
|
6218
|
+
React.useEffect(function () {
|
6219
|
+
changeAcademySearchParams();
|
6220
|
+
}, [pathname, window.location.search, isAuthPage, email, academyDomain]);
|
6495
6221
|
};
|
6496
6222
|
|
6497
|
-
var
|
6498
|
-
|
6223
|
+
var EXAM_SESSION_URL = BASE_URL + "/api/examSession";
|
6224
|
+
var getCheckStatusExam = function getCheckStatusExam(examCode) {
|
6225
|
+
return api.get(EXAM_SESSION_URL + "/" + examCode + "/status");
|
6499
6226
|
};
|
6500
6227
|
|
6501
|
-
var
|
6502
|
-
|
6503
|
-
var
|
6504
|
-
|
6505
|
-
|
6506
|
-
|
6507
|
-
|
6508
|
-
|
6509
|
-
|
6510
|
-
|
6511
|
-
|
6512
|
-
|
6513
|
-
|
6514
|
-
|
6228
|
+
var ONE_SECOND_IN_MILLISECONDS = 1000;
|
6229
|
+
var useCountDownTimer = function useCountDownTimer(props) {
|
6230
|
+
var startTime = props.startTime,
|
6231
|
+
status = props.status,
|
6232
|
+
code = props.code,
|
6233
|
+
duration = props.duration,
|
6234
|
+
onFinish = props.onFinish;
|
6235
|
+
var dispatch = reactRedux.useDispatch();
|
6236
|
+
var _useState = React.useState(),
|
6237
|
+
remainTime = _useState[0],
|
6238
|
+
setRemainTime = _useState[1];
|
6239
|
+
var checkStatusRef = React.useRef(null);
|
6240
|
+
var requestRef = React.useRef(null);
|
6241
|
+
var checkLiveExamStatus = React.useCallback(function () {
|
6242
|
+
try {
|
6243
|
+
!!checkStatusRef.current && clearTimeout(checkStatusRef.current);
|
6244
|
+
if (!code || status === exports.ExamStatus.Completed) {
|
6245
|
+
return Promise.resolve();
|
6246
|
+
}
|
6247
|
+
var isOk = false;
|
6248
|
+
var _temp = _finallyRethrows(function () {
|
6249
|
+
return _catch(function () {
|
6250
|
+
dispatch(setLoading(true));
|
6251
|
+
return Promise.resolve(getCheckStatusExam(code)).then(function (res) {
|
6252
|
+
if (res.data.data.status === exports.ExamStatus.Completed) {
|
6253
|
+
isOk = true;
|
6254
|
+
clearTimeout(checkStatusRef.current);
|
6255
|
+
dispatch(setLoading(false));
|
6256
|
+
onFinish();
|
6257
|
+
} else {
|
6258
|
+
checkStatusRef.current = setTimeout(checkLiveExamStatus, ONE_SECOND_IN_MILLISECONDS);
|
6259
|
+
}
|
6260
|
+
});
|
6261
|
+
}, function (error) {
|
6262
|
+
console.log({
|
6263
|
+
error: error
|
6264
|
+
});
|
6265
|
+
});
|
6266
|
+
}, function (_wasThrown, _result) {
|
6267
|
+
if (!isOk) checkStatusRef.current = setTimeout(checkLiveExamStatus, ONE_SECOND_IN_MILLISECONDS);
|
6268
|
+
if (_wasThrown) throw _result;
|
6269
|
+
return _result;
|
6270
|
+
});
|
6271
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
6272
|
+
} catch (e) {
|
6273
|
+
return Promise.reject(e);
|
6274
|
+
}
|
6275
|
+
}, [code, status, onFinish]);
|
6276
|
+
React.useEffect(function () {
|
6277
|
+
if (status !== exports.ExamStatus.InProgress) return;
|
6278
|
+
var animate = function animate() {
|
6279
|
+
if (!startTime || !duration) return;
|
6280
|
+
if (typeof remainTime === "number" && remainTime <= 0) {
|
6281
|
+
return;
|
6282
|
+
}
|
6283
|
+
var remain = getRemainTime(startTime, duration);
|
6284
|
+
if (typeof remain !== "number") {
|
6285
|
+
setRemainTime(undefined);
|
6286
|
+
return;
|
6515
6287
|
}
|
6288
|
+
setRemainTime(remain || 0);
|
6289
|
+
requestRef.current = requestAnimationFrame(animate);
|
6290
|
+
};
|
6291
|
+
requestRef.current = requestAnimationFrame(animate);
|
6292
|
+
return function () {
|
6293
|
+
!!requestRef.current && cancelAnimationFrame(requestRef.current);
|
6294
|
+
setRemainTime(undefined);
|
6295
|
+
};
|
6296
|
+
}, [startTime, duration]);
|
6297
|
+
React.useEffect(function () {
|
6298
|
+
if (typeof remainTime === "number" && remainTime <= 0) checkLiveExamStatus();
|
6299
|
+
}, [remainTime, checkLiveExamStatus]);
|
6300
|
+
return remainTime;
|
6301
|
+
};
|
6302
|
+
|
6303
|
+
var useGoogleSignOut = function useGoogleSignOut(props) {
|
6304
|
+
var dispatch = reactRedux.useDispatch();
|
6305
|
+
var onLogoutSuccess = props.onLogoutSuccess,
|
6306
|
+
onFailure = props.onFailure;
|
6307
|
+
var handleLogoutSuccess = function handleLogoutSuccess() {
|
6308
|
+
onLogoutSuccess === null || onLogoutSuccess === void 0 ? void 0 : onLogoutSuccess();
|
6309
|
+
};
|
6310
|
+
var handleLogoutFailure = function handleLogoutFailure() {
|
6311
|
+
onFailure === null || onFailure === void 0 ? void 0 : onFailure();
|
6312
|
+
};
|
6313
|
+
var _useGoogleLogout = GoogleLogin.useGoogleLogout({
|
6314
|
+
clientId: GOOGLE_CLIENT_ID,
|
6315
|
+
onLogoutSuccess: handleLogoutSuccess,
|
6316
|
+
onFailure: handleLogoutFailure
|
6317
|
+
}),
|
6318
|
+
signOut = _useGoogleLogout.signOut,
|
6319
|
+
loaded = _useGoogleLogout.loaded;
|
6320
|
+
var handleSignOut = function handleSignOut(isRemoveDomainStorage) {
|
6321
|
+
if (isRemoveDomainStorage === void 0) {
|
6322
|
+
isRemoveDomainStorage = false;
|
6516
6323
|
}
|
6517
|
-
|
6324
|
+
localStorage.removeItem("USER_INFORMATION");
|
6325
|
+
localStorage.removeItem(ACCESS_TOKEN);
|
6326
|
+
if (isRemoveDomainStorage) {
|
6327
|
+
localStorage.removeItem(ACADEMY_DOMAIN);
|
6328
|
+
localStorage.removeItem(LEARNING_SPACE);
|
6329
|
+
}
|
6330
|
+
try {
|
6331
|
+
var _window$gapi, _window$gapi$auth, _auth2$signOut;
|
6332
|
+
signOut();
|
6333
|
+
var auth2 = (_window$gapi = window.gapi) === null || _window$gapi === void 0 ? void 0 : (_window$gapi$auth = _window$gapi.auth2) === null || _window$gapi$auth === void 0 ? void 0 : _window$gapi$auth.getAuthInstance();
|
6334
|
+
auth2 === null || auth2 === void 0 ? void 0 : (_auth2$signOut = auth2.signOut) === null || _auth2$signOut === void 0 ? void 0 : _auth2$signOut.call(auth2);
|
6335
|
+
} catch (error) {
|
6336
|
+
console.log({
|
6337
|
+
error: error
|
6338
|
+
});
|
6339
|
+
}
|
6340
|
+
dispatch(reset());
|
6341
|
+
window.location.href = "/login";
|
6342
|
+
};
|
6343
|
+
return {
|
6344
|
+
handleSignOut: handleSignOut,
|
6345
|
+
loaded: loaded
|
6346
|
+
};
|
6518
6347
|
};
|
6519
6348
|
|
6520
|
-
var
|
6521
|
-
var
|
6522
|
-
|
6523
|
-
|
6524
|
-
|
6349
|
+
var useList = function useList(fetchData, defaultQuery) {
|
6350
|
+
var dispatch = reactRedux.useDispatch();
|
6351
|
+
var _useState = React.useState(defaultQuery),
|
6352
|
+
filter = _useState[0],
|
6353
|
+
setFilter = _useState[1];
|
6354
|
+
var _useState2 = React.useState(DEFAULT_PAGING_RESPONSE),
|
6355
|
+
paging = _useState2[0],
|
6356
|
+
setPaging = _useState2[1];
|
6357
|
+
var _useState3 = React.useState([]),
|
6358
|
+
data = _useState3[0],
|
6359
|
+
setData = _useState3[1];
|
6360
|
+
var _useState4 = React.useState(),
|
6361
|
+
selectedItem = _useState4[0],
|
6362
|
+
setSelectedItem = _useState4[1];
|
6363
|
+
var textSearchRef = React.useRef(null);
|
6364
|
+
var isFirstLoadRef = React.useRef(true);
|
6525
6365
|
var _useTranslation = reactI18next.useTranslation(),
|
6526
6366
|
t = _useTranslation.t;
|
6527
|
-
var
|
6528
|
-
|
6529
|
-
setPassCode = _useState[1];
|
6530
|
-
var handleClose = function handleClose(event, reason) {
|
6531
|
-
onClose(event, reason);
|
6367
|
+
var handleChangeSelectedItem = function handleChangeSelectedItem(item) {
|
6368
|
+
setSelectedItem(item);
|
6532
6369
|
};
|
6533
|
-
var
|
6370
|
+
var getData = function getData(isLoading) {
|
6371
|
+
if (isLoading === void 0) {
|
6372
|
+
isLoading = false;
|
6373
|
+
}
|
6534
6374
|
try {
|
6535
|
-
var
|
6536
|
-
|
6537
|
-
academyDomain: academyDomain
|
6375
|
+
var _temp2 = function _temp2() {
|
6376
|
+
isLoading && dispatch(setLoading(false));
|
6538
6377
|
};
|
6539
|
-
return Promise.resolve(
|
6378
|
+
if (!fetchData) return Promise.resolve();
|
6379
|
+
if (isFirstLoadRef.current) isFirstLoadRef.current = false;
|
6380
|
+
isLoading && dispatch(setLoading(true));
|
6381
|
+
var _temp = _catch(function () {
|
6382
|
+
return Promise.resolve(fetchData(filter)).then(function (res) {
|
6383
|
+
var _res$data$items = res.data.items,
|
6384
|
+
items = _res$data$items === void 0 ? [] : _res$data$items;
|
6385
|
+
setPaging({
|
6386
|
+
limit: res.data.limit || 0,
|
6387
|
+
page: res.data.page || 0,
|
6388
|
+
totalItems: res.data.totalItems || 0,
|
6389
|
+
totalPages: res.data.totalPages || 0
|
6390
|
+
});
|
6391
|
+
setData(items);
|
6392
|
+
});
|
6393
|
+
}, function (error) {
|
6394
|
+
setPaging(DEFAULT_PAGING_RESPONSE);
|
6395
|
+
setData([]);
|
6396
|
+
reactToastify.toast.error(getErrorMessage(t, error));
|
6397
|
+
});
|
6398
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
|
6540
6399
|
} catch (e) {
|
6541
6400
|
return Promise.reject(e);
|
6542
6401
|
}
|
6543
6402
|
};
|
6544
|
-
var
|
6545
|
-
|
6403
|
+
var handleSort = function handleSort(sortColumnName) {
|
6404
|
+
var sortColumnDirection = exports.OrderType.ASC;
|
6405
|
+
console.log({
|
6406
|
+
sortColumnName: typeof sortColumnName,
|
6407
|
+
filter: typeof filter.sortColumnName
|
6408
|
+
});
|
6409
|
+
if (filter.sortColumnName == sortColumnName && filter.sortColumnDirection === exports.OrderType.ASC) sortColumnDirection = exports.OrderType.DESC;
|
6410
|
+
setFilter(_extends({}, filter, {
|
6411
|
+
sortColumnName: sortColumnName,
|
6412
|
+
sortColumnDirection: sortColumnDirection,
|
6413
|
+
currentPage: 1
|
6414
|
+
}));
|
6415
|
+
};
|
6416
|
+
var handleChangeSearchText = function handleChangeSearchText(e) {
|
6417
|
+
if (!textSearchRef.current) return;
|
6418
|
+
textSearchRef.current.value = e.target.value.trim();
|
6419
|
+
debounceSearch();
|
6546
6420
|
};
|
6547
|
-
var theme = material.useTheme();
|
6548
|
-
return React__default.createElement(CommonDialog, {
|
6549
|
-
open: open,
|
6550
|
-
onClose: handleClose,
|
6551
|
-
size: "xs",
|
6552
|
-
title: t("join_an_academy")
|
6553
|
-
}, React__default.createElement(material.DialogContent, {
|
6554
|
-
sx: {
|
6555
|
-
overflowY: "unset"
|
6556
|
-
}
|
6557
|
-
}, React__default.createElement(material.Stack, {
|
6558
|
-
direction: "column",
|
6559
|
-
spacing: 2,
|
6560
|
-
zIndex: 1,
|
6561
|
-
position: "relative"
|
6562
|
-
}, React__default.createElement(material.FormGroup, null, React__default.createElement(material.FormLabel, {
|
6563
|
-
className: "fw-medium mb-1"
|
6564
|
-
}, t("pass_code"), React__default.createElement("span", {
|
6565
|
-
className: "text-danger"
|
6566
|
-
}, "*")), React__default.createElement(InputText, {
|
6567
|
-
id: "pass-code",
|
6568
|
-
placeholder: t("enter_pass_code"),
|
6569
|
-
value: passCode,
|
6570
|
-
onChange: handleChangePassCode
|
6571
|
-
})))), React__default.createElement(material.DialogActions, {
|
6572
|
-
className: ""
|
6573
|
-
}, React__default.createElement(material.Button, {
|
6574
|
-
variant: "contained",
|
6575
|
-
sx: {
|
6576
|
-
bgcolor: theme.palette.grey[700]
|
6577
|
-
},
|
6578
|
-
onClick: handleClose
|
6579
|
-
}, t("cancel")), React__default.createElement(material.Button, {
|
6580
|
-
variant: "contained",
|
6581
|
-
onClick: handleSubmit,
|
6582
|
-
disabled: !passCode.trim().length
|
6583
|
-
}, t("confirmation"))));
|
6584
|
-
};
|
6585
|
-
|
6586
|
-
var loadingStyle = {
|
6587
|
-
minWidth: "100vw",
|
6588
|
-
minHeight: "100vh",
|
6589
|
-
position: "fixed",
|
6590
|
-
top: 0,
|
6591
|
-
left: 0,
|
6592
|
-
zIndex: 999999999,
|
6593
|
-
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
6594
|
-
display: "flex",
|
6595
|
-
justifyContent: "center",
|
6596
|
-
alignItems: "center"
|
6597
|
-
};
|
6598
|
-
var Loading = function Loading() {
|
6599
|
-
var isLoading = reactRedux.useSelector(function (state) {
|
6600
|
-
return state.common.isLoading;
|
6601
|
-
});
|
6602
|
-
return isLoading ? React__default.createElement("div", {
|
6603
|
-
style: loadingStyle
|
6604
|
-
}, React__default.createElement("div", {
|
6605
|
-
className: "spinner-border text-secondary",
|
6606
|
-
role: "status"
|
6607
|
-
}, React__default.createElement("span", {
|
6608
|
-
className: "sr-only"
|
6609
|
-
}))) : null;
|
6610
|
-
};
|
6611
|
-
|
6612
|
-
var loadingStyle$1 = {
|
6613
|
-
minWidth: "100vw",
|
6614
|
-
minHeight: "100vh",
|
6615
|
-
position: "fixed",
|
6616
|
-
top: 0,
|
6617
|
-
left: 0,
|
6618
|
-
zIndex: 999999999,
|
6619
|
-
backgroundColor: "rgba(0, 0, 0, 0.4)",
|
6620
|
-
display: "flex",
|
6621
|
-
justifyContent: "center",
|
6622
|
-
alignItems: "center"
|
6623
|
-
};
|
6624
|
-
var LoadingComponent = function LoadingComponent(_ref) {
|
6625
|
-
var isLoading = _ref.isLoading,
|
6626
|
-
children = _ref.children,
|
6627
|
-
_ref$spinClassName = _ref.spinClassName,
|
6628
|
-
spinClassName = _ref$spinClassName === void 0 ? "text-secondary" : _ref$spinClassName,
|
6629
|
-
_ref$className = _ref.className,
|
6630
|
-
className = _ref$className === void 0 ? "" : _ref$className;
|
6631
|
-
return isLoading ? React__default.createElement("div", {
|
6632
|
-
style: loadingStyle$1
|
6633
|
-
}, React__default.createElement(material.Stack, {
|
6634
|
-
direction: "column",
|
6635
|
-
justifyContent: "center",
|
6636
|
-
alignItems: "center",
|
6637
|
-
className: className
|
6638
|
-
}, React__default.createElement("div", {
|
6639
|
-
className: "spinner-border " + spinClassName,
|
6640
|
-
role: "status"
|
6641
|
-
}, React__default.createElement("span", {
|
6642
|
-
className: "sr-only"
|
6643
|
-
})), React__default.createElement("div", null, children))) : null;
|
6644
|
-
};
|
6645
|
-
|
6646
|
-
var CustomPagination = function CustomPagination(_ref) {
|
6647
|
-
var currentPage = _ref.currentPage,
|
6648
|
-
totalPage = _ref.totalPage,
|
6649
|
-
onChangePage = _ref.onChangePage;
|
6650
6421
|
var handleChangePage = function handleChangePage(_, page) {
|
6651
|
-
|
6422
|
+
setFilter(_extends({}, filter, {
|
6423
|
+
currentPage: page
|
6424
|
+
}));
|
6425
|
+
};
|
6426
|
+
var calcOrderNumber = function calcOrderNumber(index) {
|
6427
|
+
var _paging$page, _paging$limit;
|
6428
|
+
return (((_paging$page = paging.page) != null ? _paging$page : 0) - 1) * ((_paging$limit = paging.limit) != null ? _paging$limit : 0) + index + 1;
|
6429
|
+
};
|
6430
|
+
var debounceSearch = _.debounce(function () {
|
6431
|
+
var _textSearchRef$curren;
|
6432
|
+
setFilter(_extends({}, filter, {
|
6433
|
+
currentPage: 1,
|
6434
|
+
textSearch: (_textSearchRef$curren = textSearchRef.current) === null || _textSearchRef$curren === void 0 ? void 0 : _textSearchRef$curren.value
|
6435
|
+
}));
|
6436
|
+
}, 500);
|
6437
|
+
React.useEffect(function () {
|
6438
|
+
getData(isFirstLoadRef.current);
|
6439
|
+
}, [JSON.stringify(filter)]);
|
6440
|
+
return {
|
6441
|
+
filter: filter,
|
6442
|
+
textSearchRef: textSearchRef,
|
6443
|
+
paging: paging,
|
6444
|
+
data: data,
|
6445
|
+
selectedItem: selectedItem,
|
6446
|
+
handleSort: handleSort,
|
6447
|
+
handleChangeSearchText: handleChangeSearchText,
|
6448
|
+
handleChangePage: handleChangePage,
|
6449
|
+
calcOrderNumber: calcOrderNumber,
|
6450
|
+
handleChangeSelectedItem: handleChangeSelectedItem,
|
6451
|
+
getData: getData
|
6652
6452
|
};
|
6653
|
-
return React__default.createElement(material.Pagination, {
|
6654
|
-
className: "w-fit",
|
6655
|
-
count: totalPage,
|
6656
|
-
page: currentPage,
|
6657
|
-
onChange: handleChangePage
|
6658
|
-
});
|
6659
|
-
};
|
6660
|
-
|
6661
|
-
var DropdownIndicator = function DropdownIndicator(props) {
|
6662
|
-
return React__default.createElement(Select.components.DropdownIndicator, Object.assign({}, props), React__default.createElement(fa.FaCaretDown, {
|
6663
|
-
size: 20,
|
6664
|
-
color: styles.darker
|
6665
|
-
}));
|
6666
|
-
};
|
6667
|
-
var CustomOption = function CustomOption(props) {
|
6668
|
-
return React__default.createElement(Select.components.Option, Object.assign({}, props), React__default.createElement("div", {
|
6669
|
-
style: {
|
6670
|
-
fontSize: "14px",
|
6671
|
-
fontWeight: 500
|
6672
|
-
}
|
6673
|
-
}, props.data.label));
|
6674
6453
|
};
|
6675
6454
|
|
6676
|
-
var
|
6677
|
-
|
6678
|
-
|
6679
|
-
|
6680
|
-
|
6681
|
-
|
6682
|
-
|
6683
|
-
|
6684
|
-
|
6685
|
-
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
|
6686
|
-
},
|
6687
|
-
"&:hover": {
|
6688
|
-
borderColor: state.isFocused || state.hasValue ? styles.dark : styles.less_dark
|
6455
|
+
var useLoadMore = function useLoadMore(props) {
|
6456
|
+
var onLoadMore = props.onLoadMore,
|
6457
|
+
loading = props.loading;
|
6458
|
+
var observerTarget = React.useRef(null);
|
6459
|
+
React.useEffect(function () {
|
6460
|
+
var currentTarget = observerTarget.current;
|
6461
|
+
var observer = new IntersectionObserver(function (entries) {
|
6462
|
+
if (entries[0].isIntersecting && !loading) {
|
6463
|
+
onLoadMore();
|
6689
6464
|
}
|
6465
|
+
}, {
|
6466
|
+
threshold: 1
|
6690
6467
|
});
|
6691
|
-
|
6692
|
-
|
6693
|
-
|
6694
|
-
|
6695
|
-
|
6696
|
-
|
6697
|
-
});
|
6698
|
-
},
|
6699
|
-
singleValue: function singleValue(baseStyles) {
|
6700
|
-
return _extends({}, baseStyles, {
|
6701
|
-
fontSize: "14px",
|
6702
|
-
fontWeight: 700,
|
6703
|
-
color: styles.darker
|
6704
|
-
});
|
6705
|
-
},
|
6706
|
-
option: function option(baseStyles, state) {
|
6707
|
-
return _extends({}, baseStyles, {
|
6708
|
-
backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.light : 'white',
|
6709
|
-
"&:active": {
|
6710
|
-
backgroundColor: state.isSelected ? styles.dark : state.isFocused ? styles.less_dark : baseStyles.backgroundColor
|
6468
|
+
if (observerTarget.current) {
|
6469
|
+
observer.observe(observerTarget.current);
|
6470
|
+
}
|
6471
|
+
return function () {
|
6472
|
+
if (currentTarget) {
|
6473
|
+
observer.unobserve(currentTarget);
|
6711
6474
|
}
|
6712
|
-
}
|
6713
|
-
}
|
6475
|
+
};
|
6476
|
+
}, [observerTarget, loading, onLoadMore]);
|
6477
|
+
return {
|
6478
|
+
observerTarget: observerTarget
|
6479
|
+
};
|
6480
|
+
};
|
6481
|
+
|
6482
|
+
var AUTH_URL = BASE_URL + "/api/auth";
|
6483
|
+
var AUTH_SUPER_ADMIN_URL = SUPER_ADMIN_BASE_URL + "/api/auth";
|
6484
|
+
var getInfo = function getInfo(role, isLearningSpace) {
|
6485
|
+
var _headers;
|
6486
|
+
return api.get(AUTH_URL + "/info", {
|
6487
|
+
params: {
|
6488
|
+
role: role
|
6489
|
+
},
|
6490
|
+
headers: (_headers = {}, _headers[NoAcademyHeaders] = isLearningSpace, _headers)
|
6491
|
+
});
|
6714
6492
|
};
|
6715
|
-
|
6716
|
-
|
6717
|
-
|
6718
|
-
|
6719
|
-
|
6720
|
-
|
6721
|
-
|
6722
|
-
value = _ref.value,
|
6723
|
-
isMulti = _ref.isMulti,
|
6724
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
6725
|
-
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
6726
|
-
return value.includes(i.value);
|
6727
|
-
}) : isMulti ? options.filter(function (i) {
|
6728
|
-
return i.value == value;
|
6729
|
-
}) : options.find(function (i) {
|
6730
|
-
return i.value == value;
|
6493
|
+
var getSuperAdminInfoFromWeb = function getSuperAdminInfoFromWeb() {
|
6494
|
+
return api.get(AUTH_SUPER_ADMIN_URL + "/info");
|
6495
|
+
};
|
6496
|
+
var apiLoginGoogle = function apiLoginGoogle(body, isLearningSpace) {
|
6497
|
+
var _headers2;
|
6498
|
+
return api.post(AUTH_URL + "/login", body, {
|
6499
|
+
headers: (_headers2 = {}, _headers2[NoAcademyHeaders] = isLearningSpace, _headers2)
|
6731
6500
|
});
|
6732
|
-
|
6733
|
-
|
6734
|
-
return
|
6735
|
-
|
6736
|
-
|
6737
|
-
|
6738
|
-
|
6739
|
-
|
6740
|
-
|
6741
|
-
components: {
|
6742
|
-
IndicatorSeparator: function IndicatorSeparator() {
|
6743
|
-
return null;
|
6744
|
-
},
|
6745
|
-
DropdownIndicator: DropdownIndicator,
|
6746
|
-
Option: CustomOption
|
6501
|
+
};
|
6502
|
+
var apiLoginGoogleSuperAdmin = function apiLoginGoogleSuperAdmin(body) {
|
6503
|
+
return api.post(AUTH_SUPER_ADMIN_URL + "/login", body);
|
6504
|
+
};
|
6505
|
+
var apiLoginWithAccessToken = function apiLoginWithAccessToken(body, isLearningSpace, domain) {
|
6506
|
+
var _headers3;
|
6507
|
+
return api.post(AUTH_URL + "/login/access-token", body, {
|
6508
|
+
params: {
|
6509
|
+
isLearningSpace: isLearningSpace
|
6747
6510
|
},
|
6748
|
-
|
6749
|
-
|
6750
|
-
|
6511
|
+
headers: (_headers3 = {}, _headers3[AcademyHeaders] = domain, _headers3[NoAcademyHeaders] = isLearningSpace, _headers3)
|
6512
|
+
});
|
6513
|
+
};
|
6514
|
+
var apiLoginSuperAdminWithAccessToken = function apiLoginSuperAdminWithAccessToken(body) {
|
6515
|
+
return api.post(AUTH_SUPER_ADMIN_URL + "/login/access-token", body);
|
6751
6516
|
};
|
6752
6517
|
|
6753
|
-
var
|
6754
|
-
|
6755
|
-
|
6756
|
-
|
6757
|
-
|
6758
|
-
value = _ref.value,
|
6759
|
-
isMulti = _ref.isMulti,
|
6760
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
6761
|
-
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
6762
|
-
return value.includes(i.value);
|
6763
|
-
}) : isMulti ? options.filter(function (i) {
|
6764
|
-
return i.value == value;
|
6765
|
-
}) : options.find(function (i) {
|
6766
|
-
return i.value == value;
|
6767
|
-
});
|
6518
|
+
var useLogin = function useLogin(history, homeAcademyUrl, homeUrl, registerUrl, redirectAfterLogin) {
|
6519
|
+
if (redirectAfterLogin === void 0) {
|
6520
|
+
redirectAfterLogin = true;
|
6521
|
+
}
|
6522
|
+
var dispatch = reactRedux.useDispatch();
|
6768
6523
|
var _useTranslation = reactI18next.useTranslation(),
|
6769
6524
|
t = _useTranslation.t;
|
6770
|
-
|
6771
|
-
|
6772
|
-
|
6773
|
-
|
6774
|
-
|
6775
|
-
|
6776
|
-
|
6777
|
-
|
6778
|
-
|
6779
|
-
|
6780
|
-
|
6781
|
-
|
6782
|
-
|
6783
|
-
|
6784
|
-
|
6785
|
-
|
6786
|
-
|
6525
|
+
var _useGoogleSignOut = useGoogleSignOut({}),
|
6526
|
+
handleSignOut = _useGoogleSignOut.handleSignOut;
|
6527
|
+
var searchParams = new URLSearchParams(window.location.search);
|
6528
|
+
var paramDomain = searchParams.get('domain');
|
6529
|
+
var handleLoginGoogle = function handleLoginGoogle(data, isLogout) {
|
6530
|
+
if (isLogout === void 0) {
|
6531
|
+
isLogout = true;
|
6532
|
+
}
|
6533
|
+
try {
|
6534
|
+
var isStudent = data.role === exports.Role.Student;
|
6535
|
+
var academyDomain = paramDomain || getAcademyDomain();
|
6536
|
+
var isLearningSpace = getLearningSpace() || isStudent && !academyDomain;
|
6537
|
+
if (!isStudent && isLearningSpace) {
|
6538
|
+
isLearningSpace = false;
|
6539
|
+
localStorage.removeItem(LEARNING_SPACE);
|
6540
|
+
}
|
6541
|
+
var isAcademy = !!academyDomain || isLearningSpace;
|
6542
|
+
return Promise.resolve(handleLogin(function () {
|
6543
|
+
return new Promise(function (resolve, reject) {
|
6544
|
+
try {
|
6545
|
+
var _temp3 = _catch(function () {
|
6546
|
+
return Promise.resolve(isAcademy ? apiLoginGoogle(data, isLearningSpace) : apiLoginGoogleSuperAdmin(data)).then(function (loginResponse) {
|
6547
|
+
function _temp2() {
|
6548
|
+
resolve(result);
|
6549
|
+
}
|
6550
|
+
var result = loginResponse.data;
|
6551
|
+
var _temp = function () {
|
6552
|
+
if (loginResponse.status === 204 && academyDomain) {
|
6553
|
+
localStorage.removeItem(ACADEMY_DOMAIN);
|
6554
|
+
localStorage.removeItem(LEARNING_SPACE);
|
6555
|
+
return Promise.resolve(apiLoginGoogleSuperAdmin(data)).then(function (_apiLoginGoogleSuperA) {
|
6556
|
+
loginResponse = _apiLoginGoogleSuperA;
|
6557
|
+
result = loginResponse.data;
|
6558
|
+
});
|
6559
|
+
}
|
6560
|
+
}();
|
6561
|
+
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
6562
|
+
});
|
6563
|
+
}, function (error) {
|
6564
|
+
!!academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
6565
|
+
localStorage.removeItem(LEARNING_SPACE);
|
6566
|
+
reject(error);
|
6567
|
+
});
|
6568
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(function () {}) : void 0);
|
6569
|
+
} catch (e) {
|
6570
|
+
return Promise.reject(e);
|
6571
|
+
}
|
6572
|
+
});
|
6573
|
+
}, isStudent, isLogout)).then(function () {});
|
6574
|
+
} catch (e) {
|
6575
|
+
return Promise.reject(e);
|
6576
|
+
}
|
6577
|
+
};
|
6578
|
+
var handleLoginAccessToken = function handleLoginAccessToken(data, isLearningSpace, domain, isLogout, superAdminRedirectPath) {
|
6579
|
+
if (isLogout === void 0) {
|
6580
|
+
isLogout = true;
|
6581
|
+
}
|
6582
|
+
try {
|
6583
|
+
var isStudent = data.role === exports.Role.Student;
|
6584
|
+
return Promise.resolve(handleLogin(function () {
|
6585
|
+
return new Promise(function (resolve, reject) {
|
6586
|
+
try {
|
6587
|
+
var _temp4 = _catch(function () {
|
6588
|
+
return Promise.resolve(!isLearningSpace && !domain ? apiLoginSuperAdminWithAccessToken(data) : apiLoginWithAccessToken(data, isLearningSpace, domain)).then(function (loginResponse) {
|
6589
|
+
var result = loginResponse.data;
|
6590
|
+
resolve(result);
|
6591
|
+
});
|
6592
|
+
}, function (error) {
|
6593
|
+
reject(error);
|
6594
|
+
});
|
6595
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(function () {}) : void 0);
|
6596
|
+
} catch (e) {
|
6597
|
+
return Promise.reject(e);
|
6598
|
+
}
|
6599
|
+
});
|
6600
|
+
}, isStudent, isLogout, superAdminRedirectPath)).then(function () {});
|
6601
|
+
} catch (e) {
|
6602
|
+
return Promise.reject(e);
|
6603
|
+
}
|
6604
|
+
};
|
6605
|
+
var handleLogin = function handleLogin(apiLogin, isStudent, isLogout, superAdminRedirectPath) {
|
6606
|
+
if (isLogout === void 0) {
|
6607
|
+
isLogout = true;
|
6608
|
+
}
|
6609
|
+
try {
|
6610
|
+
var _temp6 = function _temp6(_result) {
|
6611
|
+
if (_exit) return _result;
|
6612
|
+
dispatch(setLoading(false));
|
6613
|
+
};
|
6614
|
+
var _exit = false;
|
6615
|
+
dispatch(setLoading(true));
|
6616
|
+
var _temp5 = _catch(function () {
|
6617
|
+
return Promise.resolve(apiLogin()).then(function (loginResponse) {
|
6618
|
+
var isFirstLogin = loginResponse.isFirstLogin,
|
6619
|
+
token = loginResponse.token,
|
6620
|
+
user = loginResponse.user,
|
6621
|
+
isSuperAdmin = loginResponse.isSuperAdmin;
|
6622
|
+
var isAcademy = !!(user !== null && user !== void 0 && user.academyDomain) || !!(user !== null && user !== void 0 && user.isLearningSpace);
|
6623
|
+
var needToRegister = isStudent && isFirstLogin && isAcademy;
|
6624
|
+
var redirectUrl = getRedirectUrl();
|
6625
|
+
if (isStudent && !registerUrl) throw new Error("an_unexpected_error_has_occurred");
|
6626
|
+
if (!redirectUrl) redirectUrl = needToRegister ? registerUrl : isAcademy ? homeAcademyUrl : homeUrl;
|
6627
|
+
if (superAdminRedirectPath) {
|
6628
|
+
redirectUrl = superAdminRedirectPath;
|
6629
|
+
}
|
6630
|
+
if (!redirectAfterLogin) redirectUrl = undefined;
|
6631
|
+
redirectLoginUser(_extends({}, user, {
|
6632
|
+
isNotEnoughStatements: isFirstLogin,
|
6633
|
+
isSuperAdmin: isSuperAdmin
|
6634
|
+
}), token, redirectUrl);
|
6635
|
+
});
|
6636
|
+
}, function (error) {
|
6637
|
+
alert(getErrorMessage(t, error));
|
6638
|
+
isLogout && handleSignOut();
|
6639
|
+
});
|
6640
|
+
return Promise.resolve(_temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5));
|
6641
|
+
} catch (e) {
|
6642
|
+
return Promise.reject(e);
|
6643
|
+
}
|
6644
|
+
};
|
6645
|
+
var redirectLoginUser = function redirectLoginUser(data, token, redirectUrl) {
|
6646
|
+
localStorage.setItem(ACCESS_TOKEN, token);
|
6647
|
+
!data.academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
6648
|
+
!!data.academyDomain && localStorage.setItem(ACADEMY_DOMAIN, data.academyDomain);
|
6649
|
+
if (data.roles.includes(exports.Role.Student)) data.isLearningSpace ? localStorage.setItem(LEARNING_SPACE, "true") : localStorage.removeItem(LEARNING_SPACE);
|
6650
|
+
dispatch(setUser(_extends({}, data)));
|
6651
|
+
if (redirectUrl) {
|
6652
|
+
pushTo(history, redirectUrl);
|
6653
|
+
localStorage.removeItem(REDIRECT_URL);
|
6654
|
+
}
|
6655
|
+
};
|
6656
|
+
return {
|
6657
|
+
handleLoginGoogle: handleLoginGoogle,
|
6658
|
+
handleLoginAccessToken: handleLoginAccessToken,
|
6659
|
+
redirectLoginUser: redirectLoginUser
|
6660
|
+
};
|
6787
6661
|
};
|
6788
6662
|
|
6789
|
-
var
|
6790
|
-
var
|
6791
|
-
|
6792
|
-
|
6793
|
-
|
6794
|
-
|
6795
|
-
|
6796
|
-
isMulti = _ref.isMulti,
|
6797
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
6798
|
-
var _useTranslation = reactI18next.useTranslation(),
|
6799
|
-
t = _useTranslation.t;
|
6800
|
-
var initialValues = Array.isArray(value) ? options.filter(function (i) {
|
6801
|
-
return value.includes(i.value);
|
6802
|
-
}) : isMulti ? options === null || options === void 0 ? void 0 : options.filter(function (i) {
|
6803
|
-
return i.value == value;
|
6804
|
-
}) : options === null || options === void 0 ? void 0 : options.find(function (i) {
|
6805
|
-
return i.value == value;
|
6663
|
+
var ACADEMY_URL = BASE_URL + "/api/academy";
|
6664
|
+
var SUPER_ADMIN_ACADEMY_URL = SUPER_ADMIN_BASE_URL + "/api/academies";
|
6665
|
+
var getAcademyList = function getAcademyList(role) {
|
6666
|
+
return api.get(SUPER_ADMIN_ACADEMY_URL + "/active", {
|
6667
|
+
params: {
|
6668
|
+
role: role
|
6669
|
+
}
|
6806
6670
|
});
|
6807
|
-
|
6808
|
-
|
6809
|
-
|
6810
|
-
|
6811
|
-
|
6812
|
-
|
6813
|
-
isMulti: isMulti,
|
6814
|
-
components: {
|
6815
|
-
IndicatorSeparator: function IndicatorSeparator() {
|
6816
|
-
return null;
|
6817
|
-
},
|
6818
|
-
DropdownIndicator: DropdownIndicator,
|
6819
|
-
Option: CustomOption
|
6671
|
+
};
|
6672
|
+
var getUserAcademies = function getUserAcademies(role, isLearningSpace) {
|
6673
|
+
var _headers;
|
6674
|
+
return api.get("" + ACADEMY_URL, {
|
6675
|
+
params: {
|
6676
|
+
role: role
|
6820
6677
|
},
|
6821
|
-
|
6822
|
-
|
6823
|
-
|
6678
|
+
headers: (_headers = {}, _headers[NoAcademyHeaders] = isLearningSpace, _headers)
|
6679
|
+
});
|
6680
|
+
};
|
6681
|
+
var getAcademyByDomainApi = function getAcademyByDomainApi(domain, role) {
|
6682
|
+
return api.get(SUPER_ADMIN_ACADEMY_URL + "/domain/" + domain, {
|
6683
|
+
params: {
|
6684
|
+
role: role
|
6685
|
+
}
|
6686
|
+
});
|
6687
|
+
};
|
6688
|
+
var getAcademyDetail = function getAcademyDetail() {
|
6689
|
+
return api.get(ACADEMY_URL + "/detail");
|
6690
|
+
};
|
6691
|
+
var switchAcademy = function switchAcademy(academyId, role, isLearningSpace) {
|
6692
|
+
if (isLearningSpace === void 0) {
|
6693
|
+
isLearningSpace = false;
|
6694
|
+
}
|
6695
|
+
return api.post(ACADEMY_URL + "/" + academyId + "/switch-academy/" + role, undefined, {
|
6696
|
+
params: {
|
6697
|
+
isLearningSpace: isLearningSpace
|
6698
|
+
}
|
6699
|
+
});
|
6700
|
+
};
|
6701
|
+
var switchSuperAdminAcademy = function switchSuperAdminAcademy(academyId, role) {
|
6702
|
+
return api.post(SUPER_ADMIN_ACADEMY_URL + "/" + academyId + "/switch-academy/" + role);
|
6824
6703
|
};
|
6825
6704
|
|
6826
|
-
var
|
6827
|
-
var
|
6828
|
-
|
6829
|
-
|
6830
|
-
|
6831
|
-
|
6832
|
-
|
6833
|
-
|
6834
|
-
|
6835
|
-
|
6836
|
-
|
6705
|
+
var useSwitchAcademy = function useSwitchAcademy(role, history, homeAcademyUrl, homeUrl, registerUrl, canFetchAcademies) {
|
6706
|
+
var _user$roles;
|
6707
|
+
if (role === void 0) {
|
6708
|
+
role = exports.Role.Student;
|
6709
|
+
}
|
6710
|
+
if (canFetchAcademies === void 0) {
|
6711
|
+
canFetchAcademies = false;
|
6712
|
+
}
|
6713
|
+
var dispatch = reactRedux.useDispatch();
|
6714
|
+
var _useLogin = useLogin(history, homeAcademyUrl, homeUrl, registerUrl),
|
6715
|
+
handleLoginAccessToken = _useLogin.handleLoginAccessToken;
|
6716
|
+
var academyList = reactRedux.useSelector(function (state) {
|
6717
|
+
var _state$academies;
|
6718
|
+
return state === null || state === void 0 ? void 0 : (_state$academies = state.academies) === null || _state$academies === void 0 ? void 0 : _state$academies.items;
|
6719
|
+
}) || [];
|
6720
|
+
var _useState = React.useState(false),
|
6721
|
+
dropdownOpen = _useState[0],
|
6722
|
+
setDropdownOpen = _useState[1];
|
6723
|
+
var toggleDropdown = function toggleDropdown() {
|
6724
|
+
return setDropdownOpen(function (prevState) {
|
6725
|
+
return !prevState;
|
6726
|
+
});
|
6727
|
+
};
|
6728
|
+
var user = reactRedux.useSelector(function (state) {
|
6729
|
+
var _state$common;
|
6730
|
+
return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
|
6731
|
+
});
|
6732
|
+
var isReFetchUserAcademies = reactRedux.useSelector(function (state) {
|
6733
|
+
var _state$common2;
|
6734
|
+
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.isReFetchUserAcademies;
|
6735
|
+
});
|
6837
6736
|
var _useTranslation = reactI18next.useTranslation(),
|
6838
6737
|
t = _useTranslation.t;
|
6839
|
-
var
|
6840
|
-
|
6841
|
-
|
6842
|
-
|
6843
|
-
|
6844
|
-
|
6845
|
-
|
6846
|
-
|
6847
|
-
|
6848
|
-
|
6849
|
-
|
6850
|
-
|
6851
|
-
|
6852
|
-
|
6853
|
-
|
6854
|
-
|
6855
|
-
|
6856
|
-
|
6857
|
-
|
6858
|
-
|
6859
|
-
|
6860
|
-
|
6861
|
-
|
6862
|
-
|
6863
|
-
|
6864
|
-
|
6865
|
-
|
6866
|
-
|
6867
|
-
|
6868
|
-
|
6869
|
-
|
6870
|
-
|
6871
|
-
|
6872
|
-
|
6873
|
-
|
6874
|
-
|
6875
|
-
|
6876
|
-
|
6877
|
-
|
6878
|
-
|
6879
|
-
|
6880
|
-
|
6738
|
+
var getAcademies = function getAcademies(isLoading) {
|
6739
|
+
if (isLoading === void 0) {
|
6740
|
+
isLoading = true;
|
6741
|
+
}
|
6742
|
+
try {
|
6743
|
+
var _temp3 = function _temp3() {
|
6744
|
+
isLoading && dispatch(setLoading(false));
|
6745
|
+
};
|
6746
|
+
if (!user) return Promise.resolve();
|
6747
|
+
var isSuperAdminUser = user && !user.academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace);
|
6748
|
+
var isSuperAdminRole = user.roles.includes(exports.Role.Admin);
|
6749
|
+
isLoading && dispatch(setLoading(true));
|
6750
|
+
var _temp2 = _catch(function () {
|
6751
|
+
return Promise.resolve(isSuperAdminUser ? getAcademyList(role) : getUserAcademies(role, user === null || user === void 0 ? void 0 : user.isLearningSpace)).then(function (res) {
|
6752
|
+
var items = res.data.items || [];
|
6753
|
+
if (isReFetchUserAcademies) dispatch(setReFetchUserAcademies(false));
|
6754
|
+
dispatch(setAcademies(items));
|
6755
|
+
var _temp = function () {
|
6756
|
+
if (!isSuperAdminRole && isSuperAdminUser && role == exports.Role.Admin && items.length > 0) {
|
6757
|
+
return Promise.resolve(handleSwitchAcademy(false, items[0], false)).then(function () {});
|
6758
|
+
}
|
6759
|
+
}();
|
6760
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
6761
|
+
});
|
6762
|
+
}, function (error) {
|
6763
|
+
reactToastify.toast.error(getErrorMessage(t, error));
|
6764
|
+
});
|
6765
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2));
|
6766
|
+
} catch (e) {
|
6767
|
+
return Promise.reject(e);
|
6768
|
+
}
|
6769
|
+
};
|
6770
|
+
var handleSwitchAcademy = function handleSwitchAcademy(isLearningSpace, selectedAcademy, isLoading, superAdminRedirectPath) {
|
6771
|
+
if (isLoading === void 0) {
|
6772
|
+
isLoading = true;
|
6773
|
+
}
|
6774
|
+
try {
|
6775
|
+
var _temp5 = function _temp5() {
|
6776
|
+
isLoading && dispatch(setLoading(false));
|
6777
|
+
setDropdownOpen(false);
|
6778
|
+
};
|
6779
|
+
isLoading && dispatch(setLoading(true));
|
6780
|
+
var academyId = selectedAcademy ? selectedAcademy.id : 0;
|
6781
|
+
var academyDomain = selectedAcademy ? selectedAcademy.domain : undefined;
|
6782
|
+
var isSuperAdminUser = user && !user.academyDomain && !(user !== null && user !== void 0 && user.isLearningSpace);
|
6783
|
+
var _temp4 = _catch(function () {
|
6784
|
+
return Promise.resolve(isSuperAdminUser ? switchSuperAdminAcademy(academyId, role) : switchAcademy(academyId, role, isLearningSpace)).then(function (res) {
|
6785
|
+
var data = res.data;
|
6786
|
+
var requestBody = {
|
6787
|
+
accessToken: data.accessToken,
|
6788
|
+
email: user.email,
|
6789
|
+
role: role
|
6790
|
+
};
|
6791
|
+
return Promise.resolve(handleLoginAccessToken(requestBody, isLearningSpace, academyDomain, false, superAdminRedirectPath)).then(function () {});
|
6792
|
+
});
|
6793
|
+
}, function (error) {
|
6794
|
+
reactToastify.toast.error(getErrorMessage(t, error));
|
6795
|
+
});
|
6796
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
6797
|
+
} catch (e) {
|
6798
|
+
return Promise.reject(e);
|
6799
|
+
}
|
6800
|
+
};
|
6801
|
+
var handleLogOutAcademy = function handleLogOutAcademy(callback) {
|
6802
|
+
try {
|
6803
|
+
var _temp7 = function _temp7() {
|
6804
|
+
dispatch(setLoading(false));
|
6805
|
+
callback();
|
6806
|
+
};
|
6807
|
+
dispatch(setLoading(true));
|
6808
|
+
var _temp6 = _catch(function () {
|
6809
|
+
return Promise.resolve(switchAcademy(0, role)).then(function (res) {
|
6810
|
+
var data = res.data;
|
6811
|
+
var requestBody = {
|
6812
|
+
accessToken: data.accessToken,
|
6813
|
+
email: user.email,
|
6814
|
+
role: role
|
6815
|
+
};
|
6816
|
+
return Promise.resolve(handleLoginAccessToken(requestBody, undefined, undefined, false)).then(function () {});
|
6817
|
+
});
|
6818
|
+
}, function (error) {
|
6819
|
+
reactToastify.toast.error(getErrorMessage(t, error));
|
6820
|
+
});
|
6821
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(_temp7) : _temp7(_temp6));
|
6822
|
+
} catch (e) {
|
6823
|
+
return Promise.reject(e);
|
6824
|
+
}
|
6825
|
+
};
|
6826
|
+
React.useEffect(function () {
|
6827
|
+
canFetchAcademies && getAcademies();
|
6828
|
+
}, [canFetchAcademies, user === null || user === void 0 ? void 0 : user.academyDomain, user === null || user === void 0 ? void 0 : user.email, user === null || user === void 0 ? void 0 : (_user$roles = user.roles) === null || _user$roles === void 0 ? void 0 : _user$roles.join(",")]);
|
6829
|
+
React.useEffect(function () {
|
6830
|
+
canFetchAcademies && isReFetchUserAcademies && getAcademies(false);
|
6831
|
+
}, [canFetchAcademies, isReFetchUserAcademies]);
|
6832
|
+
var selectedAcademy = React.useMemo(function () {
|
6833
|
+
return academyList.find(function (i) {
|
6834
|
+
var _user$academyDomain;
|
6835
|
+
return i.domain.trim().toLowerCase() === (user === null || user === void 0 ? void 0 : (_user$academyDomain = user.academyDomain) === null || _user$academyDomain === void 0 ? void 0 : _user$academyDomain.trim().toLowerCase());
|
6836
|
+
});
|
6837
|
+
}, [user === null || user === void 0 ? void 0 : user.academyDomain, JSON.stringify(academyList)]);
|
6838
|
+
return {
|
6839
|
+
selectedAcademy: selectedAcademy,
|
6840
|
+
dropdownOpen: dropdownOpen,
|
6841
|
+
academyList: academyList,
|
6842
|
+
toggleDropdown: toggleDropdown,
|
6843
|
+
handleSwitchAcademy: handleSwitchAcademy,
|
6844
|
+
handleLogOutAcademy: handleLogOutAcademy
|
6845
|
+
};
|
6846
|
+
};
|
6847
|
+
|
6848
|
+
var useVirtualizeList = function useVirtualizeList(totalItems, rowHeight, offsetRow, minRows) {
|
6849
|
+
if (offsetRow === void 0) {
|
6850
|
+
offsetRow = 1;
|
6851
|
+
}
|
6852
|
+
var _useState = React.useState(-1),
|
6853
|
+
startIndex = _useState[0],
|
6854
|
+
setStartIndex = _useState[1];
|
6855
|
+
var _useState2 = React.useState(-1),
|
6856
|
+
endIndex = _useState2[0],
|
6857
|
+
setEndIndex = _useState2[1];
|
6858
|
+
var containerRef = React.useRef(null);
|
6859
|
+
var handleScroll = React.useCallback(function () {
|
6860
|
+
if (containerRef.current) {
|
6861
|
+
var _containerRef$current = containerRef.current,
|
6862
|
+
scrollTop = _containerRef$current.scrollTop,
|
6863
|
+
clientHeight = _containerRef$current.clientHeight;
|
6864
|
+
var itemsPerPage = Math.ceil(clientHeight / rowHeight);
|
6865
|
+
var newStartIndex = Math.max(Math.floor(scrollTop / rowHeight) - offsetRow, 0);
|
6866
|
+
var newEndIndex = Math.min(newStartIndex + itemsPerPage + offsetRow, totalItems - 1);
|
6867
|
+
if (minRows) {
|
6868
|
+
if (totalItems <= minRows) {
|
6869
|
+
newStartIndex = -1;
|
6870
|
+
newEndIndex = -1;
|
6871
|
+
} else {
|
6872
|
+
var total = newEndIndex - newStartIndex;
|
6873
|
+
var diff = minRows - total;
|
6874
|
+
if (diff > 0) {
|
6875
|
+
var valS = diff / 2;
|
6876
|
+
var valE = diff - valS;
|
6877
|
+
if (newStartIndex < valS) {
|
6878
|
+
valE += valS - newStartIndex;
|
6879
|
+
newStartIndex = 0;
|
6880
|
+
}
|
6881
|
+
if (newEndIndex + valE > totalItems - 1) {
|
6882
|
+
valS += newEndIndex + valE - totalItems + 1;
|
6883
|
+
}
|
6884
|
+
newStartIndex = Math.max(newStartIndex - valS, 0);
|
6885
|
+
newEndIndex = Math.min(newEndIndex + valE, totalItems - 1);
|
6886
|
+
}
|
6887
|
+
}
|
6888
|
+
}
|
6889
|
+
setStartIndex(newStartIndex);
|
6890
|
+
setEndIndex(newEndIndex);
|
6891
|
+
}
|
6892
|
+
}, [totalItems, rowHeight, offsetRow]);
|
6893
|
+
React.useEffect(function () {
|
6894
|
+
var container = containerRef.current;
|
6895
|
+
if (container) {
|
6896
|
+
container.addEventListener("scroll", handleScroll);
|
6897
|
+
}
|
6898
|
+
return function () {
|
6899
|
+
if (container) {
|
6900
|
+
container.removeEventListener("scroll", handleScroll);
|
6901
|
+
}
|
6902
|
+
};
|
6903
|
+
}, [handleScroll]);
|
6904
|
+
var handleChangeStartIndex = function handleChangeStartIndex(index) {
|
6905
|
+
setStartIndex(index);
|
6906
|
+
};
|
6907
|
+
var handleChangeEndIndex = function handleChangeEndIndex(index) {
|
6908
|
+
setEndIndex(index);
|
6909
|
+
};
|
6910
|
+
return {
|
6911
|
+
startIndex: startIndex,
|
6912
|
+
endIndex: endIndex,
|
6913
|
+
containerRef: containerRef,
|
6914
|
+
handleChangeStartIndex: handleChangeStartIndex,
|
6915
|
+
handleChangeEndIndex: handleChangeEndIndex
|
6916
|
+
};
|
6881
6917
|
};
|
6882
6918
|
|
6883
|
-
|
6884
|
-
|
6885
|
-
}
|
6886
|
-
|
6887
|
-
|
6888
|
-
|
6889
|
-
|
6890
|
-
|
6891
|
-
|
6919
|
+
(function (RecentUserActionSortBy) {
|
6920
|
+
RecentUserActionSortBy["CreatedAt"] = "CreatedAt";
|
6921
|
+
})(exports.RecentUserActionSortBy || (exports.RecentUserActionSortBy = {}));
|
6922
|
+
(function (OrderBy) {
|
6923
|
+
OrderBy["ASC"] = "ASC";
|
6924
|
+
OrderBy["DESC"] = "DESC";
|
6925
|
+
})(exports.OrderBy || (exports.OrderBy = {}));
|
6926
|
+
|
6927
|
+
var api = axios.create({
|
6928
|
+
baseURL: BASE_URL,
|
6929
|
+
timeout: 0,
|
6930
|
+
headers: {
|
6931
|
+
"Content-Type": "application/json"
|
6932
|
+
},
|
6933
|
+
paramsSerializer: function paramsSerializer(params) {
|
6934
|
+
return encodeParams(params);
|
6935
|
+
}
|
6892
6936
|
});
|
6893
|
-
var
|
6894
|
-
|
6895
|
-
|
6896
|
-
|
6937
|
+
var apiUpload = axios.create({
|
6938
|
+
baseURL: BASE_URL,
|
6939
|
+
timeout: 60000,
|
6940
|
+
headers: {
|
6941
|
+
"Content-Type": "multipart/form-data"
|
6942
|
+
}
|
6897
6943
|
});
|
6898
|
-
|
6899
|
-
|
6900
|
-
var
|
6901
|
-
|
6902
|
-
|
6903
|
-
|
6904
|
-
|
6905
|
-
|
6906
|
-
|
6907
|
-
|
6908
|
-
|
6909
|
-
|
6910
|
-
|
6911
|
-
|
6912
|
-
|
6913
|
-
|
6944
|
+
[api, apiUpload].forEach(function (i) {
|
6945
|
+
return i.interceptors.request.use(function (config) {
|
6946
|
+
var token = getAccessToken();
|
6947
|
+
var searchParams = new URLSearchParams(window.location.search);
|
6948
|
+
var paramLang = searchParams.get('lang');
|
6949
|
+
var academyDomainStorage = getAcademyDomain();
|
6950
|
+
var isLearningSpace = getLearningSpace();
|
6951
|
+
var langStorage = getLanguage();
|
6952
|
+
var academyDomain = academyDomainStorage;
|
6953
|
+
var language = paramLang || langStorage;
|
6954
|
+
if (token) {
|
6955
|
+
config.headers.Authorization = "Bearer " + token;
|
6956
|
+
localStorage.setItem("LAST_TIME_REQUEST", moment().utc().format("YYYY-MM-DD HH:mm:ss"));
|
6957
|
+
}
|
6958
|
+
if (academyDomain && !isLearningSpace && config.headers[AcademyHeaders] == undefined) config.headers[AcademyHeaders] = "" + academyDomain;
|
6959
|
+
if (isLearningSpace && config.headers[NoAcademyHeaders] == undefined) config.headers[NoAcademyHeaders] = "" + isLearningSpace;
|
6960
|
+
if (language) config.headers[LanguageHeaders] = "" + language;
|
6961
|
+
return config;
|
6962
|
+
}, function (error) {
|
6963
|
+
return Promise.reject(error);
|
6914
6964
|
});
|
6915
|
-
|
6916
|
-
|
6917
|
-
|
6918
|
-
|
6919
|
-
|
6920
|
-
|
6965
|
+
});
|
6966
|
+
[api, apiUpload].forEach(function (i) {
|
6967
|
+
return i.interceptors.response.use(function (response) {
|
6968
|
+
return response;
|
6969
|
+
}, function (error) {
|
6970
|
+
var _error$response, _error$response2, _error$response3;
|
6971
|
+
console.log({
|
6972
|
+
error: error
|
6973
|
+
});
|
6974
|
+
if (((_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.status) === 401) {
|
6975
|
+
var _window$location = window.location,
|
6976
|
+
pathname = _window$location.pathname,
|
6977
|
+
search = _window$location.search;
|
6978
|
+
var preRedirectUrl = localStorage.getItem(PRE_REDIRECT_URL);
|
6979
|
+
var newRedirectUrl = "" + pathname + search;
|
6980
|
+
if (!pathname.startsWith("/login")) {
|
6981
|
+
if (preRedirectUrl !== newRedirectUrl) {
|
6982
|
+
localStorage.setItem(REDIRECT_URL, newRedirectUrl);
|
6983
|
+
localStorage.setItem(PRE_REDIRECT_URL, newRedirectUrl);
|
6984
|
+
}
|
6985
|
+
}
|
6986
|
+
}
|
6987
|
+
if (((_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.status) === 401 || ((_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.status) == 403) {
|
6988
|
+
localStorage.removeItem(ACCESS_TOKEN);
|
6989
|
+
window.location.href = "/login";
|
6990
|
+
}
|
6991
|
+
return Promise.reject(error);
|
6921
6992
|
});
|
6922
|
-
};
|
6923
|
-
|
6924
|
-
var _excluded$4 = ["id", "value", "onChange", "isDisabled", "options", "isMulti", "placeholder"];
|
6925
|
-
var ArticleCategorySelector = function ArticleCategorySelector(_ref) {
|
6926
|
-
var id = _ref.id,
|
6927
|
-
value = _ref.value,
|
6928
|
-
onChange = _ref.onChange,
|
6929
|
-
isDisabled = _ref.isDisabled,
|
6930
|
-
options = _ref.options,
|
6931
|
-
isMulti = _ref.isMulti,
|
6932
|
-
placeholder = _ref.placeholder,
|
6933
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$4);
|
6934
|
-
var _useTranslation = reactI18next.useTranslation(),
|
6935
|
-
t = _useTranslation.t;
|
6936
|
-
return React__default.createElement(CustomSelect, Object.assign({
|
6937
|
-
isMulti: isMulti,
|
6938
|
-
inputId: id,
|
6939
|
-
value: value,
|
6940
|
-
options: options,
|
6941
|
-
onChange: onChange,
|
6942
|
-
isDisabled: isDisabled,
|
6943
|
-
placeholder: placeholder || t("select_category")
|
6944
|
-
}, rest));
|
6945
|
-
};
|
6993
|
+
});
|
6946
6994
|
|
6947
6995
|
var COURSE_URL = BASE_URL + "/api/course";
|
6948
6996
|
var getClassesApi = function getClassesApi(textSearch) {
|
@@ -9162,7 +9210,7 @@ var usePusherConversation = function usePusherConversation(onNewMessageConversat
|
|
9162
9210
|
return {};
|
9163
9211
|
};
|
9164
9212
|
|
9165
|
-
var config = {
|
9213
|
+
var config$1 = {
|
9166
9214
|
height: 300,
|
9167
9215
|
allowedContent: true,
|
9168
9216
|
toolbar: ["/", {
|
@@ -9194,13 +9242,16 @@ var config = {
|
|
9194
9242
|
filebrowserUploadUrl: BASE_URL + "/api/file/support-files?"
|
9195
9243
|
};
|
9196
9244
|
|
9245
|
+
var _excluded$6 = ["ref", "value", "option", "onBlur", "onFocus", "onChange", "onAfterInsertHtml", "onInsertElement", "onInsertHtml", "onInsertText", "onDataReady", "onSelectionChange", "disabled"];
|
9197
9246
|
var CkEditor = function CkEditor(_ref) {
|
9198
9247
|
var ref = _ref.ref,
|
9199
9248
|
value = _ref.value,
|
9200
|
-
onChange = _ref.onChange,
|
9201
9249
|
option = _ref.option,
|
9250
|
+
onChange = _ref.onChange,
|
9251
|
+
onDataReady = _ref.onDataReady,
|
9202
9252
|
_ref$disabled = _ref.disabled,
|
9203
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
9253
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
9254
|
+
action = _objectWithoutPropertiesLoose(_ref, _excluded$6);
|
9204
9255
|
var _React$useState = React__default.useState(null),
|
9205
9256
|
editor = _React$useState[0],
|
9206
9257
|
setEditor = _React$useState[1];
|
@@ -9212,19 +9263,20 @@ var CkEditor = function CkEditor(_ref) {
|
|
9212
9263
|
editor.setData(value);
|
9213
9264
|
}
|
9214
9265
|
}, [value, editor]);
|
9215
|
-
return React__default.createElement(ckeditor4React.CKEditor, {
|
9266
|
+
return React__default.createElement(ckeditor4React.CKEditor, Object.assign({
|
9216
9267
|
ref: ref,
|
9217
9268
|
initData: value,
|
9218
9269
|
readOnly: disabled,
|
9219
|
-
onChange: onChange,
|
9220
9270
|
onInstanceReady: handleInstanceReady,
|
9221
|
-
config: !!option ? option : config,
|
9271
|
+
config: !!option ? option : config$1,
|
9272
|
+
onDataReady: onDataReady,
|
9273
|
+
onChange: onChange,
|
9222
9274
|
onBeforeLoad: function onBeforeLoad(CKEDITOR) {
|
9223
9275
|
CKEDITOR.disableAutoInline = true;
|
9224
9276
|
CKEDITOR.config.height = 300;
|
9225
9277
|
CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR;
|
9226
9278
|
}
|
9227
|
-
});
|
9279
|
+
}, action));
|
9228
9280
|
};
|
9229
9281
|
|
9230
9282
|
var ListView = function ListView(_ref) {
|
@@ -10793,10 +10845,10 @@ var LoginQRCode = function LoginQRCode(props) {
|
|
10793
10845
|
}));
|
10794
10846
|
};
|
10795
10847
|
|
10796
|
-
var _excluded$
|
10848
|
+
var _excluded$7 = ["history"];
|
10797
10849
|
var Login = function Login(_ref) {
|
10798
10850
|
var history = _ref.history,
|
10799
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
10851
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$7);
|
10800
10852
|
var _useLogin = useLogin$1({
|
10801
10853
|
homeAcademyUrl: rest.homeAcademyUrl,
|
10802
10854
|
homeUrl: rest.homeUrl,
|
@@ -11750,11 +11802,11 @@ var DEFAULT_USER_FILTERS = {
|
|
11750
11802
|
|
11751
11803
|
var styles$2 = {"avatar":"_2rJkZ","date-picker":"_1iqE2","time-picker":"_20xtc","teacher-selector-wrapper":"_3L1Oj"};
|
11752
11804
|
|
11753
|
-
var _excluded$
|
11805
|
+
var _excluded$8 = ["teachers", "value"];
|
11754
11806
|
var TeacherSelector = function TeacherSelector(_ref) {
|
11755
11807
|
var teachers = _ref.teachers,
|
11756
11808
|
value = _ref.value,
|
11757
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
11809
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$8);
|
11758
11810
|
var teacherOptions = teachers.map(function (i) {
|
11759
11811
|
return {
|
11760
11812
|
label: i.teacherName + "/" + i.teacherEmail,
|
@@ -13045,7 +13097,7 @@ var useTeacherList = function useTeacherList() {
|
|
13045
13097
|
};
|
13046
13098
|
};
|
13047
13099
|
|
13048
|
-
var _excluded$
|
13100
|
+
var _excluded$9 = ["getStudents"],
|
13049
13101
|
_excluded2 = ["getTeachers"],
|
13050
13102
|
_excluded3 = ["getLessons"];
|
13051
13103
|
var PAGE_TITLE$4 = "classes";
|
@@ -13096,7 +13148,7 @@ var useClassDetail = function useClassDetail(_ref) {
|
|
13096
13148
|
};
|
13097
13149
|
var _useStudentClassList = useStudentClassList(classId),
|
13098
13150
|
getStudents = _useStudentClassList.getStudents,
|
13099
|
-
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$
|
13151
|
+
studentListProps = _objectWithoutPropertiesLoose(_useStudentClassList, _excluded$9);
|
13100
13152
|
var _useTeacherClassList = useTeacherClassList(classId),
|
13101
13153
|
getTeachers = _useTeacherClassList.getTeachers,
|
13102
13154
|
teacherListProps = _objectWithoutPropertiesLoose(_useTeacherClassList, _excluded2);
|
@@ -13846,12 +13898,12 @@ var LessonList = function LessonList(_ref) {
|
|
13846
13898
|
}));
|
13847
13899
|
};
|
13848
13900
|
|
13849
|
-
var _excluded$
|
13901
|
+
var _excluded$a = ["children", "value", "index"];
|
13850
13902
|
var CustomTabPanel = function CustomTabPanel(props) {
|
13851
13903
|
var children = props.children,
|
13852
13904
|
value = props.value,
|
13853
13905
|
index = props.index,
|
13854
|
-
other = _objectWithoutPropertiesLoose(props, _excluded$
|
13906
|
+
other = _objectWithoutPropertiesLoose(props, _excluded$a);
|
13855
13907
|
return React__default.createElement("div", Object.assign({
|
13856
13908
|
role: "tabpanel",
|
13857
13909
|
hidden: value !== index,
|
@@ -15940,6 +15992,28 @@ var CompareGrass = function CompareGrass(_ref2) {
|
|
15940
15992
|
var effectSize = _ref2.effectSize;
|
15941
15993
|
var _useTranslation = reactI18next.useTranslation(),
|
15942
15994
|
t = _useTranslation.t;
|
15995
|
+
var renderAnswer = function renderAnswer(type, content) {
|
15996
|
+
var _content$split, _content$split$map;
|
15997
|
+
if (!content) return "";
|
15998
|
+
switch (type) {
|
15999
|
+
case exports.QuestionAnswerType.ShortAnswer:
|
16000
|
+
return React__default.createElement(MathJaxContainer, {
|
16001
|
+
content: content
|
16002
|
+
});
|
16003
|
+
case exports.QuestionAnswerType.SingleChoice:
|
16004
|
+
return t("number_question", {
|
16005
|
+
number: content
|
16006
|
+
});
|
16007
|
+
case exports.QuestionAnswerType.MultipleChoice:
|
16008
|
+
return content === null || content === void 0 ? void 0 : (_content$split = content.split("|")) === null || _content$split === void 0 ? void 0 : (_content$split$map = _content$split.map(function (i) {
|
16009
|
+
return t("number_question", {
|
16010
|
+
number: i
|
16011
|
+
});
|
16012
|
+
})) === null || _content$split$map === void 0 ? void 0 : _content$split$map.join(",");
|
16013
|
+
default:
|
16014
|
+
return content;
|
16015
|
+
}
|
16016
|
+
};
|
15943
16017
|
var renderTableBody = function renderTableBody(effectSize) {
|
15944
16018
|
return effectSize.map(function (item, index) {
|
15945
16019
|
return React__default.createElement("tr", {
|
@@ -15957,23 +16031,17 @@ var CompareGrass = function CompareGrass(_ref2) {
|
|
15957
16031
|
textAlign: "center",
|
15958
16032
|
color: "#202B37"
|
15959
16033
|
}
|
15960
|
-
},
|
15961
|
-
number: item.correctAnswers
|
15962
|
-
})), React__default.createElement("td", {
|
16034
|
+
}, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.correctAnswers)), React__default.createElement("td", {
|
15963
16035
|
className: styles$3["tdcolumn3"],
|
15964
16036
|
style: {
|
15965
16037
|
color: item.isCorrect ? styles$3.green_support_900 : styles$3.red_900
|
15966
16038
|
}
|
15967
|
-
}, item.
|
15968
|
-
number: item.selectedAnswers
|
15969
|
-
}) : ""), React__default.createElement("td", {
|
16039
|
+
}, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.selectedAnswers)), React__default.createElement("td", {
|
15970
16040
|
style: {
|
15971
16041
|
textAlign: "center",
|
15972
16042
|
color: "#414E62"
|
15973
16043
|
}
|
15974
|
-
}, item.
|
15975
|
-
number: item.mostSelectedAnswers
|
15976
|
-
}) : ""), React__default.createElement("td", {
|
16044
|
+
}, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.mostSelectedAnswers)), React__default.createElement("td", {
|
15977
16045
|
className: "" + printStyles["avoid-break-inside"]
|
15978
16046
|
}, React__default.createElement("div", {
|
15979
16047
|
className: styles$3["classification"] + " " + printStyles["avoid-break-inside"]
|
@@ -16326,6 +16394,28 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
16326
16394
|
return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
|
16327
16395
|
}).slice(0, limitQuestions);
|
16328
16396
|
}, [JSON.stringify(data.questions)]);
|
16397
|
+
var renderAnswer = function renderAnswer(type, content) {
|
16398
|
+
var _content$split, _content$split$map;
|
16399
|
+
if (!content) return "";
|
16400
|
+
switch (type) {
|
16401
|
+
case exports.QuestionAnswerType.ShortAnswer:
|
16402
|
+
return React__default.createElement(MathJaxContainer, {
|
16403
|
+
content: content
|
16404
|
+
});
|
16405
|
+
case exports.QuestionAnswerType.SingleChoice:
|
16406
|
+
return t("number_question", {
|
16407
|
+
number: content
|
16408
|
+
});
|
16409
|
+
case exports.QuestionAnswerType.MultipleChoice:
|
16410
|
+
return content === null || content === void 0 ? void 0 : (_content$split = content.split("|")) === null || _content$split === void 0 ? void 0 : (_content$split$map = _content$split.map(function (i) {
|
16411
|
+
return t("number_question", {
|
16412
|
+
number: i
|
16413
|
+
});
|
16414
|
+
})) === null || _content$split$map === void 0 ? void 0 : _content$split$map.join(",");
|
16415
|
+
default:
|
16416
|
+
return content;
|
16417
|
+
}
|
16418
|
+
};
|
16329
16419
|
var renderTableBody = function renderTableBody(data) {
|
16330
16420
|
return data.map(function (item, index) {
|
16331
16421
|
return React__default.createElement("tr", {
|
@@ -16360,16 +16450,12 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
16360
16450
|
fontSize: "13px",
|
16361
16451
|
fontWeight: 500
|
16362
16452
|
}
|
16363
|
-
}, item.
|
16364
|
-
number: item.selectedAnswers
|
16365
|
-
}) : ""), React__default.createElement("td", {
|
16453
|
+
}, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.selectedAnswers)), React__default.createElement("td", {
|
16366
16454
|
style: {
|
16367
16455
|
textAlign: "center",
|
16368
16456
|
color: styles$3.gray_700
|
16369
16457
|
}
|
16370
|
-
}, item.
|
16371
|
-
number: item.correctAnswers
|
16372
|
-
}) : ""), React__default.createElement("td", {
|
16458
|
+
}, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.correctAnswers)), React__default.createElement("td", {
|
16373
16459
|
style: {
|
16374
16460
|
textAlign: "center",
|
16375
16461
|
color: styles$3.gray_700
|
@@ -16379,6 +16465,7 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
16379
16465
|
};
|
16380
16466
|
var renderQuestions = function renderQuestions(questions) {
|
16381
16467
|
return questions.map(function (question) {
|
16468
|
+
var _question$selectedAns, _question$selectedAns2, _question$correctAnsw, _question$correctAnsw2, _question$correctAnsw3;
|
16382
16469
|
return React__default.createElement(material.Grid, {
|
16383
16470
|
container: true,
|
16384
16471
|
flexWrap: "nowrap",
|
@@ -16405,7 +16492,23 @@ var Vulnerable = function Vulnerable(_ref) {
|
|
16405
16492
|
className: styles$3["span2"]
|
16406
16493
|
}, t("my_wrong_answer"))), React__default.createElement("div", null, React__default.createElement("span", {
|
16407
16494
|
className: styles$3["overallCorrectRate"]
|
16408
|
-
}, question.overallCorrectRate.toFixed(2), "%"), React__default.createElement("span", {
|
16495
|
+
}, question.overallCorrectRate.toFixed(2), "%"), question.questionAnswerType === exports.QuestionAnswerType.ShortAnswer ? React__default.createElement("span", {
|
16496
|
+
className: styles$3["answer"]
|
16497
|
+
}, React__default.createElement(MathJaxContainer, {
|
16498
|
+
content: question.selectedAnswers
|
16499
|
+
}), " ", t("answer"), " ", React__default.createElement(MathJaxContainer, {
|
16500
|
+
content: question.correctAnswers
|
16501
|
+
})) : question.questionAnswerType === exports.QuestionAnswerType.MultipleChoice ? React__default.createElement("span", {
|
16502
|
+
className: styles$3["answer"]
|
16503
|
+
}, (_question$selectedAns = question.selectedAnswers.split("|")) === null || _question$selectedAns === void 0 ? void 0 : (_question$selectedAns2 = _question$selectedAns.map(function (i) {
|
16504
|
+
return t("number_question", {
|
16505
|
+
number: i
|
16506
|
+
});
|
16507
|
+
})) === null || _question$selectedAns2 === void 0 ? void 0 : _question$selectedAns2.join(","), " (", t("answer"), " ", (_question$correctAnsw = question.correctAnswers) === null || _question$correctAnsw === void 0 ? void 0 : (_question$correctAnsw2 = _question$correctAnsw.split("|")) === null || _question$correctAnsw2 === void 0 ? void 0 : (_question$correctAnsw3 = _question$correctAnsw2.map(function (i) {
|
16508
|
+
return t("number_question", {
|
16509
|
+
number: i
|
16510
|
+
});
|
16511
|
+
})) === null || _question$correctAnsw3 === void 0 ? void 0 : _question$correctAnsw3.join(","), ")") : React__default.createElement("span", {
|
16409
16512
|
className: styles$3["answer"]
|
16410
16513
|
}, t("number_question", {
|
16411
16514
|
number: question.selectedAnswers
|
@@ -18169,6 +18272,28 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
18169
18272
|
return q2.overallCorrectRate === q1.overallCorrectRate ? q1.questionOrder - q2.questionOrder : q2.overallCorrectRate - q1.overallCorrectRate;
|
18170
18273
|
}).slice(0, limitQuestions$1);
|
18171
18274
|
}, [JSON.stringify(data === null || data === void 0 ? void 0 : data.studentQuestionResults)]);
|
18275
|
+
var renderAnswer = function renderAnswer(type, content) {
|
18276
|
+
var _content$split, _content$split$map;
|
18277
|
+
if (!content) return "";
|
18278
|
+
switch (type) {
|
18279
|
+
case exports.QuestionAnswerType.ShortAnswer:
|
18280
|
+
return React__default.createElement(MathJaxContainer, {
|
18281
|
+
content: content
|
18282
|
+
});
|
18283
|
+
case exports.QuestionAnswerType.SingleChoice:
|
18284
|
+
return t("number_question", {
|
18285
|
+
number: content
|
18286
|
+
});
|
18287
|
+
case exports.QuestionAnswerType.MultipleChoice:
|
18288
|
+
return content === null || content === void 0 ? void 0 : (_content$split = content.split("|")) === null || _content$split === void 0 ? void 0 : (_content$split$map = _content$split.map(function (i) {
|
18289
|
+
return t("number_question", {
|
18290
|
+
number: i
|
18291
|
+
});
|
18292
|
+
})) === null || _content$split$map === void 0 ? void 0 : _content$split$map.join(",");
|
18293
|
+
default:
|
18294
|
+
return content;
|
18295
|
+
}
|
18296
|
+
};
|
18172
18297
|
var renderTableBody = function renderTableBody(data) {
|
18173
18298
|
return data === null || data === void 0 ? void 0 : data.map(function (item, index) {
|
18174
18299
|
return React__default.createElement("tr", {
|
@@ -18203,16 +18328,12 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
18203
18328
|
fontSize: "13px",
|
18204
18329
|
fontWeight: 500
|
18205
18330
|
}
|
18206
|
-
}, item.
|
18207
|
-
number: item.selectedAnswers
|
18208
|
-
}) : ""), React__default.createElement("td", {
|
18331
|
+
}, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.selectedAnswers)), React__default.createElement("td", {
|
18209
18332
|
style: {
|
18210
18333
|
textAlign: "center",
|
18211
18334
|
color: styles$3.gray_700
|
18212
18335
|
}
|
18213
|
-
}, item.
|
18214
|
-
number: item.correctAnswers
|
18215
|
-
}) : ""), React__default.createElement("td", {
|
18336
|
+
}, renderAnswer(item === null || item === void 0 ? void 0 : item.questionAnswerType, item === null || item === void 0 ? void 0 : item.correctAnswers)), React__default.createElement("td", {
|
18216
18337
|
style: {
|
18217
18338
|
textAlign: "center",
|
18218
18339
|
color: styles$3.gray_700
|
@@ -18224,6 +18345,7 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
18224
18345
|
};
|
18225
18346
|
var renderQuestions = function renderQuestions(questions) {
|
18226
18347
|
return questions.map(function (question) {
|
18348
|
+
var _question$selectedAns, _question$selectedAns2, _question$selectedAns3, _question$correctAnsw, _question$correctAnsw2, _question$correctAnsw3;
|
18227
18349
|
return React__default.createElement(material.Grid, {
|
18228
18350
|
container: true,
|
18229
18351
|
flexWrap: "nowrap",
|
@@ -18250,11 +18372,27 @@ var TextbookVulnerable = function TextbookVulnerable(_ref) {
|
|
18250
18372
|
className: styles$3["span2"]
|
18251
18373
|
}, t("my_wrong_answer"))), React__default.createElement("div", null, React__default.createElement("span", {
|
18252
18374
|
className: styles$3["overallCorrectRate"]
|
18253
|
-
}, question.overallCorrectRate.toFixed(2), "%"), React__default.createElement("span", {
|
18375
|
+
}, question.overallCorrectRate.toFixed(2), "%"), (question === null || question === void 0 ? void 0 : question.questionAnswerType) === exports.QuestionAnswerType.ShortAnswer ? React__default.createElement("span", {
|
18376
|
+
className: styles$3["answer"]
|
18377
|
+
}, React__default.createElement(MathJaxContainer, {
|
18378
|
+
content: question === null || question === void 0 ? void 0 : question.selectedAnswers
|
18379
|
+
}), " ", React__default.createElement(MathJaxContainer, {
|
18380
|
+
content: question === null || question === void 0 ? void 0 : question.correctAnswers
|
18381
|
+
})) : exports.QuestionAnswerType.MultipleChoice ? React__default.createElement("span", {
|
18382
|
+
className: styles$3["answer"]
|
18383
|
+
}, (_question$selectedAns = question.selectedAnswers) === null || _question$selectedAns === void 0 ? void 0 : (_question$selectedAns2 = _question$selectedAns.split("|")) === null || _question$selectedAns2 === void 0 ? void 0 : (_question$selectedAns3 = _question$selectedAns2.map(function (i) {
|
18384
|
+
return t("number_question", {
|
18385
|
+
number: i
|
18386
|
+
});
|
18387
|
+
})) === null || _question$selectedAns3 === void 0 ? void 0 : _question$selectedAns3.join(","), " ", "(", t("answer"), " ", (_question$correctAnsw = question.correctAnswers) === null || _question$correctAnsw === void 0 ? void 0 : (_question$correctAnsw2 = _question$correctAnsw.split("|")) === null || _question$correctAnsw2 === void 0 ? void 0 : (_question$correctAnsw3 = _question$correctAnsw2.map(function (i) {
|
18388
|
+
return t("number_question", {
|
18389
|
+
number: i
|
18390
|
+
});
|
18391
|
+
})) === null || _question$correctAnsw3 === void 0 ? void 0 : _question$correctAnsw3.join(","), ")", " ") : React__default.createElement("span", {
|
18254
18392
|
className: styles$3["answer"]
|
18255
18393
|
}, t("number_question", {
|
18256
18394
|
number: question.selectedAnswers
|
18257
|
-
}), " (", t("answer"), " ", t("number_question", {
|
18395
|
+
}), " ", "(", t("answer"), " ", t("number_question", {
|
18258
18396
|
number: question.correctAnswers
|
18259
18397
|
}), ")"))));
|
18260
18398
|
});
|
@@ -20037,16 +20175,24 @@ var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, t
|
|
20037
20175
|
setPrintState(PrintState$1.Printing);
|
20038
20176
|
setTimeout(function () {
|
20039
20177
|
try {
|
20040
|
-
var
|
20178
|
+
var _temp4 = function _temp4() {
|
20041
20179
|
setPrintState(PrintState$1.Printed);
|
20042
20180
|
};
|
20043
|
-
var
|
20181
|
+
var _temp3 = _catch(function () {
|
20182
|
+
function _temp2() {
|
20183
|
+
html2pdf().from(element).set(options).save();
|
20184
|
+
onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
|
20185
|
+
}
|
20044
20186
|
var element = contentRef.current;
|
20045
20187
|
var options = {
|
20046
20188
|
margin: 5,
|
20047
20189
|
filename: name + ".pdf",
|
20190
|
+
image: {
|
20191
|
+
type: "jpeg",
|
20192
|
+
quality: 1
|
20193
|
+
},
|
20048
20194
|
html2canvas: {
|
20049
|
-
scale:
|
20195
|
+
scale: 4
|
20050
20196
|
},
|
20051
20197
|
jsPDF: {
|
20052
20198
|
format: 'a4',
|
@@ -20056,14 +20202,18 @@ var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, t
|
|
20056
20202
|
mode: ['css', 'legacy']
|
20057
20203
|
}
|
20058
20204
|
};
|
20059
|
-
|
20060
|
-
|
20061
|
-
|
20205
|
+
var _temp = function (_window) {
|
20206
|
+
if ((_window = window) !== null && _window !== void 0 && _window.MathJax) {
|
20207
|
+
var _window2, _window2$MathJax, _window2$MathJax$type;
|
20208
|
+
return Promise.resolve((_window2 = window) === null || _window2 === void 0 ? void 0 : (_window2$MathJax = _window2.MathJax) === null || _window2$MathJax === void 0 ? void 0 : (_window2$MathJax$type = _window2$MathJax.typesetPromise) === null || _window2$MathJax$type === void 0 ? void 0 : _window2$MathJax$type.call(_window2$MathJax)).then(function () {});
|
20209
|
+
}
|
20210
|
+
}();
|
20211
|
+
return _temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp);
|
20062
20212
|
}, function (error) {
|
20063
20213
|
!window.opener && reactToastify.toast.error(getErrorMessage(t, error));
|
20064
20214
|
onError === null || onError === void 0 ? void 0 : onError(error === null || error === void 0 ? void 0 : error.message);
|
20065
20215
|
});
|
20066
|
-
return Promise.resolve(
|
20216
|
+
return Promise.resolve(_temp3 && _temp3.then ? _temp3.then(_temp4) : _temp4(_temp3));
|
20067
20217
|
} catch (e) {
|
20068
20218
|
return Promise.reject(e);
|
20069
20219
|
}
|
@@ -21081,14 +21231,14 @@ var CSV_PREFIX = "data:text/csv;charset=utf-8,";
|
|
21081
21231
|
|
21082
21232
|
var styles$5 = {"action-btn":"_1jXbz","action-btn--pencil":"_at4xP","icon-rotate-180":"_12gv9","drop-area":"_R4bn5"};
|
21083
21233
|
|
21084
|
-
var _excluded$
|
21234
|
+
var _excluded$b = ["text", "isRequired", "className"];
|
21085
21235
|
var LabelRequired = function LabelRequired(_ref) {
|
21086
21236
|
var text = _ref.text,
|
21087
21237
|
_ref$isRequired = _ref.isRequired,
|
21088
21238
|
isRequired = _ref$isRequired === void 0 ? true : _ref$isRequired,
|
21089
21239
|
_ref$className = _ref.className,
|
21090
21240
|
className = _ref$className === void 0 ? "" : _ref$className,
|
21091
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
21241
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$b);
|
21092
21242
|
return React__default.createElement(material.FormLabel, Object.assign({
|
21093
21243
|
className: "fw-medium mb-1 " + className
|
21094
21244
|
}, rest), text, isRequired && React__default.createElement("span", {
|
@@ -21142,7 +21292,7 @@ var deleteUserApi = function deleteUserApi(id) {
|
|
21142
21292
|
return api["delete"](USER_URL + "/delete/" + id);
|
21143
21293
|
};
|
21144
21294
|
|
21145
|
-
var _excluded$
|
21295
|
+
var _excluded$c = ["ref"],
|
21146
21296
|
_excluded2$1 = ["ref"],
|
21147
21297
|
_excluded3$1 = ["ref"],
|
21148
21298
|
_excluded4 = ["ref"],
|
@@ -21172,7 +21322,7 @@ var UserDialog = function UserDialog(_ref) {
|
|
21172
21322
|
t = _useTranslation.t;
|
21173
21323
|
var _register = register("fullName"),
|
21174
21324
|
fullNameRef = _register.ref,
|
21175
|
-
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$
|
21325
|
+
fullNameBio = _objectWithoutPropertiesLoose(_register, _excluded$c);
|
21176
21326
|
var _register2 = register("email"),
|
21177
21327
|
emailRef = _register2.ref,
|
21178
21328
|
emailBio = _objectWithoutPropertiesLoose(_register2, _excluded2$1);
|
@@ -24958,12 +25108,12 @@ var ArticleDialog = function ArticleDialog(_ref) {
|
|
24958
25108
|
|
24959
25109
|
var styles$7 = {"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"};
|
24960
25110
|
|
24961
|
-
var _excluded$
|
25111
|
+
var _excluded$d = ["isOpen", "onClose", "handleSaveExam"];
|
24962
25112
|
var CreateExamDrawer = function CreateExamDrawer(props) {
|
24963
25113
|
var isOpen = props.isOpen,
|
24964
25114
|
onClose = props.onClose,
|
24965
25115
|
handleSaveExam = props.handleSaveExam,
|
24966
|
-
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$
|
25116
|
+
examDetailViewProps = _objectWithoutPropertiesLoose(props, _excluded$d);
|
24967
25117
|
var _useTranslation = reactI18next.useTranslation(),
|
24968
25118
|
t = _useTranslation.t;
|
24969
25119
|
var theme = material.useTheme();
|
@@ -26031,12 +26181,12 @@ var useNotificationDetail = function useNotificationDetail(_ref) {
|
|
26031
26181
|
|
26032
26182
|
var styles$8 = {"avatar":"_8niRT"};
|
26033
26183
|
|
26034
|
-
var _excluded$
|
26184
|
+
var _excluded$e = ["value", "disabled", "optionTypeNotification"];
|
26035
26185
|
var TypeSelector = function TypeSelector(_ref) {
|
26036
26186
|
var value = _ref.value,
|
26037
26187
|
disabled = _ref.disabled,
|
26038
26188
|
optionTypeNotification = _ref.optionTypeNotification,
|
26039
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26189
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$e);
|
26040
26190
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
26041
26191
|
options: optionTypeNotification,
|
26042
26192
|
value: value
|
@@ -26428,11 +26578,11 @@ var useNotificationList = function useNotificationList(_ref) {
|
|
26428
26578
|
};
|
26429
26579
|
};
|
26430
26580
|
|
26431
|
-
var _excluded$
|
26581
|
+
var _excluded$f = ["value", "optionTypeNotification"];
|
26432
26582
|
var SelectFilterType = function SelectFilterType(_ref) {
|
26433
26583
|
var value = _ref.value,
|
26434
26584
|
optionTypeNotification = _ref.optionTypeNotification,
|
26435
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
26585
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$f);
|
26436
26586
|
return React__default.createElement(CustomAsyncSelect, Object.assign({
|
26437
26587
|
options: optionTypeNotification,
|
26438
26588
|
value: value
|
@@ -26654,7 +26804,9 @@ var DefaultQuestion = {
|
|
26654
26804
|
title: "",
|
26655
26805
|
author: "",
|
26656
26806
|
subjectId: null,
|
26657
|
-
preparedType: null
|
26807
|
+
preparedType: null,
|
26808
|
+
questionAnswerType: exports.QuestionAnswerType.SingleChoice,
|
26809
|
+
textualAnswer: ""
|
26658
26810
|
};
|
26659
26811
|
var DefaultArticle = {
|
26660
26812
|
answerCount: 5,
|
@@ -28007,7 +28159,7 @@ var useTextbookManagement = function useTextbookManagement(_ref) {
|
|
28007
28159
|
};
|
28008
28160
|
};
|
28009
28161
|
|
28010
|
-
var _excluded$
|
28162
|
+
var _excluded$g = ["value"],
|
28011
28163
|
_excluded2$2 = ["onChange"],
|
28012
28164
|
_excluded3$2 = ["onChange"];
|
28013
28165
|
var VisuallyHiddenInput = material.styled("input")({
|
@@ -28272,7 +28424,7 @@ var PreparedTextbook = function PreparedTextbook(_ref) {
|
|
28272
28424
|
render: function render(_ref4) {
|
28273
28425
|
var _ref4$field = _ref4.field,
|
28274
28426
|
value = _ref4$field.value,
|
28275
|
-
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$
|
28427
|
+
action = _objectWithoutPropertiesLoose(_ref4$field, _excluded$g);
|
28276
28428
|
return React__default.createElement(xDatePickers.LocalizationProvider, {
|
28277
28429
|
dateAdapter: AdapterMoment.AdapterMoment
|
28278
28430
|
}, React__default.createElement(xDatePickers.DatePicker, Object.assign({}, action, {
|
@@ -28483,10 +28635,22 @@ var PreparedTextbook = function PreparedTextbook(_ref) {
|
|
28483
28635
|
fontSize: "16px"
|
28484
28636
|
}, t("chapter_number", {
|
28485
28637
|
number: chapterIndex + 1
|
28486
|
-
})), React__default.createElement(material.
|
28638
|
+
})), React__default.createElement(material.Stack, {
|
28639
|
+
flexDirection: "row",
|
28640
|
+
gap: "8px"
|
28641
|
+
}, React__default.createElement(material.Typography, {
|
28487
28642
|
fontWeight: 700,
|
28488
28643
|
fontSize: "16px"
|
28489
|
-
}, chapter.pageFrom + " - " + chapter.pageTo)
|
28644
|
+
}, chapter.pageFrom + " - " + chapter.pageTo), React__default.createElement(material.IconButton, {
|
28645
|
+
onClick: function onClick(e) {
|
28646
|
+
e.stopPropagation();
|
28647
|
+
arrayHelpers.remove(chapterIndex);
|
28648
|
+
},
|
28649
|
+
color: "default",
|
28650
|
+
className: " bg-danger text-white"
|
28651
|
+
}, React__default.createElement(fa6.FaTrashCan, {
|
28652
|
+
size: 12
|
28653
|
+
})))));
|
28490
28654
|
}));
|
28491
28655
|
}
|
28492
28656
|
}), textbookState.position === TextbookState.Chapter && React__default.createElement(Chapter, {
|
@@ -29757,7 +29921,7 @@ var ChapterProblemSolvingResultsDialog = function ChapterProblemSolvingResultsDi
|
|
29757
29921
|
}, t("cancel"))))));
|
29758
29922
|
};
|
29759
29923
|
|
29760
|
-
var _excluded$
|
29924
|
+
var _excluded$h = ["onChange"];
|
29761
29925
|
var StartPageDialog = function StartPageDialog(_ref) {
|
29762
29926
|
var t = _ref.t,
|
29763
29927
|
onClose = _ref.onClose,
|
@@ -29818,7 +29982,7 @@ var StartPageDialog = function StartPageDialog(_ref) {
|
|
29818
29982
|
}, t("page_to_start_with")), React__default.createElement(formik.Field, {
|
29819
29983
|
name: "startPage",
|
29820
29984
|
render: function render(_ref3) {
|
29821
|
-
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$
|
29985
|
+
var field = _objectWithoutPropertiesLoose(_ref3, _excluded$h);
|
29822
29986
|
return React__default.createElement(CustomSelectOption, Object.assign({
|
29823
29987
|
menuPosition: "fixed",
|
29824
29988
|
onChange: function onChange(option) {
|
@@ -32367,7 +32531,18 @@ Object.defineProperty(exports, 'useTranslation', {
|
|
32367
32531
|
return reactI18next.useTranslation;
|
32368
32532
|
}
|
32369
32533
|
});
|
32370
|
-
exports
|
32534
|
+
Object.defineProperty(exports, 'MathJax', {
|
32535
|
+
enumerable: true,
|
32536
|
+
get: function () {
|
32537
|
+
return betterReactMathjax.MathJax;
|
32538
|
+
}
|
32539
|
+
});
|
32540
|
+
Object.defineProperty(exports, 'MathJaxContext', {
|
32541
|
+
enumerable: true,
|
32542
|
+
get: function () {
|
32543
|
+
return betterReactMathjax.MathJaxContext;
|
32544
|
+
}
|
32545
|
+
});
|
32371
32546
|
Object.defineProperty(exports, 'DateCalendar', {
|
32372
32547
|
enumerable: true,
|
32373
32548
|
get: function () {
|
@@ -32416,6 +32591,7 @@ Object.defineProperty(exports, 'DemoContainer', {
|
|
32416
32591
|
return demo.DemoContainer;
|
32417
32592
|
}
|
32418
32593
|
});
|
32594
|
+
exports.moment = moment;
|
32419
32595
|
exports.ACADEMY_DOMAIN = ACADEMY_DOMAIN;
|
32420
32596
|
exports.ACCESS_TOKEN = ACCESS_TOKEN;
|
32421
32597
|
exports.AcademyHeaders = AcademyHeaders;
|
@@ -32470,6 +32646,7 @@ exports.Login = Login;
|
|
32470
32646
|
exports.LoginQRCode = LoginQRCode;
|
32471
32647
|
exports.LoginWithEmail = LoginWithEmail;
|
32472
32648
|
exports.LoginWithPassword = SignIn;
|
32649
|
+
exports.MathJaxContainer = MathJaxContainer;
|
32473
32650
|
exports.NewNoteButton = NewNoteButton;
|
32474
32651
|
exports.NoAcademyHeaders = NoAcademyHeaders;
|
32475
32652
|
exports.NotFound = NotFound;
|