javascript quiz tutorial code example

Example 1: how to create a quiz in p5

function generateQuiz(questions, quizContainer, resultsContainer, submitButton){

	function showQuestions(questions, quizContainer){
		// code will go here
	}

	function showResults(questions, quizContainer, resultsContainer){
		// code will go here
	}

	// show the questions
	showQuestions(questions, quizContainer);

	// when user clicks submit, show results
	submitButton.onclick = function(){
		showResults(questions, quizContainer, resultsContainer);
	}
}

Example 2: how to create a quiz in p5

<div id="quiz"></div>
<button id="submit">Get Results</button>
<div id="results"></div>