// create questions
var questions = [
new Question("Which one is not an object oriented programming language?", ["Java", "C#","C++", "C"], "C"),
new Question("Which language is used for styling web pages?", ["HTML", "JQuery", "CSS", "XML"], "CSS"),
new Question("There are ____ main components of object oriented programming.", ["1", "6","2", "4"], "4"),
new Question("Which language is used for web apps?", ["PHP", "Python", "Javascript", "All"], "All"),
new Question("MVC is a ____.", ["Language", "Library", "Framework", "All"], "Framework")
];
// create quiz
var quiz = new Quiz(questions);
how to randomize when the quiz is created ^^^
the [Math.floor(math.random()*] doesn't work
Try this :
// create questions
var questions = [
new Question("Which one is not an object oriented programming language?", ["Java", "C#","C++", "C"], "C"),
new Question("Which language is used for styling web pages?", ["HTML", "JQuery", "CSS", "XML"], "CSS"),
new Question("There are ____ main components of object oriented programming.", ["1", "6","2", "4"], "4"),
new Question("Which language is used for web apps?", ["PHP", "Python", "Javascript", "All"], "All"),
new Question("MVC is a ____.", ["Language", "Library", "Framework", "All"], "Framework")
];
// create quiz
let randomQuestion = questions[Math.floor(Math.random()*questions.length)]
var quiz = new Quiz(randomQuestion);