"; } questionContainer.textContent = (currentQuestion + 1) + ". " + quiz[cQarr[currentQuestion]].question; choicesContainer.innerHTML = choicesHtml; if (currentQuestion === 0) { submitBtn.textContent = "Submit Answer"; } } function checkAnswer() { if (askingQuestion) { submitBtn.textContent = "Next Question"; askingQuestion = false; var userpick, correctIndex, radios = document.getElementsByName("quiz" + currentQuestion); for (var i = 0; i < radios.length; i++) { if (radios[i].checked) { userpick = radios[i].value; } if (radios[i].value == quiz[cQarr[currentQuestion]].correct) { correctIndex = i; } } var labelStyle = document.getElementsByTagName("label")[correctIndex].style; labelStyle.fontWeight = "bold"; if (userpick == quiz[cQarr[currentQuestion]].correct) { score++; labelStyle.color = "green"; } else { labelStyle.color = "red"; } } else { askingQuestion = true; submitBtn.textContent = "Submit Answer"; if (currentQuestion < quiz.length - 1) { currentQuestion++; askQuestion(); } else { showFinalResults(); } } } function showFinalResults() { content.innerHTML = "
Module 13 chapter 1 quiz 9
"; } questionContainer.textContent = (currentQuestion + 1) + ". " + quiz[cQarr[currentQuestion]].question; choicesContainer.innerHTML = choicesHtml; if (currentQuestion === 0) { submitBtn.textContent = "Submit Answer"; } } function checkAnswer() { if (askingQuestion) { submitBtn.textContent = "Next Question"; askingQuestion = false; var userpick, correctIndex, radios = document.getElementsByName("quiz" + currentQuestion); for (var i = 0; i < radios.length; i++) { if (radios[i].checked) { userpick = radios[i].value; } if (radios[i].value == quiz[cQarr[currentQuestion]].correct) { correctIndex = i; } } var labelStyle = document.getElementsByTagName("label")[correctIndex].style; labelStyle.fontWeight = "bold"; if (userpick == quiz[cQarr[currentQuestion]].correct) { score++; labelStyle.color = "green"; } else { labelStyle.color = "red"; } } else { askingQuestion = true; submitBtn.textContent = "Submit Answer"; if (currentQuestion < quiz.length - 1) { currentQuestion++; askQuestion(); } else { showFinalResults(); } } } function showFinalResults() { content.innerHTML = "
" + score + " out of " + quiz.length + " " + "
Subscribe to:
Posts (Atom)
RMS Voltage Tutorial
What is RMS Voltage ? The RMS or effective value of a sinusoidal waveform gives the same heating effect of an equivalent DC supply In ou...
-
EASA MODULE 13 AIRCRAFT STRUCTURES AND SYSTEMS SUB-MODULE 01 THEORY OF FLIGHT SUB-MODULE 03 AUTOFLIGHT ...
-
Easa
-
Angular displacement of the control coils with respect to the reference coils in a two phase induction motor are a) 0o, 180o Ans b) 90o, 2...
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete