how to create a quiz in p5

Solutions on MaxInterview for how to create a quiz in p5 by the best coders in the world

showing results for - "how to create a quiz in p5"
Tommaso
22 Oct 2019
1var myQuestions = [
2	{
3		question: "What is 10/2?",
4		answers: {
5			a: '3',
6			b: '5',
7			c: '115'
8		},
9		correctAnswer: 'b'
10	},
11	{
12		question: "What is 30/3?",
13		answers: {
14			a: '3',
15			b: '5',
16			c: '10'
17		},
18		correctAnswer: 'c'
19	}
20];
Michela
31 Jun 2020
1<div id="quiz"></div>
2<button id="submit">Get Results</button>
3<div id="results"></div>
Liam
02 Jul 2018
1function generateQuiz(questions, quizContainer, resultsContainer, submitButton){
2
3	function showQuestions(questions, quizContainer){
4		// code will go here
5	}
6
7	function showResults(questions, quizContainer, resultsContainer){
8		// code will go here
9	}
10
11	// show the questions
12	showQuestions(questions, quizContainer);
13
14	// when user clicks submit, show results
15	submitButton.onclick = function(){
16		showResults(questions, quizContainer, resultsContainer);
17	}
18}