l-min-components 1.7.1539 → 1.7.1540

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.7.1539",
3
+ "version": "1.7.1540",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -100,8 +100,9 @@ const ReportQuestions = ({
100
100
  const commentData = answerData?.answer?.comments;
101
101
  const hasAnswer = answerData?.answer?.data;
102
102
  useEffect(() => {
103
- if (commentData?.length) setComment(commentData?.[0]);
104
- }, [commentData, findedQuestion?.question_id]);
103
+ if (commentData?.length && findedQuestion?.question_id)
104
+ setComment(commentData?.[0]);
105
+ }, [commentData, findedQuestion?.question_id, questionActivityID]);
105
106
  useEffect(() => {
106
107
  if (findedQuestion?.question_id) {
107
108
  if (
@@ -149,10 +150,18 @@ const ReportQuestions = ({
149
150
  );
150
151
  const prevId = questions?.[currentQuestionIndex - 1]?.question_activity_id;
151
152
  const nextId = questions?.[currentQuestionIndex + 1]?.question_activity_id;
153
+
154
+ const reset = () => {
155
+ setAIScore(0);
156
+ setInstructorScore(0);
157
+ setComment(null);
158
+ };
152
159
  const handleNext = () => {
160
+ reset();
153
161
  if (nextId) onSwitchQuestion?.(nextId);
154
162
  };
155
163
  const handlePrev = () => {
164
+ reset();
156
165
  if (prevId) onSwitchQuestion?.(prevId);
157
166
  };
158
167