Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private int score = 0;
- …
- private void checkAnswer(boolean pickedAnswer) {
- boolean correctAnswer = allQuestions.list.get(questionNumber).answer;
- if (correctAnswer == pickedAnswer) {
- score = score + 1;
- …
- } else {
- …
- }
- …
- }
- …
- private void nextQuestion() {
- if (questionNumber <= allQuestions.list.size() - 1) {
- tvQuestion.setText(allQuestions.list.get(questionNumber).questionText);
- tvQuestionNumber.setText(questionNumber + 1 + “/“ + allQuestions.list.size( ));
- tvScore.setText(“Score: “ + score);
- } else { … }
- }
Add Comment
Please, Sign In to add comment