@@ -296,7 +296,6 @@ const ReadingTest = ({ setCycle, setShowCyclePopup }) => {
296296
297297 useEffect ( ( ) => {
298298 if ( ! currentReadingTestQuestion ) {
299- console . log ( 'no currentReadingTestQuestion' )
300299 return
301300 }
302301
@@ -305,7 +304,6 @@ const ReadingTest = ({ setCycle, setShowCyclePopup }) => {
305304 previousStatus ?. is_correct &&
306305 previousStatus . last_question_id === currentReadingTestQuestion . question_id
307306 ) {
308- console . log ( 'nextQuestion called 1' )
309307 nextQuestion ( )
310308 return
311309 }
@@ -314,7 +312,6 @@ const ReadingTest = ({ setCycle, setShowCyclePopup }) => {
314312 previousStatus . last_question_id === currentReadingTestQuestion . question_id &&
315313 previousStatus . responses . length === 1
316314 ) {
317- console . log ( 'setAttempts called' )
318315 setAttempts ( prev => prev + 1 )
319316 return
320317 }
@@ -323,15 +320,24 @@ const ReadingTest = ({ setCycle, setShowCyclePopup }) => {
323320 previousStatus . last_question_id === currentReadingTestQuestion . question_id &&
324321 previousStatus ?. responses ?. length > 1
325322 ) {
326- console . log ( 'nextQuestion called 2' )
327323 nextQuestion ( )
328324 return
329325 }
330326 }
331327
332328 if ( in_experimental_grp ) {
333- if ( previousStatus ?. is_correct ) {
334- console . log ( 'nextQuestion called 3' )
329+ if (
330+ previousStatus ?. is_correct &&
331+ previousStatus . last_question_id === currentReadingTestQuestion . question_id
332+ ) {
333+ nextQuestion ( )
334+ return
335+ }
336+
337+ if (
338+ previousStatus . last_question_id === currentReadingTestQuestion . question_id &&
339+ previousStatus ?. responses ?. length > 3
340+ ) {
335341 nextQuestion ( )
336342 }
337343 }
@@ -356,13 +362,6 @@ const ReadingTest = ({ setCycle, setShowCyclePopup }) => {
356362 }
357363 } , [ testDone ] )
358364
359- /* useEffect(() => {
360- dispatch(getGroups());
361- if (learningLanguage && readingTestSessionId && testDone && readingHistory == {}) {
362- dispatch(getReadingHistory(learningLanguage, readingTestSessionId));
363- }
364- }, [testDone]); */
365-
366365 useEffect ( ( ) => {
367366 let experimental = false ;
368367 let control = false ;
@@ -388,9 +387,7 @@ const ReadingTest = ({ setCycle, setShowCyclePopup }) => {
388387 } , [ groups ] ) ;
389388
390389 useEffect ( ( ) => {
391- console . log ( 'about to mark question as seen' )
392390 if ( currentReadingTestQuestion && ! currentReadingTestQuestion ?. seen ) {
393- console . log ( 'marking question as seen: ' , currentReadingTestQuestion )
394391 dispatch (
395392 markQuestionAsSeen (
396393 learningLanguage ,
@@ -456,10 +453,6 @@ const ReadingTest = ({ setCycle, setShowCyclePopup }) => {
456453 timer . start ( )
457454 } , [ ] )
458455
459- /* if (!currentReadingTestQuestion) {
460- return null
461- } */
462-
463456 const testContainerOverflow = displaySpinner ? { overflow : "hidden" } : { overflowY : "auto" } ;
464457
465458 if ( showStats ) {
@@ -556,18 +549,18 @@ const ReadingTest = ({ setCycle, setShowCyclePopup }) => {
556549 ) }
557550 </ div >
558551 { /* This button used to be in hiddenFeatures, now visible to all */ }
559- < div className = "test-top-info space-between" style = { { marginBottom : '0.2em' } } >
560- < Button
561- className = "restart-reading-test-button btn-secondary"
562- style = { { marginRight : 'auto' , marginTop : '1rem' } }
563- onClick = { ( ) => restartTest ( ) }
564- disabled = { showFeedbacks }
565- >
566- < span >
567- < FormattedMessage id = "restart-reading-test" />
568- </ span >
569- </ Button >
570- </ div >
552+ < div className = "test-top-info space-between" style = { { marginBottom : '0.2em' } } >
553+ < Button
554+ className = "restart-reading-test-button btn-secondary"
555+ style = { { marginRight : 'auto' , marginTop : '1rem' } }
556+ onClick = { ( ) => restartTest ( ) }
557+ disabled = { showFeedbacks }
558+ >
559+ < span >
560+ < FormattedMessage id = "restart-reading-test" />
561+ </ span >
562+ </ Button >
563+ </ div >
571564 </ div >
572565 </ div >
573566 </ Segment >
0 commit comments