touchstudy-core 0.1.73 → 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 +811 -923
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.modern.js +808 -922
  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
package/dist/index.js CHANGED
@@ -17,7 +17,8 @@ require('moment/locale/ko.js');
17
17
  require('moment/locale/en-au.js');
18
18
  var Pusher = _interopDefault(require('pusher-js'));
19
19
  var io5 = require('react-icons/io5');
20
- var i18n = _interopDefault(require('i18next'));
20
+ var i18n = require('i18next');
21
+ var i18n__default = _interopDefault(i18n);
21
22
  var Box = _interopDefault(require('@mui/material/Box'));
22
23
  var Popover = _interopDefault(require('@mui/material/Popover'));
23
24
  var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
@@ -32,13 +33,12 @@ var io = require('react-icons/io');
32
33
  var _ = _interopDefault(require('lodash'));
33
34
  var fa6 = require('react-icons/fa6');
34
35
  var CreatableSelect = _interopDefault(require('react-select/creatable'));
35
- var html2canvas = _interopDefault(require('html2canvas'));
36
- var jspdf = require('jspdf');
37
36
  var Button = _interopDefault(require('@mui/material/Button'));
38
37
  var DialogTitle = _interopDefault(require('@mui/material/DialogTitle'));
39
38
  var DialogContent = _interopDefault(require('@mui/material/DialogContent'));
40
39
  var DialogActions = _interopDefault(require('@mui/material/DialogActions'));
41
40
  var Typography = _interopDefault(require('@mui/material/Typography'));
41
+ var html2pdf = _interopDefault(require('html2pdf.js'));
42
42
  var Avatar = _interopDefault(require('@mui/material/Avatar'));
43
43
  var TextField = _interopDefault(require('@mui/material/TextField'));
44
44
  var Paper = _interopDefault(require('@mui/material/Paper'));
@@ -123,10 +123,6 @@ var RecentUserAction = {
123
123
  AddedStudentToClass: "added_student_to_class",
124
124
  RemovedStudentFromClass: "removed_student_from_class"
125
125
  };
126
- var PrintHeaderClassName = "print-header";
127
- var PrintTitleClassName = "print-title";
128
- var PrintContentClassName = "print-content";
129
- var PrintContainerClassName = "print-container";
130
126
 
131
127
  var utcToLocalTime = (function (time, FORMAT) {
132
128
  if (time === DATE_MIN_VALUE || time === DATE_TIME_MIN_VALUE) return "";
@@ -176,194 +172,11 @@ function _taggedTemplateLiteralLoose(strings, raw) {
176
172
  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
173
 
178
174
  // 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
175
 
276
176
  const _iteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator"))) : "@@iterator";
277
177
 
278
178
  const _asyncIteratorSymbol = /*#__PURE__*/ typeof Symbol !== "undefined" ? (Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator"))) : "@@asyncIterator";
279
179
 
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
180
  // Asynchronously call a function and send errors to recovery continuation
368
181
  function _catch(body, recover) {
369
182
  try {
@@ -1498,8 +1311,11 @@ var switchSuperAdminAcademy = function switchSuperAdminAcademy(academyId, role)
1498
1311
  return api.post(SUPER_ADMIN_ACADEMY_URL + "/" + academyId + "/switch-academy/" + role);
1499
1312
  };
1500
1313
 
1501
- var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
1314
+ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy) {
1502
1315
  var _currentPusher$connec2;
1316
+ if (showLoadingAcademy === void 0) {
1317
+ showLoadingAcademy = true;
1318
+ }
1503
1319
  var _useGoogleSignOut = useGoogleSignOut({}),
1504
1320
  handleSignOut = _useGoogleSignOut.handleSignOut;
1505
1321
  var _useTranslation = reactI18next.useTranslation(),
@@ -1528,10 +1344,10 @@ var useLayoutContext = function useLayoutContext(role, pusherRegisterUrls) {
1528
1344
  var handleGetAcademyDetail = function handleGetAcademyDetail() {
1529
1345
  try {
1530
1346
  var _temp2 = function _temp2() {
1531
- dispatch(setLoading(false));
1347
+ showLoadingAcademy && dispatch(setLoading(false));
1532
1348
  };
1533
1349
  if (!academyDomain) return Promise.resolve();
1534
- dispatch(setLoading(true));
1350
+ showLoadingAcademy && dispatch(setLoading(true));
1535
1351
  var _temp = _catch(function () {
1536
1352
  return Promise.resolve(getAcademyDetail()).then(function (info) {
1537
1353
  if (info) {
@@ -1669,27 +1485,38 @@ var loadingStyle$1 = {
1669
1485
  alignItems: "center"
1670
1486
  };
1671
1487
  var LoadingComponent = function LoadingComponent(_ref) {
1672
- 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;
1673
1494
  return isLoading ? React__default.createElement("div", {
1674
1495
  style: loadingStyle$1
1496
+ }, React__default.createElement(material.Stack, {
1497
+ direction: "column",
1498
+ justifyContent: "center",
1499
+ alignItems: "center",
1500
+ className: className
1675
1501
  }, React__default.createElement("div", {
1676
- className: "spinner-border text-secondary",
1502
+ className: "spinner-border " + spinClassName,
1677
1503
  role: "status"
1678
1504
  }, React__default.createElement("span", {
1679
1505
  className: "sr-only"
1680
- }))) : null;
1506
+ })), React__default.createElement("div", null, children))) : null;
1681
1507
  };
1682
1508
 
1683
1509
  var LayoutContext = function LayoutContext(_ref) {
1684
1510
  var children = _ref.children,
1685
1511
  role = _ref.role,
1686
1512
  _ref$pusherRegisterUr = _ref.pusherRegisterUrls,
1687
- pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr;
1513
+ pusherRegisterUrls = _ref$pusherRegisterUr === void 0 ? [] : _ref$pusherRegisterUr,
1514
+ showLoadingAcademy = _ref.showLoadingAcademy;
1688
1515
  var user = reactRedux.useSelector(function (state) {
1689
1516
  var _state$common;
1690
1517
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
1691
1518
  });
1692
- useLayoutContext(role, pusherRegisterUrls);
1519
+ useLayoutContext(role, pusherRegisterUrls, showLoadingAcademy);
1693
1520
  if (!(user !== null && user !== void 0 && user.email)) return React__default.createElement(LoadingComponent, {
1694
1521
  isLoading: true
1695
1522
  });else return React__default.createElement(React.Fragment, null, children);
@@ -1884,7 +1711,9 @@ var getSubjectListApi = function getSubjectListApi() {
1884
1711
  }
1885
1712
  };
1886
1713
 
1887
- var useSubjectSelect = function useSubjectSelect() {
1714
+ var useSubjectSelect = function useSubjectSelect(_ref) {
1715
+ var onChangeExam = _ref.onChangeExam,
1716
+ exam = _ref.exam;
1888
1717
  var firstLoad = true;
1889
1718
  var dispatch = reactRedux.useDispatch();
1890
1719
  var _useState = React.useState(),
@@ -1942,18 +1771,15 @@ var useSubjectSelect = function useSubjectSelect() {
1942
1771
  var selectedSubject = subjectList === null || subjectList === void 0 ? void 0 : subjectList.find(function (subject) {
1943
1772
  return subject.id === id;
1944
1773
  });
1945
- setSelectedSubject(selectedSubject);
1946
- };
1947
- var handleChangeSelectedSubject = function handleChangeSelectedSubject(subject) {
1948
- if (!subject) return;
1949
- setSelectedSubject(subject);
1774
+ onChangeExam(_extends({}, exam, {
1775
+ subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
1776
+ }));
1950
1777
  };
1951
1778
  return {
1952
1779
  subjectOptions: subjectOptions,
1953
1780
  selectedSubject: selectedSubject,
1954
1781
  subjectList: subjectList,
1955
- handleChangeSubject: handleChangeSubject,
1956
- handleChangeSelectedSubject: handleChangeSelectedSubject
1782
+ handleChangeSubject: handleChangeSubject
1957
1783
  };
1958
1784
  };
1959
1785
 
@@ -2602,7 +2428,7 @@ var exam = "시험";
2602
2428
  var me = "나";
2603
2429
  var teacher_name = "선생님 성함";
2604
2430
  var class_schedule = "수업 시간표";
2605
- var summary = "요약";
2431
+ var summary = "전체 현황";
2606
2432
  var load_exam = "시험 로드";
2607
2433
  var exam_name = "시험 이름";
2608
2434
  var student_phone_number_header = "학생 전화번호";
@@ -2628,6 +2454,13 @@ var total_users = "총 사용자";
2628
2454
  var added_date = "추가된 날짜";
2629
2455
  var sync_exam_results = "시험 결과 동기화";
2630
2456
  var update_data_fail = "데이터 업데이트 실패";
2457
+ var add_students_to_class = "수업에 학생 추가";
2458
+ var click_to_choose_file = "파일을 선택하려면 클릭하세요.";
2459
+ var exam_data = "시험 데이터";
2460
+ var questions_correct_rate = "질문 정답률";
2461
+ var question_management = "질문 관리";
2462
+ var student_data = "학생 데이터";
2463
+ var problem_number_question_chart = "문제 {{number}}번";
2631
2464
  var are_you_sure_to_sync_exam_results_to_academy = "시험 결과를 아카데미 {{ academyName }}에 동기화하시겠습니까(백그라운드에서 실행되며 시간이 다소 소요됨)";
2632
2465
  var messages = {
2633
2466
  exam_sessions_are_being_synchronized: "{{ total }} 개의 시험 세션이 동기화되고 있습니다"
@@ -3371,6 +3204,13 @@ var lang_ko = {
3371
3204
  added_date: added_date,
3372
3205
  sync_exam_results: sync_exam_results,
3373
3206
  update_data_fail: update_data_fail,
3207
+ add_students_to_class: add_students_to_class,
3208
+ click_to_choose_file: click_to_choose_file,
3209
+ exam_data: exam_data,
3210
+ questions_correct_rate: questions_correct_rate,
3211
+ question_management: question_management,
3212
+ student_data: student_data,
3213
+ problem_number_question_chart: problem_number_question_chart,
3374
3214
  are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy,
3375
3215
  messages: messages,
3376
3216
  submit: submit,
@@ -3507,8 +3347,8 @@ var number_answer$1 = "No.{{number}}";
3507
3347
  var answer_no$1 = "Ans.{{number}}";
3508
3348
  var answer_rate$1 = "Answer rate";
3509
3349
  var seconds$1 = "s";
3510
- var search_placeholder$1 = "Search by exam name";
3511
- var search_by_student$1 = "Search by student name";
3350
+ var search_placeholder$1 = "Search by Exam Name";
3351
+ var search_by_student$1 = "Search by Student Name";
3512
3352
  var study_touch$1 = "Study touch";
3513
3353
  var exam_information$1 = "Exam information";
3514
3354
  var issue_number$1 = "Issue number";
@@ -3584,8 +3424,8 @@ var update_exam$1 = "Update exam";
3584
3424
  var create_exam$1 = "Create exam";
3585
3425
  var back$1 = "Back";
3586
3426
  var date_format_exam$1 = "MMMM YYYY";
3587
- var date_format$1 = "MMM.D YYYY";
3588
- var date_time_format$1 = "HH:mm MMM.D YYYY ";
3427
+ var date_format$1 = "MMM. D. YYYY";
3428
+ var date_time_format$1 = "HH:mm MMM. D YYYY ";
3589
3429
  var date_time_format_12h$1 = "MM-DD-YYYY HH:mm A";
3590
3430
  var full_date_time_format$1 = "MMM Do YYYY HH:mm:ss";
3591
3431
  var total_questions$1 = "Total questions";
@@ -3658,8 +3498,9 @@ var problem_number_question$1 = "Question {{number}}";
3658
3498
  var teacher_in_charge$1 = "Teacher In Charge";
3659
3499
  var counselor$1 = "Counselor";
3660
3500
  var new_question$1 = "New Question";
3661
- var hour$1 = "hour";
3662
- var minute$1 = "minutes";
3501
+ var hour$1 = "hr";
3502
+ var hours = "hrs";
3503
+ var minute$1 = "min";
3663
3504
  var second$1 = "second";
3664
3505
  var question_order$1 = "Number {{number}}";
3665
3506
  var send_message$1 = "Send Message";
@@ -3688,7 +3529,7 @@ var check_attendance$1 = "Check attendance";
3688
3529
  var attendance_check$1 = "Attendance check";
3689
3530
  var class_date$1 = "Class date";
3690
3531
  var class_time$1 = "Class time";
3691
- var attendance$1 = "Attendance";
3532
+ var attendance$1 = "Attendance List";
3692
3533
  var attendance_completed$1 = "Attendance completed";
3693
3534
  var none_attendance$1 = "Non-attendance";
3694
3535
  var academy_list$1 = "Academy list";
@@ -4118,6 +3959,13 @@ var total_users$1 = "Total users";
4118
3959
  var added_date$1 = "Added date";
4119
3960
  var sync_exam_results$1 = "Sync exam results";
4120
3961
  var update_data_fail$1 = "Update data fail";
3962
+ var add_students_to_class$1 = "Add students to class";
3963
+ var click_to_choose_file$1 = "Click to choose file";
3964
+ var exam_data$1 = "Exam Data";
3965
+ var questions_correct_rate$1 = "Questions Correct Rate";
3966
+ var question_management$1 = "Question Management";
3967
+ var student_data$1 = "Student Data";
3968
+ var problem_number_question_chart$1 = "Q. {{number}}";
4121
3969
  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)";
4122
3970
  var messages$1 = {
4123
3971
  exam_sessions_are_being_synchronized: "{{ total }} exam sessions are being synchronized"
@@ -4406,6 +4254,7 @@ var lang_en = {
4406
4254
  counselor: counselor$1,
4407
4255
  new_question: new_question$1,
4408
4256
  hour: hour$1,
4257
+ hours: hours,
4409
4258
  minute: minute$1,
4410
4259
  second: second$1,
4411
4260
  question_order: question_order$1,
@@ -4860,6 +4709,13 @@ var lang_en = {
4860
4709
  added_date: added_date$1,
4861
4710
  sync_exam_results: sync_exam_results$1,
4862
4711
  update_data_fail: update_data_fail$1,
4712
+ add_students_to_class: add_students_to_class$1,
4713
+ click_to_choose_file: click_to_choose_file$1,
4714
+ exam_data: exam_data$1,
4715
+ questions_correct_rate: questions_correct_rate$1,
4716
+ question_management: question_management$1,
4717
+ student_data: student_data$1,
4718
+ problem_number_question_chart: problem_number_question_chart$1,
4863
4719
  are_you_sure_to_sync_exam_results_to_academy: are_you_sure_to_sync_exam_results_to_academy$1,
4864
4720
  messages: messages$1,
4865
4721
  submit: submit$1,
@@ -4942,7 +4798,7 @@ var lang_en = {
4942
4798
  sent_at: sent_at$1
4943
4799
  };
4944
4800
 
4945
- i18n.use(reactI18next.initReactI18next).init({
4801
+ i18n__default.use(reactI18next.initReactI18next).init({
4946
4802
  lng: "ko",
4947
4803
  fallbackLng: "ko",
4948
4804
  interpolation: {
@@ -5664,7 +5520,6 @@ var ContentTooltip = function ContentTooltip(_ref) {
5664
5520
  var ChatRightItem = function ChatRightItem(_ref) {
5665
5521
  var content = _ref.content,
5666
5522
  createdAt = _ref.createdAt,
5667
- sender = _ref.sender,
5668
5523
  showTimestamp = _ref.showTimestamp,
5669
5524
  isStudent = _ref.isStudent,
5670
5525
  showName = _ref.showName,
@@ -5697,13 +5552,15 @@ var ChatRightItem = function ChatRightItem(_ref) {
5697
5552
  alignItems: "center",
5698
5553
  justifyContent: "end",
5699
5554
  flexDirection: "row"
5700
- }, React__default.createElement(iconPersonNoActive, null), React__default.createElement(material.Typography, {
5555
+ }, React__default.createElement(iconPersonNoActive, {
5556
+ color: styles.gray_700
5557
+ }), React__default.createElement(material.Typography, {
5701
5558
  fontWeight: 700,
5702
5559
  fontSize: 14,
5703
5560
  padding: "4px",
5704
5561
  lineHeight: "16.71px",
5705
5562
  color: styles.gray_700
5706
- }, sender === null || sender === void 0 ? void 0 : sender.fullName)), React__default.createElement(material.Stack, {
5563
+ }, t("me"))), React__default.createElement(material.Stack, {
5707
5564
  display: "flex",
5708
5565
  flexDirection: "row",
5709
5566
  gap: "8px",
@@ -6591,7 +6448,7 @@ var ChatHeader = function ChatHeader(_ref) {
6591
6448
  sx: {
6592
6449
  color: styles.gray_500
6593
6450
  }
6594
- }, (!!filterDurationExam.hours() ? filterDurationExam.hours() + " " + t("hour") : "") + " " + (!!filterDurationExam.minutes() ? filterDurationExam.minutes() + " " + t("minute") : "") + " " + (!!filterDurationExam.seconds() ? filterDurationExam.seconds() + " " + t("second") : "")))), React__default.createElement(material.Box, {
6451
+ }, (!!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(material.Box, {
6595
6452
  display: "flex",
6596
6453
  alignItems: "end",
6597
6454
  gap: "6px",
@@ -6612,16 +6469,12 @@ var ChatHeader = function ChatHeader(_ref) {
6612
6469
  fontSize: "12px",
6613
6470
  lineHeight: "14.32px",
6614
6471
  color: styles.less_dark
6615
- }, t("points", {
6616
- number: score || 0
6617
- })), React__default.createElement(material.Typography, {
6472
+ }, score || 0), React__default.createElement(material.Typography, {
6618
6473
  fontWeight: 700,
6619
6474
  fontSize: "12px",
6620
6475
  lineHeight: "14.32px",
6621
6476
  color: styles.gray_300
6622
- }, "/", t("points", {
6623
- number: totalScore || 0
6624
- }))), React__default.createElement(material.Typography, {
6477
+ }, "/", totalScore || 0)), React__default.createElement(material.Typography, {
6625
6478
  fontWeight: 500,
6626
6479
  fontSize: "12px",
6627
6480
  lineHeight: "14.32px",
@@ -7572,45 +7425,11 @@ var QuestionView = function QuestionView(_ref2) {
7572
7425
  }))));
7573
7426
  };
7574
7427
 
7575
- var ADMIN_CATEGORY_URL = SUPER_ADMIN_BASE_URL + "/api/category";
7576
- var CATEGORY_URL = BASE_URL + "/api/examcategory";
7577
- var getCategoryListAdminApi = function getCategoryListAdminApi(data) {
7578
- try {
7579
- return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL, {
7580
- params: data
7581
- }));
7582
- } catch (e) {
7583
- return Promise.reject(e);
7584
- }
7585
- };
7586
- var getCategoryListApi = function getCategoryListApi(data) {
7587
- try {
7588
- return Promise.resolve(api.get("" + CATEGORY_URL, {
7589
- params: data
7590
- }));
7591
- } catch (e) {
7592
- return Promise.reject(e);
7593
- }
7594
- };
7595
-
7596
7428
  var useCategorySelect = function useCategorySelect(_ref) {
7597
- var subjectId = _ref.subjectId;
7598
- var firstLoad = true;
7599
- var dispatch = reactRedux.useDispatch();
7429
+ var categoryList = _ref.categoryList;
7600
7430
  var _useState = React.useState(),
7601
- categoryList = _useState[0],
7602
- setCategoryList = _useState[1];
7603
- var _useState2 = React.useState(),
7604
- selectedCategory = _useState2[0],
7605
- setSelectedCategory = _useState2[1];
7606
- var isDomain = reactRedux.useSelector(function (state) {
7607
- var _state$common, _state$common$user;
7608
- 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;
7609
- });
7610
- var isSuperAdmin = reactRedux.useSelector(function (state) {
7611
- var _state$common2, _state$common2$user;
7612
- 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) || [];
7613
- }).includes(exports.Role.Admin) && !isDomain;
7431
+ selectedCategory = _useState[0],
7432
+ setSelectedCategory = _useState[1];
7614
7433
  var categoryOptions = React.useMemo(function () {
7615
7434
  return categoryList === null || categoryList === void 0 ? void 0 : categoryList.map(function (category) {
7616
7435
  var _category$path;
@@ -7620,39 +7439,6 @@ var useCategorySelect = function useCategorySelect(_ref) {
7620
7439
  };
7621
7440
  });
7622
7441
  }, [JSON.stringify(categoryList)]);
7623
- var getCategoryList = function getCategoryList(isLoading) {
7624
- if (isLoading === void 0) {
7625
- isLoading = true;
7626
- }
7627
- try {
7628
- var _temp2 = function _temp2() {
7629
- isLoading && dispatch(setLoading(false));
7630
- };
7631
- if (!subjectId) return Promise.resolve();
7632
- if (firstLoad) firstLoad = false;
7633
- isLoading && dispatch(setLoading(true));
7634
- var _temp = _catch(function () {
7635
- return Promise.resolve(isSuperAdmin ? getCategoryListAdminApi({
7636
- subjectId: subjectId
7637
- }) : getCategoryListApi({
7638
- subjectId: subjectId
7639
- })).then(function (res) {
7640
- var data = res.data.items;
7641
- setCategoryList(data || []);
7642
- setSelectedCategory(data[0]);
7643
- });
7644
- }, function (error) {
7645
- setCategoryList([]);
7646
- console.log(error);
7647
- });
7648
- return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
7649
- } catch (e) {
7650
- return Promise.reject(e);
7651
- }
7652
- };
7653
- React.useEffect(function () {
7654
- getCategoryList();
7655
- }, [subjectId]);
7656
7442
  var handleChangeCategory = function handleChangeCategory(value) {
7657
7443
  var id = value.value;
7658
7444
  var selectedCategory = categoryList === null || categoryList === void 0 ? void 0 : categoryList.find(function (category) {
@@ -7745,7 +7531,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
7745
7531
  questions = _ref.questions,
7746
7532
  answerCount = _ref.answerCount,
7747
7533
  questionCount = _ref.questionCount,
7748
- selectedSubject = _ref.selectedSubject,
7534
+ categoryList = _ref.categoryList,
7749
7535
  categoryId = _ref.categoryId,
7750
7536
  isActive = _ref.isActive,
7751
7537
  isDisabled = _ref.isDisabled,
@@ -7760,7 +7546,7 @@ var ArticleGroupView = function ArticleGroupView(_ref) {
7760
7546
  var _useTranslation = reactI18next.useTranslation(),
7761
7547
  t = _useTranslation.t;
7762
7548
  var _useCategorySelect = useCategorySelect({
7763
- subjectId: defaultCategoryOptions === undefined ? selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id : undefined
7549
+ categoryList: categoryList
7764
7550
  }),
7765
7551
  categoryOptions = _useCategorySelect.categoryOptions;
7766
7552
  var theme = material.useTheme();
@@ -9625,12 +9411,45 @@ var DURATION_OPTIONS = Array.from({
9625
9411
  });
9626
9412
  var DEFAULT_ANSWER_COUNT$1 = 5;
9627
9413
 
9414
+ var ADMIN_CATEGORY_URL = SUPER_ADMIN_BASE_URL + "/api/category";
9415
+ var CATEGORY_URL = BASE_URL + "/api/examcategory";
9416
+ var getCategoryListAdminApi = function getCategoryListAdminApi(data) {
9417
+ try {
9418
+ return Promise.resolve(api.get("" + ADMIN_CATEGORY_URL, {
9419
+ params: data
9420
+ }));
9421
+ } catch (e) {
9422
+ return Promise.reject(e);
9423
+ }
9424
+ };
9425
+ var getCategoryListApi = function getCategoryListApi(data) {
9426
+ try {
9427
+ return Promise.resolve(api.get("" + CATEGORY_URL, {
9428
+ params: data
9429
+ }));
9430
+ } catch (e) {
9431
+ return Promise.reject(e);
9432
+ }
9433
+ };
9434
+
9628
9435
  var useExamDetailView = function useExamDetailView(props) {
9629
9436
  var exam = props.exam,
9630
- selectedSubject = props.selectedSubject,
9631
9437
  onChangeExam = props.onChangeExam;
9632
9438
  var _useTranslation = reactI18next.useTranslation(),
9633
9439
  t = _useTranslation.t;
9440
+ var firstLoad = true;
9441
+ var dispatch = reactRedux.useDispatch();
9442
+ var isDomain = reactRedux.useSelector(function (state) {
9443
+ var _state$common, _state$common$user;
9444
+ 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;
9445
+ });
9446
+ var isSuperAdmin = reactRedux.useSelector(function (state) {
9447
+ var _state$common2, _state$common2$user;
9448
+ 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) || [];
9449
+ }).includes(exports.Role.Admin) && !isDomain;
9450
+ var _useState = React.useState([]),
9451
+ categoryList = _useState[0],
9452
+ setCategoryList = _useState[1];
9634
9453
  var handleChangeQuestionCount = function handleChangeQuestionCount(article, questionCount, answerCount) {
9635
9454
  if (!exam) return;
9636
9455
  var examQuestions = exam.questions;
@@ -9808,6 +9627,39 @@ var useExamDetailView = function useExamDetailView(props) {
9808
9627
  }])
9809
9628
  }));
9810
9629
  };
9630
+ var getCategoryList = function getCategoryList(isLoading) {
9631
+ if (isLoading === void 0) {
9632
+ isLoading = true;
9633
+ }
9634
+ try {
9635
+ var _temp2 = function _temp2() {
9636
+ isLoading && dispatch(setLoading(false));
9637
+ };
9638
+ if (!exam.subjectId) return Promise.resolve();
9639
+ if (firstLoad) firstLoad = false;
9640
+ isLoading && dispatch(setLoading(true));
9641
+ var _temp = _catch(function () {
9642
+ return Promise.resolve(isSuperAdmin ? getCategoryListAdminApi({
9643
+ subjectId: exam.subjectId
9644
+ }) : getCategoryListApi({
9645
+ subjectId: exam.subjectId
9646
+ })).then(function (res) {
9647
+ var data = res.data.items;
9648
+ setCategoryList(data || []);
9649
+ });
9650
+ }, function (error) {
9651
+ setCategoryList([]);
9652
+ console.log(error);
9653
+ });
9654
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
9655
+ } catch (e) {
9656
+ return Promise.reject(e);
9657
+ }
9658
+ };
9659
+ React.useEffect(function () {
9660
+ if (categoryList !== null && categoryList !== void 0 && categoryList.length) return;
9661
+ getCategoryList();
9662
+ }, [exam.subjectId, JSON.stringify(categoryList)]);
9811
9663
  var examGroupByArticle = React.useMemo(function () {
9812
9664
  if (!exam) return [];
9813
9665
  var articles = [];
@@ -9832,27 +9684,23 @@ var useExamDetailView = function useExamDetailView(props) {
9832
9684
  var durationOptions = React.useMemo(function () {
9833
9685
  var options = DURATION_OPTIONS.map(function (i) {
9834
9686
  return {
9835
- label: t('mins_mins', {
9687
+ label: t("mins_mins", {
9836
9688
  mins: i
9837
9689
  }),
9838
9690
  value: i
9839
9691
  };
9840
9692
  });
9841
9693
  if (!!exam.duration && exam.duration > DURATION_OPTIONS[DURATION_OPTIONS.length - 1]) return [].concat(options, [{
9842
- label: t('mins_mins', {
9694
+ label: t("mins_mins", {
9843
9695
  mins: exam.duration
9844
9696
  }),
9845
9697
  value: exam.duration
9846
9698
  }]);
9847
9699
  return options;
9848
9700
  }, [exam.duration]);
9849
- React.useEffect(function () {
9850
- if ((selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) !== exam.subjectId) onChangeExam(_extends({}, exam, {
9851
- subjectId: (selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id) || 0
9852
- }));
9853
- }, [selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id, exam.subjectId]);
9854
9701
  return {
9855
9702
  t: t,
9703
+ categoryList: categoryList,
9856
9704
  durationOptions: durationOptions,
9857
9705
  examGroupByArticle: examGroupByArticle,
9858
9706
  handleAddArticle: handleAddArticle,
@@ -9874,16 +9722,19 @@ var ExamDetailView = function ExamDetailView(_ref) {
9874
9722
  isDisabled = _ref.isDisabled,
9875
9723
  isEdit = _ref.isEdit,
9876
9724
  onChangeExam = _ref.onChangeExam;
9877
- var _useSubjectSelect = useSubjectSelect(),
9725
+ var _useSubjectSelect = useSubjectSelect({
9726
+ onChangeExam: onChangeExam,
9727
+ exam: exam
9728
+ }),
9878
9729
  subjectOptions = _useSubjectSelect.subjectOptions,
9879
9730
  selectedSubject = _useSubjectSelect.selectedSubject,
9880
9731
  handleChangeSubject = _useSubjectSelect.handleChangeSubject;
9881
9732
  var _useExamDetailView = useExamDetailView({
9882
9733
  exam: exam,
9883
- onChangeExam: onChangeExam,
9884
- selectedSubject: selectedSubject
9734
+ onChangeExam: onChangeExam
9885
9735
  }),
9886
9736
  t = _useExamDetailView.t,
9737
+ categoryList = _useExamDetailView.categoryList,
9887
9738
  durationOptions = _useExamDetailView.durationOptions,
9888
9739
  examGroupByArticle = _useExamDetailView.examGroupByArticle,
9889
9740
  handleAddArticle = _useExamDetailView.handleAddArticle,
@@ -9932,10 +9783,10 @@ var ExamDetailView = function ExamDetailView(_ref) {
9932
9783
  className: 'mb-2'
9933
9784
  }, React__default.createElement("label", {
9934
9785
  className: styles["form-label"] + " " + styles$2["question-label"],
9935
- htmlFor: "duration"
9936
- }, t("subject"), " ", selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.name), React__default.createElement(CustomSelect, {
9786
+ htmlFor: "subject"
9787
+ }, t("subject")), React__default.createElement(CustomSelect, {
9937
9788
  inputId: "subject",
9938
- value: selectedSubject === null || selectedSubject === void 0 ? void 0 : selectedSubject.id,
9789
+ value: exam === null || exam === void 0 ? void 0 : exam.subjectId,
9939
9790
  options: subjectOptions,
9940
9791
  onChange: handleChangeSubject,
9941
9792
  isDisabled: isDisabled || isEdit
@@ -9946,6 +9797,7 @@ var ExamDetailView = function ExamDetailView(_ref) {
9946
9797
  xs: 12,
9947
9798
  className: index === examGroupByArticle.length - 1 ? "mb-2" : ''
9948
9799
  }, React__default.createElement(ArticleGroupView, Object.assign({}, i, {
9800
+ categoryList: categoryList,
9949
9801
  isActive: index === examGroupByArticle.length - 1,
9950
9802
  onChangeQuestionCount: handleChangeQuestionCount,
9951
9803
  onChangeCategory: handleChangeCategory,
@@ -10830,18 +10682,6 @@ var createConversationApi = function createConversationApi(data) {
10830
10682
  return api.post(BASE_URL + "/api/conversation", data);
10831
10683
  };
10832
10684
 
10833
- var toNumberOrder = function toNumberOrder(value) {
10834
- return "The " + value + (value % 10 === 1 ? 'st' : value % 10 === 2 ? 'nd' : value % 10 === 3 ? 'rd' : 'th');
10835
- };
10836
- var formatDuration = function formatDuration(t, duration) {
10837
- if (!duration) return "0" + t("seconds");
10838
- var totalTime = Math.round(duration);
10839
- return totalTime > 60 ? t("mins_mins_seconds_seconds", {
10840
- mins: Math.floor(totalTime / 60),
10841
- seconds: totalTime % 60
10842
- }) : "" + Math.round(duration) + t("seconds");
10843
- };
10844
-
10845
10685
  var ORDER_NUMBERS = {
10846
10686
  1: "the_first",
10847
10687
  2: "the_second",
@@ -10896,6 +10736,7 @@ var EXAM_RESULT = {
10896
10736
  parentPhoneNumber: "",
10897
10737
  schoolName: "Academy",
10898
10738
  className: "1",
10739
+ fullName: "Abc",
10899
10740
  major: "",
10900
10741
  roles: []
10901
10742
  },
@@ -11628,6 +11469,18 @@ var defaultSeries = function defaultSeries(t) {
11628
11469
  }];
11629
11470
  };
11630
11471
 
11472
+ var formatDuration = function formatDuration(t, duration) {
11473
+ if (!duration) return "0" + t("seconds");
11474
+ var totalTime = Math.round(duration);
11475
+ return totalTime > 60 ? t("mins_mins_seconds_seconds", {
11476
+ mins: Math.floor(totalTime / 60),
11477
+ seconds: totalTime % 60
11478
+ }) : "" + Math.round(duration) + t("seconds");
11479
+ };
11480
+ var formatQuestionOrder = function formatQuestionOrder(index, t, language) {
11481
+ return language === exports.Language.en ? "" + (index + 1) + getOrdinalSuffix(index + 1, language) : t(ORDER_NUMBERS[index + 1]);
11482
+ };
11483
+
11631
11484
  var RECENT_USER_URL = BASE_URL + "/api/recentUsers";
11632
11485
  var getRecentUserActionListApi = function getRecentUserActionListApi(query) {
11633
11486
  return api.get("" + RECENT_USER_URL, {
@@ -11650,19 +11503,18 @@ var createRecentUserActionListApi = function createRecentUserActionListApi(_ref)
11650
11503
  });
11651
11504
  };
11652
11505
 
11653
- var useExamResult = function useExamResult(searchParam, history, examSessionId, studentId, code, handleChangeTab, selectedTab) {
11506
+ var useExamResult = function useExamResult(props) {
11654
11507
  var _allSeries$dataChartI;
11655
- if (examSessionId === void 0) {
11656
- examSessionId = 0;
11657
- }
11658
- if (studentId === void 0) {
11659
- studentId = 0;
11660
- }
11661
- if (code === void 0) {
11662
- code = "";
11663
- }
11664
- var query = new URLSearchParams(searchParam);
11665
- var dispatch = reactRedux.useDispatch();
11508
+ var searchParams = props.searchParams,
11509
+ history = props.history,
11510
+ examSessionId = props.examSessionId,
11511
+ studentId = props.studentId,
11512
+ _props$code = props.code,
11513
+ code = _props$code === void 0 ? "" : _props$code,
11514
+ handleChangeTab = props.handleChangeTab,
11515
+ selectedTab = props.selectedTab,
11516
+ isPrint = props.isPrint;
11517
+ var query = new URLSearchParams(searchParams);
11666
11518
  var user = reactRedux.useSelector(function (state) {
11667
11519
  var _state$common;
11668
11520
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.user;
@@ -11674,7 +11526,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11674
11526
  var _state$common2;
11675
11527
  return state === null || state === void 0 ? void 0 : (_state$common2 = state.common) === null || _state$common2 === void 0 ? void 0 : _state$common2.language;
11676
11528
  });
11677
- var _useState = React.useState(false),
11529
+ var _useState = React.useState(),
11678
11530
  isLoading = _useState[0],
11679
11531
  setIsLoading = _useState[1];
11680
11532
  var _useState2 = React.useState(),
@@ -11695,9 +11547,12 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11695
11547
  var _useState7 = React.useState(0),
11696
11548
  dataChartIndex = _useState7[0],
11697
11549
  setDataChartIndex = _useState7[1];
11698
- var _useState8 = React.useState(""),
11550
+ var _useState8 = React.useState(),
11699
11551
  openProblem = _useState8[0],
11700
11552
  setOpenProblem = _useState8[1];
11553
+ var _useState9 = React.useState(),
11554
+ errorMessage = _useState9[0],
11555
+ setErrorMessage = _useState9[1];
11701
11556
  var _useTranslation = reactI18next.useTranslation(),
11702
11557
  t = _useTranslation.t;
11703
11558
  var getStudentData = function getStudentData(examCode) {
@@ -11710,7 +11565,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11710
11565
  var _temp = _catch(function () {
11711
11566
  return Promise.resolve(Promise.all([getResults(examCode), getResultsLongTimeSpend(examCode), getResultsEffectSize(examCode), getResultsTimeOrderQuestion(examCode), getResultsCategories(examCode)])).then(function (result) {
11712
11567
  var _result$0$data, _result$1$data, _result$2$data, _result$3$data, _result$4$data;
11713
- handleChangeTab(0);
11568
+ handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
11714
11569
  setDataChartIndex(0);
11715
11570
  setResultData((_result$0$data = result[0].data) === null || _result$0$data === void 0 ? void 0 : _result$0$data.data);
11716
11571
  setLongTimeSpend((_result$1$data = result[1].data) === null || _result$1$data === void 0 ? void 0 : _result$1$data.data);
@@ -11719,19 +11574,21 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11719
11574
  setCategoryResponses(((_result$4$data = result[4].data) === null || _result$4$data === void 0 ? void 0 : _result$4$data.data) || []);
11720
11575
  });
11721
11576
  }, function (error) {
11722
- reactToastify.toast.error(getErrorMessage(t, error));
11577
+ var message = getErrorMessage(t, error);
11578
+ !isPrint && reactToastify.toast.error(message);
11579
+ setErrorMessage(message);
11723
11580
  });
11724
11581
  return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
11725
11582
  } catch (e) {
11726
11583
  return Promise.reject(e);
11727
11584
  }
11728
11585
  };
11729
- var getStudentDataByTeacher = function getStudentDataByTeacher(examCode, examSessionId, studentId) {
11586
+ var getStudentDataByTeacher = function getStudentDataByTeacher(examSessionId, studentId) {
11730
11587
  try {
11731
11588
  var _temp5 = function _temp5() {
11732
11589
  setIsLoading(false);
11733
11590
  };
11734
- if (!examCode || !examSessionId || !studentId) return Promise.resolve();
11591
+ if (!examSessionId || !studentId) return Promise.resolve();
11735
11592
  setIsLoading(true);
11736
11593
  var _temp4 = _catch(function () {
11737
11594
  return Promise.resolve(Promise.all([getResultsTeacher(examSessionId, studentId), getResultsLongTimeSpendTeacher(examSessionId, studentId), getResultsEffectSizeTeacher(examSessionId, studentId), getResultsTimeOrderQuestionTeacher(examSessionId, studentId), getResultsCategoriesTeacher(examSessionId, studentId)])).then(function (result) {
@@ -11739,7 +11596,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11739
11596
  function _temp3(_createRecentUserActi) {
11740
11597
  _createRecentUserActi;
11741
11598
  }
11742
- handleChangeTab(0);
11599
+ handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
11743
11600
  setDataChartIndex(0);
11744
11601
  setResultData((_result$0$data2 = result[0].data) === null || _result$0$data2 === void 0 ? void 0 : _result$0$data2.data);
11745
11602
  setLongTimeSpend((_result$1$data2 = result[1].data) === null || _result$1$data2 === void 0 ? void 0 : _result$1$data2.data);
@@ -11759,7 +11616,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11759
11616
  })).then(_temp3);
11760
11617
  });
11761
11618
  }, function (error) {
11762
- reactToastify.toast.error(getErrorMessage(t, error));
11619
+ var message = getErrorMessage(t, error);
11620
+ !isPrint && reactToastify.toast.error(message);
11621
+ setErrorMessage(message);
11763
11622
  });
11764
11623
  return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
11765
11624
  } catch (e) {
@@ -11774,7 +11633,9 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11774
11633
  setCategoryResponses(CATEGORY_RESPONSES);
11775
11634
  };
11776
11635
  var resetData = function resetData() {
11636
+ setIsLoading(undefined);
11777
11637
  setResultData(undefined);
11638
+ setErrorMessage(undefined);
11778
11639
  setLongTimeSpend([]);
11779
11640
  setEffectSize([]);
11780
11641
  setTimelyOrderQuestions([]);
@@ -11785,7 +11646,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11785
11646
  resetData();
11786
11647
  if (!(user !== null && user !== void 0 && user.email)) return;
11787
11648
  isStudent && getStudentData(examCode);
11788
- !isStudent && getStudentDataByTeacher(code, examSessionId, studentId);
11649
+ !isStudent && getStudentDataByTeacher(examSessionId, studentId);
11789
11650
  };
11790
11651
  examCode === "example-code" ? setExampleData() : getData();
11791
11652
  }, [examCode, isStudent, code, examSessionId, studentId, user === null || user === void 0 ? void 0 : user.email]);
@@ -11825,7 +11686,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11825
11686
  var dataPointIndex = _ref.dataPointIndex;
11826
11687
  if (dataPointIndex > 0) {
11827
11688
  var _questions;
11828
- return val != null ? t("problem_number_question", {
11689
+ return val != null ? t("problem_number_question_chart", {
11829
11690
  number: questions !== null ? (((_questions = questions[questionLength - val]) === null || _questions === void 0 ? void 0 : _questions.questionOrder) || 0) + 1 : val
11830
11691
  }) : t("no_data");
11831
11692
  }
@@ -11834,11 +11695,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11834
11695
  }
11835
11696
  }),
11836
11697
  xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
11837
- categories: [""].concat(Array.from({
11698
+ categories: ["s"].concat(Array.from({
11838
11699
  length: questionLength
11839
11700
  }, function (_, i) {
11840
- return ORDER_NUMBERS[i + 1] ? t(ORDER_NUMBERS[i + 1]) : toNumberOrder(i + 1);
11841
- }), [""]),
11701
+ return formatQuestionOrder(i, t, language);
11702
+ }), ["e"]),
11842
11703
  tooltip: {
11843
11704
  formatter: function formatter(val) {
11844
11705
  if (val > 1) return t(ORDER_NUMBERS[val - 1]);
@@ -11910,7 +11771,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11910
11771
  var dataPointIndex = _ref2.dataPointIndex;
11911
11772
  if (dataPointIndex > 0) {
11912
11773
  var _questions3;
11913
- return val != null ? t("problem_number_question", {
11774
+ return val != null ? t("problem_number_question_chart", {
11914
11775
  number: questions !== null ? (((_questions3 = questions[questionLength - val]) === null || _questions3 === void 0 ? void 0 : _questions3.questionOrder) || 0) + 1 : val
11915
11776
  }) : t("no_data");
11916
11777
  }
@@ -11920,11 +11781,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11920
11781
  }),
11921
11782
  colors: ['#3DC674', '#C3099A'],
11922
11783
  xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
11923
- categories: [""].concat(Array.from({
11784
+ categories: ["s"].concat(Array.from({
11924
11785
  length: questionLength
11925
11786
  }, function (_, i) {
11926
- return ORDER_NUMBERS[i + 1] ? t(ORDER_NUMBERS[i + 1]) : toNumberOrder(i + 1);
11927
- }), [""]),
11787
+ return formatQuestionOrder(i, t, language);
11788
+ }), ["e"]),
11928
11789
  tooltip: {
11929
11790
  formatter: function formatter(val) {
11930
11791
  if (val > 1) return t(ORDER_NUMBERS[val - 1]);
@@ -11938,7 +11799,7 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11938
11799
  labels: _extends({}, DEFAULT_LINE_CHART_OPTIONS.yaxis.labels, {
11939
11800
  formatter: function formatter(val) {
11940
11801
  var _questions4;
11941
- return val != null ? t("problem_number_question", {
11802
+ return val != null ? t("problem_number_question_chart", {
11942
11803
  number: questions !== null ? (((_questions4 = questions[questionLength - val]) === null || _questions4 === void 0 ? void 0 : _questions4.questionOrder) || 0) + 1 : val
11943
11804
  }) : t("no_data");
11944
11805
  }
@@ -11947,224 +11808,6 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11947
11808
  });
11948
11809
  }, [JSON.stringify(allChartOptions), dataChartIndex, language]);
11949
11810
  var series = (_allSeries$dataChartI = allSeries[dataChartIndex]) != null ? _allSeries$dataChartI : defaultSeries(t);
11950
- var handleExportPdf = function handleExportPdf() {
11951
- try {
11952
- var _temp24 = function _temp24(_result) {
11953
- if (_exit) return _result;
11954
- dispatch(setLoading(false));
11955
- };
11956
- var _exit = false;
11957
- dispatch(setLoading(true));
11958
- var _temp23 = _catch(function () {
11959
- var canvas = document.querySelector("#canvas");
11960
- var headerCanvas = document.querySelector("#header-canvas");
11961
- if (!canvas || !headerCanvas) {
11962
- _exit = true;
11963
- return;
11964
- }
11965
- var doc = new jspdf.jsPDF({
11966
- orientation: "p",
11967
- unit: "px",
11968
- format: "a4"
11969
- });
11970
- var WIDTH_PAPER = doc.internal.pageSize.width;
11971
- var HEIGHT_PAPER = doc.internal.pageSize.height;
11972
- var line = 0;
11973
- var breakPage = function breakPage() {
11974
- doc.addPage();
11975
- line = 20;
11976
- };
11977
- var imgWidth = WIDTH_PAPER;
11978
- var chartWidth = WIDTH_PAPER - 20;
11979
- return Promise.resolve(html2canvas(headerCanvas)).then(function (header) {
11980
- function _temp22() {
11981
- function _temp20(_createRecentUserActi2) {
11982
- _createRecentUserActi2;
11983
- }
11984
- doc.save("download.pdf");
11985
- return isStudent ? _temp20(!isStudent && createRecentUserActionListApi({
11986
- userId: studentId,
11987
- action: RecentUserAction$1.PrintedExamResult,
11988
- data: "" + examSessionId,
11989
- roles: [exports.Role.Teacher]
11990
- })) : Promise.resolve(!isStudent && createRecentUserActionListApi({
11991
- userId: studentId,
11992
- action: RecentUserAction$1.PrintedExamResult,
11993
- data: "" + examSessionId,
11994
- roles: [exports.Role.Teacher]
11995
- })).then(_temp20);
11996
- }
11997
- var imgHeaderHeight = header.height * imgWidth / header.width;
11998
- var imgHeaderData = header.toDataURL('image/png');
11999
- doc.addImage(imgHeaderData, 'PNG', 0, 0, imgWidth, imgHeaderHeight);
12000
- line += imgHeaderHeight;
12001
- if (line > HEIGHT_PAPER) breakPage();
12002
- var _temp21 = function () {
12003
- if (canvas && canvas.childElementCount > 0) {
12004
- var _index = 0;
12005
- var _temp19 = _for(function () {
12006
- return _index < canvas.childElementCount;
12007
- }, function () {
12008
- return _index++;
12009
- }, function () {
12010
- function _temp18() {
12011
- function _temp16() {
12012
- line += 20;
12013
- }
12014
- var printChartTitle = function printChartTitle() {
12015
- try {
12016
- if (chartTitleData && chartTitleHeight) {
12017
- if (line + chartTitleHeight + 10 > HEIGHT_PAPER) breakPage();else line + 10;
12018
- doc.addImage(chartTitleData, 'PNG', 10, line, chartWidth, chartTitleHeight);
12019
- line += chartTitleHeight;
12020
- }
12021
- return Promise.resolve();
12022
- } catch (e) {
12023
- return Promise.reject(e);
12024
- }
12025
- };
12026
- var _temp15 = function () {
12027
- if (printContainerEls.length) {
12028
- var _temp14 = _forTo(printContainerEls, function (i) {
12029
- function _temp13() {
12030
- function _temp11() {
12031
- var printTitle = function printTitle() {
12032
- try {
12033
- if (!printTitleHeight || !printTitleData) return Promise.resolve();
12034
- doc.addImage(printTitleData, 'PNG', 0, line, chartWidth, printTitleHeight);
12035
- line += printTitleHeight;
12036
- return Promise.resolve();
12037
- } catch (e) {
12038
- return Promise.reject(e);
12039
- }
12040
- };
12041
- var printHeader = function printHeader(top) {
12042
- if (top === void 0) {
12043
- top = 0;
12044
- }
12045
- try {
12046
- if (!printHeaderData || !printHeaderHeight) return Promise.resolve();
12047
- line += top;
12048
- if (line + printHeaderHeight > HEIGHT_PAPER) breakPage();
12049
- doc.addImage(printHeaderData, 'PNG', 10, line, chartWidth, printHeaderHeight);
12050
- line += printHeaderHeight;
12051
- return Promise.resolve();
12052
- } catch (e) {
12053
- return Promise.reject(e);
12054
- }
12055
- };
12056
- var printContents = printContainerEl.querySelectorAll("." + PrintContentClassName);
12057
- if (!printContents.length) return;
12058
- printTitle();
12059
- var _temp9 = _forTo(printContents, function (j) {
12060
- var rowItem = printContents[j];
12061
- return Promise.resolve(html2canvas(rowItem)).then(function (rowItemCanvas) {
12062
- function _temp8() {
12063
- doc.addImage(data, 'PNG', 10, line, chartWidth, height);
12064
- line += height;
12065
- }
12066
- var height = rowItemCanvas.height * chartWidth / rowItemCanvas.width;
12067
- var data = rowItemCanvas.toDataURL('image/png');
12068
- if (i === 0 && j === 0 && line + height + (printHeaderHeight || 0) + ((chartTitleHeight || 0) + 10) + 20 > HEIGHT_PAPER) breakPage();
12069
- i === 0 && j === 0 && printChartTitle();
12070
- var _temp7 = function () {
12071
- if (line + height + 20 > HEIGHT_PAPER) {
12072
- breakPage();
12073
- return Promise.resolve(printHeader()).then(function () {});
12074
- } else {
12075
- var _temp25 = function () {
12076
- if (j === 0) {
12077
- return Promise.resolve(printHeader(10)).then(function () {});
12078
- }
12079
- }();
12080
- if (_temp25 && _temp25.then) return _temp25.then(function () {});
12081
- }
12082
- }();
12083
- return _temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7);
12084
- });
12085
- });
12086
- if (_temp9 && _temp9.then) return _temp9.then(function () {});
12087
- }
12088
- var _temp10 = function () {
12089
- if (printHeaderEl) {
12090
- return Promise.resolve(html2canvas(printHeaderEl)).then(function (_html2canvas3) {
12091
- printHeaderCanvas = _html2canvas3;
12092
- printHeaderHeight = printHeaderCanvas.height * chartWidth / printHeaderCanvas.width;
12093
- printHeaderData = printHeaderCanvas.toDataURL('image/png');
12094
- });
12095
- }
12096
- }();
12097
- return _temp10 && _temp10.then ? _temp10.then(_temp11) : _temp11(_temp10);
12098
- }
12099
- var printContainerEl = printContainerEls[i];
12100
- var printTitleEl = printContainerEl.querySelector("." + PrintTitleClassName);
12101
- var printHeaderEl = printContainerEl.querySelector("." + PrintHeaderClassName);
12102
- var printTitleCanvas = null;
12103
- var printTitleHeight = null;
12104
- var printTitleData = "";
12105
- var printHeaderCanvas = null;
12106
- var printHeaderHeight = null;
12107
- var printHeaderData = "";
12108
- var _temp12 = function () {
12109
- if (printTitleEl) {
12110
- return Promise.resolve(html2canvas(printTitleEl)).then(function (_html2canvas2) {
12111
- printTitleCanvas = _html2canvas2;
12112
- printTitleHeight = printTitleCanvas.height * chartWidth / printTitleCanvas.width;
12113
- printTitleData = printTitleCanvas.toDataURL('image/png');
12114
- });
12115
- }
12116
- }();
12117
- return _temp12 && _temp12.then ? _temp12.then(_temp13) : _temp13(_temp12);
12118
- });
12119
- if (_temp14 && _temp14.then) return _temp14.then(function () {});
12120
- } else {
12121
- return Promise.resolve(html2canvas(chart)).then(function (chartCanvas) {
12122
- var imgBodyHeight = chartCanvas.height * chartWidth / chartCanvas.width;
12123
- var imgBodyData = chartCanvas.toDataURL('image/png');
12124
- line += 10;
12125
- if (line + imgBodyHeight + 20 + (chartTitleHeight || 0) > HEIGHT_PAPER) breakPage();
12126
- printChartTitle();
12127
- doc.addImage(imgBodyData, 'PNG', 10, line, chartWidth, imgBodyHeight);
12128
- line += imgBodyHeight;
12129
- });
12130
- }
12131
- }();
12132
- return _temp15 && _temp15.then ? _temp15.then(_temp16) : _temp16(_temp15);
12133
- }
12134
- var chart = canvas.children.item(_index);
12135
- if (chart.getAttribute("id") === "header-canvas") return;
12136
- var chartTitle = chart.querySelector(".chart-title");
12137
- var printContainerEls = chart.querySelectorAll("." + PrintContainerClassName);
12138
- var printChartTitleCanvas = null;
12139
- var chartTitleHeight = null;
12140
- var chartTitleData = "";
12141
- var _temp17 = function () {
12142
- if (chartTitle && printContainerEls.length) {
12143
- return Promise.resolve(html2canvas(chartTitle)).then(function (_html2canvas) {
12144
- printChartTitleCanvas = _html2canvas;
12145
- chartTitleHeight = printChartTitleCanvas.height * chartWidth / printChartTitleCanvas.width;
12146
- chartTitleData = printChartTitleCanvas.toDataURL('image/png');
12147
- });
12148
- }
12149
- }();
12150
- return _temp17 && _temp17.then ? _temp17.then(_temp18) : _temp18(_temp17);
12151
- });
12152
- if (_temp19 && _temp19.then) return _temp19.then(function () {});
12153
- }
12154
- }();
12155
- return _temp21 && _temp21.then ? _temp21.then(_temp22) : _temp22(_temp21);
12156
- });
12157
- }, function (error) {
12158
- console.log({
12159
- error: error
12160
- });
12161
- reactToastify.toast.error(getErrorMessage(t, error));
12162
- });
12163
- return Promise.resolve(_temp23 && _temp23.then ? _temp23.then(_temp24) : _temp24(_temp23));
12164
- } catch (e) {
12165
- return Promise.reject(e);
12166
- }
12167
- };
12168
11811
  React.useEffect(function () {
12169
11812
  setDataChartIndex(0);
12170
11813
  }, [selectedTab]);
@@ -12187,11 +11830,11 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
12187
11830
  timelyOrderQuestions: timelyOrderQuestions,
12188
11831
  openProblem: openProblem,
12189
11832
  categoryResponses: categoryResponses,
11833
+ errorMessage: errorMessage,
12190
11834
  setOpenProblem: setOpenProblem,
12191
11835
  handlePrevChart: handlePrevChart,
12192
11836
  handleNextChart: handleNextChart,
12193
- handleExit: handleExit,
12194
- handleExportPdf: handleExportPdf
11837
+ handleExit: handleExit
12195
11838
  };
12196
11839
  };
12197
11840
 
@@ -13308,7 +12951,7 @@ Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==t
13308
12951
 
13309
12952
  var ReactApexChart = unwrapExports(reactApexcharts_min);
13310
12953
 
13311
- 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"};
12954
+ 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"};
13312
12955
 
13313
12956
  var iconStarQuestion = function iconStarQuestion(_ref) {
13314
12957
  var _ref$width = _ref.width,
@@ -13699,8 +13342,7 @@ function CreateNewQuestionDialog(_ref) {
13699
13342
  function MyAnswer(_ref) {
13700
13343
  var data = _ref.data,
13701
13344
  categories = _ref.categories,
13702
- isStudent = _ref.isStudent,
13703
- isPrint = _ref.isPrint;
13345
+ isStudent = _ref.isStudent;
13704
13346
  var _useCreateQuestionDia = useCreateQuestionDialog({
13705
13347
  questions: data.questions
13706
13348
  }),
@@ -13828,24 +13470,12 @@ function MyAnswer(_ref) {
13828
13470
  })))));
13829
13471
  });
13830
13472
  };
13831
- var renderPrintQuestions = function renderPrintQuestions(questions) {
13832
- var chunkedQuestions = _.chunk(questions, 10);
13833
- return chunkedQuestions.map(function (i, index) {
13834
- return React__default.createElement("div", {
13835
- key: index,
13836
- className: PrintContentClassName
13837
- }, renderQuestions(i));
13838
- });
13839
- };
13840
13473
  return React__default.createElement("div", {
13841
13474
  className: styles$4["myanswer"]
13842
13475
  }, formattedData && formattedData.length > 0 && formattedData.map(function (item) {
13843
13476
  return React__default.createElement("div", {
13844
- key: item.category.id,
13845
- className: isPrint ? PrintContainerClassName : ""
13846
- }, React__default.createElement("div", {
13847
- className: isPrint ? PrintHeaderClassName : ""
13848
- }, React__default.createElement(material.Stack, {
13477
+ key: item.category.id
13478
+ }, React__default.createElement("div", null, React__default.createElement(material.Stack, {
13849
13479
  bgcolor: "#F9FAFB",
13850
13480
  flexDirection: "row",
13851
13481
  padding: "12px",
@@ -13857,6 +13487,7 @@ function MyAnswer(_ref) {
13857
13487
  gap: "4px"
13858
13488
  }
13859
13489
  }, React__default.createElement(material.Typography, {
13490
+ paddingInline: "4px",
13860
13491
  sx: {
13861
13492
  fontSize: "13px",
13862
13493
  fontWeight: 600,
@@ -13871,6 +13502,7 @@ function MyAnswer(_ref) {
13871
13502
  gap: "4px"
13872
13503
  }
13873
13504
  }, React__default.createElement(material.Typography, {
13505
+ paddingInline: "4px",
13874
13506
  sx: {
13875
13507
  fontSize: "13px",
13876
13508
  fontWeight: 600,
@@ -13885,6 +13517,7 @@ function MyAnswer(_ref) {
13885
13517
  gap: "4px"
13886
13518
  }
13887
13519
  }, React__default.createElement(material.Typography, {
13520
+ paddingInline: "4px",
13888
13521
  sx: {
13889
13522
  fontSize: "13px",
13890
13523
  fontWeight: 600,
@@ -13900,6 +13533,7 @@ function MyAnswer(_ref) {
13900
13533
  gap: "4px"
13901
13534
  }
13902
13535
  }, React__default.createElement(material.Typography, {
13536
+ paddingInline: "4px",
13903
13537
  sx: {
13904
13538
  fontSize: "13px",
13905
13539
  fontWeight: 600,
@@ -13915,6 +13549,7 @@ function MyAnswer(_ref) {
13915
13549
  gap: "4px"
13916
13550
  }
13917
13551
  }, React__default.createElement(material.Typography, {
13552
+ paddingInline: "4px",
13918
13553
  sx: {
13919
13554
  fontSize: "13px",
13920
13555
  fontWeight: 600,
@@ -13937,7 +13572,7 @@ function MyAnswer(_ref) {
13937
13572
  }
13938
13573
  }, item.category.name))), React__default.createElement("div", {
13939
13574
  className: styles$4["contentMyAnswer"]
13940
- }, isPrint ? renderPrintQuestions(item.questions) : renderQuestions(item.questions)));
13575
+ }, renderQuestions(item.questions)));
13941
13576
  }), React__default.createElement(CreateNewQuestionDialog, {
13942
13577
  questionOptions: questionOptions,
13943
13578
  questionOrderSelected: questionOrderSelected,
@@ -13991,8 +13626,7 @@ var iconBtnNextChart = function iconBtnNextChart(_ref) {
13991
13626
  };
13992
13627
 
13993
13628
  var CompareGrass = function CompareGrass(_ref) {
13994
- var effectSize = _ref.effectSize,
13995
- isPrint = _ref.isPrint;
13629
+ var effectSize = _ref.effectSize;
13996
13630
  var _useTranslation = reactI18next.useTranslation(),
13997
13631
  t = _useTranslation.t;
13998
13632
  var renderTableBody = function renderTableBody(effectSize) {
@@ -14055,17 +13689,8 @@ var CompareGrass = function CompareGrass(_ref) {
14055
13689
  }))));
14056
13690
  });
14057
13691
  };
14058
- var renderPrintTableBody = function renderPrintTableBody(effectSize) {
14059
- var chunkedEffectSizeQuestions = _.chunk(effectSize, 10);
14060
- return chunkedEffectSizeQuestions.map(function (i, index) {
14061
- return React__default.createElement("tbody", {
14062
- key: index,
14063
- className: PrintContentClassName
14064
- }, renderTableBody(i));
14065
- });
14066
- };
14067
13692
  return React__default.createElement("div", {
14068
- className: styles$4["compareGrass"] + " " + (isPrint ? PrintContainerClassName : "")
13693
+ className: "" + styles$4["compareGrass"]
14069
13694
  }, React__default.createElement("div", {
14070
13695
  className: styles$4["tableCompareGrass"]
14071
13696
  }, React__default.createElement("div", {
@@ -14077,8 +13702,7 @@ var CompareGrass = function CompareGrass(_ref) {
14077
13702
  }, React__default.createElement("thead", {
14078
13703
  style: {
14079
13704
  borderBottom: "1px solid #E4E7EC"
14080
- },
14081
- className: isPrint ? PrintHeaderClassName : ""
13705
+ }
14082
13706
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14083
13707
  className: styles$4["thcolumn1"]
14084
13708
  }, t("problem_number")), React__default.createElement("th", {
@@ -14097,7 +13721,7 @@ var CompareGrass = function CompareGrass(_ref) {
14097
13721
  style: {
14098
13722
  textAlign: "center"
14099
13723
  }
14100
- }, t("problem_classification")))), isPrint ? renderPrintTableBody(effectSize) : React__default.createElement("tbody", null, renderTableBody(effectSize))))));
13724
+ }, t("problem_classification")))), React__default.createElement("tbody", null, renderTableBody(effectSize))))));
14101
13725
  };
14102
13726
 
14103
13727
  var iconX = function iconX(_ref) {
@@ -14149,8 +13773,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
14149
13773
  var keyOpen = _ref.keyOpen,
14150
13774
  data = _ref.data,
14151
13775
  openProblem = _ref.openProblem,
14152
- changeOpen = _ref.changeOpen,
14153
- isPrint = _ref.isPrint;
13776
+ changeOpen = _ref.changeOpen;
14154
13777
  var _useTranslation = reactI18next.useTranslation(),
14155
13778
  t = _useTranslation.t;
14156
13779
  var isOpen = openProblem === keyOpen;
@@ -14189,45 +13812,12 @@ var TrickyProblem = function TrickyProblem(_ref) {
14189
13812
  className: styles$4["noData"]
14190
13813
  }, t("no_data"))));
14191
13814
  };
14192
- var renderPrintProblems = function renderPrintProblems() {
14193
- return React__default.createElement(React.Fragment, null, React__default.createElement("div", {
14194
- className: PrintContentClassName
14195
- }, React__default.createElement("div", {
14196
- className: styles$4["titleTrickyProblem"]
14197
- }, React__default.createElement(iconX, null), React__default.createElement("span", null, t("incorrect_problem_among_the_starred_problems"))), React__default.createElement("div", {
14198
- className: styles$4["wrongQuestions"]
14199
- }, !!inCorrectQuestions.length && inCorrectQuestions.map(function (question) {
14200
- return React__default.createElement("span", {
14201
- key: question.id,
14202
- className: styles$4["question"]
14203
- }, t("number_question", {
14204
- number: question.questionOrder + 1
14205
- }));
14206
- }), !data.questions.length && React__default.createElement("div", {
14207
- className: styles$4["noData"]
14208
- }, t("no_data")))), React__default.createElement("div", {
14209
- className: PrintContentClassName
14210
- }, React__default.createElement("div", {
14211
- className: styles$4["titleTrickyProblem"]
14212
- }, React__default.createElement(iconAssignedQuestions, null), React__default.createElement("span", null, t("correct_problem_among_the_starred_problems"))), React__default.createElement("div", {
14213
- className: styles$4["assignedQuestions"]
14214
- }, !!correctQuestions.length && correctQuestions.map(function (question) {
14215
- return React__default.createElement("div", {
14216
- key: question.id,
14217
- className: styles$4["question"]
14218
- }, t("number_question", {
14219
- number: question.questionOrder + 1
14220
- }));
14221
- }), !data.questions.length && React__default.createElement("div", {
14222
- className: styles$4["noData"]
14223
- }, t("no_data")))));
14224
- };
14225
13815
  return React__default.createElement("div", {
14226
- className: styles$4["wrapperProblem"] + " " + (isPrint ? PrintContainerClassName : "")
13816
+ className: "" + styles$4["wrapperProblem"]
14227
13817
  }, React__default.createElement("div", {
14228
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintHeaderClassName : ""),
13818
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14229
13819
  onClick: function onClick() {
14230
- return changeOpen(isOpen ? "" : keyOpen);
13820
+ return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
14231
13821
  }
14232
13822
  }, React__default.createElement(material.Typography, {
14233
13823
  sx: {
@@ -14241,7 +13831,7 @@ var TrickyProblem = function TrickyProblem(_ref) {
14241
13831
  }) : React__default.createElement(io5.IoChevronDown, {
14242
13832
  size: 24,
14243
13833
  color: styles$4.gray_300
14244
- })), isOpen && React__default.createElement(React.Fragment, null, isPrint ? renderPrintProblems() : renderProblems()));
13834
+ })), isOpen && React__default.createElement(React.Fragment, null, renderProblems()));
14245
13835
  };
14246
13836
 
14247
13837
  var ProtractedProblem = function ProtractedProblem(_ref) {
@@ -14249,7 +13839,6 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14249
13839
  data = _ref.data,
14250
13840
  openProblem = _ref.openProblem,
14251
13841
  changeOpen = _ref.changeOpen,
14252
- isPrint = _ref.isPrint,
14253
13842
  isMyStoryStudent = _ref.isMyStoryStudent;
14254
13843
  var _useTranslation = reactI18next.useTranslation(),
14255
13844
  t = _useTranslation.t;
@@ -14324,21 +13913,12 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14324
13913
  }, formatTimeSecond(item.topDuration, t)))));
14325
13914
  });
14326
13915
  };
14327
- var renderPrintQuestions = function renderPrintQuestions() {
14328
- var chunkedData = _.chunk(data, 5);
14329
- return chunkedData.map(function (i, index) {
14330
- return React__default.createElement("tbody", {
14331
- key: index,
14332
- className: PrintContentClassName
14333
- }, isMyStoryStudent ? renderTableBody(i) : renderQuestions(i));
14334
- });
14335
- };
14336
13916
  return React__default.createElement("div", {
14337
- className: styles$4["wrapperProblem"] + " " + (isPrint ? PrintContainerClassName : "")
13917
+ className: "" + styles$4["wrapperProblem"]
14338
13918
  }, React__default.createElement("div", {
14339
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintTitleClassName : ""),
13919
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14340
13920
  onClick: function onClick() {
14341
- return changeOpen(isOpen ? "" : keyOpen);
13921
+ return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
14342
13922
  }
14343
13923
  }, React__default.createElement(material.Stack, {
14344
13924
  flexDirection: "row",
@@ -14374,8 +13954,7 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14374
13954
  }, isMyStoryStudent && React__default.createElement("thead", {
14375
13955
  style: {
14376
13956
  borderBottom: "1px solid #E4E7EC"
14377
- },
14378
- className: isPrint ? PrintHeaderClassName : ""
13957
+ }
14379
13958
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14380
13959
  className: styles$4["thcolumn1"]
14381
13960
  }, t("problem_number")), React__default.createElement("th", {
@@ -14390,8 +13969,8 @@ var ProtractedProblem = function ProtractedProblem(_ref) {
14390
13969
  style: {
14391
13970
  textAlign: "center"
14392
13971
  }
14393
- }, t("time_comparison")))), isPrint ? renderPrintQuestions() : React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(data) : renderQuestions(data))))) : React__default.createElement("div", {
14394
- className: styles$4["noData"] + " " + (isPrint ? PrintContentClassName : "")
13972
+ }, t("time_comparison")))), React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(data) : renderQuestions(data))))) : React__default.createElement("div", {
13973
+ className: "" + styles$4["noData"]
14395
13974
  }, t("no_data"))));
14396
13975
  };
14397
13976
 
@@ -14400,7 +13979,6 @@ var Vulnerable = function Vulnerable(_ref) {
14400
13979
  keyOpen = _ref.keyOpen,
14401
13980
  openProblem = _ref.openProblem,
14402
13981
  changeOpen = _ref.changeOpen,
14403
- isPrint = _ref.isPrint,
14404
13982
  isMyStoryStudent = _ref.isMyStoryStudent;
14405
13983
  var _useTranslation = reactI18next.useTranslation(),
14406
13984
  t = _useTranslation.t;
@@ -14464,11 +14042,13 @@ var Vulnerable = function Vulnerable(_ref) {
14464
14042
  return questions.map(function (question) {
14465
14043
  return React__default.createElement(material.Grid, {
14466
14044
  container: true,
14045
+ flexWrap: "nowrap",
14467
14046
  className: styles$4["content"],
14468
14047
  key: question.id
14469
14048
  }, React__default.createElement(material.Grid, {
14470
14049
  item: true,
14471
14050
  xs: 1.5,
14051
+ minWidth: "120px",
14472
14052
  className: styles$4["contentColumn1"]
14473
14053
  }, React__default.createElement("div", null, React__default.createElement("span", {
14474
14054
  className: styles$4["span1"]
@@ -14495,22 +14075,14 @@ var Vulnerable = function Vulnerable(_ref) {
14495
14075
  }), ")"))));
14496
14076
  });
14497
14077
  };
14498
- var renderPrintQuestions = function renderPrintQuestions(questions) {
14499
- var chunkedQuestions = _.chunk(questions, 5);
14500
- return chunkedQuestions.map(function (i, index) {
14501
- return React__default.createElement("tbody", {
14502
- key: index,
14503
- className: PrintContentClassName
14504
- }, isMyStoryStudent ? renderTableBody(i) : renderQuestions(i));
14505
- });
14078
+ var handleToggle = function handleToggle() {
14079
+ changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : keyOpen);
14506
14080
  };
14507
14081
  return React__default.createElement("div", {
14508
- className: styles$4["wrapperProblem"] + " " + PrintContainerClassName
14082
+ className: "" + styles$4["wrapperProblem"]
14509
14083
  }, React__default.createElement("div", {
14510
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintTitleClassName : ""),
14511
- onClick: function onClick() {
14512
- return changeOpen(isOpen ? "" : keyOpen);
14513
- }
14084
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14085
+ onClick: handleToggle
14514
14086
  }, React__default.createElement(material.Stack, {
14515
14087
  flexDirection: "row",
14516
14088
  gap: "24px",
@@ -14537,16 +14109,15 @@ var Vulnerable = function Vulnerable(_ref) {
14537
14109
  className: styles$4["tableCompareGrass"]
14538
14110
  }, React__default.createElement("div", {
14539
14111
  className: styles$4["table-responsive"]
14540
- }, React__default.createElement(material.Table, {
14112
+ }, isMyStoryStudent && React__default.createElement(material.Table, {
14541
14113
  style: {
14542
14114
  width: "100%",
14543
14115
  marginBottom: isMyStoryStudent ? "120px" : 0
14544
14116
  }
14545
- }, isMyStoryStudent && React__default.createElement("thead", {
14117
+ }, React__default.createElement("thead", {
14546
14118
  style: {
14547
14119
  borderBottom: "1px solid #E4E7EC"
14548
- },
14549
- className: isPrint ? PrintHeaderClassName : ""
14120
+ }
14550
14121
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14551
14122
  className: styles$4["thcolumn1"]
14552
14123
  }, t("problem_number")), React__default.createElement("th", {
@@ -14565,23 +14136,44 @@ var Vulnerable = function Vulnerable(_ref) {
14565
14136
  style: {
14566
14137
  textAlign: "center"
14567
14138
  }
14568
- }, t("_category")))), isPrint ? renderPrintQuestions(incorrectQuestions) : React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(incorrectQuestions) : renderQuestions(incorrectQuestions))))) : React__default.createElement("div", {
14569
- className: styles$4["noData"] + " " + (isPrint ? PrintContentClassName : "")
14139
+ }, t("_category")))), React__default.createElement("tbody", null, renderTableBody(incorrectQuestions))), !isMyStoryStudent && renderQuestions(incorrectQuestions))) : React__default.createElement("div", {
14140
+ className: "" + styles$4["noData"]
14570
14141
  }, t("no_data"))));
14571
14142
  };
14572
14143
 
14144
+ var AnswerResponseSignal;
14145
+ (function (AnswerResponseSignal) {
14146
+ AnswerResponseSignal[AnswerResponseSignal["Purple"] = 0] = "Purple";
14147
+ AnswerResponseSignal[AnswerResponseSignal["Red"] = 1] = "Red";
14148
+ AnswerResponseSignal[AnswerResponseSignal["Yellow"] = 2] = "Yellow";
14149
+ AnswerResponseSignal[AnswerResponseSignal["Green"] = 3] = "Green";
14150
+ AnswerResponseSignal[AnswerResponseSignal["Black"] = 4] = "Black";
14151
+ })(AnswerResponseSignal || (AnswerResponseSignal = {}));
14152
+ var ProblemKey;
14153
+ (function (ProblemKey) {
14154
+ ProblemKey[ProblemKey["TrickyProblem"] = 0] = "TrickyProblem";
14155
+ ProblemKey[ProblemKey["ProtractedProblem"] = 1] = "ProtractedProblem";
14156
+ ProblemKey[ProblemKey["GradesByTerritory"] = 2] = "GradesByTerritory";
14157
+ ProblemKey[ProblemKey["Vulnerable"] = 3] = "Vulnerable";
14158
+ })(ProblemKey || (ProblemKey = {}));
14159
+ var PrintState;
14160
+ (function (PrintState) {
14161
+ PrintState[PrintState["Default"] = 0] = "Default";
14162
+ PrintState[PrintState["Printing"] = 1] = "Printing";
14163
+ PrintState[PrintState["Pending"] = 2] = "Pending";
14164
+ PrintState[PrintState["Printed"] = 3] = "Printed";
14165
+ })(PrintState || (PrintState = {}));
14166
+
14573
14167
  var GradesByTerritory = function GradesByTerritory(_ref) {
14574
- var keyOpen = _ref.keyOpen,
14575
- data = _ref.data,
14168
+ var data = _ref.data,
14576
14169
  openProblem = _ref.openProblem,
14577
14170
  changeOpen = _ref.changeOpen,
14578
- isPrint = _ref.isPrint,
14579
14171
  resultData = _ref.resultData,
14580
14172
  isMyStoryStudent = _ref.isMyStoryStudent;
14581
14173
  var _useTranslation = reactI18next.useTranslation(),
14582
14174
  t = _useTranslation.t;
14583
14175
  var formattedData = totalSolveTimeCategories(resultData, data);
14584
- var isOpen = openProblem === keyOpen;
14176
+ var isOpen = openProblem === ProblemKey.GradesByTerritory;
14585
14177
  var renderTableBody = function renderTableBody(data) {
14586
14178
  return data.map(function (item, index) {
14587
14179
  return React__default.createElement("tr", {
@@ -14655,21 +14247,12 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
14655
14247
  }))));
14656
14248
  });
14657
14249
  };
14658
- var renderPrintCategories = function renderPrintCategories() {
14659
- var chunkedCategories = _.chunk(formattedData, 10);
14660
- return chunkedCategories.map(function (i, index) {
14661
- return React__default.createElement("tbody", {
14662
- key: index,
14663
- className: PrintContentClassName
14664
- }, isMyStoryStudent ? renderTableBody(i) : renderCategories(i));
14665
- });
14666
- };
14667
14250
  return React__default.createElement("div", {
14668
- className: styles$4["wrapperProblem"] + " " + (isPrint ? PrintContainerClassName : "")
14251
+ className: "" + styles$4["wrapperProblem"]
14669
14252
  }, React__default.createElement("div", {
14670
- className: (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]) + " " + (isPrint ? PrintTitleClassName : ""),
14253
+ className: "" + (!isOpen ? styles$4["titleProblemClose"] : styles$4["titleProblem"]),
14671
14254
  onClick: function onClick() {
14672
- return changeOpen(isOpen ? "" : keyOpen);
14255
+ return changeOpen === null || changeOpen === void 0 ? void 0 : changeOpen(isOpen ? undefined : ProblemKey.GradesByTerritory);
14673
14256
  }
14674
14257
  }, React__default.createElement(material.Typography, {
14675
14258
  sx: {
@@ -14687,16 +14270,15 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
14687
14270
  className: styles$4["tableCompareGrass"]
14688
14271
  }, React__default.createElement("div", {
14689
14272
  className: styles$4["table-responsive"]
14690
- }, React__default.createElement(material.Table, {
14273
+ }, isMyStoryStudent && React__default.createElement(material.Table, {
14691
14274
  style: {
14692
14275
  width: "100%",
14693
14276
  marginBottom: isMyStoryStudent ? "120px" : 0
14694
14277
  }
14695
- }, isMyStoryStudent && React__default.createElement("thead", {
14278
+ }, React__default.createElement("thead", {
14696
14279
  style: {
14697
14280
  borderBottom: "1px solid #E4E7EC"
14698
- },
14699
- className: isPrint ? PrintHeaderClassName : ""
14281
+ }
14700
14282
  }, React__default.createElement("tr", null, React__default.createElement("th", {
14701
14283
  className: styles$4["thcolumn1"]
14702
14284
  }, t("categories")), React__default.createElement("th", {
@@ -14715,8 +14297,8 @@ var GradesByTerritory = function GradesByTerritory(_ref) {
14715
14297
  style: {
14716
14298
  textAlign: "center"
14717
14299
  }
14718
- }, t("total_solve_time")))), isPrint ? renderPrintCategories() : React__default.createElement("tbody", null, isMyStoryStudent ? renderTableBody(formattedData) : renderCategories(formattedData))))) : React__default.createElement("div", {
14719
- className: styles$4["noData"] + " " + (isPrint ? PrintContentClassName : "")
14300
+ }, t("total_solve_time")))), React__default.createElement("tbody", null, renderTableBody(formattedData))), !isMyStoryStudent && renderCategories(formattedData))) : React__default.createElement("div", {
14301
+ className: "" + styles$4["noData"]
14720
14302
  }, t("no_data"))));
14721
14303
  };
14722
14304
 
@@ -14920,23 +14502,379 @@ var useTab = function useTab() {
14920
14502
  };
14921
14503
  };
14922
14504
 
14505
+ var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, totalChart, onSuccess, onError, autoPrint) {
14506
+ if (autoPrint === void 0) {
14507
+ autoPrint = false;
14508
+ }
14509
+ var contentRef = React.useRef(null);
14510
+ var _useState = React.useState([]),
14511
+ renderedCharts = _useState[0],
14512
+ setRenderedCharts = _useState[1];
14513
+ var _useTranslation = reactI18next.useTranslation(),
14514
+ t = _useTranslation.t;
14515
+ var _useState2 = React.useState(PrintState.Default),
14516
+ printState = _useState2[0],
14517
+ setPrintState = _useState2[1];
14518
+ var setRenderedChart = function setRenderedChart(chart) {
14519
+ setRenderedCharts(function (state) {
14520
+ return [].concat(state, [chart]);
14521
+ });
14522
+ };
14523
+ var reset = function reset() {
14524
+ setRenderedCharts([]);
14525
+ setPrintState(PrintState.Default);
14526
+ };
14527
+ var autoPrintPdf = function autoPrintPdf() {
14528
+ if (printState === PrintState.Printing) return;
14529
+ if (autoPrint && printState !== PrintState.Default) return;
14530
+ if (totalChart !== renderedCharts.length) {
14531
+ !autoPrint && setPrintState(PrintState.Pending);
14532
+ return;
14533
+ }
14534
+ var name = !fileName ? "Exam-Result_" + new Date().getTime() : fileName;
14535
+ if (contentRef.current && contentRef.current != null) {
14536
+ setPrintState(PrintState.Printing);
14537
+ setTimeout(function () {
14538
+ try {
14539
+ var _temp2 = function _temp2() {
14540
+ setPrintState(PrintState.Printed);
14541
+ };
14542
+ var _temp = _catch(function () {
14543
+ var element = contentRef.current;
14544
+ var options = {
14545
+ margin: 5,
14546
+ filename: name + ".pdf",
14547
+ html2canvas: {
14548
+ scale: 2
14549
+ },
14550
+ jsPDF: {
14551
+ format: 'a4',
14552
+ orientation: 'portrait'
14553
+ },
14554
+ pagebreak: {
14555
+ mode: ['avoid-all', 'css', 'legacy']
14556
+ }
14557
+ };
14558
+ return Promise.resolve(html2pdf().from(element).set(options).save()).then(function () {
14559
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
14560
+ });
14561
+ }, function (error) {
14562
+ !window.opener && reactToastify.toast.error(getErrorMessage(t, error));
14563
+ onError === null || onError === void 0 ? void 0 : onError(error === null || error === void 0 ? void 0 : error.message);
14564
+ });
14565
+ return Promise.resolve(_temp && _temp.then ? _temp.then(_temp2) : _temp2(_temp));
14566
+ } catch (e) {
14567
+ return Promise.reject(e);
14568
+ }
14569
+ }, 300);
14570
+ }
14571
+ };
14572
+ var handlePrintPdf = function handlePrintPdf() {
14573
+ autoPrintPdf();
14574
+ };
14575
+ React.useEffect(function () {
14576
+ (autoPrint || printState === PrintState.Pending) && isDataFetching === false && autoPrintPdf();
14577
+ }, [totalChart, renderedCharts.length, fileName, autoPrint, printState, isDataFetching]);
14578
+ React.useEffect(function () {
14579
+ isDataFetching && reset();
14580
+ }, [isDataFetching]);
14581
+ return {
14582
+ contentRef: contentRef,
14583
+ printState: printState,
14584
+ setRenderedChart: setRenderedChart,
14585
+ handlePrintPdf: handlePrintPdf,
14586
+ reset: reset
14587
+ };
14588
+ };
14589
+
14590
+ var printStyles = {"page-break":"_35kyG","print-exact-color":"_1PFgl","avoid-break-inside":"_3rPGh"};
14591
+
14592
+ var TimeOrderChart = function TimeOrderChart(_ref) {
14593
+ var timelyOrderQuestion = _ref.timelyOrderQuestion,
14594
+ options = _ref.options,
14595
+ series = _ref.series,
14596
+ setIsRendered = _ref.setIsRendered;
14597
+ var _useTranslation = reactI18next.useTranslation(),
14598
+ t = _useTranslation.t;
14599
+ var chartRef = React.useRef(null);
14600
+ var chartOptions = _extends({}, options, {
14601
+ chart: _extends({}, options.chart, {
14602
+ animations: {
14603
+ enabled: false
14604
+ }
14605
+ })
14606
+ });
14607
+ React.useEffect(function () {
14608
+ if (chartRef.current) {
14609
+ setIsRendered(timelyOrderQuestion.article);
14610
+ }
14611
+ }, [timelyOrderQuestion.article]);
14612
+ return React__default.createElement("div", {
14613
+ className: "" + printStyles["avoid-break-inside"]
14614
+ }, React__default.createElement(material.Typography, {
14615
+ className: "pb-2",
14616
+ sx: {
14617
+ fontSize: "14px",
14618
+ fontWeight: 700,
14619
+ color: "#414E62"
14620
+ }
14621
+ }, t("article_number"), " ", timelyOrderQuestion.article), React__default.createElement("div", {
14622
+ className: "" + styles$4["compareChart"]
14623
+ }, React__default.createElement("div", {
14624
+ className: "" + styles$4["prevChart"]
14625
+ }), React__default.createElement("div", {
14626
+ className: styles$4["chart"] + " sr-line-chart"
14627
+ }, React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
14628
+ ref: chartRef,
14629
+ height: 389,
14630
+ options: chartOptions,
14631
+ series: series
14632
+ }))), React__default.createElement("div", {
14633
+ className: "" + styles$4["nextChart"]
14634
+ })));
14635
+ };
14636
+
14637
+ var textStyle = {
14638
+ fontSize: "18px",
14639
+ fontWeight: 700,
14640
+ color: styles.gray_500
14641
+ };
14642
+ var courseNameStyle = {
14643
+ fontSize: "14px",
14644
+ fontWeight: 600,
14645
+ color: styles.less_dark
14646
+ };
14647
+ var examTitleStyle = {
14648
+ fontSize: "20px",
14649
+ fontWeight: 600,
14650
+ color: styles.darker
14651
+ };
14652
+ var studentNameStyle = {
14653
+ fontSize: "24px",
14654
+ fontWeight: 600,
14655
+ color: styles.darker,
14656
+ lineHeight: 1
14657
+ };
14658
+ var PrintExamResult = function PrintExamResult(_ref) {
14659
+ var resultData = _ref.resultData,
14660
+ examTime = _ref.examTime,
14661
+ isStudent = _ref.isStudent,
14662
+ categoryResponses = _ref.categoryResponses,
14663
+ timelyOrderQuestions = _ref.timelyOrderQuestions,
14664
+ allChartOptions = _ref.allChartOptions,
14665
+ allSeries = _ref.allSeries,
14666
+ effectSize = _ref.effectSize,
14667
+ isMyStoryStudent = _ref.isMyStoryStudent,
14668
+ longTimeSpend = _ref.longTimeSpend,
14669
+ contentRef = _ref.contentRef,
14670
+ setRenderedChart = _ref.setRenderedChart;
14671
+ var academy = reactRedux.useSelector(function (state) {
14672
+ var _state$common;
14673
+ return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.academy;
14674
+ });
14675
+ return React__default.createElement(material.Box, {
14676
+ sx: {
14677
+ minWidth: "768px",
14678
+ width: "768px",
14679
+ maxWidth: "768px!important",
14680
+ background: "#FFF",
14681
+ padding: "24px",
14682
+ overflow: "auto"
14683
+ },
14684
+ id: "canvas",
14685
+ className: printStyles["print-exact-color"] + " " + printStyles["container"],
14686
+ ref: contentRef
14687
+ }, React__default.createElement(material.Grid, {
14688
+ container: true,
14689
+ marginBottom: "24px"
14690
+ }, React__default.createElement(material.Grid, {
14691
+ item: true,
14692
+ xs: 12
14693
+ }, React__default.createElement(material.Stack, {
14694
+ direction: "row",
14695
+ justifyContent: "space-between",
14696
+ flexWrap: "nowrap",
14697
+ spacing: 1,
14698
+ marginBottom: "12px"
14699
+ }, React__default.createElement(material.Stack, {
14700
+ direction: "column"
14701
+ }, React__default.createElement(material.Typography, {
14702
+ sx: studentNameStyle
14703
+ }, resultData.student.fullName), React__default.createElement(material.Typography, {
14704
+ sx: {
14705
+ fontSize: "16px",
14706
+ fontWeight: 600,
14707
+ color: styles.gray_500
14708
+ }
14709
+ }, resultData.student.email)), academy && React__default.createElement(material.Typography, {
14710
+ sx: _extends({}, studentNameStyle, {
14711
+ textAlign: "end"
14712
+ })
14713
+ }, academy.name)), resultData.courseName && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
14714
+ sx: courseNameStyle
14715
+ }, resultData.courseName)), React__default.createElement(material.Box, {
14716
+ display: "flex",
14717
+ gap: "16px",
14718
+ flexDirection: "column"
14719
+ }, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
14720
+ sx: examTitleStyle
14721
+ }, resultData.title)), React__default.createElement(material.Stack, {
14722
+ flexDirection: "row",
14723
+ gap: "16px"
14724
+ }, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
14725
+ sx: {
14726
+ fontSize: "13px",
14727
+ fontWeight: 600,
14728
+ color: styles.gray_500
14729
+ }
14730
+ }, i18n.t("my_score")), React__default.createElement(material.Typography, {
14731
+ sx: {
14732
+ fontSize: "14px",
14733
+ fontWeight: 600,
14734
+ color: styles.darker
14735
+ }
14736
+ }, i18n.t("score_format", {
14737
+ score: resultData === null || resultData === void 0 ? void 0 : resultData.score
14738
+ }))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
14739
+ sx: {
14740
+ fontSize: "13px",
14741
+ fontWeight: 600,
14742
+ color: styles.gray_500
14743
+ }
14744
+ }, i18n.t("exam_date")), React__default.createElement(material.Typography, {
14745
+ sx: {
14746
+ fontSize: "14px",
14747
+ fontWeight: 600,
14748
+ color: styles.gray_700
14749
+ }
14750
+ }, utcToLocalTime(resultData === null || resultData === void 0 ? void 0 : resultData.startTime, i18n.t("date_format")))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
14751
+ sx: {
14752
+ fontSize: "13px",
14753
+ fontWeight: 600,
14754
+ color: styles.gray_500
14755
+ }
14756
+ }, i18n.t("exam_time")), React__default.createElement(material.Typography, {
14757
+ sx: {
14758
+ fontSize: "14px",
14759
+ fontWeight: 600,
14760
+ color: styles.gray_700
14761
+ }
14762
+ }, examTime)), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
14763
+ sx: {
14764
+ fontSize: "13px",
14765
+ fontWeight: 600,
14766
+ color: styles.gray_500
14767
+ }
14768
+ }, i18n.t("total_students")), React__default.createElement(material.Typography, {
14769
+ sx: {
14770
+ fontSize: "14px",
14771
+ fontWeight: 600,
14772
+ color: styles.gray_700
14773
+ }
14774
+ }, i18n.t("number_people", {
14775
+ number: resultData === null || resultData === void 0 ? void 0 : resultData.totalStudent
14776
+ }))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
14777
+ sx: {
14778
+ fontSize: "13px",
14779
+ fontWeight: 600,
14780
+ color: styles.gray_500
14781
+ }
14782
+ }, i18n.t("teacher_in_charge")), React__default.createElement(material.Typography, {
14783
+ sx: {
14784
+ fontSize: "14px",
14785
+ fontWeight: 600,
14786
+ color: styles.gray_700
14787
+ }
14788
+ }, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), React__default.createElement(material.Stack, {
14789
+ display: "flex",
14790
+ flexDirection: "column",
14791
+ gap: "12px"
14792
+ }, React__default.createElement(material.Typography, {
14793
+ sx: textStyle
14794
+ }, i18n.t(TabList[0].label)), React__default.createElement(MyAnswer, {
14795
+ data: resultData,
14796
+ categories: categoryResponses,
14797
+ isStudent: isStudent
14798
+ })), React__default.createElement(material.Stack, {
14799
+ display: "flex",
14800
+ flexDirection: "column",
14801
+ gap: "12px",
14802
+ marginTop: "24px"
14803
+ }, React__default.createElement(material.Typography, {
14804
+ sx: textStyle
14805
+ }, i18n.t(TabList[1].label)), timelyOrderQuestions.map(function (timelyOrderQuestion, index) {
14806
+ return React__default.createElement(TimeOrderChart, {
14807
+ key: index,
14808
+ timelyOrderQuestion: timelyOrderQuestion,
14809
+ options: allChartOptions[index],
14810
+ series: allSeries[index],
14811
+ setIsRendered: setRenderedChart
14812
+ });
14813
+ })), React__default.createElement(material.Stack, {
14814
+ display: "flex",
14815
+ flexDirection: "column",
14816
+ gap: "12px",
14817
+ marginTop: "24px"
14818
+ }, React__default.createElement(material.Typography, {
14819
+ sx: textStyle
14820
+ }, i18n.t(TabList[2].label)), React__default.createElement(CompareGrass, {
14821
+ effectSize: effectSize
14822
+ })), React__default.createElement(material.Stack, {
14823
+ display: "flex",
14824
+ flexDirection: "column",
14825
+ gap: "12px",
14826
+ marginTop: "24px"
14827
+ }, React__default.createElement(material.Typography, {
14828
+ sx: textStyle
14829
+ }, i18n.t(TabList[3].label)), React__default.createElement(TrickyProblem, {
14830
+ keyOpen: ProblemKey.TrickyProblem,
14831
+ data: resultData,
14832
+ openProblem: ProblemKey.TrickyProblem
14833
+ }), React__default.createElement(Vulnerable, {
14834
+ keyOpen: ProblemKey.Vulnerable,
14835
+ data: resultData,
14836
+ openProblem: ProblemKey.Vulnerable,
14837
+ isMyStoryStudent: isMyStoryStudent
14838
+ }), React__default.createElement(ProtractedProblem, {
14839
+ keyOpen: ProblemKey.ProtractedProblem,
14840
+ data: longTimeSpend,
14841
+ openProblem: ProblemKey.ProtractedProblem,
14842
+ isMyStoryStudent: isMyStoryStudent
14843
+ }), React__default.createElement(GradesByTerritory, {
14844
+ data: categoryResponses,
14845
+ resultData: resultData,
14846
+ openProblem: ProblemKey.GradesByTerritory,
14847
+ isMyStoryStudent: isMyStoryStudent
14848
+ })));
14849
+ };
14850
+
14923
14851
  var ExamResultV2 = function ExamResultV2(_ref) {
14924
14852
  var searchParams = _ref.searchParams,
14925
14853
  history = _ref.history,
14926
- examSessionId = _ref.examSessionId,
14927
- studentId = _ref.studentId,
14854
+ _ref$examSessionId = _ref.examSessionId,
14855
+ examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
14856
+ _ref$studentId = _ref.studentId,
14857
+ studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
14928
14858
  code = _ref.code,
14929
14859
  isMyStoryStudent = _ref.isMyStoryStudent;
14930
14860
  var _useTab = useTab(),
14931
14861
  selected = _useTab.selected,
14932
14862
  handleChangeTab = _useTab.handleChangeTab;
14933
- var _useExamResult = useExamResult(searchParams, history, examSessionId, studentId, code, handleChangeTab, selected),
14863
+ var _useExamResult = useExamResult({
14864
+ searchParams: searchParams,
14865
+ history: history,
14866
+ examSessionId: examSessionId,
14867
+ studentId: studentId,
14868
+ code: code,
14869
+ handleChangeTab: handleChangeTab,
14870
+ selectedTab: selected
14871
+ }),
14934
14872
  isLoading = _useExamResult.isLoading,
14935
14873
  examTime = _useExamResult.examTime,
14936
14874
  series = _useExamResult.series,
14937
14875
  allSeries = _useExamResult.allSeries,
14938
- chartOptions = _useExamResult.chartOptions,
14939
14876
  allChartOptions = _useExamResult.allChartOptions,
14877
+ chartOptions = _useExamResult.chartOptions,
14940
14878
  dataChartIndex = _useExamResult.dataChartIndex,
14941
14879
  timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
14942
14880
  isStudent = _useExamResult.isStudent,
@@ -14945,7 +14883,6 @@ var ExamResultV2 = function ExamResultV2(_ref) {
14945
14883
  longTimeSpend = _useExamResult.longTimeSpend,
14946
14884
  effectSize = _useExamResult.effectSize,
14947
14885
  categoryResponses = _useExamResult.categoryResponses,
14948
- handleExportPdf = _useExamResult.handleExportPdf,
14949
14886
  setOpenProblem = _useExamResult.setOpenProblem,
14950
14887
  handlePrevChart = _useExamResult.handlePrevChart,
14951
14888
  handleNextChart = _useExamResult.handleNextChart;
@@ -14955,9 +14892,15 @@ var ExamResultV2 = function ExamResultV2(_ref) {
14955
14892
  handleCreateQuestion = _useCreateQuestionDia.handleCreateQuestion,
14956
14893
  openCreateQuestionDialog = _useCreateQuestionDia.openCreateQuestionDialog,
14957
14894
  toggleCreateQuestion = _useCreateQuestionDia.toggleCreateQuestion;
14895
+ var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
14896
+ var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length),
14897
+ contentRef = _usePrintExamResult.contentRef,
14898
+ printState = _usePrintExamResult.printState,
14899
+ handlePrintPdf = _usePrintExamResult.handlePrintPdf,
14900
+ setRenderedChart = _usePrintExamResult.setRenderedChart;
14958
14901
  var isTabletUp = material.useMediaQuery('(min-width:900px)');
14959
14902
  return React__default.createElement(React.Fragment, null, React__default.createElement(LoadingComponent, {
14960
- isLoading: isLoading
14903
+ isLoading: !!isLoading
14961
14904
  }), timelyOrderQuestions[dataChartIndex] && longTimeSpend && resultData && effectSize ? React__default.createElement("div", {
14962
14905
  style: {
14963
14906
  width: "100%"
@@ -15073,7 +15016,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15073
15016
  className: styles$4["pdfBtnBox"]
15074
15017
  }, React__default.createElement("button", {
15075
15018
  className: styles$4["pdfBtn"] + " " + styles["truncate"],
15076
- onClick: handleExportPdf
15019
+ onClick: handlePrintPdf
15077
15020
  }, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print_all"))))))), React__default.createElement(material.Grid, {
15078
15021
  item: true,
15079
15022
  xs: 12
@@ -15119,7 +15062,7 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15119
15062
  className: styles$4["pdfBtnBox"]
15120
15063
  }, React__default.createElement("button", {
15121
15064
  className: styles$4["pdfBtn"] + " " + styles["truncate"],
15122
- onClick: handleExportPdf
15065
+ onClick: handlePrintPdf
15123
15066
  }, React__default.createElement(iconPrintFill, null), React__default.createElement("p", null, t("print"))))))), React__default.createElement(material.Grid, {
15124
15067
  item: true,
15125
15068
  xs: 12
@@ -15156,240 +15099,54 @@ var ExamResultV2 = function ExamResultV2(_ref) {
15156
15099
  value: selected,
15157
15100
  index: 3
15158
15101
  }, React__default.createElement(TrickyProblem, {
15159
- keyOpen: "TrickyProblem",
15102
+ keyOpen: ProblemKey.TrickyProblem,
15160
15103
  data: resultData,
15161
15104
  openProblem: openProblem,
15162
15105
  changeOpen: setOpenProblem
15163
15106
  }), React__default.createElement(Vulnerable, {
15164
- keyOpen: "Vulnerable",
15107
+ keyOpen: ProblemKey.Vulnerable,
15165
15108
  data: resultData,
15166
15109
  openProblem: openProblem,
15167
15110
  changeOpen: setOpenProblem,
15168
15111
  isMyStoryStudent: isMyStoryStudent
15169
15112
  }), React__default.createElement(ProtractedProblem, {
15170
- keyOpen: "ProtractedProblem",
15113
+ keyOpen: ProblemKey.ProtractedProblem,
15171
15114
  data: longTimeSpend,
15172
15115
  openProblem: openProblem,
15173
15116
  changeOpen: setOpenProblem,
15174
15117
  isMyStoryStudent: isMyStoryStudent
15175
15118
  }), React__default.createElement(GradesByTerritory, {
15176
- keyOpen: "GradesByTerritory",
15177
15119
  data: categoryResponses,
15178
15120
  resultData: resultData,
15179
15121
  openProblem: openProblem,
15180
15122
  isMyStoryStudent: isMyStoryStudent,
15181
15123
  changeOpen: setOpenProblem
15182
- }))), React__default.createElement(material.Grid, {
15183
- item: true,
15184
- xs: 12,
15185
- className: "position-absolute",
15186
- sx: {
15187
- zIndex: -1,
15188
- width: "1024px"
15189
- },
15190
- id: "canvas"
15191
- }, React__default.createElement(material.Grid, {
15192
- container: true,
15193
- padding: "24px",
15194
- id: "header-canvas"
15195
- }, React__default.createElement(material.Grid, {
15196
- item: true
15197
- }, resultData.courseName && React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15198
- sx: {
15199
- fontSize: "14px",
15200
- fontWeight: 600,
15201
- color: styles.less_dark
15202
- }
15203
- }, resultData.courseName)), React__default.createElement(material.Box, {
15204
- display: "flex",
15205
- gap: "16px",
15206
- flexDirection: "column"
15207
- }, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15208
- sx: {
15209
- fontSize: "20px",
15210
- fontWeight: 600,
15211
- color: styles.darker
15212
- }
15213
- }, resultData.title)), React__default.createElement(material.Stack, {
15214
- flexDirection: "row",
15215
- gap: "16px"
15216
- }, React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15217
- sx: {
15218
- fontSize: "13px",
15219
- fontWeight: 600,
15220
- color: styles.gray_500
15221
- }
15222
- }, t("my_score")), React__default.createElement(material.Typography, {
15223
- sx: {
15224
- fontSize: "14px",
15225
- fontWeight: 600,
15226
- color: styles.darker
15227
- }
15228
- }, t("score_format", {
15229
- score: resultData === null || resultData === void 0 ? void 0 : resultData.score
15230
- }))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15231
- sx: {
15232
- fontSize: "13px",
15233
- fontWeight: 600,
15234
- color: styles.gray_500
15235
- }
15236
- }, t("exam_date")), React__default.createElement(material.Typography, {
15237
- sx: {
15238
- fontSize: "14px",
15239
- fontWeight: 600,
15240
- color: styles.gray_700
15241
- }
15242
- }, utcToLocalTime(resultData === null || resultData === void 0 ? void 0 : resultData.startTime, t("date_format")))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15243
- sx: {
15244
- fontSize: "13px",
15245
- fontWeight: 600,
15246
- color: styles.gray_500
15247
- }
15248
- }, t("exam_time")), React__default.createElement(material.Typography, {
15249
- sx: {
15250
- fontSize: "14px",
15251
- fontWeight: 600,
15252
- color: styles.gray_700
15253
- }
15254
- }, examTime)), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15255
- sx: {
15256
- fontSize: "13px",
15257
- fontWeight: 600,
15258
- color: styles.gray_500
15259
- }
15260
- }, t("total_students")), React__default.createElement(material.Typography, {
15261
- sx: {
15262
- fontSize: "14px",
15263
- fontWeight: 600,
15264
- color: styles.gray_700
15265
- }
15266
- }, t("number_people", {
15267
- number: resultData === null || resultData === void 0 ? void 0 : resultData.totalStudent
15268
- }))), React__default.createElement(material.Stack, null, React__default.createElement(material.Typography, {
15269
- sx: {
15270
- fontSize: "13px",
15271
- fontWeight: 600,
15272
- color: styles.gray_500
15273
- }
15274
- }, t("teacher_in_charge")), React__default.createElement(material.Typography, {
15275
- sx: {
15276
- fontSize: "14px",
15277
- fontWeight: 600,
15278
- color: styles.gray_700
15279
- }
15280
- }, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), React__default.createElement(material.Stack, {
15281
- display: "flex",
15282
- flexDirection: "column",
15283
- gap: "12px"
15284
- }, React__default.createElement(material.Typography, {
15285
- className: "chart-title",
15286
- sx: {
15287
- fontSize: "18px",
15288
- fontWeight: 700,
15289
- color: styles.gray_500
15290
- }
15291
- }, t(TabList[0].label)), React__default.createElement(MyAnswer, {
15292
- data: resultData,
15293
- categories: categoryResponses,
15294
- isStudent: isStudent,
15295
- isPrint: true
15296
- })), React__default.createElement(material.Stack, {
15297
- display: "flex",
15298
- flexDirection: "column",
15299
- gap: "12px",
15300
- marginTop: "24px"
15301
- }, React__default.createElement(material.Typography, {
15302
- className: "chart-title",
15303
- sx: {
15304
- fontSize: "18px",
15305
- fontWeight: 700,
15306
- color: styles.gray_500
15307
- }
15308
- }, t(TabList[1].label)), timelyOrderQuestions.map(function (timelyOrderQuestion, index) {
15309
- return React__default.createElement("div", {
15310
- key: index,
15311
- className: PrintContainerClassName
15312
- }, React__default.createElement(material.Typography, {
15313
- className: "pb-2 " + PrintHeaderClassName,
15314
- sx: {
15315
- fontSize: "14px",
15316
- fontWeight: 700,
15317
- color: "#414E62"
15318
- }
15319
- }, t("article_number"), " ", timelyOrderQuestion.article), React__default.createElement("div", {
15320
- className: styles$4["compareChart"] + " " + PrintContentClassName
15321
- }, React__default.createElement("div", {
15322
- className: "" + styles$4["prevChart"]
15323
- }), React__default.createElement("div", {
15324
- className: styles$4["chart"] + " sr-line-chart"
15325
- }, React__default.createElement("div", null, React__default.createElement(ReactApexChart, {
15326
- height: 389,
15327
- options: allChartOptions[index],
15328
- series: allSeries[index]
15329
- }))), React__default.createElement("div", {
15330
- className: "" + styles$4["nextChart"]
15331
- })));
15332
- })), React__default.createElement(material.Stack, {
15333
- display: "flex",
15334
- flexDirection: "column",
15335
- gap: "12px",
15336
- marginTop: "24px"
15337
- }, React__default.createElement(material.Typography, {
15338
- className: "chart-title",
15339
- sx: {
15340
- fontSize: "18px",
15341
- fontWeight: 700,
15342
- color: styles.gray_500
15343
- }
15344
- }, t(TabList[2].label)), React__default.createElement(CompareGrass, {
15345
- effectSize: effectSize,
15346
- isPrint: true
15347
- })), React__default.createElement(material.Stack, {
15348
- display: "flex",
15349
- flexDirection: "column",
15350
- gap: "12px",
15351
- marginTop: "24px"
15352
- }, React__default.createElement(material.Typography, {
15353
- className: "chart-title",
15354
- sx: {
15355
- fontSize: "18px",
15356
- fontWeight: 700,
15357
- color: styles.gray_500
15358
- }
15359
- }, t(TabList[3].label)), React__default.createElement(TrickyProblem, {
15360
- keyOpen: "TrickyProblem",
15361
- data: resultData,
15362
- openProblem: "TrickyProblem",
15363
- changeOpen: setOpenProblem,
15364
- isPrint: true
15365
- }), React__default.createElement(Vulnerable, {
15366
- keyOpen: "Vulnerable",
15367
- data: resultData,
15368
- openProblem: "Vulnerable",
15369
- changeOpen: setOpenProblem,
15370
- isMyStoryStudent: isMyStoryStudent,
15371
- isPrint: true
15372
- }), React__default.createElement(ProtractedProblem, {
15373
- keyOpen: "ProtractedProblem",
15374
- data: longTimeSpend,
15375
- openProblem: "ProtractedProblem",
15376
- changeOpen: setOpenProblem,
15377
- isPrint: true,
15378
- isMyStoryStudent: isMyStoryStudent
15379
- }), React__default.createElement(GradesByTerritory, {
15380
- keyOpen: "GradesByTerritory",
15381
- data: categoryResponses,
15382
- resultData: resultData,
15383
- openProblem: "GradesByTerritory",
15384
- changeOpen: setOpenProblem,
15385
- isPrint: true,
15386
- isMyStoryStudent: isMyStoryStudent
15387
15124
  })))), React__default.createElement(CreateNewQuestionDialog$1, {
15388
15125
  examSessionId: resultData === null || resultData === void 0 ? void 0 : resultData.examSessionId,
15389
15126
  handleCreateQuestion: handleCreateQuestion,
15390
15127
  openCreateQuestionDialog: openCreateQuestionDialog,
15391
15128
  toggleCreateQuestion: toggleCreateQuestion
15392
- })) : React__default.createElement(React.Fragment, null));
15129
+ }), isLoading === false && React__default.createElement(material.Box, {
15130
+ width: 0,
15131
+ height: 0,
15132
+ overflow: "hidden"
15133
+ }, React__default.createElement(PrintExamResult, {
15134
+ contentRef: contentRef,
15135
+ allChartOptions: allChartOptions,
15136
+ allSeries: allSeries,
15137
+ categoryResponses: categoryResponses,
15138
+ effectSize: effectSize,
15139
+ examTime: examTime,
15140
+ isStudent: isStudent,
15141
+ longTimeSpend: longTimeSpend,
15142
+ resultData: resultData,
15143
+ timelyOrderQuestions: timelyOrderQuestions,
15144
+ isMyStoryStudent: isMyStoryStudent,
15145
+ fileName: fileName,
15146
+ setRenderedChart: setRenderedChart
15147
+ }))) : React__default.createElement(React.Fragment, null), React__default.createElement(LoadingComponent, {
15148
+ isLoading: printState === PrintState.Pending || printState === PrintState.Printing
15149
+ }));
15393
15150
  };
15394
15151
 
15395
15152
  var RecentUserActionSortBy;
@@ -16668,6 +16425,136 @@ var useVirtualizeList = function useVirtualizeList(totalItems, rowHeight, offset
16668
16425
  };
16669
16426
  };
16670
16427
 
16428
+ var usePrintView = function usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage) {
16429
+ var _useState = React.useState(false),
16430
+ isDone = _useState[0],
16431
+ setDone = _useState[1];
16432
+ var handelPrintSuccess = function handelPrintSuccess() {
16433
+ var _window$opener$postMe, _window$opener;
16434
+ var data = {
16435
+ examSessionId: examSessionId,
16436
+ studentId: studentId,
16437
+ succeed: true
16438
+ };
16439
+ 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);
16440
+ setDone(true);
16441
+ };
16442
+ var handelPrintError = function handelPrintError(errorMessage) {
16443
+ var _window$opener$postMe2, _window$opener2;
16444
+ var data = {
16445
+ examSessionId: examSessionId,
16446
+ studentId: studentId,
16447
+ succeed: false,
16448
+ errorMessage: errorMessage
16449
+ };
16450
+ 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);
16451
+ setDone(true);
16452
+ };
16453
+ var fileName = !resultData ? "" : "Exam-Result_" + resultData.student.fullName + "_" + resultData.title + "_(" + utcToLocalTime(resultData.startTime, "MM-DD-YYYY HH:mm") + ")";
16454
+ React.useEffect(function () {
16455
+ setNotFound === null || setNotFound === void 0 ? void 0 : setNotFound(isLoading === false && !!errorMessage);
16456
+ if (isLoading === false && !!errorMessage) handelPrintError(errorMessage);
16457
+ }, [isLoading, errorMessage]);
16458
+ return {
16459
+ fileName: fileName,
16460
+ isDone: isDone,
16461
+ handelPrintSuccess: handelPrintSuccess,
16462
+ handelPrintError: handelPrintError
16463
+ };
16464
+ };
16465
+
16466
+ var LoadingDots = function LoadingDots(_ref) {
16467
+ var text = _ref.text;
16468
+ return React__default.createElement(material.Stack, {
16469
+ className: "mt-3",
16470
+ direction: "row",
16471
+ spacing: 0.5
16472
+ }, React__default.createElement(material.Typography, {
16473
+ color: "#FFF",
16474
+ fontSize: 20
16475
+ }, text), React__default.createElement("div", {
16476
+ className: styles$4["loader"]
16477
+ }, React__default.createElement("div", {
16478
+ className: styles$4["dot"]
16479
+ }), React__default.createElement("div", {
16480
+ className: styles$4["dot"]
16481
+ }), React__default.createElement("div", {
16482
+ className: styles$4["dot"]
16483
+ })));
16484
+ };
16485
+
16486
+ var PrintExamResultView = function PrintExamResultView(_ref) {
16487
+ var isMyStoryStudent = _ref.isMyStoryStudent,
16488
+ _ref$searchParams = _ref.searchParams,
16489
+ searchParams = _ref$searchParams === void 0 ? "" : _ref$searchParams,
16490
+ history = _ref.history,
16491
+ _ref$examSessionId = _ref.examSessionId,
16492
+ examSessionId = _ref$examSessionId === void 0 ? 0 : _ref$examSessionId,
16493
+ _ref$studentId = _ref.studentId,
16494
+ studentId = _ref$studentId === void 0 ? 0 : _ref$studentId,
16495
+ code = _ref.code,
16496
+ setNotFound = _ref.setNotFound;
16497
+ var _useExamResult = useExamResult({
16498
+ searchParams: searchParams,
16499
+ history: history,
16500
+ examSessionId: examSessionId,
16501
+ studentId: studentId,
16502
+ code: code,
16503
+ isPrint: true
16504
+ }),
16505
+ isLoading = _useExamResult.isLoading,
16506
+ examTime = _useExamResult.examTime,
16507
+ allSeries = _useExamResult.allSeries,
16508
+ allChartOptions = _useExamResult.allChartOptions,
16509
+ timelyOrderQuestions = _useExamResult.timelyOrderQuestions,
16510
+ isStudent = _useExamResult.isStudent,
16511
+ resultData = _useExamResult.resultData,
16512
+ longTimeSpend = _useExamResult.longTimeSpend,
16513
+ effectSize = _useExamResult.effectSize,
16514
+ categoryResponses = _useExamResult.categoryResponses,
16515
+ errorMessage = _useExamResult.errorMessage;
16516
+ var _usePrintView = usePrintView(examSessionId, studentId, setNotFound, resultData, isLoading, errorMessage),
16517
+ fileName = _usePrintView.fileName,
16518
+ isDone = _usePrintView.isDone,
16519
+ handelPrintSuccess = _usePrintView.handelPrintSuccess,
16520
+ handelPrintError = _usePrintView.handelPrintError;
16521
+ var _usePrintExamResult = usePrintExamResult(isLoading, fileName, timelyOrderQuestions.length, handelPrintSuccess, handelPrintError, true),
16522
+ contentRef = _usePrintExamResult.contentRef,
16523
+ setRenderedChart = _usePrintExamResult.setRenderedChart;
16524
+ var isTabletUp = material.useMediaQuery("(min-width:900px)");
16525
+ return React__default.createElement(material.Box, {
16526
+ sx: {
16527
+ display: "flex",
16528
+ justifyContent: "center"
16529
+ },
16530
+ displayPrint: "block"
16531
+ }, isLoading === false && resultData && effectSize ? React__default.createElement(PrintExamResult, {
16532
+ contentRef: contentRef,
16533
+ allChartOptions: allChartOptions,
16534
+ allSeries: allSeries,
16535
+ categoryResponses: categoryResponses,
16536
+ effectSize: effectSize,
16537
+ examTime: examTime,
16538
+ isStudent: isStudent,
16539
+ longTimeSpend: longTimeSpend,
16540
+ resultData: resultData,
16541
+ timelyOrderQuestions: timelyOrderQuestions,
16542
+ isMyStoryStudent: isMyStoryStudent,
16543
+ fileName: fileName,
16544
+ setRenderedChart: setRenderedChart
16545
+ }) : isLoading === undefined || isLoading === true ? React__default.createElement(LoadingComponent, {
16546
+ isLoading: !!isLoading,
16547
+ spinClassName: "text-white"
16548
+ }, isTabletUp && React__default.createElement(LoadingDots, {
16549
+ text: "Loading data"
16550
+ })) : React__default.createElement(NotFound, null), React__default.createElement(LoadingComponent, {
16551
+ isLoading: isDone !== true && isLoading === false && !!resultData,
16552
+ spinClassName: "text-white"
16553
+ }, isTabletUp && React__default.createElement(LoadingDots, {
16554
+ text: "Please wait for a while! Printing"
16555
+ })));
16556
+ };
16557
+
16671
16558
  exports.moment = moment;
16672
16559
  Object.defineProperty(exports, 'I18nextProvider', {
16673
16560
  enumerable: true,
@@ -16731,6 +16618,7 @@ exports.LoginWithPassword = SignIn;
16731
16618
  exports.NotFound = NotFound;
16732
16619
  exports.PUSHER_CONFIG = PUSHER_CONFIG;
16733
16620
  exports.PassCodeCheck = PassCodeCheck;
16621
+ exports.PrintExamResultView = PrintExamResultView;
16734
16622
  exports.QuestionCountSelector = QuestionCountSelector;
16735
16623
  exports.RecentUserAction = RecentUserAction;
16736
16624
  exports.SUPER_ADMIN_BASE_URL = SUPER_ADMIN_BASE_URL;
@@ -16754,7 +16642,7 @@ exports.getAccessToken = getAccessToken;
16754
16642
  exports.getErrorMessage = getErrorMessage;
16755
16643
  exports.getOrdinalSuffix = getOrdinalSuffix;
16756
16644
  exports.getRecentUserActionListApi = getRecentUserActionListApi;
16757
- exports.i18n = i18n;
16645
+ exports.i18n = i18n__default;
16758
16646
  exports.minutesToTimeSpan = minutesToTimeSpan;
16759
16647
  exports.setAlert = setAlert;
16760
16648
  exports.setLanguage = setLanguage;