我已经想出如何在我的previous post中选择所有可能的正确答案,问题是问题只会通过选择错误的答案进入下一轮,然后出现下一个按钮。< / p>
已选择所有正确答案。
只有在选择了错误答案时才会出现下一个按钮。
我修改了我之前发布的问题的代码:
public void answerButtonClickHandler(View v)
{
Answer answer = answers.get(v.getId());
if (answer != null) {
questionAnswered++;
if (answer.isCorrect()) {
correctlyAnswered++;
v.setBackgroundResource(R.drawable.answer_button_correct);
} else{
disableAnswerButtons();
v.setBackgroundResource(R.drawable.answer_button_wrong);
questionDescriptionText.setText(question.getDescription());
questionDescriptionText.setVisibility(View.VISIBLE);
nextBtn.setVisibility(View.VISIBLE);
}
if (nextQuestionIndex >= questionsIndexList.size()) {
//} else{
completeBtn.setVisibility(View.VISIBLE);
}
}
}