touchstudy-core 0.1.72 → 0.1.74

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.
Files changed (32) hide show
  1. package/dist/components/Loading/LoadingComponent.d.ts +4 -2
  2. package/dist/containers/ExamResult/components/Charts/TimeOrderChart.d.ts +10 -0
  3. package/dist/containers/ExamResult/components/CompareGrass/index.d.ts +0 -1
  4. package/dist/containers/ExamResult/components/Dialog/PrintDialog.d.ts +6 -0
  5. package/dist/containers/ExamResult/components/GradesByTerritory/index.d.ts +3 -5
  6. package/dist/containers/ExamResult/components/LoadingDots.d.ts +6 -0
  7. package/dist/containers/ExamResult/components/MyAnswer/index.d.ts +1 -2
  8. package/dist/containers/ExamResult/components/ProtractedProblem/index.d.ts +4 -5
  9. package/dist/containers/ExamResult/components/TrickyProblem/index.d.ts +4 -5
  10. package/dist/containers/ExamResult/components/Vulnerable/index.d.ts +4 -5
  11. package/dist/containers/ExamResult/configs/functions.d.ts +1 -0
  12. package/dist/containers/ExamResult/configs/types.d.ts +13 -0
  13. package/dist/containers/ExamResult/hooks/useExamResult.d.ts +16 -6
  14. package/dist/containers/ExamResult/hooks/usePrintExamResult.d.ts +10 -0
  15. package/dist/containers/ExamResult/hooks/usePrintView.d.ts +8 -0
  16. package/dist/containers/ExamResult/views/ExamResultView.d.ts +11 -0
  17. package/dist/containers/ExamResult/views/PrintExamResult.d.ts +19 -0
  18. package/dist/containers/ExamResult/views/PrintExamResultView.d.ts +12 -0
  19. package/dist/containers/ExamResult/views/PrintPdfExamResult.d.ts +12 -0
  20. package/dist/containers/Exams/components/ArticleGroupView.d.ts +2 -0
  21. package/dist/containers/Exams/hooks/useExamDetailView.d.ts +2 -2
  22. package/dist/containers/Select/Category/hook/useCategorySelect.d.ts +2 -1
  23. package/dist/containers/Select/Subject/hook/useSubjectSelect.d.ts +6 -2
  24. package/dist/index.css +33 -0
  25. package/dist/index.d.ts +2 -1
  26. package/dist/index.js +819 -924
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.modern.js +816 -923
  29. package/dist/index.modern.js.map +1 -1
  30. package/dist/layouts/LayoutContext.d.ts +1 -0
  31. package/dist/utils/hooks/useLayoutContext.d.ts +1 -1
  32. package/package.json +2 -2
@@ -15,7 +15,7 @@ import 'moment/locale/ko.js';
15
15
  import 'moment/locale/en-au.js';
16
16
  import Pusher from 'pusher-js';
17
17
  import { IoClose, IoCloseCircle, IoLogOut, IoCloseOutline, IoSearch, IoChevronUp, IoChevronDown } from 'react-icons/io5';
18
- import i18n from 'i18next';
18
+ import i18n, { t as t$1 } from 'i18next';
19
19
  import Box$1 from '@mui/material/Box';
20
20
  import Popover from '@mui/material/Popover';
21
21
  import MenuItem from '@mui/material/MenuItem';
@@ -30,13 +30,12 @@ import { IoMdArrowBack } from 'react-icons/io';
30
30
  import _ from 'lodash';
31
31
  import { FaPencil } from 'react-icons/fa6';
32
32
  import CreatableSelect from 'react-select/creatable';
33
- import html2canvas from 'html2canvas';
34
- import { jsPDF } from 'jspdf';
35
33
  import Button$1 from '@mui/material/Button';
36
34
  import DialogTitle$1 from '@mui/material/DialogTitle';
37
35
  import DialogContent$1 from '@mui/material/DialogContent';
38
36
  import DialogActions$1 from '@mui/material/DialogActions';
39
37
  import Typography$1 from '@mui/material/Typography';
38
+ import html2pdf from 'html2pdf.js';
40
39
  import Avatar from '@mui/material/Avatar';
41
40
  import TextField$1 from '@mui/material/TextField';
42
41
  import Paper$1 from '@mui/material/Paper';
@@ -123,10 +122,6 @@ var RecentUserAction = {
123
122
  AddedStudentToClass: "added_student_to_class",
124
123
  RemovedStudentFromClass: "removed_student_from_class"
125
124
  };
126
- var PrintHeaderClassName = "print-header";
127
- var PrintTitleClassName = "print-title";
128
- var PrintContentClassName = "print-content";
129
- var PrintContainerClassName = "print-container";
130
125
 
131
126
  var utcToLocalTime = (function (time, FORMAT) {
132
127
  if (time === DATE_MIN_VALUE || time === DATE_TIME_MIN_VALUE) return "";
@@ -176,194 +171,11 @@ function _taggedTemplateLiteralLoose(strings, raw) {
176
171
  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","btn-login-google":"_2HqmH","block-login":"_wWIyO","box-login":"_38Lo1","btn-primary":"_rd4Uy","dropdown-menu":"_1krbH","header-avatar":"_RQaHE","dropdown-menu-flag":"_XK8oS","dropdown-content":"_3ys4W","dropdown-change":"_ToOW_","item-address":"_3sQlR","item-logout":"_3bqSM","title-address":"_1jgSI","img-avatar":"_35Ttz","item-contact":"_1wc7o","content-text":"_3S4f2","dropdown-content-language":"_3ajui","dropdown-item-language":"_3Y_y4","dropdown-item-language-active":"_CzNMi","dropdown-academy":"_3CMVp","image-academy":"_2ibYC","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"};
177
172
 
178
173
  // A type of promise-like that resolves synchronously and supports only one observer
179
- const _Pact = /*#__PURE__*/(function() {
180
- function _Pact() {}
181
- _Pact.prototype.then = function(onFulfilled, onRejected) {
182
- const result = new _Pact();
183
- const state = this.s;
184
- if (state) {
185
- const callback = state & 1 ? onFulfilled : onRejected;
186
- if (callback) {
187
- try {
188
- _settle(result, 1, callback(this.v));
189
- } catch (e) {
190
- _settle(result, 2, e);
191
- }
192
- return result;
193
- } else {
194
- return this;
195
- }
196
- }
197
- this.o = function(_this) {
198
- try {
199
- const value = _this.v;
200
- if (_this.s & 1) {
201
- _settle(result, 1, onFulfilled ? onFulfilled(value) : value);
202
- } else if (onRejected) {
203
- _settle(result, 1, onRejected(value));
204
- } else {
205
- _settle(result, 2, value);
206
- }
207
- } catch (e) {
208
- _settle(result, 2, e);
209
- }
210
- };
211
- return result;
212
- };
213
- return _Pact;
214
- })();
215
-
216
- // Settles a pact synchronously
217
- function _settle(pact, state, value) {
218
- if (!pact.s) {
219
- if (value instanceof _Pact) {
220
- if (value.s) {
221
- if (state & 1) {
222
- state = value.s;
223
- }
224
- value = value.v;
225
- } else {
226
- value.o = _settle.bind(null, pact, state);
227
- return;
228
- }
229
- }
230
- if (value && value.then) {
231
- value.then(_settle.bind(null, pact, state), _settle.bind(null, pact, 2));
232
- return;
233
- }
234
- pact.s = state;
235
- pact.v = value;
236
- const observer = pact.o;
237
- if (observer) {
238
- observer(pact);
239
- }
240
- }
241
- }
242
-
243
- function _isSettledPact(thenable) {
244
- return thenable instanceof _Pact && thenable.s & 1;
245
- }
246
-
247
- // Asynchronously iterate through an object that has a length property, passing the index as the first argument to the callback (even as the length property changes)
248
- function _forTo(array, body, check) {
249
- var i = -1, pact, reject;
250
- function _cycle(result) {
251
- try {
252
- while (++i < array.length && (!check || !check())) {
253
- result = body(i);
254
- if (result && result.then) {
255
- if (_isSettledPact(result)) {
256
- result = result.v;
257
- } else {
258
- result.then(_cycle, reject || (reject = _settle.bind(null, pact = new _Pact(), 2)));
259
- return;
260
- }
261
- }
262
- }
263
- if (pact) {
264
- _settle(pact, 1, result);
265
- } else {
266
- pact = result;
267
- }
268
- } catch (e) {
269
- _settle(pact || (pact = new _Pact()), 2, e);
270
- }
271
- }
272
- _cycle();
273
- return pact;
274
- }
275
174
 
276
175
  const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
277
176
 
278
177
  const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
279
178
 
280
- // Asynchronously implement a generic for loop
281
- function _for(test, update, body) {
282
- var stage;
283
- for (;;) {
284
- var shouldContinue = test();
285
- if (_isSettledPact(shouldContinue)) {
286
- shouldContinue = shouldContinue.v;
287
- }
288
- if (!shouldContinue) {
289
- return result;
290
- }
291
- if (shouldContinue.then) {
292
- stage = 0;
293
- break;
294
- }
295
- var result = body();
296
- if (result && result.then) {
297
- if (_isSettledPact(result)) {
298
- result = result.s;
299
- } else {
300
- stage = 1;
301
- break;
302
- }
303
- }
304
- if (update) {
305
- var updateValue = update();
306
- if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
307
- stage = 2;
308
- break;
309
- }
310
- }
311
- }
312
- var pact = new _Pact();
313
- var reject = _settle.bind(null, pact, 2);
314
- (stage === 0 ? shouldContinue.then(_resumeAfterTest) : stage === 1 ? result.then(_resumeAfterBody) : updateValue.then(_resumeAfterUpdate)).then(void 0, reject);
315
- return pact;
316
- function _resumeAfterBody(value) {
317
- result = value;
318
- do {
319
- if (update) {
320
- updateValue = update();
321
- if (updateValue && updateValue.then && !_isSettledPact(updateValue)) {
322
- updateValue.then(_resumeAfterUpdate).then(void 0, reject);
323
- return;
324
- }
325
- }
326
- shouldContinue = test();
327
- if (!shouldContinue || (_isSettledPact(shouldContinue) && !shouldContinue.v)) {
328
- _settle(pact, 1, result);
329
- return;
330
- }
331
- if (shouldContinue.then) {
332
- shouldContinue.then(_resumeAfterTest).then(void 0, reject);
333
- return;
334
- }
335
- result = body();
336
- if (_isSettledPact(result)) {
337
- result = result.v;
338
- }
339
- } while (!result || !result.then);
340
- result.then(_resumeAfterBody).then(void 0, reject);
341
- }
342
- function _resumeAfterTest(shouldContinue) {
343
- if (shouldContinue) {
344
- result = body();
345
- if (result && result.then) {
346
- result.then(_resumeAfterBody).then(void 0, reject);
347
- } else {
348
- _resumeAfterBody(result);
349
- }
350
- } else {
351
- _settle(pact, 1, result);
352
- }
353
- }
354
- function _resumeAfterUpdate() {
355
- if (shouldContinue = test()) {
356
- if (shouldContinue.then) {
357
- shouldContinue.then(_resumeAfterTest).then(void 0, reject);
358
- } else {
359
- _resumeAfterTest(shouldContinue);
360
- }
361
- } else {
362
- _settle(pact, 1, result);
363
- }
364
- }
365
- }
366
-
367
179
  // Asynchronously call a function and send errors to recovery continuation
368
180
  function _catch(body, recover) {
369
181
  try {
@@ -1499,8 +1311,11 @@ var switchSuperAdminAcademy = function switchSuperAdminAcademy(academyId, role)
1499
1311
  return api.post(SUPER_ADMIN_ACADEMY_URL + "/" + academyId + "/switch-academy/" + role);
1500
1312
  };
1501
1313
 
1502
- var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
1314
+ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy) {
1503
1315
  var _currentPusher$connec2;
1316
+ if (showLoadingAcademy === void 0) {
1317
+ showLoadingAcademy = true;
1318
+ }
1504
1319
  var _useGoogleSignOut = useGoogleSignOut({}),
1505
1320
  handleSignOut = _useGoogleSignOut.handleSignOut;
1506
1321
  var _useTranslation = useTranslation(),
@@ -1529,10 +1344,10 @@ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
1529
1344
  var handleGetAcademyDetail = function handleGetAcademyDetail() {
1530
1345
  try {
1531
1346
  var _temp2 = function _temp2() {
1532
- dispatch(setLoading(false));
1347
+ showLoadingAcademy && dispatch(setLoading(false));
1533
1348
  };
1534
1349
  if (!academyDomain) return Promise.resolve();
1535
- dispatch(setLoading(true));
1350
+ showLoadingAcademy && dispatch(setLoading(true));
1536
1351
  var _temp = _catch(function () {
1537
1352
  return Promise.resolve(getAcademyDetail()).then(function (info) {
1538
1353
  if (info) {
@@ -1670,27 +1485,38 @@ var loadingStyle$1 = {
1670
1485
  alignItems: "center"
1671
1486
  };
1672
1487
  var LoadingComponent = function LoadingComponent(_ref) {
1673
- var isLoading = _ref.isLoading;
1488
+ var isLoading = _ref.isLoading,
1489
+ children = _ref.children,
1490
+ _ref$spinClassName = _ref.spinClassName,
1491
+ spinClassName = _ref$spinClassName === void 0 ? "text-secondary" : _ref$spinClassName,
1492
+ _ref$className = _ref.className,
1493
+ className = _ref$className === void 0 ? "" : _ref$className;
1674
1494
  return isLoading ? React__default.createElement("div", {
1675
1495
  style: loadingStyle$1
1496
+ }, React__default.createElement(Stack, {
1497
+ direction: "column",
1498
+ justifyContent: "center",
1499
+ alignItems: "center",
1500
+ className: className
1676
1501
  }, React__default.createElement("div", {
1677
- className: "spinner-border text-secondary",
1502
+ className: "spinner-border " + spinClassName,
1678
1503
  role: "status"
1679
1504
  }, React__default.createElement("span", {
1680
1505
  className: "sr-only"
1681
- }))) : null;
1506
+ })), React__default.createElement("div", null, children))) : null;
1682
1507
  };
1683
1508
 
1684
1509
  var LayoutContext = function LayoutContext(_ref) {
1685
1510
  var children = _ref.children,
1686
1511
  role = _ref.role,
1687
1512
  _ref$pusherRegisterUr = _ref.pusherRegisterUrls,
1688
- pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr;
1513
+ pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr,
1514
+ showLoadingAcademy = _ref.showLoadingAcademy;
1689
1515
  var user = useSelector(function (state) {
1690
1516
  var _state$common;
1691
1517
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
1692
1518
  });
1693
- useLayoutContext(role, pusherRegisterUrls);
1519
+ useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy);
1694
1520
  if (!(user !== null && user !== void 0 && user.email)) return React__default.createElement(LoadingComponent, {
1695
1521
  isLoading: true
1696
1522
  });else return React__default.createElement(Fragment$1, null, children);
@@ -1885,7 +1711,9 @@ var getSubjectListApi = function getSubjectListApi() {
1885
1711
  }
1886
1712
  };
1887
1713
 
1888
- var useSubjectSelect = function useSubjectSelect() {
1714
+ var useSubjectSelect = function useSubjectSelect(_ref) {
1715
+ var onChangeExam = _ref.onChangeExam,
1716
+ exam = _ref.exam;
1889
1717
  var firstLoad = true;
1890
1718
  var dispatch = useDispatch();
1891
1719
  var _useState = useState(),
@@ -1943,18 +1771,15 @@ var useSubjectSelect = function useSubjectSelect() {
1943
1771
  var selectedSubject = subjectList === null || subjectList === void 0 ? void 0 : subjectList.find(function (subject) {
1944
1772
  return subject.id === id;
1945
1773
  });
1946
- setSelectedSubject(selectedSubject);
1947
- };
1948
- var handleChangeSelectedSubject = function handleChangeSelectedSubject(subject) {
1949
- if (!subject) return;
1950
- setSelectedSubject(subject);
1774
+ onChangeExam(_extends({}, exam, {
1775
+ subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
1776
+ }));
1951
1777
  };
1952
1778
  return {
1953
1779
  subjectOptions: subjectOptions,
1954
1780
  selectedSubject: selectedSubject,
1955
1781
  subjectList: subjectList,
1956
- handleChangeSubject: handleChangeSubject,
1957
- handleChangeSelectedSubject: handleChangeSelectedSubject
1782
+ handleChangeSubject: handleChangeSubject
1958
1783
  };
1959
1784
  };
1960
1785
 
@@ -2604,7 +2429,7 @@ var exam = "시험";
2604
2429
  var me = "나";
2605
2430
  var teacher_name = "선생님 성함";
2606
2431
  var class_schedule = "수업 시간표";
2607
- var summary = "요약";
2432
+ var summary = "전체 현황";
2608
2433
  var load_exam = "시험 로드";
2609
2434
  var exam_name = "시험 이름";
2610
2435
  var student_phone_number_header = "학생 전화번호";
@@ -2630,6 +2455,13 @@ var total_users = "총 사용자";
2630
2455
  var added_date = "추가된 날짜";
2631
2456
  var sync_exam_results = "시험 결과 동기화";
2632
2457
  var update_data_fail = "데이터 업데이트 실패";
2458
+ var add_students_to_class = "수업에 학생 추가";
2459
+ var click_to_choose_file = "파일을 선택하려면 클릭하세요.";
2460
+ var exam_data = "시험 데이터";
2461
+ var questions_correct_rate = "질문 정답률";
2462
+ var question_management = "질문 관리";
2463
+ var student_data = "학생 데이터";
2464
+ var problem_number_question_chart = "문제 {{number}}번";
2633
2465
  var are_you_sure_to_sync_exam_results_to_academy = "시험 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까(백그라운드에서 실행되며 시간이 다소 소요됨)";
2634
2466
  var messages = {
2635
2467
  exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
@@ -3373,6 +3205,13 @@ var lang_ko = {
3373
3205
  added_date: added_date,
3374
3206
  sync_exam_results: sync_exam_results,
3375
3207
  update_data_fail: update_data_fail,
3208
+ add_students_to_class: add_students_to_class,
3209
+ click_to_choose_file: click_to_choose_file,
3210
+ exam_data: exam_data,
3211
+ questions_correct_rate: questions_correct_rate,
3212
+ question_management: question_management,
3213
+ student_data: student_data,
3214
+ problem_number_question_chart: problem_number_question_chart,
3376
3215
  are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy,
3377
3216
  messages: messages,
3378
3217
  submit: submit,
@@ -3509,8 +3348,8 @@ var number_answer$1 = "No.{{number}}";
3509
3348
  var answer_no$1 = "Ans.{{number}}";
3510
3349
  var answer_rate$1 = "Answer rate";
3511
3350
  var seconds$1 = "s";
3512
- var search_placeholder$1 = "Search by exam name";
3513
- var search_by_student$1 = "Search by student name";
3351
+ var search_placeholder$1 = "Search by Exam Name";
3352
+ var search_by_student$1 = "Search by Student Name";
3514
3353
  var study_touch$1 = "Study touch";
3515
3354
  var exam_information$1 = "Exam information";
3516
3355
  var issue_number$1 = "Issue number";
@@ -3586,8 +3425,8 @@ var update_exam$1 = "Update exam";
3586
3425
  var create_exam$1 = "Create exam";
3587
3426
  var back$1 = "Back";
3588
3427
  var date_format_exam$1 = "MMMM YYYY";
3589
- var date_format$1 = "MMM.D YYYY";
3590
- var date_time_format$1 = "HH:mm MMM.D YYYY ";
3428
+ var date_format$1 = "MMM. D. YYYY";
3429
+ var date_time_format$1 = "HH:mm MMM. D YYYY ";
3591
3430
  var date_time_format_12h$1 = "MM-DD-YYYY HH:mm A";
3592
3431
  var full_date_time_format$1 = "MMM Do YYYY HH:mm:ss";
3593
3432
  var total_questions$1 = "Total questions";
@@ -3660,8 +3499,9 @@ var problem_number_question$1 = "Question {{number}}";
3660
3499
  var teacher_in_charge$1 = "Teacher In Charge";
3661
3500
  var counselor$1 = "Counselor";
3662
3501
  var new_question$1 = "New Question";
3663
- var hour$1 = "hour";
3664
- var minute$1 = "minutes";
3502
+ var hour$1 = "hr";
3503
+ var hours = "hrs";
3504
+ var minute$1 = "min";
3665
3505
  var second$1 = "second";
3666
3506
  var question_order$1 = "Number {{number}}";
3667
3507
  var send_message$1 = "Send Message";
@@ -3690,7 +3530,7 @@ var check_attendance$1 = "Check attendance";
3690
3530
  var attendance_check$1 = "Attendance check";
3691
3531
  var class_date$1 = "Class date";
3692
3532
  var class_time$1 = "Class time";
3693
- var attendance$1 = "Attendance";
3533
+ var attendance$1 = "Attendance List";
3694
3534
  var attendance_completed$1 = "Attendance completed";
3695
3535
  var none_attendance$1 = "Non-attendance";
3696
3536
  var academy_list$1 = "Academy list";
@@ -4120,6 +3960,13 @@ var total_users$1 = "Total users";
4120
3960
  var added_date$1 = "Added date";
4121
3961
  var sync_exam_results$1 = "Sync exam results";
4122
3962
  var update_data_fail$1 = "Update data fail";
3963
+ var add_students_to_class$1 = "Add students to class";
3964
+ var click_to_choose_file$1 = "Click to choose file";
3965
+ var exam_data$1 = "Exam Data";
3966
+ var questions_correct_rate$1 = "Questions Correct Rate";
3967
+ var question_management$1 = "Question Management";
3968
+ var student_data$1 = "Student Data";
3969
+ var problem_number_question_chart$1 = "Q. {{number}}";
4123
3970
  var are_you_sure_to_sync_exam_results_to_academy$1 = "Are you sure to sync exam results to academy \"{{ academyName }}\" (it will run in the background and take a while)";
4124
3971
  var messages$1 = {
4125
3972
  exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
@@ -4408,6 +4255,7 @@ var lang_en = {
4408
4255
  counselor: counselor$1,
4409
4256
  new_question: new_question$1,
4410
4257
  hour: hour$1,
4258
+ hours: hours,
4411
4259
  minute: minute$1,
4412
4260
  second: second$1,
4413
4261
  question_order: question_order$1,
@@ -4862,6 +4710,13 @@ var lang_en = {
4862
4710
  added_date: added_date$1,
4863
4711
  sync_exam_results: sync_exam_results$1,
4864
4712
  update_data_fail: update_data_fail$1,
4713
+ add_students_to_class: add_students_to_class$1,
4714
+ click_to_choose_file: click_to_choose_file$1,
4715
+ exam_data: exam_data$1,
4716
+ questions_correct_rate: questions_correct_rate$1,
4717
+ question_management: question_management$1,
4718
+ student_data: student_data$1,
4719
+ problem_number_question_chart: problem_number_question_chart$1,
4865
4720
  are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy$1,
4866
4721
  messages: messages$1,
4867
4722
  submit: submit$1,
@@ -5666,7 +5521,6 @@ var ContentTooltip = function ContentTooltip(_ref) {
5666
5521
  var ChatRightItem = function ChatRightItem(_ref) {
5667
5522
  var content = _ref.content,
5668
5523
  createdAt = _ref.createdAt,
5669
- sender = _ref.sender,
5670
5524
  showTimestamp = _ref.showTimestamp,
5671
5525
  isStudent = _ref.isStudent,
5672
5526
  showName = _ref.showName,
@@ -5699,13 +5553,15 @@ var ChatRightItem = function ChatRightItem(_ref) {
5699
5553
  alignItems: "center",
5700
5554
  justifyContent: "end",
5701
5555
  flexDirection: "row"
5702
- }, React__default.createElement(iconPersonNoActive, null), React__default.createElement(Typography, {
5556
+ }, React__default.createElement(iconPersonNoActive, {
5557
+ color: styles.gray_700
5558
+ }), React__default.createElement(Typography, {
5703
5559
  fontWeight: 700,
5704
5560
  fontSize: 14,
5705
5561
  padding: "4px",
5706
5562
  lineHeight: "16.71px",
5707
5563
  color: styles.gray_700
5708
- }, sender === null || sender === void 0 ? void 0 : sender.fullName)), React__default.createElement(Stack, {
5564
+ }, t("me"))), React__default.createElement(Stack, {
5709
5565
  display: "flex",
5710
5566
  flexDirection: "row",
5711
5567
  gap: "8px",
@@ -6594,7 +6450,7 @@ var ChatHeader = function ChatHeader(_ref) {
6594
6450
  sx: {
6595
6451
  color: styles.gray_500
6596
6452
  }
6597
- }, (!!filterDurationExam.hours() ? filterDurationExam.hours() + " " + t("hour") : "") + " " + (!!filterDurationExam.minutes() ? filterDurationExam.minutes() + " " + t("minute") : "") + " " + (!!filterDurationExam.seconds() ? filterDurationExam.seconds() + " " + t("second") : "")))), React__default.createElement(Box, {
6453
+ }, (!!filterDurationExam.hours() ? filterDurationExam.hours() + " " + (filterDurationExam.hours() > 1 ? t("hours") : t("hour")) : "") + " " + (!!filterDurationExam.minutes() ? filterDurationExam.minutes() + " " + t("minute") : "") + " " + (!!filterDurationExam.seconds() ? filterDurationExam.seconds() + " " + t("second") : "")))), React__default.createElement(Box, {
6598
6454
  display: "flex",
6599
6455
  alignItems: "end",
6600
6456
  gap: "6px",
@@ -6615,16 +6471,12 @@ var ChatHeader = function ChatHeader(_ref) {
6615
6471
  fontSize: "12px",
6616
6472
  lineHeight: "14.32px",
6617
6473
  color: styles.less_dark
6618
- }, t("points", {
6619
- number: score || 0
6620
- })), React__default.createElement(Typography, {
6474
+ }, score || 0), React__default.createElement(Typography, {
6621
6475
  fontWeight: 700,
6622
6476
  fontSize: "12px",
6623
6477
  lineHeight: "14.32px",
6624
6478
  color: styles.gray_300
6625
- }, "/", t("points", {
6626
- number: totalScore || 0
6627
- }))), React__default.createElement(Typography, {
6479
+ }, "/", totalScore || 0)), React__default.createElement(Typography, {
6628
6480
  fontWeight: 500,
6629
6481
  fontSize: "12px",
6630
6482
  lineHeight: "14.32px",
@@ -7575,45 +7427,11 @@ var QuestionView = function QuestionView(_ref2) {
7575
7427
  }))));
7576
7428
  };
7577
7429
 
7578
- var ADMIN_CATEGORY_URL = SUPER_ADMIN_BASE_URL + "/api/category";
7579
- var CATEGORY_URL = BASE_URL + "/api/examcategory";
7580
- var getCategoryListAdminApi = function getCategoryListAdminApi(data) {
7581
- try {
7582
- return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL, {
7583
- params: data
7584
- }));
7585
- } catch (e) {
7586
- return Promise.reject(e);
7587
- }
7588
- };
7589
- var getCategoryListApi = function getCategoryListApi(data) {
7590
- try {
7591
- return Promise.resolve(api.get("" + CATEGORY_URL, {
7592
- params: data
7593
- }));
7594
- } catch (e) {
7595
- return Promise.reject(e);
7596
- }
7597
- };
7598
-
7599
7430
  var useCategorySelect = function useCategorySelect(_ref) {
7600
- var subjectId = _ref.subjectId;
7601
- var firstLoad = true;
7602
- var dispatch = useDispatch();
7431
+ var categoryList = _ref.categoryList;
7603
7432
  var _useState = useState(),
7604
- categoryList = _useState[0],
7605
- setCategoryList = _useState[1];
7606
- var _useState2 = useState(),
7607
- selectedCategory = _useState2[0],
7608
- setSelectedCategory = _useState2[1];
7609
- var isDomain = useSelector(function (state) {
7610
- var _state$common, _state$common$user;
7611
- return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.academyDomain;
7612
- });
7613
- var isSuperAdmin = useSelector(function (state) {
7614
- var _state$common2, _state$common2$user;
7615
- return (state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.roles) || [];
7616
- }).includes(Role.Admin) && !isDomain;
7433
+ selectedCategory = _useState[0],
7434
+ setSelectedCategory = _useState[1];
7617
7435
  var categoryOptions = useMemo(function () {
7618
7436
  return categoryList === null || categoryList === void 0 ? void 0 : categoryList.map(function (category) {
7619
7437
  var _category$path;
@@ -7623,39 +7441,6 @@ var useCategorySelect = function useCategorySelect(_ref) {
7623
7441
  };
7624
7442
  });
7625
7443
  }, [JSON.stringify(categoryList)]);
7626
- var getCategoryList = function getCategoryList(isLoading) {
7627
- if (isLoading === void 0) {
7628
- isLoading = true;
7629
- }
7630
- try {
7631
- var _temp2 = function _temp2() {
7632
- isLoading && dispatch(setLoading(false));
7633
- };
7634
- if (!subjectId) return Promise.resolve();
7635
- if (firstLoad) firstLoad = false;
7636
- isLoading && dispatch(setLoading(true));
7637
- var _temp = _catch(function () {
7638
- return Promise.resolve(isSuperAdmin ? getCategoryListAdminApi({
7639
- subjectId: subjectId
7640
- }) : getCategoryListApi({
7641
- subjectId: subjectId
7642
- })).then(function (res) {
7643
- var data = res.data.items;
7644
- setCategoryList(data || []);
7645
- setSelectedCategory(data[0]);
7646
- });
7647
- }, function (error) {
7648
- setCategoryList([]);
7649
- console.log(error);
7650
- });
7651
- return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
7652
- } catch (e) {
7653
- return Promise.reject(e);
7654
- }
7655
- };
7656
- useEffect(function () {
7657
- getCategoryList();
7658
- }, [subjectId]);
7659
7444
  var handleChangeCategory = function handleChangeCategory(value) {
7660
7445
  var id = value.value;
7661
7446
  var selectedCategory = categoryList === null || categoryList === void 0 ? void 0 : categoryList.find(function (category) {
@@ -7748,7 +7533,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
7748
7533
  questions = _ref.questions,
7749
7534
  answerCount = _ref.answerCount,
7750
7535
  questionCount = _ref.questionCount,
7751
- selectedSubject = _ref.selectedSubject,
7536
+ categoryList = _ref.categoryList,
7752
7537
  categoryId = _ref.categoryId,
7753
7538
  isActive = _ref.isActive,
7754
7539
  isDisabled = _ref.isDisabled,
@@ -7763,7 +7548,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
7763
7548
  var _useTranslation = useTranslation(),
7764
7549
  t = _useTranslation.t;
7765
7550
  var _useCategorySelect = useCategorySelect({
7766
- subjectId: defaultCategoryOptions === undefined ? selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id : undefined
7551
+ categoryList: categoryList
7767
7552
  }),
7768
7553
  categoryOptions = _useCategorySelect.categoryOptions;
7769
7554
  var theme = useTheme();
@@ -9628,12 +9413,45 @@ var DURATION_OPTIONS = Array.from({
9628
9413
  });
9629
9414
  var DEFAULT_ANSWER_COUNT$1 = 5;
9630
9415
 
9416
+ var ADMIN_CATEGORY_URL = SUPER_ADMIN_BASE_URL + "/api/category";
9417
+ var CATEGORY_URL = BASE_URL + "/api/examcategory";
9418
+ var getCategoryListAdminApi = function getCategoryListAdminApi(data) {
9419
+ try {
9420
+ return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL, {
9421
+ params: data
9422
+ }));
9423
+ } catch (e) {
9424
+ return Promise.reject(e);
9425
+ }
9426
+ };
9427
+ var getCategoryListApi = function getCategoryListApi(data) {
9428
+ try {
9429
+ return Promise.resolve(api.get("" + CATEGORY_URL, {
9430
+ params: data
9431
+ }));
9432
+ } catch (e) {
9433
+ return Promise.reject(e);
9434
+ }
9435
+ };
9436
+
9631
9437
  var useExamDetailView = function useExamDetailView(props) {
9632
9438
  var exam = props.exam,
9633
- selectedSubject = props.selectedSubject,
9634
9439
  onChangeExam = props.onChangeExam;
9635
9440
  var _useTranslation = useTranslation(),
9636
9441
  t = _useTranslation.t;
9442
+ var firstLoad = true;
9443
+ var dispatch = useDispatch();
9444
+ var isDomain = useSelector(function (state) {
9445
+ var _state$common, _state$common$user;
9446
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : (_state$common$user = _state$common.user) === null || _state$common$user === void 0 ? void 0 : _state$common$user.academyDomain;
9447
+ });
9448
+ var isSuperAdmin = useSelector(function (state) {
9449
+ var _state$common2, _state$common2$user;
9450
+ return (state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : (_state$common2$user = _state$common2.user) === null || _state$common2$user === void 0 ? void 0 : _state$common2$user.roles) || [];
9451
+ }).includes(Role.Admin) && !isDomain;
9452
+ var _useState = useState([]),
9453
+ categoryList = _useState[0],
9454
+ setCategoryList = _useState[1];
9637
9455
  var handleChangeQuestionCount = function handleChangeQuestionCount(article, questionCount, answerCount) {
9638
9456
  if (!exam) return;
9639
9457
  var examQuestions = exam.questions;
@@ -9811,6 +9629,39 @@ var useExamDetailView = function useExamDetailView(props) {
9811
9629
  }])
9812
9630
  }));
9813
9631
  };
9632
+ var getCategoryList = function getCategoryList(isLoading) {
9633
+ if (isLoading === void 0) {
9634
+ isLoading = true;
9635
+ }
9636
+ try {
9637
+ var _temp2 = function _temp2() {
9638
+ isLoading && dispatch(setLoading(false));
9639
+ };
9640
+ if (!exam.subjectId) return Promise.resolve();
9641
+ if (firstLoad) firstLoad = false;
9642
+ isLoading && dispatch(setLoading(true));
9643
+ var _temp = _catch(function () {
9644
+ return Promise.resolve(isSuperAdmin ? getCategoryListAdminApi({
9645
+ subjectId: exam.subjectId
9646
+ }) : getCategoryListApi({
9647
+ subjectId: exam.subjectId
9648
+ })).then(function (res) {
9649
+ var data = res.data.items;
9650
+ setCategoryList(data || []);
9651
+ });
9652
+ }, function (error) {
9653
+ setCategoryList([]);
9654
+ console.log(error);
9655
+ });
9656
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
9657
+ } catch (e) {
9658
+ return Promise.reject(e);
9659
+ }
9660
+ };
9661
+ useEffect(function () {
9662
+ if (categoryList !== null && categoryList !== void 0 && categoryList.length) return;
9663
+ getCategoryList();
9664
+ }, [exam.subjectId, JSON.stringify(categoryList)]);
9814
9665
  var examGroupByArticle = useMemo(function () {
9815
9666
  if (!exam) return [];
9816
9667
  var articles = [];
@@ -9835,27 +9686,23 @@ var useExamDetailView = function useExamDetailView(props) {
9835
9686
  var durationOptions = useMemo(function () {
9836
9687
  var options = DURATION_OPTIONS.map(function (i) {
9837
9688
  return {
9838
- label: t('mins_mins', {
9689
+ label: t("mins_mins", {
9839
9690
  mins: i
9840
9691
  }),
9841
9692
  value: i
9842
9693
  };
9843
9694
  });
9844
9695
  if (!!exam.duration && exam.duration > DURATION_OPTIONS[DURATION_OPTIONS.length - 1]) return [].concat(options, [{
9845
- label: t('mins_mins', {
9696
+ label: t("mins_mins", {
9846
9697
  mins: exam.duration
9847
9698
  }),
9848
9699
  value: exam.duration
9849
9700
  }]);
9850
9701
  return options;
9851
9702
  }, [exam.duration]);
9852
- useEffect(function () {
9853
- if ((selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) !== exam.subjectId) onChangeExam(_extends({}, exam, {
9854
- subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
9855
- }));
9856
- }, [selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id, exam.subjectId]);
9857
9703
  return {
9858
9704
  t: t,
9705
+ categoryList: categoryList,
9859
9706
  durationOptions: durationOptions,
9860
9707
  examGroupByArticle: examGroupByArticle,
9861
9708
  handleAddArticle: handleAddArticle,
@@ -9877,16 +9724,19 @@ var ExamDetailView = function ExamDetailView(_ref) {
9877
9724
  isDisabled = _ref.isDisabled,
9878
9725
  isEdit = _ref.isEdit,
9879
9726
  onChangeExam = _ref.onChangeExam;
9880
- var _useSubjectSelect = useSubjectSelect(),
9727
+ var _useSubjectSelect = useSubjectSelect({
9728
+ onChangeExam: onChangeExam,
9729
+ exam: exam
9730
+ }),
9881
9731
  subjectOptions = _useSubjectSelect.subjectOptions,
9882
9732
  selectedSubject = _useSubjectSelect.selectedSubject,
9883
9733
  handleChangeSubject = _useSubjectSelect.handleChangeSubject;
9884
9734
  var _useExamDetailView = useExamDetailView({
9885
9735
  exam: exam,
9886
- onChangeExam: onChangeExam,
9887
- selectedSubject: selectedSubject
9736
+ onChangeExam: onChangeExam
9888
9737
  }),
9889
9738
  t = _useExamDetailView.t,
9739
+ categoryList = _useExamDetailView.categoryList,
9890
9740
  durationOptions = _useExamDetailView.durationOptions,
9891
9741
  examGroupByArticle = _useExamDetailView.examGroupByArticle,
9892
9742
  handleAddArticle = _useExamDetailView.handleAddArticle,
@@ -9935,10 +9785,10 @@ var ExamDetailView = function ExamDetailView(_ref) {
9935
9785
  className: 'mb-2'
9936
9786
  }, React__default.createElement("label", {
9937
9787
  className: styles["form-label"] + " " + styles$2["question-label"],
9938
- htmlFor: "duration"
9939
- }, t("subject"), " ", selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.name), React__default.createElement(CustomSelect, {
9788
+ htmlFor: "subject"
9789
+ }, t("subject")), React__default.createElement(CustomSelect, {
9940
9790
  inputId: "subject",
9941
- value: selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id,
9791
+ value: exam === null || exam === void 0 ? void 0 : exam.subjectId,
9942
9792
  options: subjectOptions,
9943
9793
  onChange: handleChangeSubject,
9944
9794
  isDisabled: isDisabled || isEdit
@@ -9949,6 +9799,7 @@ var ExamDetailView = function ExamDetailView(_ref) {
9949
9799
  xs: 12,
9950
9800
  className: index === examGroupByArticle.length - 1 ? "mb-2" : ''
9951
9801
  }, React__default.createElement(ArticleGroupView, Object.assign({}, i, {
9802
+ categoryList: categoryList,
9952
9803
  isActive: index === examGroupByArticle.length - 1,
9953
9804
  onChangeQuestionCount: handleChangeQuestionCount,
9954
9805
  onChangeCategory: handleChangeCategory,
@@ -10833,18 +10684,6 @@ var createConversationApi = function createConversationApi(data) {
10833
10684
  return api.post(BASE_URL + "/api/conversation", data);
10834
10685
  };
10835
10686
 
10836
- var toNumberOrder = function toNumberOrder(value) {
10837
- return "The " + value + (value % 10 === 1 ? 'st' : value % 10 === 2 ? 'nd' : value % 10 === 3 ? 'rd' : 'th');
10838
- };
10839
- var formatDuration = function formatDuration(t, duration) {
10840
- if (!duration) return "0" + t("seconds");
10841
- var totalTime = Math.round(duration);
10842
- return totalTime > 60 ? t("mins_mins_seconds_seconds", {
10843
- mins: Math.floor(totalTime / 60),
10844
- seconds: totalTime % 60
10845
- }) : "" + Math.round(duration) + t("seconds");
10846
- };
10847
-
10848
10687
  var ORDER_NUMBERS = {
10849
10688
  1: "the_first",
10850
10689
  2: "the_second",
@@ -10899,6 +10738,7 @@ var EXAM_RESULT = {
10899
10738
  parentPhoneNumber: "",
10900
10739
  schoolName: "Academy",
10901
10740
  className: "1",
10741
+ fullName: "Abc",
10902
10742
  major: "",
10903
10743
  roles: []
10904
10744
  },
@@ -11631,6 +11471,18 @@ var defaultSeries = function defaultSeries(t) {
11631
11471
  }];
11632
11472
  };
11633
11473
 
11474
+ var formatDuration = function formatDuration(t, duration) {
11475
+ if (!duration) return "0" + t("seconds");
11476
+ var totalTime = Math.round(duration);
11477
+ return totalTime > 60 ? t("mins_mins_seconds_seconds", {
11478
+ mins: Math.floor(totalTime / 60),
11479
+ seconds: totalTime % 60
11480
+ }) : "" + Math.round(duration) + t("seconds");
11481
+ };
11482
+ var formatQuestionOrder = function formatQuestionOrder(index, t, language) {
11483
+ return language === Language.en ? "" + (index + 1) + getOrdinalSuffix(index + 1, language) : t(ORDER_NUMBERS[index + 1]);
11484
+ };
11485
+
11634
11486
  var RECENT_USER_URL = BASE_URL + "/api/recentUsers";
11635
11487
  var getRecentUserActionListApi = function getRecentUserActionListApi(query) {
11636
11488
  return api.get("" + RECENT_USER_URL, {
@@ -11653,19 +11505,18 @@ var createRecentUserActionListApi = function createRecentUserActionListApi(_ref)
11653
11505
  });
11654
11506
  };
11655
11507
 
11656
- var useExamResult = function useExamResult(searchParam, history, examSessionId, studentId, code, handleChangeTab, selectedTab) {
11508
+ var useExamResult = function useExamResult(props) {
11657
11509
  var _allSeries$dataChartI;
11658
- if (examSessionId === void 0) {
11659
- examSessionId = 0;
11660
- }
11661
- if (studentId === void 0) {
11662
- studentId = 0;
11663
- }
11664
- if (code === void 0) {
11665
- code = "";
11666
- }
11667
- var query = new URLSearchParams(searchParam);
11668
- var dispatch = useDispatch();
11510
+ var searchParams = props.searchParams,
11511
+ history = props.history,
11512
+ examSessionId = props.examSessionId,
11513
+ studentId = props.studentId,
11514
+ _props$code = props.code,
11515
+ code = _props$code === void 0 ? "" : _props$code,
11516
+ handleChangeTab = props.handleChangeTab,
11517
+ selectedTab = props.selectedTab,
11518
+ isPrint = props.isPrint;
11519
+ var query = new URLSearchParams(searchParams);
11669
11520
  var user = useSelector(function (state) {
11670
11521
  var _state$common;
11671
11522
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
@@ -11677,7 +11528,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11677
11528
  var _state$common2;
11678
11529
  return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.language;
11679
11530
  });
11680
- var _useState = useState(false),
11531
+ var _useState = useState(),
11681
11532
  isLoading = _useState[0],
11682
11533
  setIsLoading = _useState[1];
11683
11534
  var _useState2 = useState(),
@@ -11698,9 +11549,12 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11698
11549
  var _useState7 = useState(0),
11699
11550
  dataChartIndex = _useState7[0],
11700
11551
  setDataChartIndex = _useState7[1];
11701
- var _useState8 = useState(""),
11552
+ var _useState8 = useState(),
11702
11553
  openProblem = _useState8[0],
11703
11554
  setOpenProblem = _useState8[1];
11555
+ var _useState9 = useState(),
11556
+ errorMessage = _useState9[0],
11557
+ setErrorMessage = _useState9[1];
11704
11558
  var _useTranslation = useTranslation(),
11705
11559
  t = _useTranslation.t;
11706
11560
  var getStudentData = function getStudentData(examCode) {
@@ -11713,7 +11567,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11713
11567
  var _temp = _catch(function () {
11714
11568
  return Promise.resolve(Promise.all([getResults(examCode), getResultsLongTimeSpend(examCode), getResultsEffectSize(examCode), getResultsTimeOrderQuestion(examCode), getResultsCategories(examCode)])).then(function (result) {
11715
11569
  var _result$0$data, _result$1$data, _result$2$data, _result$3$data, _result$4$data;
11716
- handleChangeTab(0);
11570
+ handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
11717
11571
  setDataChartIndex(0);
11718
11572
  setResultData((_result$0$data = result[0].data) === null || _result$0$data === void 0 ? void 0 : _result$0$data.data);
11719
11573
  setLongTimeSpend((_result$1$data = result[1].data) === null || _result$1$data === void 0 ? void 0 : _result$1$data.data);
@@ -11722,19 +11576,21 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11722
11576
  setCategoryResponses(((_result$4$data = result[4].data) === null || _result$4$data === void 0 ? void 0 : _result$4$data.data) || []);
11723
11577
  });
11724
11578
  }, function (error) {
11725
- toast.error(getErrorMessage(t, error));
11579
+ var message = getErrorMessage(t, error);
11580
+ !isPrint && toast.error(message);
11581
+ setErrorMessage(message);
11726
11582
  });
11727
11583
  return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
11728
11584
  } catch (e) {
11729
11585
  return Promise.reject(e);
11730
11586
  }
11731
11587
  };
11732
- var getStudentDataByTeacher = function getStudentDataByTeacher(examCode, examSessionId, studentId) {
11588
+ var getStudentDataByTeacher = function getStudentDataByTeacher(examSessionId, studentId) {
11733
11589
  try {
11734
11590
  var _temp5 = function _temp5() {
11735
11591
  setIsLoading(false);
11736
11592
  };
11737
- if (!examCode || !examSessionId || !studentId) return Promise.resolve();
11593
+ if (!examSessionId || !studentId) return Promise.resolve();
11738
11594
  setIsLoading(true);
11739
11595
  var _temp4 = _catch(function () {
11740
11596
  return Promise.resolve(Promise.all([getResultsTeacher(examSessionId, studentId), getResultsLongTimeSpendTeacher(examSessionId, studentId), getResultsEffectSizeTeacher(examSessionId, studentId), getResultsTimeOrderQuestionTeacher(examSessionId, studentId), getResultsCategoriesTeacher(examSessionId, studentId)])).then(function (result) {
@@ -11742,7 +11598,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11742
11598
  function _temp3(_createRecentUserActi) {
11743
11599
  _createRecentUserActi;
11744
11600
  }
11745
- handleChangeTab(0);
11601
+ handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
11746
11602
  setDataChartIndex(0);
11747
11603
  setResultData((_result$0$data2 = result[0].data) === null || _result$0$data2 === void 0 ? void 0 : _result$0$data2.data);
11748
11604
  setLongTimeSpend((_result$1$data2 = result[1].data) === null || _result$1$data2 === void 0 ? void 0 : _result$1$data2.data);
@@ -11762,7 +11618,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11762
11618
  })).then(_temp3);
11763
11619
  });
11764
11620
  }, function (error) {
11765
- toast.error(getErrorMessage(t, error));
11621
+ var message = getErrorMessage(t, error);
11622
+ !isPrint && toast.error(message);
11623
+ setErrorMessage(message);
11766
11624
  });
11767
11625
  return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
11768
11626
  } catch (e) {
@@ -11777,7 +11635,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11777
11635
  setCategoryResponses(CATEGORY_RESPONSES);
11778
11636
  };
11779
11637
  var resetData = function resetData() {
11638
+ setIsLoading(undefined);
11780
11639
  setResultData(undefined);
11640
+ setErrorMessage(undefined);
11781
11641
  setLongTimeSpend([]);
11782
11642
  setEffectSize([]);
11783
11643
  setTimelyOrderQuestions([]);
@@ -11788,7 +11648,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11788
11648
  resetData();
11789
11649
  if (!(user !== null && user !== void 0 && user.email)) return;
11790
11650
  isStudent && getStudentData(examCode);
11791
- !isStudent && getStudentDataByTeacher(code, examSessionId, studentId);
11651
+ !isStudent && getStudentDataByTeacher(examSessionId, studentId);
11792
11652
  };
11793
11653
  examCode === "example-code" ? setExampleData() : getData();
11794
11654
  }, [examCode, isStudent, code, examSessionId, studentId, user === null || user === void 0 ? void 0 : user.email]);
@@ -11828,7 +11688,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11828
11688
  var dataPointIndex = _ref.dataPointIndex;
11829
11689
  if (dataPointIndex > 0) {
11830
11690
  var _questions;
11831
- return val != null ? t("problem_number_question", {
11691
+ return val != null ? t("problem_number_question_chart", {
11832
11692
  number: questions !== null ? (((_questions = questions[questionLength - val]) === null || _questions === void 0 ? void 0 : _questions.questionOrder) || 0) + 1 : val
11833
11693
  }) : t("no_data");
11834
11694
  }
@@ -11837,11 +11697,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11837
11697
  }
11838
11698
  }),
11839
11699
  xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
11840
- categories: [""].concat(Array.from({
11700
+ categories: ["s"].concat(Array.from({
11841
11701
  length: questionLength
11842
11702
  }, function (_, i) {
11843
- return ORDER_NUMBERS[i + 1] ? t(ORDER_NUMBERS[i + 1]) : toNumberOrder(i + 1);
11844
- }), [""]),
11703
+ return formatQuestionOrder(i, t, language);
11704
+ }), ["e"]),
11845
11705
  tooltip: {
11846
11706
  formatter: function formatter(val) {
11847
11707
  if (val > 1) return t(ORDER_NUMBERS[val - 1]);
@@ -11913,7 +11773,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11913
11773
  var dataPointIndex = _ref2.dataPointIndex;
11914
11774
  if (dataPointIndex > 0) {
11915
11775
  var _questions3;
11916
- return val != null ? t("problem_number_question", {
11776
+ return val != null ? t("problem_number_question_chart", {
11917
11777
  number: questions !== null ? (((_questions3 = questions[questionLength - val]) === null || _questions3 === void 0 ? void 0 : _questions3.questionOrder) || 0) + 1 : val
11918
11778
  }) : t("no_data");
11919
11779
  }
@@ -11923,11 +11783,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11923
11783
  }),
11924
11784
  colors: ['#3DC674', '#C3099A'],
11925
11785
  xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
11926
- categories: [""].concat(Array.from({
11786
+ categories: ["s"].concat(Array.from({
11927
11787
  length: questionLength
11928
11788
  }, function (_, i) {
11929
- return ORDER_NUMBERS[i + 1] ? t(ORDER_NUMBERS[i + 1]) : toNumberOrder(i + 1);
11930
- }), [""]),
11789
+ return formatQuestionOrder(i, t, language);
11790
+ }), ["e"]),
11931
11791
  tooltip: {
11932
11792
  formatter: function formatter(val) {
11933
11793
  if (val > 1) return t(ORDER_NUMBERS[val - 1]);
@@ -11941,7 +11801,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11941
11801
  labels: _extends({}, DEFAULT_LINE_CHART_OPTIONS.yaxis.labels, {
11942
11802
  formatter: function formatter(val) {
11943
11803
  var _questions4;
11944
- return val != null ? t("problem_number_question", {
11804
+ return val != null ? t("problem_number_question_chart", {
11945
11805
  number: questions !== null ? (((_questions4 = questions[questionLength - val]) === null || _questions4 === void 0 ? void 0 : _questions4.questionOrder) || 0) + 1 : val
11946
11806
  }) : t("no_data");
11947
11807
  }
@@ -11950,224 +11810,6 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11950
11810
  });
11951
11811
  }, [JSON.stringify(allChartOptions), dataChartIndex, language]);
11952
11812
  var series = (_allSeries$dataChartI = allSeries[dataChartIndex]) != null ? _allSeries$dataChartI : defaultSeries(t);
11953
- var handleExportPdf = function handleExportPdf() {
11954
- try {
11955
- var _temp24 = function _temp24(_result) {
11956
- if (_exit) return _result;
11957
- dispatch(setLoading(false));
11958
- };
11959
- var _exit = false;
11960
- dispatch(setLoading(true));
11961
- var _temp23 = _catch(function () {
11962
- var canvas = document.querySelector("#canvas");
11963
- var headerCanvas = document.querySelector("#header-canvas");
11964
- if (!canvas || !headerCanvas) {
11965
- _exit = true;
11966
- return;
11967
- }
11968
- var doc = new jsPDF({
11969
- orientation: "p",
11970
- unit: "px",
11971
- format: "a4"
11972
- });
11973
- var WIDTH_PAPER = doc.internal.pageSize.width;
11974
- var HEIGHT_PAPER = doc.internal.pageSize.height;
11975
- var line = 0;
11976
- var breakPage = function breakPage() {
11977
- doc.addPage();
11978
- line = 20;
11979
- };
11980
- var imgWidth = WIDTH_PAPER;
11981
- var chartWidth = WIDTH_PAPER - 20;
11982
- return Promise.resolve(html2canvas(headerCanvas)).then(function (header) {
11983
- function _temp22() {
11984
- function _temp20(_createRecentUserActi2) {
11985
- _createRecentUserActi2;
11986
- }
11987
- doc.save("download.pdf");
11988
- return isStudent ? _temp20(!isStudent && createRecentUserActionListApi({
11989
- userId: studentId,
11990
- action: RecentUserAction$1.PrintedExamResult,
11991
- data: "" + examSessionId,
11992
- roles: [Role.Teacher]
11993
- })) : Promise.resolve(!isStudent && createRecentUserActionListApi({
11994
- userId: studentId,
11995
- action: RecentUserAction$1.PrintedExamResult,
11996
- data: "" + examSessionId,
11997
- roles: [Role.Teacher]
11998
- })).then(_temp20);
11999
- }
12000
- var imgHeaderHeight = header.height * imgWidth / header.width;
12001
- var imgHeaderData = header.toDataURL('image/png');
12002
- doc.addImage(imgHeaderData, 'PNG', 0, 0, imgWidth, imgHeaderHeight);
12003
- line += imgHeaderHeight;
12004
- if (line > HEIGHT_PAPER) breakPage();
12005
- var _temp21 = function () {
12006
- if (canvas && canvas.childElementCount > 0) {
12007
- var _index = 0;
12008
- var _temp19 = _for(function () {
12009
- return _index < canvas.childElementCount;
12010
- }, function () {
12011
- return _index++;
12012
- }, function () {
12013
- function _temp18() {
12014
- function _temp16() {
12015
- line += 20;
12016
- }
12017
- var printChartTitle = function printChartTitle() {
12018
- try {
12019
- if (chartTitleData && chartTitleHeight) {
12020
- if (line + chartTitleHeight + 10 > HEIGHT_PAPER) breakPage();else line + 10;
12021
- doc.addImage(chartTitleData, 'PNG', 10, line, chartWidth, chartTitleHeight);
12022
- line += chartTitleHeight;
12023
- }
12024
- return Promise.resolve();
12025
- } catch (e) {
12026
- return Promise.reject(e);
12027
- }
12028
- };
12029
- var _temp15 = function () {
12030
- if (printContainerEls.length) {
12031
- var _temp14 = _forTo(printContainerEls, function (i) {
12032
- function _temp13() {
12033
- function _temp11() {
12034
- var printTitle = function printTitle() {
12035
- try {
12036
- if (!printTitleHeight || !printTitleData) return Promise.resolve();
12037
- doc.addImage(printTitleData, 'PNG', 0, line, chartWidth, printTitleHeight);
12038
- line += printTitleHeight;
12039
- return Promise.resolve();
12040
- } catch (e) {
12041
- return Promise.reject(e);
12042
- }
12043
- };
12044
- var printHeader = function printHeader(top) {
12045
- if (top === void 0) {
12046
- top = 0;
12047
- }
12048
- try {
12049
- if (!printHeaderData || !printHeaderHeight) return Promise.resolve();
12050
- line += top;
12051
- if (line + printHeaderHeight > HEIGHT_PAPER) breakPage();
12052
- doc.addImage(printHeaderData, 'PNG', 10, line, chartWidth, printHeaderHeight);
12053
- line += printHeaderHeight;
12054
- return Promise.resolve();
12055
- } catch (e) {
12056
- return Promise.reject(e);
12057
- }
12058
- };
12059
- var printContents = printContainerEl.querySelectorAll("." + PrintContentClassName);
12060
- if (!printContents.length) return;
12061
- printTitle();
12062
- var _temp9 = _forTo(printContents, function (j) {
12063
- var rowItem = printContents[j];
12064
- return Promise.resolve(html2canvas(rowItem)).then(function (rowItemCanvas) {
12065
- function _temp8() {
12066
- doc.addImage(data, 'PNG', 10, line, chartWidth, height);
12067
- line += height;
12068
- }
12069
- var height = rowItemCanvas.height * chartWidth / rowItemCanvas.width;
12070
- var data = rowItemCanvas.toDataURL('image/png');
12071
- if (i === 0 && j === 0 && line + height + (printHeaderHeight || 0) + ((chartTitleHeight || 0) + 10) + 20 > HEIGHT_PAPER) breakPage();
12072
- i === 0 && j === 0 && printChartTitle();
12073
- var _temp7 = function () {
12074
- if (line + height + 20 > HEIGHT_PAPER) {
12075
- breakPage();
12076
- return Promise.resolve(printHeader()).then(function () {});
12077
- } else {
12078
- var _temp25 = function () {
12079
- if (j === 0) {
12080
- return Promise.resolve(printHeader(10)).then(function () {});
12081
- }
12082
- }();
12083
- if (_temp25 && _temp25.then) return _temp25.then(function () {});
12084
- }
12085
- }();
12086
- return _temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7);
12087
- });
12088
- });
12089
- if (_temp9 && _temp9.then) return _temp9.then(function () {});
12090
- }
12091
- var _temp10 = function () {
12092
- if (printHeaderEl) {
12093
- return Promise.resolve(html2canvas(printHeaderEl)).then(function (_html2canvas3) {
12094
- printHeaderCanvas = _html2canvas3;
12095
- printHeaderHeight = printHeaderCanvas.height * chartWidth / printHeaderCanvas.width;
12096
- printHeaderData = printHeaderCanvas.toDataURL('image/png');
12097
- });
12098
- }
12099
- }();
12100
- return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10);
12101
- }
12102
- var printContainerEl = printContainerEls[i];
12103
- var printTitleEl = printContainerEl.querySelector("." + PrintTitleClassName);
12104
- var printHeaderEl = printContainerEl.querySelector("." + PrintHeaderClassName);
12105
- var printTitleCanvas = null;
12106
- var printTitleHeight = null;
12107
- var printTitleData = "";
12108
- var printHeaderCanvas = null;
12109
- var printHeaderHeight = null;
12110
- var printHeaderData = "";
12111
- var _temp12 = function () {
12112
- if (printTitleEl) {
12113
- return Promise.resolve(html2canvas(printTitleEl)).then(function (_html2canvas2) {
12114
- printTitleCanvas = _html2canvas2;
12115
- printTitleHeight = printTitleCanvas.height * chartWidth / printTitleCanvas.width;
12116
- printTitleData = printTitleCanvas.toDataURL('image/png');
12117
- });
12118
- }
12119
- }();
12120
- return _temp12 && _temp12.then ? _temp12.then(_temp13) : _temp13(_temp12);
12121
- });
12122
- if (_temp14 && _temp14.then) return _temp14.then(function () {});
12123
- } else {
12124
- return Promise.resolve(html2canvas(chart)).then(function (chartCanvas) {
12125
- var imgBodyHeight = chartCanvas.height * chartWidth / chartCanvas.width;
12126
- var imgBodyData = chartCanvas.toDataURL('image/png');
12127
- line += 10;
12128
- if (line + imgBodyHeight + 20 + (chartTitleHeight || 0) > HEIGHT_PAPER) breakPage();
12129
- printChartTitle();
12130
- doc.addImage(imgBodyData, 'PNG', 10, line, chartWidth, imgBodyHeight);
12131
- line += imgBodyHeight;
12132
- });
12133
- }
12134
- }();
12135
- return _temp15 && _temp15.then ? _temp15.then(_temp16) : _temp16(_temp15);
12136
- }
12137
- var chart = canvas.children.item(_index);
12138
- if (chart.getAttribute("id") === "header-canvas") return;
12139
- var chartTitle = chart.querySelector(".chart-title");
12140
- var printContainerEls = chart.querySelectorAll("." + PrintContainerClassName);
12141
- var printChartTitleCanvas = null;
12142
- var chartTitleHeight = null;
12143
- var chartTitleData = "";
12144
- var _temp17 = function () {
12145
- if (chartTitle && printContainerEls.length) {
12146
- return Promise.resolve(html2canvas(chartTitle)).then(function (_html2canvas) {
12147
- printChartTitleCanvas = _html2canvas;
12148
- chartTitleHeight = printChartTitleCanvas.height * chartWidth / printChartTitleCanvas.width;
12149
- chartTitleData = printChartTitleCanvas.toDataURL('image/png');
12150
- });
12151
- }
12152
- }();
12153
- return _temp17 && _temp17.then ? _temp17.then(_temp18) : _temp18(_temp17);
12154
- });
12155
- if (_temp19 && _temp19.then) return _temp19.then(function () {});
12156
- }
12157
- }();
12158
- return _temp21 && _temp21.then ? _temp21.then(_temp22) : _temp22(_temp21);
12159
- });
12160
- }, function (error) {
12161
- console.log({
12162
- error: error
12163
- });
12164
- toast.error(getErrorMessage(t, error));
12165
- });
12166
- return Promise.resolve(_temp23 && _temp23.then ? _temp23.then(_temp24) : _temp24(_temp23));
12167
- } catch (e) {
12168
- return Promise.reject(e);
12169
- }
12170
- };
12171
11813
  useEffect(function () {
12172
11814
  setDataChartIndex(0);
12173
11815
  }, [selectedTab]);
@@ -12190,11 +11832,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
12190
11832
  timelyOrderQuestions: timelyOrderQuestions,
12191
11833
  openProblem: openProblem,
12192
11834
  categoryResponses: categoryResponses,
11835
+ errorMessage: errorMessage,
12193
11836
  setOpenProblem: setOpenProblem,
12194
11837
  handlePrevChart: handlePrevChart,
12195
11838
  handleNextChart: handleNextChart,
12196
- handleExit: handleExit,
12197
- handleExportPdf: handleExportPdf
11839
+ handleExit: handleExit
12198
11840
  };
12199
11841
  };
12200
11842
 
@@ -13311,7 +12953,7 @@ Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==t
13311
12953
 
13312
12954
  var ReactApexChart = unwrapExports(reactApexcharts_min);
13313
12955
 
13314
- var styles$4 = {"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","titleBox":"_1dveO","title":"_mxRxf","point":"_2fD-F","buttonGroup":"_2DGl3","btnFeedback":"_xGW1x","btnTerminate":"_3mLu2","myanswer":"_eDBpS","titleMyAnswer1":"_2fMq3","titleMyAnswer2":"_3gEYh","contentMyAnswer":"_2K_sx","myAnswerItem":"_2qiLh","time":"_6TCOK","timeCol":"_hmseC","answer-response":"_3GfJt","answer-response-0":"_3ut64","answer-response-1":"_2VtpD","answer-response-2":"_58lQU","answer-response-3":"_1ucMY","answer-response-4":"_1qkxy","answerCorrect":"_2jIeT","answerIncorrect":"_to2v0","answerNograss":"_1JSte","answerEasy":"_2_uTU","answerDiscrimination":"_1DBoA","answerTrap":"_1q3tD","answerNoTime":"_3iItu","questionOrder":"_1fNkS","myTimeLabel":"_1Z_F3","myPoolTime":"_4KwG0","topTimeLabel":"_245H-","topTime":"_3tZqw","meanTimeLabel":"_PlPLY","meanTime":"_12a7R","compareChart":"_3MW16","prevChart":"_1fNkb","chart":"_3K4oY","nextChart":"_3YKBp","titleChart":"_13BVP","titleCompareGrass":"_o1txm","tableCompareGrass":"_bT5nf","thcolumn1":"_3Umg0","tdcolumn1":"_3dRMF","tdcolumn3":"_2tcBP","classification":"_1AFeb","wrapperProblem":"_oTqG7","titleProblem":"_35eIx","titleProblemClose":"_3t4HO","titleTrickyProblem":"_1-oxK","wrongQuestions":"_2dpMR","question":"_1lSOX","assignedQuestions":"_1ONUt","wrapperContent":"_nPoR0","content":"_2zmZn","contentColumn1":"_334SY","span1":"_3Lf-U","span2":"_ZpMot","contentColumn2":"_16P3l","duration":"_1kT28","topDuration":"_1fVRi","overallCorrectRate":"_3jLGe","answer":"_VsZ0K","contentVulnerable":"_QxKMy","wrappContentProblem":"_nnqpW","contentProblem":"_3Z1nV","labelProblem":"_36Xpx","name":"_3ZJQW","percent":"_2J3MK","slider":"_1MPdO","track":"_3CV_y","noData":"__g-ff","loading":"_3j485","table-responsive":"_2O6RX","form-label":"_1RYOQ","form-control":"_3VRVT","form-label-dialog":"_3oCSh","btn-cancel":"_3USKq","btn-register":"_3y_iD","pdfBtnBox":"_3xZHo","pdfBtn":"_1DtWq","form-select":"_1a_vw"};
12956
+ var styles$4 = {"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","titleBox":"_1dveO","title":"_mxRxf","point":"_2fD-F","buttonGroup":"_2DGl3","btnFeedback":"_xGW1x","btnTerminate":"_3mLu2","myanswer":"_eDBpS","titleMyAnswer1":"_2fMq3","titleMyAnswer2":"_3gEYh","contentMyAnswer":"_2K_sx","myAnswerItem":"_2qiLh","time":"_6TCOK","timeCol":"_hmseC","answer-response":"_3GfJt","answer-response-0":"_3ut64","answer-response-1":"_2VtpD","answer-response-2":"_58lQU","answer-response-3":"_1ucMY","answer-response-4":"_1qkxy","answerCorrect":"_2jIeT","answerIncorrect":"_to2v0","answerNograss":"_1JSte","answerEasy":"_2_uTU","answerDiscrimination":"_1DBoA","answerTrap":"_1q3tD","answerNoTime":"_3iItu","questionOrder":"_1fNkS","myTimeLabel":"_1Z_F3","myPoolTime":"_4KwG0","topTimeLabel":"_245H-","topTime":"_3tZqw","meanTimeLabel":"_PlPLY","meanTime":"_12a7R","compareChart":"_3MW16","prevChart":"_1fNkb","chart":"_3K4oY","nextChart":"_3YKBp","titleChart":"_13BVP","titleCompareGrass":"_o1txm","tableCompareGrass":"_bT5nf","thcolumn1":"_3Umg0","tdcolumn1":"_3dRMF","tdcolumn3":"_2tcBP","classification":"_1AFeb","wrapperProblem":"_oTqG7","titleProblem":"_35eIx","titleProblemClose":"_3t4HO","titleTrickyProblem":"_1-oxK","wrongQuestions":"_2dpMR","question":"_1lSOX","assignedQuestions":"_1ONUt","wrapperContent":"_nPoR0","content":"_2zmZn","contentColumn1":"_334SY","span1":"_3Lf-U","span2":"_ZpMot","contentColumn2":"_16P3l","duration":"_1kT28","topDuration":"_1fVRi","overallCorrectRate":"_3jLGe","answer":"_VsZ0K","contentVulnerable":"_QxKMy","wrappContentProblem":"_nnqpW","contentProblem":"_3Z1nV","labelProblem":"_36Xpx","name":"_3ZJQW","percent":"_2J3MK","slider":"_1MPdO","track":"_3CV_y","noData":"__g-ff","loading":"_3j485","table-responsive":"_2O6RX","form-label":"_1RYOQ","form-control":"_3VRVT","form-label-dialog":"_3oCSh","btn-cancel":"_3USKq","btn-register":"_3y_iD","pdfBtnBox":"_3xZHo","pdfBtn":"_1DtWq","form-select":"_1a_vw","loader":"_2uC7T","dot":"_Xz-Mr","bounce":"_3THgz"};
13315
12957
 
13316
12958
  var iconStarQuestion = function iconStarQuestion(_ref) {
13317
12959
  var _ref$width = _ref.width,
@@ -13702,8 +13344,7 @@ function CreateNewQuestionDialog(_ref) {
13702
13344
  function MyAnswer(_ref) {
13703
13345
  var data = _ref.data,
13704
13346
  categories = _ref.categories,
13705
- isStudent = _ref.isStudent,
13706
- isPrint = _ref.isPrint;
13347
+ isStudent = _ref.isStudent;
13707
13348
  var _useCreateQuestionDia = useCreateQuestionDialog({
13708
13349
  questions: data.questions
13709
13350
  }),
@@ -13723,6 +13364,13 @@ function MyAnswer(_ref) {
13723
13364
  handleSelectQuestionOrder(id);
13724
13365
  toggleCreateQuestion();
13725
13366
  };
13367
+ var formatTimeDiff = function formatTimeDiff(my, top) {
13368
+ var diff = Math.round(my - top);
13369
+ var prefix = "";
13370
+ if (diff < 0) prefix = "-";
13371
+ if (diff > 0) prefix = "+";
13372
+ return "" + prefix + formatTimeSecond(Math.abs(diff), t);
13373
+ };
13726
13374
  var renderQuestions = function renderQuestions(questions) {
13727
13375
  return questions.map(function (question, index) {
13728
13376
  return React__default.createElement("div", {
@@ -13785,7 +13433,7 @@ function MyAnswer(_ref) {
13785
13433
  margin: 0
13786
13434
  },
13787
13435
  className: styles$4["answer-response"] + " " + styles$4["answer-response-" + question.answerResponseSignal]
13788
- }, formatTimeSecond(Math.round(question.topDuration - question.duration), t)) : React__default.createElement("p", {
13436
+ }, formatTimeDiff(question.duration, question.topDuration)) : React__default.createElement("p", {
13789
13437
  style: {
13790
13438
  margin: 0,
13791
13439
  textAlign: "center"
@@ -13824,24 +13472,12 @@ function MyAnswer(_ref) {
13824
13472
  })))));
13825
13473
  });
13826
13474
  };
13827
- var renderPrintQuestions = function renderPrintQuestions(questions) {
13828
- var chunkedQuestions = _.chunk(questions, 10);
13829
- return chunkedQuestions.map(function (i, index) {
13830
- return React__default.createElement("div", {
13831
- key: index,
13832
- className: PrintContentClassName
13833
- }, renderQuestions(i));
13834
- });
13835
- };
13836
13475
  return React__default.createElement("div", {
13837
13476
  className: styles$4["myanswer"]
13838
13477
  }, formattedData && formattedData.length > 0 && formattedData.map(function (item) {
13839
13478
  return React__default.createElement("div", {
13840
- key: item.category.id,
13841
- className: isPrint ? PrintContainerClassName : ""
13842
- }, React__default.createElement("div", {
13843
- className: isPrint ? PrintHeaderClassName : ""
13844
- }, React__default.createElement(Stack, {
13479
+ key: item.category.id
13480
+ }, React__default.createElement("div", null, React__default.createElement(Stack, {
13845
13481
  bgcolor: "#F9FAFB",
13846
13482
  flexDirection: "row",
13847
13483
  padding: "12px",
@@ -13853,6 +13489,7 @@ function MyAnswer(_ref) {
13853
13489
  gap: "4px"
13854
13490
  }
13855
13491
  }, React__default.createElement(Typography, {
13492
+ paddingInline: "4px",
13856
13493
  sx: {
13857
13494
  fontSize: "13px",
13858
13495
  fontWeight: 600,
@@ -13867,6 +13504,7 @@ function MyAnswer(_ref) {
13867
13504
  gap: "4px"
13868
13505
  }
13869
13506
  }, React__default.createElement(Typography, {
13507
+ paddingInline: "4px",
13870
13508
  sx: {
13871
13509
  fontSize: "13px",
13872
13510
  fontWeight: 600,
@@ -13881,6 +13519,7 @@ function MyAnswer(_ref) {
13881
13519
  gap: "4px"
13882
13520
  }
13883
13521
  }, React__default.createElement(Typography, {
13522
+ paddingInline: "4px",
13884
13523
  sx: {
13885
13524
  fontSize: "13px",
13886
13525
  fontWeight: 600,
@@ -13896,6 +13535,7 @@ function MyAnswer(_ref) {
13896
13535
  gap: "4px"
13897
13536
  }
13898
13537
  }, React__default.createElement(Typography, {
13538
+ paddingInline: "4px",
13899
13539
  sx: {
13900
13540
  fontSize: "13px",
13901
13541
  fontWeight: 600,
@@ -13911,6 +13551,7 @@ function MyAnswer(_ref) {
13911
13551
  gap: "4px"
13912
13552
  }
13913
13553
  }, React__default.createElement(Typography, {
13554
+ paddingInline: "4px",
13914
13555
  sx: {
13915
13556
  fontSize: "13px",
13916
13557
  fontWeight: 600,
@@ -13933,7 +13574,7 @@ function MyAnswer(_ref) {
13933
13574
  }
13934
13575
  }, item.category.name))), React__default.createElement("div", {
13935
13576
  className: styles$4["contentMyAnswer"]
13936
- }, isPrint ? renderPrintQuestions(item.questions) : renderQuestions(item.questions)));
13577
+ }, renderQuestions(item.questions)));
13937
13578
  }), React__default.createElement(CreateNewQuestionDialog, {
13938
13579
  questionOptions: questionOptions,
13939
13580
  questionOrderSelected: questionOrderSelected,
@@ -13987,8 +13628,7 @@ var iconBtnNextChart = function iconBtnNextChart(_ref) {
13987
13628
  };
13988
13629
 
13989
13630
  var CompareGrass = function CompareGrass(_ref) {
13990
- var effectSize = _ref.effectSize,
13991
- isPrint = _ref.isPrint;
13631
+ var effectSize = _ref.effectSize;
13992
13632
  var _useTranslation = useTranslation(),
13993
13633
  t = _useTranslation.t;
13994
13634
  var renderTableBody = function renderTableBody(effectSize) {
@@ -14051,17 +13691,8 @@ var CompareGrass = function CompareGrass(_ref) {
14051
13691
  }))));
14052
13692
  });
14053
13693
  };
14054
- var renderPrintTableBody = function renderPrintTableBody(effectSize) {
14055
- var chunkedEffectSizeQuestions = _.chunk(effectSize, 10);
14056
- return chunkedEffectSizeQuestions.map(function (i, index) {
14057
- return React__default.createElement("tbody", {
14058
- key: index,
14059
- className: PrintContentClassName
14060
- }, renderTableBody(i));
14061
- });
14062
- };
14063
13694
  return React__default.createElement("div", {
14064
- className: styles$4["compareGrass"] + " " + (isPrint ? PrintContainerClassName : "")
13695
+ className: "" + styles$4["compareGrass"]
14065
13696
  }, React__default.createElement("div", {
14066
13697
  className: styles$4["tableCompareGrass"]
14067
13698
  }, React__default.createElement("div", {
@@ -14073,8 +13704,7 @@ var CompareGrass = function CompareGrass(_ref) {
14073
13704
  }, React__default.createElement("thead", {
14074
13705
  style: {
14075
13706
  borderBottom: "1px solid #E4E7EC"
14076
- },
14077
- className: isPrint ? PrintHeaderClassName : ""
13707
+ }
14078
13708
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14079
13709
  className: styles$4["thcolumn1"]
14080
13710
  }, t("problem_number")), React__default.createElement("th", {
@@ -14093,7 +13723,7 @@ var CompareGrass = function CompareGrass(_ref) {
14093
13723
  style: {
14094
13724
  textAlign: "center"
14095
13725
  }
14096
- }, t("problem_classification")))), isPrint ? renderPrintTableBody(effectSize) : React__default.createElement("tbody", null, renderTableBody(effectSize))))));
13726
+ }, t("problem_classification")))), React__default.createElement("tbody", null, renderTableBody(effectSize))))));
14097
13727
  };
14098
13728
 
14099
13729
  var iconX = function iconX(_ref) {
@@ -14145,8 +13775,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
14145
13775
  var keyOpen = _ref.keyOpen,
14146
13776
  data = _ref.data,
14147
13777
  openProblem = _ref.openProblem,
14148
- changeOpen = _ref.changeOpen,
14149
- isPrint = _ref.isPrint;
13778
+ changeOpen = _ref.changeOpen;
14150
13779
  var _useTranslation = useTranslation(),
14151
13780
  t = _useTranslation.t;
14152
13781
  var isOpen = openProblem === keyOpen;
@@ -14185,45 +13814,12 @@ var TrickyProblem = function TrickyProblem(_ref) {
14185
13814
  className: styles$4["noData"]
14186
13815
  }, t("no_data"))));
14187
13816
  };
14188
- var renderPrintProblems = function renderPrintProblems() {
14189
- return React__default.createElement(Fragment$1, null, React__default.createElement("div", {
14190
- className: PrintContentClassName
14191
- }, React__default.createElement("div", {
14192
- className: styles$4["titleTrickyProblem"]
14193
- }, React__default.createElement(iconX, null), React__default.createElement("span", null, t("incorrect_problem_among_the_starred_problems"))), React__default.createElement("div", {
14194
- className: styles$4["wrongQuestions"]
14195
- }, !!inCorrectQuestions.length && inCorrectQuestions.map(function (question) {
14196
- return React__default.createElement("span", {
14197
- key: question.id,
14198
- className: styles$4["question"]
14199
- }, t("number_question", {
14200
- number: question.questionOrder + 1
14201
- }));
14202
- }), !data.questions.length && React__default.createElement("div", {
14203
- className: styles$4["noData"]
14204
- }, t("no_data")))), React__default.createElement("div", {
14205
- className: PrintContentClassName
14206
- }, React__default.createElement("div", {
14207
- className: styles$4["titleTrickyProblem"]
14208
- }, React__default.createElement(iconAssignedQuestions, null), React__default.createElement("span", null, t("correct_problem_among_the_starred_problems"))), React__default.createElement("div", {
14209
- className: styles$4["assignedQuestions"]
14210
- }, !!correctQuestions.length && correctQuestions.map(function (question) {
14211
- return React__default.createElement("div", {
14212
- key: question.id,
14213
- className: styles$4["question"]
14214
- }, t("number_question", {
14215
- number: question.questionOrder + 1
14216
- }));
14217
- }), !data.questions.length && React__default.createElement("div", {
14218
- className: styles$4["noData"]
14219
- }, t("no_data")))));
14220
- };
14221
13817
  return React__default.createElement("div", {
14222
- className: styles$4["wrapperProblem"] + " " + (isPrint ? PrintContainerClassName : "")
13818
+ className: "" + styles$4["wrapperProblem"]
14223
13819
  }, React__default.createElement("div", {
14224
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintHeaderClassName : ""),
13820
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14225
13821
  onClick: function onClick() {
14226
- return changeOpen(isOpen ? "" : keyOpen);
13822
+ return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
14227
13823
  }
14228
13824
  }, React__default.createElement(Typography, {
14229
13825
  sx: {
@@ -14237,7 +13833,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
14237
13833
  }) : React__default.createElement(IoChevronDown, {
14238
13834
  size: 24,
14239
13835
  color: styles$4.gray_300
14240
- })), isOpen && React__default.createElement(Fragment$1, null, isPrint ? renderPrintProblems() : renderProblems()));
13836
+ })), isOpen && React__default.createElement(Fragment$1, null, renderProblems()));
14241
13837
  };
14242
13838
 
14243
13839
  var ProtractedProblem = function ProtractedProblem(_ref) {
@@ -14245,7 +13841,6 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14245
13841
  data = _ref.data,
14246
13842
  openProblem = _ref.openProblem,
14247
13843
  changeOpen = _ref.changeOpen,
14248
- isPrint = _ref.isPrint,
14249
13844
  isMyStoryStudent = _ref.isMyStoryStudent;
14250
13845
  var _useTranslation = useTranslation(),
14251
13846
  t = _useTranslation.t;
@@ -14320,21 +13915,12 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14320
13915
  }, formatTimeSecond(item.topDuration, t)))));
14321
13916
  });
14322
13917
  };
14323
- var renderPrintQuestions = function renderPrintQuestions() {
14324
- var chunkedData = _.chunk(data, 5);
14325
- return chunkedData.map(function (i, index) {
14326
- return React__default.createElement("tbody", {
14327
- key: index,
14328
- className: PrintContentClassName
14329
- }, isMyStoryStudent ? renderTableBody(i) : renderQuestions(i));
14330
- });
14331
- };
14332
13918
  return React__default.createElement("div", {
14333
- className: styles$4["wrapperProblem"] + " " + (isPrint ? PrintContainerClassName : "")
13919
+ className: "" + styles$4["wrapperProblem"]
14334
13920
  }, React__default.createElement("div", {
14335
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintTitleClassName : ""),
13921
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14336
13922
  onClick: function onClick() {
14337
- return changeOpen(isOpen ? "" : keyOpen);
13923
+ return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
14338
13924
  }
14339
13925
  }, React__default.createElement(Stack, {
14340
13926
  flexDirection: "row",
@@ -14370,8 +13956,7 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14370
13956
  }, isMyStoryStudent && React__default.createElement("thead", {
14371
13957
  style: {
14372
13958
  borderBottom: "1px solid #E4E7EC"
14373
- },
14374
- className: isPrint ? PrintHeaderClassName : ""
13959
+ }
14375
13960
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14376
13961
  className: styles$4["thcolumn1"]
14377
13962
  }, t("problem_number")), React__default.createElement("th", {
@@ -14386,8 +13971,8 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14386
13971
  style: {
14387
13972
  textAlign: "center"
14388
13973
  }
14389
- }, t("time_comparison")))), isPrint ? renderPrintQuestions() : React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(data) : renderQuestions(data))))) : React__default.createElement("div", {
14390
- className: styles$4["noData"] + " " + (isPrint ? PrintContentClassName : "")
13974
+ }, t("time_comparison")))), React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(data) : renderQuestions(data))))) : React__default.createElement("div", {
13975
+ className: "" + styles$4["noData"]
14391
13976
  }, t("no_data"))));
14392
13977
  };
14393
13978
 
@@ -14396,7 +13981,6 @@ var Vulnerable = function Vulnerable(_ref) {
14396
13981
  keyOpen = _ref.keyOpen,
14397
13982
  openProblem = _ref.openProblem,
14398
13983
  changeOpen = _ref.changeOpen,
14399
- isPrint = _ref.isPrint,
14400
13984
  isMyStoryStudent = _ref.isMyStoryStudent;
14401
13985
  var _useTranslation = useTranslation(),
14402
13986
  t = _useTranslation.t;
@@ -14460,11 +14044,13 @@ var Vulnerable = function Vulnerable(_ref) {
14460
14044
  return questions.map(function (question) {
14461
14045
  return React__default.createElement(Grid, {
14462
14046
  container: true,
14047
+ flexWrap: "nowrap",
14463
14048
  className: styles$4["content"],
14464
14049
  key: question.id
14465
14050
  }, React__default.createElement(Grid, {
14466
14051
  item: true,
14467
14052
  xs: 1.5,
14053
+ minWidth: "120px",
14468
14054
  className: styles$4["contentColumn1"]
14469
14055
  }, React__default.createElement("div", null, React__default.createElement("span", {
14470
14056
  className: styles$4["span1"]
@@ -14491,22 +14077,14 @@ var Vulnerable = function Vulnerable(_ref) {
14491
14077
  }), ")"))));
14492
14078
  });
14493
14079
  };
14494
- var renderPrintQuestions = function renderPrintQuestions(questions) {
14495
- var chunkedQuestions = _.chunk(questions, 5);
14496
- return chunkedQuestions.map(function (i, index) {
14497
- return React__default.createElement("tbody", {
14498
- key: index,
14499
- className: PrintContentClassName
14500
- }, isMyStoryStudent ? renderTableBody(i) : renderQuestions(i));
14501
- });
14080
+ var handleToggle = function handleToggle() {
14081
+ changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
14502
14082
  };
14503
14083
  return React__default.createElement("div", {
14504
- className: styles$4["wrapperProblem"] + " " + PrintContainerClassName
14084
+ className: "" + styles$4["wrapperProblem"]
14505
14085
  }, React__default.createElement("div", {
14506
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintTitleClassName : ""),
14507
- onClick: function onClick() {
14508
- return changeOpen(isOpen ? "" : keyOpen);
14509
- }
14086
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14087
+ onClick: handleToggle
14510
14088
  }, React__default.createElement(Stack, {
14511
14089
  flexDirection: "row",
14512
14090
  gap: "24px",
@@ -14533,16 +14111,15 @@ var Vulnerable = function Vulnerable(_ref) {
14533
14111
  className: styles$4["tableCompareGrass"]
14534
14112
  }, React__default.createElement("div", {
14535
14113
  className: styles$4["table-responsive"]
14536
- }, React__default.createElement(Table, {
14114
+ }, isMyStoryStudent && React__default.createElement(Table, {
14537
14115
  style: {
14538
14116
  width: "100%",
14539
14117
  marginBottom: isMyStoryStudent ? "120px" : 0
14540
14118
  }
14541
- }, isMyStoryStudent && React__default.createElement("thead", {
14119
+ }, React__default.createElement("thead", {
14542
14120
  style: {
14543
14121
  borderBottom: "1px solid #E4E7EC"
14544
- },
14545
- className: isPrint ? PrintHeaderClassName : ""
14122
+ }
14546
14123
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14547
14124
  className: styles$4["thcolumn1"]
14548
14125
  }, t("problem_number")), React__default.createElement("th", {
@@ -14561,23 +14138,44 @@ var Vulnerable = function Vulnerable(_ref) {
14561
14138
  style: {
14562
14139
  textAlign: "center"
14563
14140
  }
14564
- }, t("_category")))), isPrint ? renderPrintQuestions(incorrectQuestions) : React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(incorrectQuestions) : renderQuestions(incorrectQuestions))))) : React__default.createElement("div", {
14565
- className: styles$4["noData"] + " " + (isPrint ? PrintContentClassName : "")
14141
+ }, t("_category")))), React__default.createElement("tbody", null, renderTableBody(incorrectQuestions))), !isMyStoryStudent && renderQuestions(incorrectQuestions))) : React__default.createElement("div", {
14142
+ className: "" + styles$4["noData"]
14566
14143
  }, t("no_data"))));
14567
14144
  };
14568
14145
 
14146
+ var AnswerResponseSignal;
14147
+ (function (AnswerResponseSignal) {
14148
+ AnswerResponseSignal[AnswerResponseSignal["Purple"] = 0] = "Purple";
14149
+ AnswerResponseSignal[AnswerResponseSignal["Red"] = 1] = "Red";
14150
+ AnswerResponseSignal[AnswerResponseSignal["Yellow"] = 2] = "Yellow";
14151
+ AnswerResponseSignal[AnswerResponseSignal["Green"] = 3] = "Green";
14152
+ AnswerResponseSignal[AnswerResponseSignal["Black"] = 4] = "Black";
14153
+ })(AnswerResponseSignal || (AnswerResponseSignal = {}));
14154
+ var ProblemKey;
14155
+ (function (ProblemKey) {
14156
+ ProblemKey[ProblemKey["TrickyProblem"] = 0] = "TrickyProblem";
14157
+ ProblemKey[ProblemKey["ProtractedProblem"] = 1] = "ProtractedProblem";
14158
+ ProblemKey[ProblemKey["GradesByTerritory"] = 2] = "GradesByTerritory";
14159
+ ProblemKey[ProblemKey["Vulnerable"] = 3] = "Vulnerable";
14160
+ })(ProblemKey || (ProblemKey = {}));
14161
+ var PrintState;
14162
+ (function (PrintState) {
14163
+ PrintState[PrintState["Default"] = 0] = "Default";
14164
+ PrintState[PrintState["Printing"] = 1] = "Printing";
14165
+ PrintState[PrintState["Pending"] = 2] = "Pending";
14166
+ PrintState[PrintState["Printed"] = 3] = "Printed";
14167
+ })(PrintState || (PrintState = {}));
14168
+
14569
14169
  var GradesByTerritory = function GradesByTerritory(_ref) {
14570
- var keyOpen = _ref.keyOpen,
14571
- data = _ref.data,
14170
+ var data = _ref.data,
14572
14171
  openProblem = _ref.openProblem,
14573
14172
  changeOpen = _ref.changeOpen,
14574
- isPrint = _ref.isPrint,
14575
14173
  resultData = _ref.resultData,
14576
14174
  isMyStoryStudent = _ref.isMyStoryStudent;
14577
14175
  var _useTranslation = useTranslation(),
14578
14176
  t = _useTranslation.t;
14579
14177
  var formattedData = totalSolveTimeCategories(resultData, data);
14580
- var isOpen = openProblem === keyOpen;
14178
+ var isOpen = openProblem === ProblemKey.GradesByTerritory;
14581
14179
  var renderTableBody = function renderTableBody(data) {
14582
14180
  return data.map(function (item, index) {
14583
14181
  return React__default.createElement("tr", {
@@ -14651,21 +14249,12 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
14651
14249
  }))));
14652
14250
  });
14653
14251
  };
14654
- var renderPrintCategories = function renderPrintCategories() {
14655
- var chunkedCategories = _.chunk(formattedData, 10);
14656
- return chunkedCategories.map(function (i, index) {
14657
- return React__default.createElement("tbody", {
14658
- key: index,
14659
- className: PrintContentClassName
14660
- }, isMyStoryStudent ? renderTableBody(i) : renderCategories(i));
14661
- });
14662
- };
14663
14252
  return React__default.createElement("div", {
14664
- className: styles$4["wrapperProblem"] + " " + (isPrint ? PrintContainerClassName : "")
14253
+ className: "" + styles$4["wrapperProblem"]
14665
14254
  }, React__default.createElement("div", {
14666
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintTitleClassName : ""),
14255
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14667
14256
  onClick: function onClick() {
14668
- return changeOpen(isOpen ? "" : keyOpen);
14257
+ return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : ProblemKey.GradesByTerritory);
14669
14258
  }
14670
14259
  }, React__default.createElement(Typography, {
14671
14260
  sx: {
@@ -14683,16 +14272,15 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
14683
14272
  className: styles$4["tableCompareGrass"]
14684
14273
  }, React__default.createElement("div", {
14685
14274
  className: styles$4["table-responsive"]
14686
- }, React__default.createElement(Table, {
14275
+ }, isMyStoryStudent && React__default.createElement(Table, {
14687
14276
  style: {
14688
14277
  width: "100%",
14689
14278
  marginBottom: isMyStoryStudent ? "120px" : 0
14690
14279
  }
14691
- }, isMyStoryStudent && React__default.createElement("thead", {
14280
+ }, React__default.createElement("thead", {
14692
14281
  style: {
14693
14282
  borderBottom: "1px solid #E4E7EC"
14694
- },
14695
- className: isPrint ? PrintHeaderClassName : ""
14283
+ }
14696
14284
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14697
14285
  className: styles$4["thcolumn1"]
14698
14286
  }, t("categories")), React__default.createElement("th", {
@@ -14711,8 +14299,8 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
14711
14299
  style: {
14712
14300
  textAlign: "center"
14713
14301
  }
14714
- }, t("total_solve_time")))), isPrint ? renderPrintCategories() : React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(formattedData) : renderCategories(formattedData))))) : React__default.createElement("div", {
14715
- className: styles$4["noData"] + " " + (isPrint ? PrintContentClassName : "")
14302
+ }, t("total_solve_time")))), React__default.createElement("tbody", null, renderTableBody(formattedData))), !isMyStoryStudent && renderCategories(formattedData))) : React__default.createElement("div", {
14303
+ className: "" + styles$4["noData"]
14716
14304
  }, t("no_data"))));
14717
14305
  };
14718
14306
 
@@ -14916,23 +14504,379 @@ var useTab = function useTab() {
14916
14504
  };
14917
14505
  };
14918
14506
 
14507
+ var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, totalChart, onSuccess, onError, autoPrint) {
14508
+ if (autoPrint === void 0) {
14509
+ autoPrint = false;
14510
+ }
14511
+ var contentRef = useRef(null);
14512
+ var _useState = useState([]),
14513
+ renderedCharts = _useState[0],
14514
+ setRenderedCharts = _useState[1];
14515
+ var _useTranslation = useTranslation(),
14516
+ t = _useTranslation.t;
14517
+ var _useState2 = useState(PrintState.Default),
14518
+ printState = _useState2[0],
14519
+ setPrintState = _useState2[1];
14520
+ var setRenderedChart = function setRenderedChart(chart) {
14521
+ setRenderedCharts(function (state) {
14522
+ return [].concat(state, [chart]);
14523
+ });
14524
+ };
14525
+ var reset = function reset() {
14526
+ setRenderedCharts([]);
14527
+ setPrintState(PrintState.Default);
14528
+ };
14529
+ var autoPrintPdf = function autoPrintPdf() {
14530
+ if (printState === PrintState.Printing) return;
14531
+ if (autoPrint && printState !== PrintState.Default) return;
14532
+ if (totalChart !== renderedCharts.length) {
14533
+ !autoPrint && setPrintState(PrintState.Pending);
14534
+ return;
14535
+ }
14536
+ var name = !fileName ? "Exam-Result_" + new Date().getTime() : fileName;
14537
+ if (contentRef.current && contentRef.current != null) {
14538
+ setPrintState(PrintState.Printing);
14539
+ setTimeout(function () {
14540
+ try {
14541
+ var _temp2 = function _temp2() {
14542
+ setPrintState(PrintState.Printed);
14543
+ };
14544
+ var _temp = _catch(function () {
14545
+ var element = contentRef.current;
14546
+ var options = {
14547
+ margin: 5,
14548
+ filename: name + ".pdf",
14549
+ html2canvas: {
14550
+ scale: 2
14551
+ },
14552
+ jsPDF: {
14553
+ format: 'a4',
14554
+ orientation: 'portrait'
14555
+ },
14556
+ pagebreak: {
14557
+ mode: ['avoid-all', 'css', 'legacy']
14558
+ }
14559
+ };
14560
+ return Promise.resolve(html2pdf().from(element).set(options).save()).then(function () {
14561
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
14562
+ });
14563
+ }, function (error) {
14564
+ !window.opener && toast.error(getErrorMessage(t, error));
14565
+ onError === null || onError === void 0 ? void 0 : onError(error === null || error === void 0 ? void 0 : error.message);
14566
+ });
14567
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
14568
+ } catch (e) {
14569
+ return Promise.reject(e);
14570
+ }
14571
+ }, 300);
14572
+ }
14573
+ };
14574
+ var handlePrintPdf = function handlePrintPdf() {
14575
+ autoPrintPdf();
14576
+ };
14577
+ useEffect(function () {
14578
+ (autoPrint || printState === PrintState.Pending) && isDataFetching === false && autoPrintPdf();
14579
+ }, [totalChart, renderedCharts.length, fileName, autoPrint, printState, isDataFetching]);
14580
+ useEffect(function () {
14581
+ isDataFetching && reset();
14582
+ }, [isDataFetching]);
14583
+ return {
14584
+ contentRef: contentRef,
14585
+ printState: printState,
14586
+ setRenderedChart: setRenderedChart,
14587
+ handlePrintPdf: handlePrintPdf,
14588
+ reset: reset
14589
+ };
14590
+ };
14591
+
14592
+ var printStyles = {"page-break":"_35kyG","print-exact-color":"_1PFgl","avoid-break-inside":"_3rPGh"};
14593
+
14594
+ var TimeOrderChart = function TimeOrderChart(_ref) {
14595
+ var timelyOrderQuestion = _ref.timelyOrderQuestion,
14596
+ options = _ref.options,
14597
+ series = _ref.series,
14598
+ setIsRendered = _ref.setIsRendered;
14599
+ var _useTranslation = useTranslation(),
14600
+ t = _useTranslation.t;
14601
+ var chartRef = useRef(null);
14602
+ var chartOptions = _extends({}, options, {
14603
+ chart: _extends({}, options.chart, {
14604
+ animations: {
14605
+ enabled: false
14606
+ }
14607
+ })
14608
+ });
14609
+ useEffect(function () {
14610
+ if (chartRef.current) {
14611
+ setIsRendered(timelyOrderQuestion.article);
14612
+ }
14613
+ }, [timelyOrderQuestion.article]);
14614
+ return React__default.createElement("div", {
14615
+ className: "" + printStyles["avoid-break-inside"]
14616
+ }, React__default.createElement(Typography, {
14617
+ className: "pb-2",
14618
+ sx: {
14619
+ fontSize: "14px",
14620
+ fontWeight: 700,
14621
+ color: "#414E62"
14622
+ }
14623
+ }, t("article_number"), " ", timelyOrderQuestion.article), React__default.createElement("div", {
14624
+ className: "" + styles$4["compareChart"]
14625
+ }, React__default.createElement("div", {
14626
+ className: "" + styles$4["prevChart"]
14627
+ }), React__default.createElement("div", {
14628
+ className: styles$4["chart"] + " sr-line-chart"
14629
+ }, React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
14630
+ ref: chartRef,
14631
+ height: 389,
14632
+ options: chartOptions,
14633
+ series: series
14634
+ }))), React__default.createElement("div", {
14635
+ className: "" + styles$4["nextChart"]
14636
+ })));
14637
+ };
14638
+
14639
+ var textStyle = {
14640
+ fontSize: "18px",
14641
+ fontWeight: 700,
14642
+ color: styles.gray_500
14643
+ };
14644
+ var courseNameStyle = {
14645
+ fontSize: "14px",
14646
+ fontWeight: 600,
14647
+ color: styles.less_dark
14648
+ };
14649
+ var examTitleStyle = {
14650
+ fontSize: "20px",
14651
+ fontWeight: 600,
14652
+ color: styles.darker
14653
+ };
14654
+ var studentNameStyle = {
14655
+ fontSize: "24px",
14656
+ fontWeight: 600,
14657
+ color: styles.darker,
14658
+ lineHeight: 1
14659
+ };
14660
+ var PrintExamResult = function PrintExamResult(_ref) {
14661
+ var resultData = _ref.resultData,
14662
+ examTime = _ref.examTime,
14663
+ isStudent = _ref.isStudent,
14664
+ categoryResponses = _ref.categoryResponses,
14665
+ timelyOrderQuestions = _ref.timelyOrderQuestions,
14666
+ allChartOptions = _ref.allChartOptions,
14667
+ allSeries = _ref.allSeries,
14668
+ effectSize = _ref.effectSize,
14669
+ isMyStoryStudent = _ref.isMyStoryStudent,
14670
+ longTimeSpend = _ref.longTimeSpend,
14671
+ contentRef = _ref.contentRef,
14672
+ setRenderedChart = _ref.setRenderedChart;
14673
+ var academy = useSelector(function (state) {
14674
+ var _state$common;
14675
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.academy;
14676
+ });
14677
+ return React__default.createElement(Box, {
14678
+ sx: {
14679
+ minWidth: "768px",
14680
+ width: "768px",
14681
+ maxWidth: "768px!important",
14682
+ background: "#FFF",
14683
+ padding: "24px",
14684
+ overflow: "auto"
14685
+ },
14686
+ id: "canvas",
14687
+ className: printStyles["print-exact-color"] + " " + printStyles["container"],
14688
+ ref: contentRef
14689
+ }, React__default.createElement(Grid, {
14690
+ container: true,
14691
+ marginBottom: "24px"
14692
+ }, React__default.createElement(Grid, {
14693
+ item: true,
14694
+ xs: 12
14695
+ }, React__default.createElement(Stack, {
14696
+ direction: "row",
14697
+ justifyContent: "space-between",
14698
+ flexWrap: "nowrap",
14699
+ spacing: 1,
14700
+ marginBottom: "12px"
14701
+ }, React__default.createElement(Stack, {
14702
+ direction: "column"
14703
+ }, React__default.createElement(Typography, {
14704
+ sx: studentNameStyle
14705
+ }, resultData.student.fullName), React__default.createElement(Typography, {
14706
+ sx: {
14707
+ fontSize: "16px",
14708
+ fontWeight: 600,
14709
+ color: styles.gray_500
14710
+ }
14711
+ }, resultData.student.email)), academy && React__default.createElement(Typography, {
14712
+ sx: _extends({}, studentNameStyle, {
14713
+ textAlign: "end"
14714
+ })
14715
+ }, academy.name)), resultData.courseName && React__default.createElement(Stack, null, React__default.createElement(Typography, {
14716
+ sx: courseNameStyle
14717
+ }, resultData.courseName)), React__default.createElement(Box, {
14718
+ display: "flex",
14719
+ gap: "16px",
14720
+ flexDirection: "column"
14721
+ }, React__default.createElement(Stack, null, React__default.createElement(Typography, {
14722
+ sx: examTitleStyle
14723
+ }, resultData.title)), React__default.createElement(Stack, {
14724
+ flexDirection: "row",
14725
+ gap: "16px"
14726
+ }, React__default.createElement(Stack, null, React__default.createElement(Typography, {
14727
+ sx: {
14728
+ fontSize: "13px",
14729
+ fontWeight: 600,
14730
+ color: styles.gray_500
14731
+ }
14732
+ }, t$1("my_score")), React__default.createElement(Typography, {
14733
+ sx: {
14734
+ fontSize: "14px",
14735
+ fontWeight: 600,
14736
+ color: styles.darker
14737
+ }
14738
+ }, t$1("score_format", {
14739
+ score: resultData === null || resultData === void 0 ? void 0 : resultData.score
14740
+ }))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
14741
+ sx: {
14742
+ fontSize: "13px",
14743
+ fontWeight: 600,
14744
+ color: styles.gray_500
14745
+ }
14746
+ }, t$1("exam_date")), React__default.createElement(Typography, {
14747
+ sx: {
14748
+ fontSize: "14px",
14749
+ fontWeight: 600,
14750
+ color: styles.gray_700
14751
+ }
14752
+ }, utcToLocalTime(resultData === null || resultData === void 0 ? void 0 : resultData.startTime, t$1("date_format")))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
14753
+ sx: {
14754
+ fontSize: "13px",
14755
+ fontWeight: 600,
14756
+ color: styles.gray_500
14757
+ }
14758
+ }, t$1("exam_time")), React__default.createElement(Typography, {
14759
+ sx: {
14760
+ fontSize: "14px",
14761
+ fontWeight: 600,
14762
+ color: styles.gray_700
14763
+ }
14764
+ }, examTime)), React__default.createElement(Stack, null, React__default.createElement(Typography, {
14765
+ sx: {
14766
+ fontSize: "13px",
14767
+ fontWeight: 600,
14768
+ color: styles.gray_500
14769
+ }
14770
+ }, t$1("total_students")), React__default.createElement(Typography, {
14771
+ sx: {
14772
+ fontSize: "14px",
14773
+ fontWeight: 600,
14774
+ color: styles.gray_700
14775
+ }
14776
+ }, t$1("number_people", {
14777
+ number: resultData === null || resultData === void 0 ? void 0 : resultData.totalStudent
14778
+ }))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
14779
+ sx: {
14780
+ fontSize: "13px",
14781
+ fontWeight: 600,
14782
+ color: styles.gray_500
14783
+ }
14784
+ }, t$1("teacher_in_charge")), React__default.createElement(Typography, {
14785
+ sx: {
14786
+ fontSize: "14px",
14787
+ fontWeight: 600,
14788
+ color: styles.gray_700
14789
+ }
14790
+ }, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), React__default.createElement(Stack, {
14791
+ display: "flex",
14792
+ flexDirection: "column",
14793
+ gap: "12px"
14794
+ }, React__default.createElement(Typography, {
14795
+ sx: textStyle
14796
+ }, t$1(TabList[0].label)), React__default.createElement(MyAnswer, {
14797
+ data: resultData,
14798
+ categories: categoryResponses,
14799
+ isStudent: isStudent
14800
+ })), React__default.createElement(Stack, {
14801
+ display: "flex",
14802
+ flexDirection: "column",
14803
+ gap: "12px",
14804
+ marginTop: "24px"
14805
+ }, React__default.createElement(Typography, {
14806
+ sx: textStyle
14807
+ }, t$1(TabList[1].label)), timelyOrderQuestions.map(function (timelyOrderQuestion, index) {
14808
+ return React__default.createElement(TimeOrderChart, {
14809
+ key: index,
14810
+ timelyOrderQuestion: timelyOrderQuestion,
14811
+ options: allChartOptions[index],
14812
+ series: allSeries[index],
14813
+ setIsRendered: setRenderedChart
14814
+ });
14815
+ })), React__default.createElement(Stack, {
14816
+ display: "flex",
14817
+ flexDirection: "column",
14818
+ gap: "12px",
14819
+ marginTop: "24px"
14820
+ }, React__default.createElement(Typography, {
14821
+ sx: textStyle
14822
+ }, t$1(TabList[2].label)), React__default.createElement(CompareGrass, {
14823
+ effectSize: effectSize
14824
+ })), React__default.createElement(Stack, {
14825
+ display: "flex",
14826
+ flexDirection: "column",
14827
+ gap: "12px",
14828
+ marginTop: "24px"
14829
+ }, React__default.createElement(Typography, {
14830
+ sx: textStyle
14831
+ }, t$1(TabList[3].label)), React__default.createElement(TrickyProblem, {
14832
+ keyOpen: ProblemKey.TrickyProblem,
14833
+ data: resultData,
14834
+ openProblem: ProblemKey.TrickyProblem
14835
+ }), React__default.createElement(Vulnerable, {
14836
+ keyOpen: ProblemKey.Vulnerable,
14837
+ data: resultData,
14838
+ openProblem: ProblemKey.Vulnerable,
14839
+ isMyStoryStudent: isMyStoryStudent
14840
+ }), React__default.createElement(ProtractedProblem, {
14841
+ keyOpen: ProblemKey.ProtractedProblem,
14842
+ data: longTimeSpend,
14843
+ openProblem: ProblemKey.ProtractedProblem,
14844
+ isMyStoryStudent: isMyStoryStudent
14845
+ }), React__default.createElement(GradesByTerritory, {
14846
+ data: categoryResponses,
14847
+ resultData: resultData,
14848
+ openProblem: ProblemKey.GradesByTerritory,
14849
+ isMyStoryStudent: isMyStoryStudent
14850
+ })));
14851
+ };
14852
+
14919
14853
  var ExamResultV2 = function ExamResultV2(_ref) {
14920
14854
  var searchParams = _ref.searchParams,
14921
14855
  history = _ref.history,
14922
- examSessionId = _ref.examSessionId,
14923
- studentId = _ref.studentId,
14856
+ _ref$examSessionId = _ref.examSessionId,
14857
+ examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
14858
+ _ref$studentId = _ref.studentId,
14859
+ studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
14924
14860
  code = _ref.code,
14925
14861
  isMyStoryStudent = _ref.isMyStoryStudent;
14926
14862
  var _useTab = useTab(),
14927
14863
  selected = _useTab.selected,
14928
14864
  handleChangeTab = _useTab.handleChangeTab;
14929
- var _useExamResult = useExamResult(searchParams, history, examSessionId, studentId, code, handleChangeTab, selected),
14865
+ var _useExamResult = useExamResult({
14866
+ searchParams: searchParams,
14867
+ history: history,
14868
+ examSessionId: examSessionId,
14869
+ studentId: studentId,
14870
+ code: code,
14871
+ handleChangeTab: handleChangeTab,
14872
+ selectedTab: selected
14873
+ }),
14930
14874
  isLoading = _useExamResult.isLoading,
14931
14875
  examTime = _useExamResult.examTime,
14932
14876
  series = _useExamResult.series,
14933
14877
  allSeries = _useExamResult.allSeries,
14934
- chartOptions = _useExamResult.chartOptions,
14935
14878
  allChartOptions = _useExamResult.allChartOptions,
14879
+ chartOptions = _useExamResult.chartOptions,
14936
14880
  dataChartIndex = _useExamResult.dataChartIndex,
14937
14881
  timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
14938
14882
  isStudent = _useExamResult.isStudent,
@@ -14941,7 +14885,6 @@ var ExamResultV2 = function ExamResultV2(_ref) {
14941
14885
  longTimeSpend = _useExamResult.longTimeSpend,
14942
14886
  effectSize = _useExamResult.effectSize,
14943
14887
  categoryResponses = _useExamResult.categoryResponses,
14944
- handleExportPdf = _useExamResult.handleExportPdf,
14945
14888
  setOpenProblem = _useExamResult.setOpenProblem,
14946
14889
  handlePrevChart = _useExamResult.handlePrevChart,
14947
14890
  handleNextChart = _useExamResult.handleNextChart;
@@ -14951,9 +14894,15 @@ var ExamResultV2 = function ExamResultV2(_ref) {
14951
14894
  handleCreateQuestion = _useCreateQuestionDia.handleCreateQuestion,
14952
14895
  openCreateQuestionDialog = _useCreateQuestionDia.openCreateQuestionDialog,
14953
14896
  toggleCreateQuestion = _useCreateQuestionDia.toggleCreateQuestion;
14897
+ var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
14898
+ var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length),
14899
+ contentRef = _usePrintExamResult.contentRef,
14900
+ printState = _usePrintExamResult.printState,
14901
+ handlePrintPdf = _usePrintExamResult.handlePrintPdf,
14902
+ setRenderedChart = _usePrintExamResult.setRenderedChart;
14954
14903
  var isTabletUp = useMediaQuery('(min-width:900px)');
14955
14904
  return React__default.createElement(Fragment$1, null, React__default.createElement(LoadingComponent, {
14956
- isLoading: isLoading
14905
+ isLoading: !!isLoading
14957
14906
  }), timelyOrderQuestions[dataChartIndex] && longTimeSpend && resultData && effectSize ? React__default.createElement("div", {
14958
14907
  style: {
14959
14908
  width: "100%"
@@ -15069,7 +15018,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15069
15018
  className: styles$4["pdfBtnBox"]
15070
15019
  }, React__default.createElement("button", {
15071
15020
  className: styles$4["pdfBtn"] + " " + styles["truncate"],
15072
- onClick: handleExportPdf
15021
+ onClick: handlePrintPdf
15073
15022
  }, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print_all"))))))), React__default.createElement(Grid, {
15074
15023
  item: true,
15075
15024
  xs: 12
@@ -15115,7 +15064,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15115
15064
  className: styles$4["pdfBtnBox"]
15116
15065
  }, React__default.createElement("button", {
15117
15066
  className: styles$4["pdfBtn"] + " " + styles["truncate"],
15118
- onClick: handleExportPdf
15067
+ onClick: handlePrintPdf
15119
15068
  }, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print"))))))), React__default.createElement(Grid, {
15120
15069
  item: true,
15121
15070
  xs: 12
@@ -15152,240 +15101,54 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15152
15101
  value: selected,
15153
15102
  index: 3
15154
15103
  }, React__default.createElement(TrickyProblem, {
15155
- keyOpen: "TrickyProblem",
15104
+ keyOpen: ProblemKey.TrickyProblem,
15156
15105
  data: resultData,
15157
15106
  openProblem: openProblem,
15158
15107
  changeOpen: setOpenProblem
15159
15108
  }), React__default.createElement(Vulnerable, {
15160
- keyOpen: "Vulnerable",
15109
+ keyOpen: ProblemKey.Vulnerable,
15161
15110
  data: resultData,
15162
15111
  openProblem: openProblem,
15163
15112
  changeOpen: setOpenProblem,
15164
15113
  isMyStoryStudent: isMyStoryStudent
15165
15114
  }), React__default.createElement(ProtractedProblem, {
15166
- keyOpen: "ProtractedProblem",
15115
+ keyOpen: ProblemKey.ProtractedProblem,
15167
15116
  data: longTimeSpend,
15168
15117
  openProblem: openProblem,
15169
15118
  changeOpen: setOpenProblem,
15170
15119
  isMyStoryStudent: isMyStoryStudent
15171
15120
  }), React__default.createElement(GradesByTerritory, {
15172
- keyOpen: "GradesByTerritory",
15173
15121
  data: categoryResponses,
15174
15122
  resultData: resultData,
15175
15123
  openProblem: openProblem,
15176
15124
  isMyStoryStudent: isMyStoryStudent,
15177
15125
  changeOpen: setOpenProblem
15178
- }))), React__default.createElement(Grid, {
15179
- item: true,
15180
- xs: 12,
15181
- className: "position-absolute",
15182
- sx: {
15183
- zIndex: -1,
15184
- width: "1024px"
15185
- },
15186
- id: "canvas"
15187
- }, React__default.createElement(Grid, {
15188
- container: true,
15189
- padding: "24px",
15190
- id: "header-canvas"
15191
- }, React__default.createElement(Grid, {
15192
- item: true
15193
- }, resultData.courseName && React__default.createElement(Stack, null, React__default.createElement(Typography, {
15194
- sx: {
15195
- fontSize: "14px",
15196
- fontWeight: 600,
15197
- color: styles.less_dark
15198
- }
15199
- }, resultData.courseName)), React__default.createElement(Box, {
15200
- display: "flex",
15201
- gap: "16px",
15202
- flexDirection: "column"
15203
- }, React__default.createElement(Stack, null, React__default.createElement(Typography, {
15204
- sx: {
15205
- fontSize: "20px",
15206
- fontWeight: 600,
15207
- color: styles.darker
15208
- }
15209
- }, resultData.title)), React__default.createElement(Stack, {
15210
- flexDirection: "row",
15211
- gap: "16px"
15212
- }, React__default.createElement(Stack, null, React__default.createElement(Typography, {
15213
- sx: {
15214
- fontSize: "13px",
15215
- fontWeight: 600,
15216
- color: styles.gray_500
15217
- }
15218
- }, t("my_score")), React__default.createElement(Typography, {
15219
- sx: {
15220
- fontSize: "14px",
15221
- fontWeight: 600,
15222
- color: styles.darker
15223
- }
15224
- }, t("score_format", {
15225
- score: resultData === null || resultData === void 0 ? void 0 : resultData.score
15226
- }))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
15227
- sx: {
15228
- fontSize: "13px",
15229
- fontWeight: 600,
15230
- color: styles.gray_500
15231
- }
15232
- }, t("exam_date")), React__default.createElement(Typography, {
15233
- sx: {
15234
- fontSize: "14px",
15235
- fontWeight: 600,
15236
- color: styles.gray_700
15237
- }
15238
- }, utcToLocalTime(resultData === null || resultData === void 0 ? void 0 : resultData.startTime, t("date_format")))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
15239
- sx: {
15240
- fontSize: "13px",
15241
- fontWeight: 600,
15242
- color: styles.gray_500
15243
- }
15244
- }, t("exam_time")), React__default.createElement(Typography, {
15245
- sx: {
15246
- fontSize: "14px",
15247
- fontWeight: 600,
15248
- color: styles.gray_700
15249
- }
15250
- }, examTime)), React__default.createElement(Stack, null, React__default.createElement(Typography, {
15251
- sx: {
15252
- fontSize: "13px",
15253
- fontWeight: 600,
15254
- color: styles.gray_500
15255
- }
15256
- }, t("total_students")), React__default.createElement(Typography, {
15257
- sx: {
15258
- fontSize: "14px",
15259
- fontWeight: 600,
15260
- color: styles.gray_700
15261
- }
15262
- }, t("number_people", {
15263
- number: resultData === null || resultData === void 0 ? void 0 : resultData.totalStudent
15264
- }))), React__default.createElement(Stack, null, React__default.createElement(Typography, {
15265
- sx: {
15266
- fontSize: "13px",
15267
- fontWeight: 600,
15268
- color: styles.gray_500
15269
- }
15270
- }, t("teacher_in_charge")), React__default.createElement(Typography, {
15271
- sx: {
15272
- fontSize: "14px",
15273
- fontWeight: 600,
15274
- color: styles.gray_700
15275
- }
15276
- }, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), React__default.createElement(Stack, {
15277
- display: "flex",
15278
- flexDirection: "column",
15279
- gap: "12px"
15280
- }, React__default.createElement(Typography, {
15281
- className: "chart-title",
15282
- sx: {
15283
- fontSize: "18px",
15284
- fontWeight: 700,
15285
- color: styles.gray_500
15286
- }
15287
- }, t(TabList[0].label)), React__default.createElement(MyAnswer, {
15288
- data: resultData,
15289
- categories: categoryResponses,
15290
- isStudent: isStudent,
15291
- isPrint: true
15292
- })), React__default.createElement(Stack, {
15293
- display: "flex",
15294
- flexDirection: "column",
15295
- gap: "12px",
15296
- marginTop: "24px"
15297
- }, React__default.createElement(Typography, {
15298
- className: "chart-title",
15299
- sx: {
15300
- fontSize: "18px",
15301
- fontWeight: 700,
15302
- color: styles.gray_500
15303
- }
15304
- }, t(TabList[1].label)), timelyOrderQuestions.map(function (timelyOrderQuestion, index) {
15305
- return React__default.createElement("div", {
15306
- key: index,
15307
- className: PrintContainerClassName
15308
- }, React__default.createElement(Typography, {
15309
- className: "pb-2 " + PrintHeaderClassName,
15310
- sx: {
15311
- fontSize: "14px",
15312
- fontWeight: 700,
15313
- color: "#414E62"
15314
- }
15315
- }, t("article_number"), " ", timelyOrderQuestion.article), React__default.createElement("div", {
15316
- className: styles$4["compareChart"] + " " + PrintContentClassName
15317
- }, React__default.createElement("div", {
15318
- className: "" + styles$4["prevChart"]
15319
- }), React__default.createElement("div", {
15320
- className: styles$4["chart"] + " sr-line-chart"
15321
- }, React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
15322
- height: 389,
15323
- options: allChartOptions[index],
15324
- series: allSeries[index]
15325
- }))), React__default.createElement("div", {
15326
- className: "" + styles$4["nextChart"]
15327
- })));
15328
- })), React__default.createElement(Stack, {
15329
- display: "flex",
15330
- flexDirection: "column",
15331
- gap: "12px",
15332
- marginTop: "24px"
15333
- }, React__default.createElement(Typography, {
15334
- className: "chart-title",
15335
- sx: {
15336
- fontSize: "18px",
15337
- fontWeight: 700,
15338
- color: styles.gray_500
15339
- }
15340
- }, t(TabList[2].label)), React__default.createElement(CompareGrass, {
15341
- effectSize: effectSize,
15342
- isPrint: true
15343
- })), React__default.createElement(Stack, {
15344
- display: "flex",
15345
- flexDirection: "column",
15346
- gap: "12px",
15347
- marginTop: "24px"
15348
- }, React__default.createElement(Typography, {
15349
- className: "chart-title",
15350
- sx: {
15351
- fontSize: "18px",
15352
- fontWeight: 700,
15353
- color: styles.gray_500
15354
- }
15355
- }, t(TabList[3].label)), React__default.createElement(TrickyProblem, {
15356
- keyOpen: "TrickyProblem",
15357
- data: resultData,
15358
- openProblem: "TrickyProblem",
15359
- changeOpen: setOpenProblem,
15360
- isPrint: true
15361
- }), React__default.createElement(Vulnerable, {
15362
- keyOpen: "Vulnerable",
15363
- data: resultData,
15364
- openProblem: "Vulnerable",
15365
- changeOpen: setOpenProblem,
15366
- isMyStoryStudent: isMyStoryStudent,
15367
- isPrint: true
15368
- }), React__default.createElement(ProtractedProblem, {
15369
- keyOpen: "ProtractedProblem",
15370
- data: longTimeSpend,
15371
- openProblem: "ProtractedProblem",
15372
- changeOpen: setOpenProblem,
15373
- isPrint: true,
15374
- isMyStoryStudent: isMyStoryStudent
15375
- }), React__default.createElement(GradesByTerritory, {
15376
- keyOpen: "GradesByTerritory",
15377
- data: categoryResponses,
15378
- resultData: resultData,
15379
- openProblem: "GradesByTerritory",
15380
- changeOpen: setOpenProblem,
15381
- isPrint: true,
15382
- isMyStoryStudent: isMyStoryStudent
15383
15126
  })))), React__default.createElement(CreateNewQuestionDialog$1, {
15384
15127
  examSessionId: resultData === null || resultData === void 0 ? void 0 : resultData.examSessionId,
15385
15128
  handleCreateQuestion: handleCreateQuestion,
15386
15129
  openCreateQuestionDialog: openCreateQuestionDialog,
15387
15130
  toggleCreateQuestion: toggleCreateQuestion
15388
- })) : React__default.createElement(Fragment$1, null));
15131
+ }), isLoading === false && React__default.createElement(Box, {
15132
+ width: 0,
15133
+ height: 0,
15134
+ overflow: "hidden"
15135
+ }, React__default.createElement(PrintExamResult, {
15136
+ contentRef: contentRef,
15137
+ allChartOptions: allChartOptions,
15138
+ allSeries: allSeries,
15139
+ categoryResponses: categoryResponses,
15140
+ effectSize: effectSize,
15141
+ examTime: examTime,
15142
+ isStudent: isStudent,
15143
+ longTimeSpend: longTimeSpend,
15144
+ resultData: resultData,
15145
+ timelyOrderQuestions: timelyOrderQuestions,
15146
+ isMyStoryStudent: isMyStoryStudent,
15147
+ fileName: fileName,
15148
+ setRenderedChart: setRenderedChart
15149
+ }))) : React__default.createElement(Fragment$1, null), React__default.createElement(LoadingComponent, {
15150
+ isLoading: printState === PrintState.Pending || printState === PrintState.Printing
15151
+ }));
15389
15152
  };
15390
15153
 
15391
15154
  var RecentUserActionSortBy;
@@ -16664,5 +16427,135 @@ var useVirtualizeList = function useVirtualizeList(totalItems, rowHeight, offset
16664
16427
  };
16665
16428
  };
16666
16429
 
16667
- export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AnswerCountSelector, ArticleCategorySelector, ArticleGroupView, BASE_URL, ChatContainer, ChatItemType, types as ChatTypes, CommonDialog, ConfirmDialog, index$1 as CoreHooks, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_PAGING_RESPONSE, DefaultErrorMessage, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, index as Enums, ExamDetailView, ExamEvent, ExamResultV2, Header, InputText, LANGUAGES, Language, LayoutContext, Loading, LoadingComponent, Login, SignIn as LoginWithPassword, NotFound, PUSHER_CONFIG, PassCodeCheck, QuestionCountSelector, RecentUserAction, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SubjectSelector, index$2 as Textbook, TextbookViewDetail as TextbookDetail, TextbookList, TheAcademyDropdown, TheLanguageDropdown, index$3 as Types, api, apiUpload, canAccess as canAccessRoute, checkSuperUrl, createRecentUserActionListApi, diffFromNow, formatTime, getAcademyDomain, getAccessToken, getErrorMessage, getOrdinalSuffix, getRecentUserActionListApi, i18n, minutesToTimeSpan, setAlert, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, times as timeUtils, toISOString, useAutoAcademyDomain, useCategorySelect, useChatContainer, useCountDownTimer, useGoogleSignOut, useLanguage, useLoadMore, useLogin, usePusherConversation, useSubjectSelect, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
16430
+ var usePrintView = function usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage) {
16431
+ var _useState = useState(false),
16432
+ isDone = _useState[0],
16433
+ setDone = _useState[1];
16434
+ var handelPrintSuccess = function handelPrintSuccess() {
16435
+ var _window$opener$postMe, _window$opener;
16436
+ var data = {
16437
+ examSessionId: examSessionId,
16438
+ studentId: studentId,
16439
+ succeed: true
16440
+ };
16441
+ if (window.opener && !window.opener.closed) (_window$opener$postMe = (_window$opener = window.opener).postMessage) === null || _window$opener$postMe === void 0 ? void 0 : _window$opener$postMe.call(_window$opener, data, window.location.origin);
16442
+ setDone(true);
16443
+ };
16444
+ var handelPrintError = function handelPrintError(errorMessage) {
16445
+ var _window$opener$postMe2, _window$opener2;
16446
+ var data = {
16447
+ examSessionId: examSessionId,
16448
+ studentId: studentId,
16449
+ succeed: false,
16450
+ errorMessage: errorMessage
16451
+ };
16452
+ if (window.opener && !window.opener.closed) (_window$opener$postMe2 = (_window$opener2 = window.opener).postMessage) === null || _window$opener$postMe2 === void 0 ? void 0 : _window$opener$postMe2.call(_window$opener2, data, window.location.origin);
16453
+ setDone(true);
16454
+ };
16455
+ var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
16456
+ useEffect(function () {
16457
+ setNotFound === null || setNotFound === void 0 ? void 0 : setNotFound(isLoading === false && !!errorMessage);
16458
+ if (isLoading === false && !!errorMessage) handelPrintError(errorMessage);
16459
+ }, [isLoading, errorMessage]);
16460
+ return {
16461
+ fileName: fileName,
16462
+ isDone: isDone,
16463
+ handelPrintSuccess: handelPrintSuccess,
16464
+ handelPrintError: handelPrintError
16465
+ };
16466
+ };
16467
+
16468
+ var LoadingDots = function LoadingDots(_ref) {
16469
+ var text = _ref.text;
16470
+ return React__default.createElement(Stack, {
16471
+ className: "mt-3",
16472
+ direction: "row",
16473
+ spacing: 0.5
16474
+ }, React__default.createElement(Typography, {
16475
+ color: "#FFF",
16476
+ fontSize: 20
16477
+ }, text), React__default.createElement("div", {
16478
+ className: styles$4["loader"]
16479
+ }, React__default.createElement("div", {
16480
+ className: styles$4["dot"]
16481
+ }), React__default.createElement("div", {
16482
+ className: styles$4["dot"]
16483
+ }), React__default.createElement("div", {
16484
+ className: styles$4["dot"]
16485
+ })));
16486
+ };
16487
+
16488
+ var PrintExamResultView = function PrintExamResultView(_ref) {
16489
+ var isMyStoryStudent = _ref.isMyStoryStudent,
16490
+ _ref$searchParams = _ref.searchParams,
16491
+ searchParams = _ref$searchParams === void 0 ? "" : _ref$searchParams,
16492
+ history = _ref.history,
16493
+ _ref$examSessionId = _ref.examSessionId,
16494
+ examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
16495
+ _ref$studentId = _ref.studentId,
16496
+ studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
16497
+ code = _ref.code,
16498
+ setNotFound = _ref.setNotFound;
16499
+ var _useExamResult = useExamResult({
16500
+ searchParams: searchParams,
16501
+ history: history,
16502
+ examSessionId: examSessionId,
16503
+ studentId: studentId,
16504
+ code: code,
16505
+ isPrint: true
16506
+ }),
16507
+ isLoading = _useExamResult.isLoading,
16508
+ examTime = _useExamResult.examTime,
16509
+ allSeries = _useExamResult.allSeries,
16510
+ allChartOptions = _useExamResult.allChartOptions,
16511
+ timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
16512
+ isStudent = _useExamResult.isStudent,
16513
+ resultData = _useExamResult.resultData,
16514
+ longTimeSpend = _useExamResult.longTimeSpend,
16515
+ effectSize = _useExamResult.effectSize,
16516
+ categoryResponses = _useExamResult.categoryResponses,
16517
+ errorMessage = _useExamResult.errorMessage;
16518
+ var _usePrintView = usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage),
16519
+ fileName = _usePrintView.fileName,
16520
+ isDone = _usePrintView.isDone,
16521
+ handelPrintSuccess = _usePrintView.handelPrintSuccess,
16522
+ handelPrintError = _usePrintView.handelPrintError;
16523
+ var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length, handelPrintSuccess, handelPrintError, true),
16524
+ contentRef = _usePrintExamResult.contentRef,
16525
+ setRenderedChart = _usePrintExamResult.setRenderedChart;
16526
+ var isTabletUp = useMediaQuery("(min-width:900px)");
16527
+ return React__default.createElement(Box, {
16528
+ sx: {
16529
+ display: "flex",
16530
+ justifyContent: "center"
16531
+ },
16532
+ displayPrint: "block"
16533
+ }, isLoading === false && resultData && effectSize ? React__default.createElement(PrintExamResult, {
16534
+ contentRef: contentRef,
16535
+ allChartOptions: allChartOptions,
16536
+ allSeries: allSeries,
16537
+ categoryResponses: categoryResponses,
16538
+ effectSize: effectSize,
16539
+ examTime: examTime,
16540
+ isStudent: isStudent,
16541
+ longTimeSpend: longTimeSpend,
16542
+ resultData: resultData,
16543
+ timelyOrderQuestions: timelyOrderQuestions,
16544
+ isMyStoryStudent: isMyStoryStudent,
16545
+ fileName: fileName,
16546
+ setRenderedChart: setRenderedChart
16547
+ }) : isLoading === undefined || isLoading === true ? React__default.createElement(LoadingComponent, {
16548
+ isLoading: !!isLoading,
16549
+ spinClassName: "text-white"
16550
+ }, isTabletUp && React__default.createElement(LoadingDots, {
16551
+ text: "Loading data"
16552
+ })) : React__default.createElement(NotFound, null), React__default.createElement(LoadingComponent, {
16553
+ isLoading: isDone !== true && isLoading === false && !!resultData,
16554
+ spinClassName: "text-white"
16555
+ }, isTabletUp && React__default.createElement(LoadingDots, {
16556
+ text: "Please wait for a while! Printing"
16557
+ })));
16558
+ };
16559
+
16560
+ export { ACADEMY_DOMAIN, ACCESS_TOKEN, AcademyHeaders, AcademyList, AnswerCountSelector, ArticleCategorySelector, ArticleGroupView, BASE_URL, ChatContainer, ChatItemType, types as ChatTypes, CommonDialog, ConfirmDialog, index$1 as CoreHooks, CustomAsyncSelect, CustomCreatable, CustomPagination, CustomSelect, CustomSelectOption, DATE_MIN_VALUE, DATE_TIME_MIN_VALUE, DEFAULT_PAGING_RESPONSE, DefaultErrorMessage, EXAM_CHANNEL, EXAM_STUDENT_CHANNEL, index as Enums, ExamDetailView, ExamEvent, ExamResultV2, Header, InputText, LANGUAGES, Language, LayoutContext, Loading, LoadingComponent, Login, SignIn as LoginWithPassword, NotFound, PUSHER_CONFIG, PassCodeCheck, PrintExamResultView, QuestionCountSelector, RecentUserAction, Role, SUPER_ADMIN_BASE_URL, ScoreSelector, SubjectSelector, index$2 as Textbook, TextbookViewDetail as TextbookDetail, TextbookList, TheAcademyDropdown, TheLanguageDropdown, index$3 as Types, api, apiUpload, canAccess as canAccessRoute, checkSuperUrl, createRecentUserActionListApi, diffFromNow, formatTime, getAcademyDomain, getAccessToken, getErrorMessage, getOrdinalSuffix, getRecentUserActionListApi, i18n, minutesToTimeSpan, setAlert, setLanguage, setLoading, setReFetchUserAcademies, setReadyRegisterPusher, setUser, store, times as timeUtils, toISOString, useAutoAcademyDomain, useCategorySelect, useChatContainer, useCountDownTimer, useGoogleSignOut, useLanguage, useLoadMore, useLogin, usePusherConversation, useSubjectSelect, useSwitchAcademy, useVirtualizeList, utcToLocalTime };
16668
16561
  //# sourceMappingURL=index.modern.js.map