I'm coding a quiz with the expo framework, in a certain part of the code I make a comparison of each answer chosen by the user. It works for all questions except the first one. The part that compares is down below:
const verificarResposta = (opMarcada, opCorreta) => {
console.log("choosen: ", opMarcada, " correct: ", opCorreta)
// compares the choosen option with the right value
if (opMarcada == opCorreta) {
setAcertos(acertos => acertos+1)
console.log("correct! ", acertos)
} else {
setErros(erros => erros+1)
console.log("wrong! ", erros)
}
proximaQuestao()
}
I tried to increase both the number of hits and misses, for all it works with the exception of the first increment. hope it works for all comparisons.