Hi everyone I need help.
I have this code  

I have 50 question string and I want if already 10 question appears then the game finish. thank you for your help

```
private Question mQuestion = new Question();

private String mAnswer;
private int mScore = 0;
private int mQuestionLenght = 5 ;

Random r;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_quiz);

    r = new Random();

    answer1 = (Button) findViewById(R.id.answer1);
    answer2 = (Button) findViewById(R.id.answer2);
    answer3 = (Button) findViewById(R.id.answer3);
    answer4 = (Button) findViewById(R.id.answer4);

    score = (TextView) findViewById(R.id.score);
    question = (TextView) findViewById(R.id.question);
    score.setText("Score: " + mScore  );

    updateQuestion(r.nextInt(mQuestionLenght));

    answer4.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            if(answer4.getText() == mAnswer){
                mScore++;
                score.setText("Score: " + mScore);
                updateQuestion(r.nextInt(mQuestionLenght));
            } else {
                gameOver();
            }
        }
    });
}
private void updateQuestion(int num){
    question.setText(mQuestion.getQuestion(num));
    answer1.setText(mQuestion.getChoice1(num));
    answer2.setText(mQuestion.getChoice2(num));
    answer3.setText(mQuestion.getChoice3(num));
    answer4.setText(mQuestion.getChoice4(num));
    mAnswer = mQuestion.getCorrectAnswer(num);

}
private void gameOver(){

```

}

i have 50 question i want if user already answer 10 question game stop and show score. in that code it cant stop if they wrong answer game can stop but if user always right game load all question