0
What I’m trying to do is select the alternative and when checking show with Alert whether the answer is right or wrong. With each correct answer, you add up the correct ones and if you made a mistake, you add up mistakes. But checking the answer does not show the Alert is sent to the url.
var acertos=0;
var erros=0;
function verificar(){
var form =document.getElementByName('form');
var correctanswer =document.getElementByName("B");
form.addEventListener('onclick', function(event) {
event.preventDefault();
if (correctanswer.checked) {
acertos== acertos++;
alert("Resposta Correta!"+ acertos);
}else{
alert("Resposta Errada!" + erros );
}
});
}
<div class="col-md-10">
<h2>ALFABETO</h2>
<video controls="true" width="500" height="300" id="01" src="video/video1.mp4"></video>
<form name ="form">
<p>Selecione a opção que corresponde a letra sinalizada</p>
<label>
<input type="radio" name="resposta1" value="A"/> Letra A</label>
<label>
<input type="radio" name="resposta1" value="B"/> Letra B</label><br>
<label>
<input type="radio" name="resposta1" value="C"/> Letra C</label>
<label>
<input type="radio" name="resposta1" value="D"/> Letra D</label><br>
<button onclick="verificar()">verificar</button>
</form>
Thank you Richard Santos managed to issue Alert but I can’t show the number of hits and the number of errors.
– Deise
Okay, I’m sorry I only got to answer today.
– Richard Santos