@ -1,4 +1,5 @@
 
			
		
	
		
		
			
				
					
					import  ' dart:async ' ; import  ' dart:async ' ;  
			
		
	
		
		
			
				
					
					import  ' dart:developer ' ;  
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					import  ' package:appinio_swiper/appinio_swiper.dart ' ; import  ' package:appinio_swiper/appinio_swiper.dart ' ;  
			
		
	
		
		
			
				
					
					import  ' package:easy_localization/easy_localization.dart ' ; import  ' package:easy_localization/easy_localization.dart ' ;  
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -414,13 +415,16 @@ class MarathonProvider extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					    notifyListeners ( ) ; 
    notifyListeners ( ) ; 
 
			
		
	
		
		
			
				
					
					  } 
  } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					  void  updateCurrentQuestionOptionStatus ( QuestionsOptionStatus  status ,  int  )  { 
  void  updateCurrentQuestionOptionStatus ( { required  QuestionsOptionStatus  status ,  required  int  selectedOptIndex,  required   int correctOptionIn  dex} )  { 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					    for  ( int  i  =  0 ;  i  <  currentQuestion . questionOptions ! . length ;  i + + )  { 
    for  ( int  i  =  0 ;  i  <  currentQuestion . questionOptions ! . length ;  i + + )  { 
 
			
		
	
		
		
			
				
					
					      currentQuestion . questionOptions ! [ i ] . optionStatus  =  QuestionsOptionStatus . unSelected ; 
      currentQuestion . questionOptions ! [ i ] . optionStatus  =  QuestionsOptionStatus . unSelected ; 
 
			
		
	
		
		
			
				
					
					    } 
    } 
 
			
		
	
		
		
			
				
					
					    currentQuestion . questionOptions ! [ index ] . optionStatus  =  status ; 
    if  ( status  = =  QuestionsOptionStatus . wrong )  { 
 
			
				
				
			
		
	
		
		
			
				
					
					    selectedOptionId  =  currentQuestion . questionOptions ! [ index ] . id ; 
      currentQuestion . questionOptions ! [ correctOptionIndex ] . optionStatus  =  QuestionsOptionStatus . correct ;  / /  if  person ' s answer is wrong we have to show him the actual right answer 
 
			
				
				
			
		
	
		
		
			
				
					
					    selectedOptionIndex  =  index ; 
    } 
 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					    currentQuestion . questionOptions ! [ selectedOptIndex ] . optionStatus  =  status ; 
 
			
		
	
		
		
			
				
					
					    selectedOptionId  =  currentQuestion . questionOptions ! [ selectedOptIndex ] . id ; 
 
			
		
	
		
		
			
				
					
					    selectedOptionIndex  =  selectedOptIndex ; 
 
			
		
	
		
		
			
				
					
					    notifyListeners ( ) ; 
    notifyListeners ( ) ; 
 
			
		
	
		
		
			
				
					
					  } 
  } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
	
		
		
			
				
					
						
						
						
							
								 
						
					 
					@ -435,22 +439,30 @@ class MarathonProvider extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					  } 
  } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					  void  getCorrectAnswerAndUpdateAnswerColor ( )  { 
  void  getCorrectAnswerAndUpdateAnswerColor ( )  { 
 
			
		
	
		
		
			
				
					
					    log ( " correctOptionIndex " ) ; 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    callCountThreshold  =  1 ; 
    callCountThreshold  =  1 ; 
 
			
		
	
		
		
			
				
					
					    int  correctOptionIndex  =  - 1 ; 
 
			
		
	
		
		
			
				
					
					    if  ( demoMarathonDetailModel . displayCorrectAnswer  ? ?  false )  { 
 
			
		
	
		
		
			
				
					
					      correctOptionIndex  =  currentQuestion . questionOptions ! . indexWhere ( ( QuestionOptions  element )  = >  element . isCorrectOption  ? ?  false ) ; 
 
			
		
	
		
		
			
				
					
					      log ( " correctOptionIndex:  $ correctOptionIndex " ) ; 
 
			
		
	
		
		
			
				
					
					    } 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    if  ( selectedOptionIndex  ! =  null )  { 
    if  ( selectedOptionIndex  ! =  null )  { 
 
			
		
	
		
		
			
				
					
					      scheduleMicrotask ( ( )  async  { 
      scheduleMicrotask ( ( )  async  { 
 
			
		
	
		
		
			
				
					
					        if  ( AppState ( ) . getIsDemoMarathon )  { 
        if  ( AppState ( ) . getIsDemoMarathon )  { 
 
			
		
	
		
		
			
				
					
					          if  ( currentQuestion . questionOptions ! [ selectedOptionIndex ! ] . isCorrectOption ! )  { 
          if  ( currentQuestion . questionOptions ! [ selectedOptionIndex ! ] . isCorrectOption ! )  { 
 
			
		
	
		
		
			
				
					
					            updateCurrentQuestionOptionStatus ( QuestionsOptionStatus . correct ,  selectedOptionIndex ! ) ; 
            updateCurrentQuestionOptionStatus ( status:  QuestionsOptionStatus . correct ,  selectedOptIndex:  selectedOptionIndex ! ,  correctOptionIndex:  correctOptionIndex ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					          }  else  { 
          }  else  { 
 
			
		
	
		
		
			
				
					
					            updateCurrentQuestionOptionStatus ( QuestionsOptionStatus . wrong ,  selectedOptionIndex ! ) ; 
            updateCurrentQuestionOptionStatus ( status:  QuestionsOptionStatus . wrong ,  selectedOptIndex:  selectedOptionIndex ! ,  correctOptionIndex:  correctOptionIndex ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					          } 
          } 
 
			
		
	
		
		
			
				
					
					        }  else  { 
        }  else  { 
 
			
		
	
		
		
			
				
					
					          await  callSubmitOptionApi ( ) . then ( ( bool  value )  async  { 
          await  callSubmitOptionApi ( ) . then ( ( bool  value )  async  { 
 
			
		
	
		
		
			
				
					
					            updateIsUserOutOfGame  =  ! value ; 
            updateIsUserOutOfGame  =  ! value ; 
 
			
		
	
		
		
			
				
					
					            if  ( value )  { 
            if  ( value )  { 
 
			
		
	
		
		
			
				
					
					              updateCurrentQuestionOptionStatus ( QuestionsOptionStatus . correct ,  selectedOptionIndex ! ) ; 
              updateCurrentQuestionOptionStatus ( status:  QuestionsOptionStatus . correct ,  selectedOptIndex:  selectedOptionIndex ! ,  correctOptionIndex:  correctOptionIndex ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            }  else  { 
            }  else  { 
 
			
		
	
		
		
			
				
					
					              updateCurrentQuestionOptionStatus ( QuestionsOptionStatus . wrong ,  selectedOptionIndex ! ) ; 
              updateCurrentQuestionOptionStatus ( status:  QuestionsOptionStatus . wrong ,  selectedOptIndex:  selectedOptionIndex ! ,  correctOptionIndex:  correctOptionIndex ) ; 
 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					            } 
            } 
 
			
		
	
		
		
			
				
					
					          } ) ; 
          } ) ; 
 
			
		
	
		
		
			
				
					
					        } 
        } 
 
			
		
	
	
		
		
			
				
					
						
							
								 
						
						
							
								 
						
						
					 
					@ -551,7 +563,6 @@ class MarathonProvider extends ChangeNotifier {
 
			
		
	
		
		
			
				
					
					    notifyListeners ( ) ; 
    notifyListeners ( ) ; 
 
			
		
	
		
		
			
				
					
					    isPrivilegedWithMarathon  =  checkIfPrivilegedForMarathon ( ) ; 
    isPrivilegedWithMarathon  =  checkIfPrivilegedForMarathon ( ) ; 
 
			
		
	
		
		
			
				
					
					    demoMarathonDetailModel  =  await  DemoMarathonRepo ( ) . getDemoMarathonDetails ( ) ; 
    demoMarathonDetailModel  =  await  DemoMarathonRepo ( ) . getDemoMarathonDetails ( ) ; 
 
			
		
	
		
		
			
				
					
					
 
			
		
	
		
		
			
				
					
					    if  ( isPrivilegedWithMarathon )  { 
    if  ( isPrivilegedWithMarathon )  { 
 
			
		
	
		
		
			
				
					
					      marathonDetailModel  =  await  MarathonApiClient ( ) . getMarathonDetails ( ) ; 
      marathonDetailModel  =  await  MarathonApiClient ( ) . getMarathonDetails ( ) ; 
 
			
		
	
		
		
			
				
					
					      updateTotalSecondsToWaitForMarathon  =  marathonDetailModel . marathonBufferTime  ? ?  30 ; 
      updateTotalSecondsToWaitForMarathon  =  marathonDetailModel . marathonBufferTime  ? ?  30 ;