touchstudy-core 0.1.30 → 0.1.31
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/containers/ExamResult/apiClients/index.d.ts +5 -5
- package/dist/containers/ExamResult/hooks/useExamResult.d.ts +1 -1
- package/dist/containers/ExamResult/views/ExamResultV2.d.ts +3 -0
- package/dist/index.js +95 -17
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +95 -17
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
@@ -1547,6 +1547,7 @@ var users = "사용자";
|
|
1547
1547
|
var new_user = "새로운 사용자";
|
1548
1548
|
var academy_admin = "아카데미 관리자";
|
1549
1549
|
var switch_academy_admin = "스위치 아카데미 관리자";
|
1550
|
+
var switch_academy = "스위치 아카데미";
|
1550
1551
|
var there_are_no_lessons_this_week = "이번주는 수업이 없습니다";
|
1551
1552
|
var update_message = "업데이트 메시지";
|
1552
1553
|
var attachment = "첨부 파일";
|
@@ -1565,6 +1566,12 @@ var number_of_classes = "{{ number }} 개";
|
|
1565
1566
|
var complete_conversation_successfully = "대화를 성공적으로 완료했습니다";
|
1566
1567
|
var fail_to_complete_conversation = "대화를 완료하지 못했습니다";
|
1567
1568
|
var are_you_sure_you_want_to_complete_this_conversation = "정말로 이 채팅 베팅을 완료하시겠습니까?";
|
1569
|
+
var switch_academy_fail = "아카데미 전환 실패";
|
1570
|
+
var no_academy_available = "이용 가능한 아카데미가 없습니다";
|
1571
|
+
var my_classes_calendar = "내 수업 캘린더";
|
1572
|
+
var enter_exam_code = "시험 코드 입력";
|
1573
|
+
var my_score = "내 점수";
|
1574
|
+
var exam_date = "시험 날짜";
|
1568
1575
|
var lang_ko = {
|
1569
1576
|
problem_solving: problem_solving,
|
1570
1577
|
my_story: my_story,
|
@@ -1823,6 +1830,7 @@ var lang_ko = {
|
|
1823
1830
|
new_user: new_user,
|
1824
1831
|
academy_admin: academy_admin,
|
1825
1832
|
switch_academy_admin: switch_academy_admin,
|
1833
|
+
switch_academy: switch_academy,
|
1826
1834
|
there_are_no_lessons_this_week: there_are_no_lessons_this_week,
|
1827
1835
|
update_message: update_message,
|
1828
1836
|
attachment: attachment,
|
@@ -1840,7 +1848,13 @@ var lang_ko = {
|
|
1840
1848
|
number_of_classes: number_of_classes,
|
1841
1849
|
complete_conversation_successfully: complete_conversation_successfully,
|
1842
1850
|
fail_to_complete_conversation: fail_to_complete_conversation,
|
1843
|
-
are_you_sure_you_want_to_complete_this_conversation: are_you_sure_you_want_to_complete_this_conversation
|
1851
|
+
are_you_sure_you_want_to_complete_this_conversation: are_you_sure_you_want_to_complete_this_conversation,
|
1852
|
+
switch_academy_fail: switch_academy_fail,
|
1853
|
+
no_academy_available: no_academy_available,
|
1854
|
+
my_classes_calendar: my_classes_calendar,
|
1855
|
+
enter_exam_code: enter_exam_code,
|
1856
|
+
my_score: my_score,
|
1857
|
+
exam_date: exam_date
|
1844
1858
|
};
|
1845
1859
|
|
1846
1860
|
var problem_solving$1 = "Problem Solving";
|
@@ -2136,6 +2150,7 @@ var users$1 = "Users";
|
|
2136
2150
|
var new_user$1 = "New user";
|
2137
2151
|
var academy_admin$1 = "Academy Admin";
|
2138
2152
|
var switch_academy_admin$1 = "Switch Academy Admin";
|
2153
|
+
var switch_academy$1 = "Switch Academy";
|
2139
2154
|
var there_are_no_lessons_this_week$1 = "There are no lessons this week";
|
2140
2155
|
var today_lessons$1 = "Today lessons";
|
2141
2156
|
var update_message$1 = "Update message";
|
@@ -2154,6 +2169,12 @@ var number_of_classes$1 = "{{ number }} classes";
|
|
2154
2169
|
var complete_conversation_successfully$1 = "Complete conversation successfully";
|
2155
2170
|
var fail_to_complete_conversation$1 = "Fail to complete conversation";
|
2156
2171
|
var are_you_sure_you_want_to_complete_this_conversation$1 = "Are you sure you want to complete this conversation?";
|
2172
|
+
var switch_academy_fail$1 = "Academy conversion failed";
|
2173
|
+
var no_academy_available$1 = "No academy available";
|
2174
|
+
var my_classes_calendar$1 = "My classes calendar";
|
2175
|
+
var enter_exam_code$1 = "Enter exam code";
|
2176
|
+
var my_score$1 = "My score";
|
2177
|
+
var exam_date$1 = "Exam date";
|
2157
2178
|
var lang_en = {
|
2158
2179
|
problem_solving: problem_solving$1,
|
2159
2180
|
my_story: my_story$1,
|
@@ -2447,6 +2468,7 @@ var lang_en = {
|
|
2447
2468
|
new_user: new_user$1,
|
2448
2469
|
academy_admin: academy_admin$1,
|
2449
2470
|
switch_academy_admin: switch_academy_admin$1,
|
2471
|
+
switch_academy: switch_academy$1,
|
2450
2472
|
there_are_no_lessons_this_week: there_are_no_lessons_this_week$1,
|
2451
2473
|
today_lessons: today_lessons$1,
|
2452
2474
|
update_message: update_message$1,
|
@@ -2464,7 +2486,13 @@ var lang_en = {
|
|
2464
2486
|
number_of_classes: number_of_classes$1,
|
2465
2487
|
complete_conversation_successfully: complete_conversation_successfully$1,
|
2466
2488
|
fail_to_complete_conversation: fail_to_complete_conversation$1,
|
2467
|
-
are_you_sure_you_want_to_complete_this_conversation: are_you_sure_you_want_to_complete_this_conversation$1
|
2489
|
+
are_you_sure_you_want_to_complete_this_conversation: are_you_sure_you_want_to_complete_this_conversation$1,
|
2490
|
+
switch_academy_fail: switch_academy_fail$1,
|
2491
|
+
no_academy_available: no_academy_available$1,
|
2492
|
+
my_classes_calendar: my_classes_calendar$1,
|
2493
|
+
enter_exam_code: enter_exam_code$1,
|
2494
|
+
my_score: my_score$1,
|
2495
|
+
exam_date: exam_date$1
|
2468
2496
|
};
|
2469
2497
|
|
2470
2498
|
i18n.use(initReactI18next).init({
|
@@ -2711,7 +2739,8 @@ var useSwitchAcademy = function useSwitchAcademy(role, navigate, homeAcademyUrl,
|
|
2711
2739
|
});
|
2712
2740
|
}, function (error) {
|
2713
2741
|
var _error$response2, _error$response2$data;
|
2714
|
-
|
2742
|
+
academyDomain && localStorage.removeItem(ACADEMY_DOMAIN);
|
2743
|
+
toast.error((error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : (_error$response2$data = _error$response2.data) === null || _error$response2$data === void 0 ? void 0 : _error$response2$data.title) || t("switch_academy_fail"));
|
2715
2744
|
});
|
2716
2745
|
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
2717
2746
|
} catch (e) {
|
@@ -2793,7 +2822,7 @@ var TheAcademyDropdown = function TheAcademyDropdown(_ref) {
|
|
2793
2822
|
color: "#5458D5",
|
2794
2823
|
minWidth: 150
|
2795
2824
|
}
|
2796
|
-
}, (selectedAcademy === null || selectedAcademy === void 0 ? void 0 : selectedAcademy.name) || t("switch_academy_admin")), React.createElement("div", {
|
2825
|
+
}, (selectedAcademy === null || selectedAcademy === void 0 ? void 0 : selectedAcademy.name) || t(role === Role.Admin ? "switch_academy_admin" : "switch_academy")), React.createElement("div", {
|
2797
2826
|
className: "" + stylesGlobal["switch-icon"]
|
2798
2827
|
}, React.createElement(GoArrowSwitch, {
|
2799
2828
|
size: 14
|
@@ -8326,7 +8355,16 @@ var CATEGORY_RESPONSES = [{
|
|
8326
8355
|
"percentageAmongStudents": 40
|
8327
8356
|
}];
|
8328
8357
|
|
8329
|
-
var useExamResult = function useExamResult(searchParam, navigate) {
|
8358
|
+
var useExamResult = function useExamResult(searchParam, navigate, examSessionId, studentId, code) {
|
8359
|
+
if (examSessionId === void 0) {
|
8360
|
+
examSessionId = 0;
|
8361
|
+
}
|
8362
|
+
if (studentId === void 0) {
|
8363
|
+
studentId = 0;
|
8364
|
+
}
|
8365
|
+
if (code === void 0) {
|
8366
|
+
code = "";
|
8367
|
+
}
|
8330
8368
|
var query = new URLSearchParams(searchParam);
|
8331
8369
|
var dispatch = useDispatch();
|
8332
8370
|
var roles = useSelector(function (state) {
|
@@ -8335,7 +8373,6 @@ var useExamResult = function useExamResult(searchParam, navigate) {
|
|
8335
8373
|
});
|
8336
8374
|
var isStudent = roles === null || roles === void 0 ? void 0 : roles.includes(Roles$2.Student);
|
8337
8375
|
var examCode = query.get("examCode") || "";
|
8338
|
-
var studentId = query.get("studentId") || "";
|
8339
8376
|
var language = useSelector(function (state) {
|
8340
8377
|
var _state$common2;
|
8341
8378
|
return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.language;
|
@@ -8368,14 +8405,14 @@ var useExamResult = function useExamResult(searchParam, navigate) {
|
|
8368
8405
|
setOpenProblem = _useState7[1];
|
8369
8406
|
var _useTranslation = useTranslation(),
|
8370
8407
|
t = _useTranslation.t;
|
8371
|
-
var
|
8408
|
+
var getStudentData = function getStudentData(examCode) {
|
8372
8409
|
try {
|
8373
8410
|
var _temp4 = function _temp4() {
|
8374
8411
|
function _temp2() {
|
8375
8412
|
dispatch(setLoading(false));
|
8376
8413
|
}
|
8377
8414
|
var _temp = _catch(function () {
|
8378
|
-
return Promise.resolve(
|
8415
|
+
return Promise.resolve(Promise.all([getResults(examCode), getResultsLongTimeSpend(examCode), getResultsEffectSize(examCode), getResultsTimeOrderQuestion(examCode), getResultsCategories(examCode)])).then(function (result) {
|
8379
8416
|
var _result$0$data, _result$1$data, _result$2$data, _result$3$data, _result$4$data;
|
8380
8417
|
setResultDatas((_result$0$data = result[0].data) === null || _result$0$data === void 0 ? void 0 : _result$0$data.data);
|
8381
8418
|
setLongTimeSpend((_result$1$data = result[1].data) === null || _result$1$data === void 0 ? void 0 : _result$1$data.data);
|
@@ -8402,6 +8439,40 @@ var useExamResult = function useExamResult(searchParam, navigate) {
|
|
8402
8439
|
return Promise.reject(e);
|
8403
8440
|
}
|
8404
8441
|
};
|
8442
|
+
var getStudentDataByTeacher = function getStudentDataByTeacher(examCode, examSessionId, studentId) {
|
8443
|
+
try {
|
8444
|
+
var _temp8 = function _temp8() {
|
8445
|
+
function _temp6() {
|
8446
|
+
dispatch(setLoading(false));
|
8447
|
+
}
|
8448
|
+
var _temp5 = _catch(function () {
|
8449
|
+
return Promise.resolve(Promise.all([getResultsTeacher(examSessionId, studentId), getResultsLongTimeSpendTeacher(examSessionId, studentId), getResultsEffectSizeTeacher(examSessionId, studentId), getResultsTimeOrderQuestionTeacher(examSessionId, studentId), getResultsCategoriesTeacher(examSessionId, studentId)])).then(function (result) {
|
8450
|
+
var _result$0$data2, _result$1$data2, _result$2$data2, _result$3$data2, _result$4$data2;
|
8451
|
+
setResultDatas((_result$0$data2 = result[0].data) === null || _result$0$data2 === void 0 ? void 0 : _result$0$data2.data);
|
8452
|
+
setLongTimeSpend((_result$1$data2 = result[1].data) === null || _result$1$data2 === void 0 ? void 0 : _result$1$data2.data);
|
8453
|
+
setEffectSize((_result$2$data2 = result[2].data) === null || _result$2$data2 === void 0 ? void 0 : _result$2$data2.data);
|
8454
|
+
setTimelyOrderQuestion((_result$3$data2 = result[3].data) === null || _result$3$data2 === void 0 ? void 0 : _result$3$data2.data);
|
8455
|
+
setCategoryResponses(((_result$4$data2 = result[4].data) === null || _result$4$data2 === void 0 ? void 0 : _result$4$data2.data) || []);
|
8456
|
+
});
|
8457
|
+
}, function (error) {
|
8458
|
+
var _error$response2;
|
8459
|
+
toast.error((error === null || error === void 0 ? void 0 : (_error$response2 = error.response) === null || _error$response2 === void 0 ? void 0 : _error$response2.data) || error.message);
|
8460
|
+
});
|
8461
|
+
return _temp5 && _temp5.then ? _temp5.then(_temp6) : _temp6(_temp5);
|
8462
|
+
};
|
8463
|
+
dispatch(setLoading(true));
|
8464
|
+
var _temp7 = _catch(function () {
|
8465
|
+
return Promise.resolve(getCheckStatusExam(examCode)).then(function () {});
|
8466
|
+
}, function (error) {
|
8467
|
+
console.log({
|
8468
|
+
error: error
|
8469
|
+
});
|
8470
|
+
});
|
8471
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7));
|
8472
|
+
} catch (e) {
|
8473
|
+
return Promise.reject(e);
|
8474
|
+
}
|
8475
|
+
};
|
8405
8476
|
var setExampleData = function setExampleData() {
|
8406
8477
|
setResultDatas(EXAM_RESULT);
|
8407
8478
|
setLongTimeSpend(LONGTIME_SPEND_QUESTIONS);
|
@@ -8410,8 +8481,12 @@ var useExamResult = function useExamResult(searchParam, navigate) {
|
|
8410
8481
|
setCategoryResponses(CATEGORY_RESPONSES);
|
8411
8482
|
};
|
8412
8483
|
useEffect(function () {
|
8413
|
-
|
8414
|
-
|
8484
|
+
var getData = function getData() {
|
8485
|
+
isStudent && getStudentData(examCode);
|
8486
|
+
!isStudent && getStudentDataByTeacher(code, examSessionId, studentId);
|
8487
|
+
};
|
8488
|
+
examCode === "example-code" ? setExampleData() : getData();
|
8489
|
+
}, [examCode, isStudent, code, examSessionId, studentId]);
|
8415
8490
|
var handlePrevChart = function handlePrevChart() {
|
8416
8491
|
if (dataChartIndex > 0) {
|
8417
8492
|
setDataChartIndex(dataChartIndex - 1);
|
@@ -10922,8 +10997,11 @@ var useTab = function useTab() {
|
|
10922
10997
|
|
10923
10998
|
var ExamResultV2 = function ExamResultV2(_ref) {
|
10924
10999
|
var searchParams = _ref.searchParams,
|
10925
|
-
onNavigate = _ref.onNavigate
|
10926
|
-
|
11000
|
+
onNavigate = _ref.onNavigate,
|
11001
|
+
examSessionId = _ref.examSessionId,
|
11002
|
+
studentId = _ref.studentId,
|
11003
|
+
code = _ref.code;
|
11004
|
+
var _useExamResult = useExamResult(searchParams, onNavigate, examSessionId, studentId, code),
|
10927
11005
|
series = _useExamResult.series,
|
10928
11006
|
chartOptions = _useExamResult.chartOptions,
|
10929
11007
|
dataChartIndex = _useExamResult.dataChartIndex,
|
@@ -10982,7 +11060,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
10982
11060
|
fontWeight: 600,
|
10983
11061
|
color: "#97A1AF"
|
10984
11062
|
}
|
10985
|
-
}, "
|
11063
|
+
}, t("my_score")), React.createElement(Typography, {
|
10986
11064
|
sx: {
|
10987
11065
|
fontSize: "14px",
|
10988
11066
|
fontWeight: 600,
|
@@ -10996,7 +11074,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
10996
11074
|
fontWeight: 600,
|
10997
11075
|
color: "#97A1AF"
|
10998
11076
|
}
|
10999
|
-
}, "
|
11077
|
+
}, t("exam_date")), React.createElement(Typography, {
|
11000
11078
|
sx: {
|
11001
11079
|
fontSize: "14px",
|
11002
11080
|
fontWeight: 600,
|
@@ -11008,7 +11086,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
11008
11086
|
fontWeight: 600,
|
11009
11087
|
color: "#97A1AF"
|
11010
11088
|
}
|
11011
|
-
}, "
|
11089
|
+
}, t("exam_time")), React.createElement(Typography, {
|
11012
11090
|
sx: {
|
11013
11091
|
fontSize: "14px",
|
11014
11092
|
fontWeight: 600,
|
@@ -11020,7 +11098,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
11020
11098
|
fontWeight: 600,
|
11021
11099
|
color: "#97A1AF"
|
11022
11100
|
}
|
11023
|
-
}, "
|
11101
|
+
}, t("total_students")), React.createElement(Typography, {
|
11024
11102
|
sx: {
|
11025
11103
|
fontSize: "14px",
|
11026
11104
|
fontWeight: 600,
|
@@ -11034,7 +11112,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
|
|
11034
11112
|
fontWeight: 600,
|
11035
11113
|
color: "#97A1AF"
|
11036
11114
|
}
|
11037
|
-
}, "
|
11115
|
+
}, t("teacher_in_charge")), React.createElement(Typography, {
|
11038
11116
|
sx: {
|
11039
11117
|
fontSize: "14px",
|
11040
11118
|
fontWeight: 600,
|