From ba81c5443d99982928bad10b26f17dda8d672c34 Mon Sep 17 00:00:00 2001 From: "jue.hou" Date: Wed, 18 Sep 2024 11:24:26 +0300 Subject: [PATCH] debug --- client/components/Tests/ReadingTest/ReadingTest.js | 9 +++++---- client/util/redux/testReducer.js | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/components/Tests/ReadingTest/ReadingTest.js b/client/components/Tests/ReadingTest/ReadingTest.js index 14e1bdda..a1347947 100644 --- a/client/components/Tests/ReadingTest/ReadingTest.js +++ b/client/components/Tests/ReadingTest/ReadingTest.js @@ -72,6 +72,7 @@ const ReadingTest = () => { currentQuestionIdxinSet, answerPending, answerFailure, + resumedTest, } = useSelector(({ tests }) => tests) const learningLanguage = useSelector(learningLanguageSelector) const { groups } = useSelector(({ groups }) => groups) @@ -309,13 +310,13 @@ const ReadingTest = () => { setShowFeedbacks(false) if (currentReadingSet !== null && prevReadingSet !== null && currentReadingSet !== prevReadingSet) { if (in_experimental_grp && receivedFeedback > 0) { - setShowSelfReflect(true) + setShowSelfReflect(!resumedTest) } if (in_control_grp && receivedFeedback == 0) { - setShowSelfReflect(true) + setShowSelfReflect(!resumedTest) } } - setFirstMediationSelfReflectionDone(false) + setFirstMediationSelfReflectionDone(resumedTest) }, [currentReadingSet]) useEffect(() => { @@ -369,7 +370,7 @@ const ReadingTest = () => { showFeedbacks={showFeedbacks} closeFeedbacks={() => { setShowFeedbacks(false) - if (firstMediationSelfReflectionDone === false && receivedFeedback > 0 && in_experimental_grp && currentQuestionIdxinSet < currentReadingSetLength && questionDone && currentQuestionIdxinSet === currentReadingQuestionIndex) { + if (firstMediationSelfReflectionDone === false && receivedFeedback > 0 && in_experimental_grp && currentQuestionIdxinSet < currentReadingSetLength && questionDone) { setShowSelfReflect(true) } }} diff --git a/client/util/redux/testReducer.js b/client/util/redux/testReducer.js index 50e3d77c..6e3e7a6a 100644 --- a/client/util/redux/testReducer.js +++ b/client/util/redux/testReducer.js @@ -273,6 +273,7 @@ export default (state = initialState, action) => { feedbacks: [], readingSetLength: tmpreadingSetLength, pending: false, + resumedTest: Object.values(questionsBySet).some(x=>x.seen.length>0), }; case 'GET_READING_TEST_QUESTIONS_FAILURE':