Guest User

Untitled

a guest
Aug 17th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. private int score = 0;
  2. private void checkAnswer(boolean pickedAnswer) {
  3. boolean correctAnswer = allQuestions.list.get(questionNumber).answer;
  4. if (correctAnswer == pickedAnswer) {
  5. score = score + 1;
  6. } else {
  7. }
  8. }
  9. private void nextQuestion() {
  10. if (questionNumber <= allQuestions.list.size() - 1) {
  11. tvQuestion.setText(allQuestions.list.get(questionNumber).questionText);
  12. tvQuestionNumber.setText(questionNumber + 1 + “/“ + allQuestions.list.size( ));
  13. tvScore.setText(“Score: “ + score);
  14. } else { … }
  15. }
Add Comment
Please, Sign In to add comment