function NextQuestion()
{
  

   $('#player_id').attr('value',-1); //reset player in answer form
   Log('Next question');
   //check if game still on
   //var IsGameWin = parseInt($('#system_game_win').val()); 
   //if(IsGameWin==1)
   if(SystemGameWin==1)
   {
      AddHtmlToContainer('box-message',MessageDictionnary('Le match est fini'));
      return;
   }
   //once a question is asked, cannot skip
   //var IsQuestionActive = parseInt($('#system_active_question').val());
   //if(IsQuestionActive==1)
   if(SystemCurrentQuestion.length>0)//if(SystemQuestionActive==1)
   {
      AddHtmlToContainer('box-message',MessageDictionnary("Merci de repondre a la question en cours d'abord"));
      return;
   }
   Run({'mode':'reset_timer_bar'});
   //$('#system_active_question').attr('value',1);
   //SystemQuestionActive = 1;
   
   //set to white all player
   ColorizeAllPlayer('');
   //hide popup window of player's answer and reset it
   $('#box-answer').hide();
   $('#input_player_answer').attr('value','');
   //find level we are now playing
   //var GameLevel = $('#system_level').val();
   var CurrentLevel = SystemQuestion;//FindLevelObject(SystemLevel);
   
   //find current question round = current question index in level's question array
   //var CurrentRound = parseInt($('#system_round').val());
   CurrentRound = SystemRound;
   //when reaching last question, go back to beginning as long as nobody win
   
   if(CurrentRound==(CurrentLevel.ArrayOperation.length-1))
   {
      CurrentRound=-1;  //-1 because we go by 1 below
   }
   
   if(CurrentLevel != false)
   {
      //test next operation
      //$('#system_round').attr('value',CurrentRound+1);
      SystemRound = CurrentRound+1;
      CurrentRound=CurrentRound+1;
      //alert(CurrentLevel.ArrayOperation[0]);
      //alert(CurrentLevel.ArrayOperation[1]);
      //alert(CurrentLevel.ArrayOperation[2]);
      //alert(CurrentLevel.ArrayOperation[3]);

      
      SystemCurrentQuestion=CurrentLevel.ArrayOperation[CurrentRound];
        
      //undefinded
      //separate function by space to get function name and argument(s)
      var Tmp = SystemCurrentQuestion.split(' ');
      SystemCurrentQuestion = Tmp[0];
      //read arguments of function
      var Args = '';
      if(Tmp.length>1)
      {  //deals with , of parameter(s)
         Args += Tmp[1]; 
         for(a=2;a<Tmp.length;a++)
         {
            Args += ','+Tmp[a];
         }
      }
      //if(OperationAllowed.indexOf(OperationFunction)>-1)//working with firefox but not IE
      if(IsFunctionDefined('Generate_'+SystemCurrentQuestion))//$.inArray(OperationFunction,OperationAllowed)>-1) 
      {
         Log('Generate'+SystemCurrentQuestion+'('+Args+');');
         //eval is evil
         eval('var CurrentOperation = Generate_'+SystemCurrentQuestion+'('+Args+');');
         ShowOperation(CurrentOperation);
         
      }else
      {
         AddHtmlToContainer('box-message',CurrentOperation+MessageDictionnary(" : Cette operation n'est pas reconnue"));
      }
   }else
   {
      AddHtmlToContainer('box-message',MessageDictionnary("La definition du level de jeu n'est pas disponible"));
   }

   //set question to active
   //$('#system_active_question').attr('value',1);

   Run({'mode':'end_next_question'});
}
/*
  * Call for next question
  *  Check can execute call
  *  Find and run next question
  */
Call for next question
Check can execute call
Find and run next question
Call for next question Check can execute call Find and run next question
function NextQuestion()
{
   $('#player_id').attr('value',-1); 
   Log('Next question');
   if(SystemGameWin==1)
   {
      AddHtmlToContainer('box-message',MessageDictionnary('Le match est fini'));
      return;
   }
   if(SystemCurrentQuestion.length>0)
   {
      AddHtmlToContainer('box-message',MessageDictionnary("Merci de repondre a la question en cours d'abord"));
      return;
   }
   Run({'mode':'reset_timer_bar'});
   ColorizeAllPlayer('');
   $('#box-answer').hide();
   $('#input_player_answer').attr('value','');
   var CurrentLevel = SystemQuestion;
   CurrentRound = SystemRound;
   if(CurrentRound==(CurrentLevel.ArrayOperation.length-1))
   {
      CurrentRound=-1;  
   }
   if(CurrentLevel != false)
   {
      SystemRound = CurrentRound+1;
      CurrentRound=CurrentRound+1;
      SystemCurrentQuestion=CurrentLevel.ArrayOperation[CurrentRound];
      var Tmp = SystemCurrentQuestion.split(' ');
      SystemCurrentQuestion = Tmp[0];
      var Args = '';
      if(Tmp.length>1)
      {  
         Args += Tmp[1]; 
         for(a=2;a<Tmp.length;a++)
         {
            Args += ','+Tmp[a];
         }
      }
      if(IsFunctionDefined('Generate_'+SystemCurrentQuestion))
      {
         Log('Generate'+SystemCurrentQuestion+'('+Args+');');
         eval('var CurrentOperation = Generate_'+SystemCurrentQuestion+'('+Args+');');
         ShowOperation(CurrentOperation);
      }else
      {
         AddHtmlToContainer('box-message',CurrentOperation+MessageDictionnary(" : Cette operation n'est pas reconnue"));
      }
   }else
   {
      AddHtmlToContainer('box-message',MessageDictionnary("La definition du level de jeu n'est pas disponible"));
   }
   Run({'mode':'end_next_question'});
}
function NextQuestion ( ) { $ ( '#player_id' ) . attr ( 'value' , - 1 ) ; Log ( 'Next question' ) ; if ( SystemGameWin == 1 ) { AddHtmlToContainer ( 'box-message' , MessageDictionnary ( 'Le match est fini' ) ) ; return ; } if ( SystemCurrentQuestion . length > 0 ) { AddHtmlToContainer ( 'box-message' , MessageDictionnary ( "Merci de repondre a la question en cours d'abord" ) ) ; return ; } Run ( { 'mode' : 'reset_timer_bar' } ) ; ColorizeAllPlayer ( '' ) ; $ ( '#box-answer' ) . hide ( ) ; $ ( '#input_player_answer' ) . attr ( 'value' , '' ) ; var CurrentLevel = SystemQuestion ; CurrentRound = SystemRound ; if ( CurrentRound == ( CurrentLevel . ArrayOperation . length - 1 ) ) { CurrentRound = - 1 ; } if ( CurrentLevel != false ) { SystemRound = CurrentRound + 1 ; CurrentRound = CurrentRound + 1 ; SystemCurrentQuestion = CurrentLevel . ArrayOperation [ CurrentRound ] ; var Tmp = SystemCurrentQuestion . split ( ' ' ) ; SystemCurrentQuestion = Tmp [ 0 ] ; var Args = '' ; if ( Tmp . length > 1 ) { Args += Tmp [ 1 ] ; for ( a = 2 ; a < Tmp . length ; a ++ ) { Args += ',' + Tmp [ a ] ; } } if ( IsFunctionDefined ( 'Generate_' + SystemCurrentQuestion ) ) { Log ( 'Generate' + SystemCurrentQuestion + '(' + Args + ');' ) ; eval ( 'var CurrentOperation = Generate_' + SystemCurrentQuestion + '(' + Args + ');' ) ; ShowOperation ( CurrentOperation ) ; } else { AddHtmlToContainer ( 'box-message' , CurrentOperation + MessageDictionnary ( " : Cette operation n'est pas reconnue" ) ) ; } } else { AddHtmlToContainer ( 'box-message' , MessageDictionnary ( "La definition du level de jeu n'est pas disponible" ) ) ; } Run ( { 'mode' : 'end_next_question' } ) ; }
Call for next question
  Check can execute call
  Find and run next question
Call for next question Check can execute call Find and run next question
//reset player in answer form //check if game still on //var IsGameWin = parseInt($('#system_game_win').val());  //if(IsGameWin==1) //once a question is asked, cannot skip //var IsQuestionActive = parseInt($('#system_active_question').val()); //if(IsQuestionActive==1) //if(SystemQuestionActive==1) //$('#system_active_question').attr('value',1); //SystemQuestionActive = 1; //set to white all player //hide popup window of player's answer and reset it //find level we are now playing //var GameLevel = $('#system_level').val(); //FindLevelObject(SystemLevel); //find current question round = current question index in level's question array //var CurrentRound = parseInt($('#system_round').val()); //when reaching last question, go back to beginning as long as nobody win //-1 because we go by 1 below //test next operation //$('#system_round').attr('value',CurrentRound+1); //alert(CurrentLevel.ArrayOperation[0]); //alert(CurrentLevel.ArrayOperation[1]); //alert(CurrentLevel.ArrayOperation[2]); //alert(CurrentLevel.ArrayOperation[3]); //undefinded //separate function by space to get function name and argument(s) //read arguments of function //deals with , of parameter(s) //if(OperationAllowed.indexOf(OperationFunction)>-1)//working with firefox but not IE //$.inArray(OperationFunction,OperationAllowed)>-1)  //eval is evil //set question to active //$('#system_active_question').attr('value',1);