-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathquizApp.js
More file actions
49 lines (25 loc) · 1.58 KB
/
quizApp.js
File metadata and controls
49 lines (25 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//Note: use var for declaring variables
//We're going to create the JS for a basic quiz application.
//Let's think about the nature of this quiz app first. We're going to be creating lots of user objects, and we're
//also going to be creating lots of Question objects. Those would make two perfectly good constructors.
//Create a QuizUser constructor that accepts name, email, password, and totalScore parameters and set them appropriatly
//code here
//Create a Question constructor that accepts title, answersArray, rightAnswer, and difficulty parameters
//code here
//Create a quizUsers Array which is going to hold all of our users.
//code here
//Let's say three people signed up for our service, create 3 instances of User and add each to the users Array
//code here
//Create a questions Array which is going to hold all of our questions
//code here
//Now, let's say we wanted to create a quiz about JavaScript. Create three instances of Question which contain the following data
//title: 'T/F: Inheritance is achieved in JavaScript through Prototypes?'
//title: 'T/F: JavaScript is just a scripting version of Java'
//title: "T/F: In Javascript, == doesn't check 'type' but just the value - where === checks type and value"
//Fill in the rest of the required data as you see appropriate.
//code here
//Now push all of your instances of Question into the questions Array
//code here
console.log('My users Array and my questions arrray are ...');
//Now loop console.log your users array and your questions array and verify that they're both holding the right data.
//code here