0
Hello! Well, I created an app quiz with five questions, with these, five right answers. My intention is to show on the screen how many answers the user hit and how many he missed, but I do not know a correct way to compute this data without using a thousand if Else. An XML file - from Activity questionario - has all the questions with answers and a button for other results Activity, and that’s where the ids are.
I want to show in Activity of the result something similar to this:
Code of the result Activity
public class ResultadoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_resultado);
/*VALOR NOME DA EDITTEXT*/
EditText nome = findViewById(R.id.username);
/*PEGAR SOMENTE OS IDS DAS OPTIONS CERTAS*/
RadioButton a = findViewById(R.id.resp2);
RadioButton b = findViewById(R.id.resp4);
RadioButton c = findViewById(R.id.resp8);
RadioButton d = findViewById(R.id.resp10);
RadioButton e = findViewById(R.id.resp13);
public void callQuestao1(View view) {
Intent intent = new Intent();
startActivity(intent);
}
}