l-min-components 1.7.1539 → 1.7.1541

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.1541",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -100,8 +100,12 @@ 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
+ else {
106
+ setComment(null);
107
+ }
108
+ }, [commentData, findedQuestion?.question_id, questionActivityID]);
105
109
  useEffect(() => {
106
110
  if (findedQuestion?.question_id) {
107
111
  if (
@@ -149,10 +153,18 @@ const ReportQuestions = ({
149
153
  );
150
154
  const prevId = questions?.[currentQuestionIndex - 1]?.question_activity_id;
151
155
  const nextId = questions?.[currentQuestionIndex + 1]?.question_activity_id;
156
+
157
+ const reset = () => {
158
+ setAIScore(0);
159
+ setInstructorScore(0);
160
+ setComment(null);
161
+ };
152
162
  const handleNext = () => {
163
+ reset();
153
164
  if (nextId) onSwitchQuestion?.(nextId);
154
165
  };
155
166
  const handlePrev = () => {
167
+ reset();
156
168
  if (prevId) onSwitchQuestion?.(prevId);
157
169
  };
158
170