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