Colleagues.
I am bringing from the bank the grades of the students that are as follows:
A, C, A, A, A, B, C, B, D, A, C, D, B, B, B, A
But I need to compare with the template notes that come from XML and thanks to the help of my colleagues, I came up with the following code:
$contar = 0;
$notasAlunos = explode(',',$aluno->avaliacao_respostas);
foreach($xml->avaliacao->disciplina as $disciplina) {
echo $disciplina->attributes()->nome.":<br>";
foreach ($disciplina as $questao) {
foreach($notasAlunos as $notaAluno){ // Aqui trago as notas dos alunos
if($questao->resposta == $notaAluno){ // aqui verifico se as questões do gabarito é igual a nota do aluno
$conta = $contar++;
}
}
}
}
echo $conta;
The only problem is that when I use it that way, instead of bringing me 17 points, it's bringing me 91.