![](/img/trans.png)
[英]TypeError: res.json is not a function. I've poured over the similar questions and can't seem to find an answer to my case
[英]How do I randomize my questions? I can't find an answer anywhere else
// 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);
如何在創建測驗時隨機化 ^^^ [Math.floor(math.random()*]
不起作用
嘗試這個:
// 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);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.