private void newQuestion() { rg.clearCheck(); partialPoints = POINTS_FOR_QUESTION; // Puntos parciales (al fallar se resta 2 puntos). test = testList.get((int) (Math.random() * (14 - 0)) + 0); // Mostrar pregunta y opciones. question.setText(test.getQuestion()); for (int i = 0; i < NUMBER_OF_ANSWERS; i++) { respRadioButton[i].setText(test.getOption(i)); } }
private void checkIfButtonClickedIsCorrectAnswer(int index) { boolean response = false; if (respRadioButton[index].getText().equals(test.getResponse())) { response = true; } else { response = false; } super.showAnimationAnswer(response); // only create new Question if user has right input if (this.gameMode) { if (response) { gameModeControl(); newQuestion(); } else if (totalFails < 3) { totalFails++; partialPoints = partialPoints - REST_FOR_FAIL; } else { partialPoints = 0; gameModeControl(); newQuestion(); } } }