touchstudy-core 0.1.123 → 0.1.124

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.
@@ -6,8 +6,7 @@ interface Props {
6
6
  resultData?: ExamResult;
7
7
  textbookResult?: TextbookResult;
8
8
  examTime: string;
9
- status?: string;
10
- isShow?: (value: number) => boolean;
9
+ isShow: (value: number) => boolean;
11
10
  isStudent: boolean;
12
11
  categoryResponses: CategoryResponse[];
13
12
  timelyOrderQuestions: TimelyOrderQuestion[];
package/dist/index.js CHANGED
@@ -5101,9 +5101,6 @@ var PrintExamView2 = function PrintExamView2(_ref) {
5101
5101
  setErrorLinks([]);
5102
5102
  setState(PrintState.Printing);
5103
5103
  };
5104
- console.log({
5105
- status: status
5106
- });
5107
5104
  var print = function print(_ref2) {
5108
5105
  var examSessionId = _ref2.examSessionId,
5109
5106
  studentId = _ref2.studentId,
@@ -5122,7 +5119,7 @@ var PrintExamView2 = function PrintExamView2(_ref) {
5122
5119
  code: code,
5123
5120
  examSessionId: "" + examSessionId,
5124
5121
  studentId: "" + studentId,
5125
- message: isTeacher ? "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print" : "/student/exam-results/" + code + "/print"
5122
+ message: isTeacher ? "/teacher/exam-results/" + examSessionId + "/students/" + studentId + "/print?status=" + status.join(",") : "/student/exam-results/" + code + "/print"
5126
5123
  }]);
5127
5124
  });
5128
5125
  if (!isTeacher) {
@@ -5209,7 +5206,7 @@ var PrintExamView2 = function PrintExamView2(_ref) {
5209
5206
  code: (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.code,
5210
5207
  examSessionId: (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.examSessionId,
5211
5208
  studentId: "" + studentId,
5212
- message: isTeacher ? "/teacher/exam-results/" + event.data.examSessionId + "/students/" + event.data.studentId + "/print" : "/student/exam-results/" + event.data.code + "/print"
5209
+ message: isTeacher ? "/teacher/exam-results/" + event.data.examSessionId + "/students/" + event.data.studentId + "/print?status=" + status.join(",") : "/student/exam-results/" + event.data.code + "/print"
5213
5210
  }]);
5214
5211
  });
5215
5212
  }
@@ -5246,7 +5243,7 @@ var PrintExamView2 = function PrintExamView2(_ref) {
5246
5243
  className: "mt-2"
5247
5244
  }, React__default.createElement(material.Typography, {
5248
5245
  fontWeight: 700
5249
- }, t("download_failed"), ":"), Array.from(new Set(errorLinks)).map(function (i) {
5246
+ }, t("download_failed"), ":"), Array.from(new Set(errorLinks)).map(function (i, index) {
5250
5247
  var _info$createdBy;
5251
5248
  var info = isTeacher ? dataExamSession.find(function (exam) {
5252
5249
  return "" + (exam === null || exam === void 0 ? void 0 : exam.examSessionId) === "" + (i === null || i === void 0 ? void 0 : i.examSessionId) && "" + (exam === null || exam === void 0 ? void 0 : exam.studentId) === "" + (i === null || i === void 0 ? void 0 : i.studentId);
@@ -5254,6 +5251,7 @@ var PrintExamView2 = function PrintExamView2(_ref) {
5254
5251
  return (exam === null || exam === void 0 ? void 0 : exam.code) === (i === null || i === void 0 ? void 0 : i.code);
5255
5252
  });
5256
5253
  return React__default.createElement(material.Stack, {
5254
+ key: index,
5257
5255
  borderBottom: 1,
5258
5256
  borderColor: theme.palette.grey[500]
5259
5257
  }, React__default.createElement("a", {
@@ -5283,10 +5281,11 @@ var PrintExamView2 = function PrintExamView2(_ref) {
5283
5281
  gap: 1,
5284
5282
  flexWrap: "wrap"
5285
5283
  }
5286
- }, TabList.map(function (_ref3) {
5284
+ }, TabList.map(function (_ref3, index) {
5287
5285
  var label = _ref3.label,
5288
5286
  value = _ref3.value;
5289
5287
  return React__default.createElement(material.FormControlLabel, {
5288
+ key: index,
5290
5289
  control: React__default.createElement(material.Checkbox, {
5291
5290
  onChange: handleChangeStatus,
5292
5291
  value: value,
@@ -18556,7 +18555,6 @@ var PrintExamResult = function PrintExamResult(_ref) {
18556
18555
  textbookResult = _ref.textbookResult,
18557
18556
  chapterId = _ref.chapterId,
18558
18557
  examTime = _ref.examTime,
18559
- status = _ref.status,
18560
18558
  isShow = _ref.isShow,
18561
18559
  isStudent = _ref.isStudent,
18562
18560
  totalTime = _ref.totalTime,
@@ -18569,11 +18567,6 @@ var PrintExamResult = function PrintExamResult(_ref) {
18569
18567
  longTimeSpend = _ref.longTimeSpend,
18570
18568
  contentRef = _ref.contentRef,
18571
18569
  setRenderedChart = _ref.setRenderedChart;
18572
- console.log({
18573
- bang: status,
18574
- chapterId: chapterId,
18575
- bang2: isShow === null || isShow === void 0 ? void 0 : isShow(TabList$2[1].value)
18576
- });
18577
18570
  var academy = reactRedux.useSelector(function (state) {
18578
18571
  var _state$common;
18579
18572
  return state === null || state === void 0 ? void 0 : (_state$common = state.common) === null || _state$common === void 0 ? void 0 : _state$common.academy;
@@ -18747,7 +18740,7 @@ var PrintExamResult = function PrintExamResult(_ref) {
18747
18740
  fontWeight: 600,
18748
18741
  color: styles.gray_700
18749
18742
  }
18750
- }, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), (!status || (isShow === null || isShow === void 0 ? void 0 : isShow(TabList$2[0].value))) && React__default.createElement(material.Stack, {
18743
+ }, resultData === null || resultData === void 0 ? void 0 : resultData.teacherName)))))), isShow(TabList$2[0].value) && React__default.createElement(material.Stack, {
18751
18744
  display: "flex",
18752
18745
  flexDirection: "column",
18753
18746
  gap: "12px"
@@ -18761,7 +18754,7 @@ var PrintExamResult = function PrintExamResult(_ref) {
18761
18754
  data: resultData,
18762
18755
  categories: categoryResponses,
18763
18756
  isStudent: isStudent
18764
- })), (!status || (isShow === null || isShow === void 0 ? void 0 : isShow(TabList$2[1].value))) && React__default.createElement(material.Stack, {
18757
+ })), isShow(TabList$2[1].value) && React__default.createElement(material.Stack, {
18765
18758
  display: "flex",
18766
18759
  flexDirection: "column",
18767
18760
  gap: "12px",
@@ -18788,7 +18781,7 @@ var PrintExamResult = function PrintExamResult(_ref) {
18788
18781
  series: allSeries[index],
18789
18782
  setIsRendered: setRenderedChart
18790
18783
  });
18791
- })), (!status || (isShow === null || isShow === void 0 ? void 0 : isShow(TabList$2[2].value))) && React__default.createElement(material.Stack, {
18784
+ })), isShow(TabList$2[2].value) && React__default.createElement(material.Stack, {
18792
18785
  display: "flex",
18793
18786
  flexDirection: "column",
18794
18787
  gap: "12px",
@@ -18797,7 +18790,7 @@ var PrintExamResult = function PrintExamResult(_ref) {
18797
18790
  sx: textStyle
18798
18791
  }, i18n.t(TabList$2[2].label)), React__default.createElement(CompareGrass, {
18799
18792
  effectSize: effectSize
18800
- })), (!status || (isShow === null || isShow === void 0 ? void 0 : isShow(TabList$2[3].value))) && React__default.createElement(material.Stack, {
18793
+ })), isShow(TabList$2[3].value) && React__default.createElement(material.Stack, {
18801
18794
  display: "flex",
18802
18795
  flexDirection: "column",
18803
18796
  gap: "12px",
@@ -19631,7 +19624,6 @@ var useExamResultData = function useExamResultData(props) {
19631
19624
  var _temp6 = _catch(function () {
19632
19625
  return Promise.resolve(Promise.all([getChapterResultsApi(chapterId), getChapterResultsLongTimeSpendApi(chapterId), getChapterResultsEffectSizeApi(chapterId), getChapterResultsTimeOrderQuestionApi(chapterId), getChapterResultsCategoriesApi(chapterId)])).then(function (result) {
19633
19626
  var _result$0$data3, _result$1$data3, _result$2$data3, _result$3$data3, _result$4$data3;
19634
- console.log(result);
19635
19627
  handleChangeTab === null || handleChangeTab === void 0 ? void 0 : handleChangeTab(0);
19636
19628
  setDataChartIndex(0);
19637
19629
  setTextbookResult((_result$0$data3 = result[0].data) === null || _result$0$data3 === void 0 ? void 0 : _result$0$data3.data);
@@ -20193,7 +20185,7 @@ var usePrintExamResult = function usePrintExamResult(isDataFetching, fileName, t
20193
20185
  quality: 1
20194
20186
  },
20195
20187
  html2canvas: {
20196
- scale: 4
20188
+ scale: 1.5
20197
20189
  },
20198
20190
  jsPDF: {
20199
20191
  format: 'a4',
@@ -20895,12 +20887,10 @@ var usePrintView = function usePrintView(_ref) {
20895
20887
  var search = window.location.search;
20896
20888
  var query = new URLSearchParams(search);
20897
20889
  var status = query.get('status') || '';
20898
- var isPrintAll = status === "";
20899
- var isShow = function isShow(value) {
20900
- return (status === null || status === void 0 ? void 0 : status.split(',').some(function (i) {
20901
- return i === value.toString();
20902
- })) || false;
20903
- };
20890
+ var isPrintAll = !(status !== null && status !== void 0 && status.length);
20891
+ var isShow = React.useCallback(function (value) {
20892
+ return isPrintAll || (status === null || status === void 0 ? void 0 : status.split(',').includes(value.toString()));
20893
+ }, [isPrintAll, status]);
20904
20894
  var handelPrintSuccess = function handelPrintSuccess() {
20905
20895
  var _window$opener$postMe, _window$opener;
20906
20896
  var data;
@@ -21024,11 +21014,10 @@ var PrintExamResultView = function PrintExamResultView(_ref) {
21024
21014
  }),
21025
21015
  fileName = _usePrintView.fileName,
21026
21016
  isDone = _usePrintView.isDone,
21027
- status = _usePrintView.status,
21028
21017
  isShow = _usePrintView.isShow,
21029
21018
  handelPrintSuccess = _usePrintView.handelPrintSuccess,
21030
21019
  handelPrintError = _usePrintView.handelPrintError;
21031
- var _usePrintExamResult = usePrintExamResult(isLoading, fileName, !status || isShow !== null && isShow !== void 0 && isShow(TabList$2[1].value) ? timelyOrderQuestions.length : 0, handelPrintSuccess, handelPrintError, true),
21020
+ var _usePrintExamResult = usePrintExamResult(isLoading, fileName, isShow !== null && isShow !== void 0 && isShow(TabList$2[1].value) ? timelyOrderQuestions.length : 0, handelPrintSuccess, handelPrintError, true),
21032
21021
  contentRef = _usePrintExamResult.contentRef,
21033
21022
  setRenderedChart = _usePrintExamResult.setRenderedChart;
21034
21023
  var isTabletUp = material.useMediaQuery("(min-width:900px)");
@@ -21055,7 +21044,6 @@ var PrintExamResultView = function PrintExamResultView(_ref) {
21055
21044
  fileName: fileName,
21056
21045
  isShow: isShow,
21057
21046
  totalTime: totalTime,
21058
- status: status,
21059
21047
  setRenderedChart: setRenderedChart
21060
21048
  }) : isLoading === undefined || isLoading === true ? React__default.createElement(LoadingComponent, {
21061
21049
  isLoading: !!isLoading,