-
Notifications
You must be signed in to change notification settings - Fork 109
/
app.js
58 lines (51 loc) · 1.38 KB
/
app.js
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
49
50
51
52
53
54
55
56
57
58
/**
* Example store structure
*/
const store = {
// 5 or more questions are required
questions: [
{
question: 'What color is broccoli?',
answers: [
'red',
'orange',
'pink',
'green'
],
correctAnswer: 'green'
},
{
question: 'What is the current year?',
answers: [
'1970',
'2015',
'2019',
'2005'
],
correctAnswer: '2019'
}
],
quizStarted: false,
questionNumber: 0,
score: 0
};
/**
*
* Technical requirements:
*
* Your app should include a render() function, that regenerates the view each time the store is updated.
* See your course material, consult your instructor, and reference the slides for more details.
*
* NO additional HTML elements should be added to the index.html file.
*
* You may add attributes (classes, ids, etc) to the existing HTML elements, or link stylesheets or additional scripts if necessary
*
* SEE BELOW FOR THE CATEGORIES OF THE TYPES OF FUNCTIONS YOU WILL BE CREATING 👇
*
*/
/********** TEMPLATE GENERATION FUNCTIONS **********/
// These functions return HTML templates
/********** RENDER FUNCTION(S) **********/
// This function conditionally replaces the contents of the <main> tag based on the state of the store
/********** EVENT HANDLER FUNCTIONS **********/
// These functions handle events (submit, click, etc)