Skip to content

Instantly share code, notes, and snippets.

@peaceintheheart
Created October 28, 2019 14:33
Show Gist options
  • Save peaceintheheart/cd0d987114b048b296b33273536713ce to your computer and use it in GitHub Desktop.
Save peaceintheheart/cd0d987114b048b296b33273536713ce to your computer and use it in GitHub Desktop.
function updateQuestion() {
const quizQuestions = `<section class='question'>
<form>
<h4>${questionNumber}<span>/7 - Question Number</span></h4>
<h4>${score}<span>/49 - Score</span></h4>
<h2>${QUESTIONS[questionNumber].question}</h2>
<label>
<input type='radio' id='r1' name='forRadio1' class='rdo' value='${QUESTIONS[questionNumber].choice1}' >${QUESTIONS[questionNumber].choice1}
</label>
<label>
<input type='radio' id='r2' name='forRadio1' class='rdo' value='${QUESTIONS[questionNumber].choice2}'>${QUESTIONS[questionNumber].choice2}
</label>
<label>
<input type='radio' id='r3' name='forRadio1' class='rdo' value='${QUESTIONS[questionNumber].choice3}'>${QUESTIONS[questionNumber].choice3}
</label>
<label>
<input type='radio' id='r4' name='forRadio1' class='rdo' value='${QUESTIONS[questionNumber].choice4}'>${QUESTIONS[questionNumber].choice4}
</label>
<section class='tdScoresForDays'>
<div id='incorrect'><div>
</section>
<button type='submit' id='td'>Touchdown?</button>
</form>
</section>`
$('.jsList').on('click').append(quizQuestions);
$('.jsList').on('click', '#td', function(e){
e.preventDefault();
checkAnswer();
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment