I have the XML of which brings the questions from 1 to 10 with 5 answers each (A, B, C, D, E). The user will list those questions and answer them. Through the system, I can check the correct responses of users as follows:
foreach($xml->avaliacao->questao as $listar => $valor) {
if($_POST["respostas"][$c] == $respostas){
$somar[0] = $cc++;
$respostasC = $_POST["respostas"][$c];
$rc[] = $respostasC;
}else{
$somarE[0] = $cc++;
$respostasE = $_POST["respostas"][$c];
$rr[] = $respostasE;
}
}
I just forgot to compare that answer to a particular question, considering that the questions are like this in XML:
Question 1: A B C D E
Question 2: A B C D E
Question ...
I would like that when listing the correct answers, they appear as follows:
If the user hits: Question 2: The Question 5: C Question 7: D ......
If the user misses: Question 3 Question 4 Question 6 ......
I hope it was clear in my doubts.