touchstudy-core 0.1.71 → 0.1.73

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.
@@ -40,6 +40,7 @@ export declare const DEFAULT_LINE_CHART_OPTIONS: {
40
40
  show: boolean;
41
41
  fontSize: string;
42
42
  fontWeight: number;
43
+ height: number;
43
44
  markers: {
44
45
  width: number;
45
46
  height: number;
@@ -18,6 +18,9 @@ declare const useExamResult: (searchParam: string, history: any, examSessionId:
18
18
  colors: string[];
19
19
  xaxis: {
20
20
  categories: any[];
21
+ tooltip: {
22
+ formatter: (val: number) => any;
23
+ };
21
24
  axisBorder: {
22
25
  show: boolean;
23
26
  color: string;
@@ -57,6 +60,7 @@ declare const useExamResult: (searchParam: string, history: any, examSessionId:
57
60
  show: boolean;
58
61
  fontSize: string;
59
62
  fontWeight: number;
63
+ height: number;
60
64
  markers: {
61
65
  width: number;
62
66
  height: number;
@@ -93,6 +97,9 @@ declare const useExamResult: (searchParam: string, history: any, examSessionId:
93
97
  };
94
98
  xaxis: {
95
99
  categories: any[];
100
+ tooltip: {
101
+ formatter: (val: number) => any;
102
+ };
96
103
  axisBorder: {
97
104
  show: boolean;
98
105
  color: string;
@@ -133,6 +140,7 @@ declare const useExamResult: (searchParam: string, history: any, examSessionId:
133
140
  show: boolean;
134
141
  fontSize: string;
135
142
  fontWeight: number;
143
+ height: number;
136
144
  markers: {
137
145
  width: number;
138
146
  height: number;
package/dist/index.js CHANGED
@@ -11566,6 +11566,7 @@ var DEFAULT_LINE_CHART_OPTIONS = {
11566
11566
  show: true,
11567
11567
  fontSize: "12px",
11568
11568
  fontWeight: 600,
11569
+ height: 64,
11569
11570
  markers: {
11570
11571
  width: 16,
11571
11572
  height: 1
@@ -11833,11 +11834,17 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11833
11834
  }
11834
11835
  }),
11835
11836
  xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
11836
- categories: ["."].concat(Array.from({
11837
+ categories: [""].concat(Array.from({
11837
11838
  length: questionLength
11838
11839
  }, function (_, i) {
11839
11840
  return ORDER_NUMBERS[i + 1] ? t(ORDER_NUMBERS[i + 1]) : toNumberOrder(i + 1);
11840
- }), ["."])
11841
+ }), [""]),
11842
+ tooltip: {
11843
+ formatter: function formatter(val) {
11844
+ if (val > 1) return t(ORDER_NUMBERS[val - 1]);
11845
+ return null;
11846
+ }
11847
+ }
11841
11848
  }),
11842
11849
  yaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.yaxis, {
11843
11850
  tickAmount: questions.length + 1,
@@ -11913,11 +11920,17 @@ var useExamResult = function useExamResult(searchParam, history, examSessionId,
11913
11920
  }),
11914
11921
  colors: ['#3DC674', '#C3099A'],
11915
11922
  xaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.xaxis, {
11916
- categories: ["."].concat(Array.from({
11923
+ categories: [""].concat(Array.from({
11917
11924
  length: questionLength
11918
11925
  }, function (_, i) {
11919
11926
  return ORDER_NUMBERS[i + 1] ? t(ORDER_NUMBERS[i + 1]) : toNumberOrder(i + 1);
11920
- }), ["."])
11927
+ }), [""]),
11928
+ tooltip: {
11929
+ formatter: function formatter(val) {
11930
+ if (val > 1) return t(ORDER_NUMBERS[val - 1]);
11931
+ return null;
11932
+ }
11933
+ }
11921
11934
  }),
11922
11935
  yaxis: _extends({}, DEFAULT_LINE_CHART_OPTIONS.yaxis, {
11923
11936
  tickAmount: questionLength + 1,
@@ -13707,6 +13720,13 @@ function MyAnswer(_ref) {
13707
13720
  handleSelectQuestionOrder(id);
13708
13721
  toggleCreateQuestion();
13709
13722
  };
13723
+ var formatTimeDiff = function formatTimeDiff(my, top) {
13724
+ var diff = Math.round(my - top);
13725
+ var prefix = "";
13726
+ if (diff < 0) prefix = "-";
13727
+ if (diff > 0) prefix = "+";
13728
+ return "" + prefix + formatTimeSecond(Math.abs(diff), t);
13729
+ };
13710
13730
  var renderQuestions = function renderQuestions(questions) {
13711
13731
  return questions.map(function (question, index) {
13712
13732
  return React__default.createElement("div", {
@@ -13769,7 +13789,7 @@ function MyAnswer(_ref) {
13769
13789
  margin: 0
13770
13790
  },
13771
13791
  className: styles$4["answer-response"] + " " + styles$4["answer-response-" + question.answerResponseSignal]
13772
- }, formatTimeSecond(Math.round(question.topDuration - question.duration), t)) : React__default.createElement("p", {
13792
+ }, formatTimeDiff(question.duration, question.topDuration)) : React__default.createElement("p", {
13773
13793
  style: {
13774
13794
  margin: 0,
13775
13795
  textAlign: "center"