-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
390 lines (353 loc) · 17.3 KB
/
index.html
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>CatFeed</title>
<meta name="copyright" content="Copyright 2006-2008 BuzzFeed, Inc. All rights reserved." />
<meta name="description" content="The web is a 24/7 popularity contest. Help the good stuff win." />
<head>
<link href="./styles/style.css" rel="stylesheet" type="text/css" />
</head>
<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
<script>
$(document).ready(function () {
console.warn("hello");
$("#header").load("header.html");
$("#side-nav").load("sidenav.html");
$("#right-panel").load("rightpanel.html");
$("#leaderboard-ad-1").load("acrossad.html");
$("#leaderboard-ad-2").load("acrossad.html");
var submit = document.querySelector('[name="getResults"]');
console.log(submit)
submit.addEventListener('click', scoreQuiz);
// scoreQuiz();
});
/* Scores the quiz. Does NOT do tiebreaker */
function scoreQuiz() {
results_dict = {
"t1": 0,
"t2": 0,
"t3": 0,
"t4": 0,
"t5": 0,
"t6": 0
}
$("input[name^='q']:checked").each( function () {
if(this.checked == true) {
var types = this.value.split(",");
types.forEach(function (item) {
results_dict[item] += 1;
})
console.log(this.value);
}
});
// put key/val pairs in array
var keyValues = [];
for (var key in results_dict) {
keyValues.push([key, results_dict[key]])
}
keyValues.sort(function compare(kv1, kv2) {
return kv2[1]-kv1[1];
})
console.log(keyValues);
// const radioChoices =
}
function test() {
console.log("yah");
// const radioChoices =
}
</script>
<body>
<div id="page">
<div id="header"></div>
<div id="content">
<div id="side-nav">
</div> <!-- /side-nav -->
<div id="quiz-panel">
<div class="across-ad" id="leaderboard-ad-1">
</div>
<div class="quiz-header">
<div class="quiz-label">
<p>QUIZ</p>
</div>
<p class="date">Posted on April 8, 2008</p>
<h1 class="title">Take This Quiz to Find Out What Cat You Are</h1>
<h3 class="subtitle">We'll see how you're really feline.</h2>
<div class="author-panel">
<img>
<p>by catlover2008</p>
</div>
<div class="tags">
<ul class="tags-items">
<li class="label">tagged</li>
<li>cats</li>
<li>personality</li>
<li>culture</li>
<li>the important stuff</li>
</ul>
</div>
</div>
<form>
<div id="question-1" class="question">
<h2 class="question-title">
Do you like to hang around people, or do you like being alone?
</h2>
<div class="answers">
<div class="answer-box">
<label for="q1a1">
<img src="./images/q1_2.jpg">
<p>Leave me alone please.</p>
</label>
<input type="radio" value="t2,t5" id="q1a1" name="q1">
</div>
<div class="answer-box">
<label for="q1a2">
<img src="./images/q1_1.jpg">
<p>I love hanging out!</p>
</label>
<input type="radio" value="t1,t6" id="q1a2" name="q1">
</div>
<!-- <div class="answer-box">
<label for="q1a3">
<img src="./images/q1_3.jpg">
<p>Depends on my mood</p>
</label>
<input type="radio" value="t2,t3" id="q1a3" name="q1">
</div>
<div class="answer-box">
<label for="q1a4">
<img src="./images/q1_4.jpg">
<p>Just one or two close friends for me</p>
</label>
<input type="radio" value="t2,t3,t4,t5" id="q1a4" name="q1">
</div> -->
</div>
</div>
<div class="across-ad" id="leaderboard-ad-2">
</div>
<div id="question-2" class="question">
<h2 class="question-title">
Where's the best place to nap?
</h2>
<div class="answers">
<div class="answer-box">
<label for="q2a1">
<img src="./images/q2_1.jpg">
<p>I don't nap.</p>
</label>
<input type="radio" value="t5" id="q2a1" name="q2">
</div>
<div class="answer-box">
<label for="q2a2">
<img src="./images/q2_2.jpg">
<p>Cozied up under the covers</p>
</label>
<input type="radio" value="t2,t3" id="q2a2" name="q2">
</div>
<div class="answer-box">
<label for="q2a3">
<img src="./images/q2_3.jpg">
<p>In a sunbeam on the grass</p>
</label>
<input type="radio" value="t1,t2,t4" id="q2a3" name="q2">
</div>
<div class="answer-box">
<label for="q2a4">
<img src="./images/q2_4.jpg">
<p>Wherever I end up falling asleep</p>
</label>
<input type="radio" value="t1,t3,t6" id="q2a4" name="q2">
</div>
</div>
</div>
<div class="across-ad" id="leaderboard-ad-1">
</div>
<div id="question-3" class="question">
<h2 class="question-title">
What's your skincare routine?
</h2>
<div class="answers">
<div class="answer-box">
<label for="q3a1">
<img src="./images/q3_1.jpg">
<p>Just cleanser and water</p>
</label>
<input type="radio" value="t1,t3" id="q3a1" name="q3">
</div>
<div class="answer-box">
<label for="q3a2">
<img src="./images/q3_2.jpg">
<p>It's multiple steps and I can't miss a day!</p>
</label>
<input type="radio" value="t2,t5" id="q3a2" name="q3">
</div>
<div class="answer-box">
<label for="q3a3">
<img src="./images/q3_3.jpg">
<p>Routine???</p>
</label>
<input type="radio" value="t3,t6" id="q3a3" name="q3">
</div>
<div class="answer-box">
<label for="q3a4">
<img src="./images/q3_4.jpg">
<p>Sunscreen and bug spray</p>
</label>
<input type="radio" value="t4," id="q3a4" name="q3">
</div>
</div>
</div>
<div id="question-4" class="question">
<h2 class="question-title">
How do you feel about Mondays?
</h2>
<div class="answers">
<div class="answer-box">
<label for="q4a1">
<img src="./images/q4_1.jpg">
<p>Can't wait for Monday!</p>
</label>
<input type="radio" value="t3,t4" id="q4a1" name="q4">
</div>
<div class="answer-box">
<label for="q4a2">
<img src="./images/q4_2.jpg">
<p>I HATE Mondays.</p>
</label>
<input type="radio" value="t2,t6" id="q4a2" name="q4">
</div>
<div class="answer-box">
<label for="q4a3">
<img src="./images/q4_3.jpg">
<p>Just another day in this endless void</p>
</label>
<input type="radio" value="t5" id="q4a3" name="q4">
</div>
<div class="answer-box">
<label for="q4a4">
<img src="./images/q4_4.jpg">
<p>I don't mind them!</p>
</label>
<input type="radio" value="t1,t3,t4" id="q4a4" name="q4">
</div>
</div>
</div>
<div id="question-5" class="question">
<h2 class="question-title">
What about Italian food?
</h2>
<div class="answers">
<div class="answer-box">
<label for="q5a1">
<img src="./images/q5_1.jpg">
<p>Bury me in a bed of lasagna</p>
</label>
<input type="radio" value="t3,t6" id="q5a1" name="q5">
</div>
<div class="answer-box">
<label for="q5a2">
<img src="./images/q5_2.jpg">
<p>I'm not a big carbs person</p>
</label>
<input type="radio" value="t2,t4" id="q5a2" name="q5">
</div>
<div class="answer-box">
<label for="q5a3">
<img src="./images/q5_3.jpg">
<p>I'll take some italian wine instead</p>
</label>
<input type="radio" value="t2,t5" id="q5a3" name="q5">
</div>
<div class="answer-box">
<label for="q5a4">
<img src="./images/q5_4.jpg">
<p>Sure, I'll eat it!</p>
</label>
<input type="radio" value="t1,t3,t4" id="q5a4" name="q5">
</div>
</div>
</div>
<div id="question-6" class="question">
<h2 class="question-title">
What's something your friends might tease you about?
</h2>
<div class="answers">
<div class="answer-box">
<label for="q6a1">
<img src="./images/q6_1.jpg">
<p>Nothing. I am perfect.</p>
</label>
<input type="radio" value="t2" id="q6a1" name="q6">
</div>
<div class="answer-box">
<label for="q6a2">
<img src="./images/q6_2.jpg">
<p>I'm pretty clumsy and scatterbrained</p>
</label>
<input type="radio" value="t6" id="q6a2" name="q6">
</div>
<div class="answer-box">
<label for="q6a3">
<img src="./images/q6_3.jpg">
<p>They might call me... strange...</p>
</label>
<input type="radio" value="t5" id="q6a3" name="q6">
</div>
<div class="answer-box">
<label for="q6a4">
<img src="./images/q6_4.jpg">
<p>They'd say I don't go out enough</p>
</label>
<input type="radio" value="t3,t4" id="q6a4" name="q6">
</div>
<div class="answer-box">
<label for="q6a5">
<img src="./images/q6_5.jpg">
<p>We don't tease each other like that!</p>
</label>
<input type="radio" value="t1,t3,t4" id="q6a5" name="q6">
</div>
</div>
</div>
<div id="question-7" class="question">
<h2 class="question-title">
Last and potentially least... thoughts on dogs?
</h2>
<div class="answers">
<div class="answer-box">
<label for="q7a1">
<img src="./images/q7_1.jpg">
<p>Second only to cats!</p>
</label>
<input type="radio" value="t1,t3,t4" id="q7a1" name="q7">
</div>
<div class="answer-box">
<label for="q7a2">
<img src="./images/q7_2.jpg">
<p>I LOVE DOGS!!!</p>
</label>
<input type="radio" value="t4,t6" id="q7a2" name="q7">
</div>
<div class="answer-box">
<label for="q7a3">
<img src="./images/q7_3.jpg">
<p>I don't think about dogs</p>
</label>
<input type="radio" value="t2,t3" id="q7a3" name="q7">
</div>
<div class="answer-box">
<label for="q7a4">
<img src="./images/q7_4.jpg">
<p>They are my mortal enemy.</p>
</label>
<input type="radio" value="t5" id="q7a4" name="q7">
</div>
</div>
</div>
<button type="button" name="getResults">Results</button>
</form>
<div id="result"></div>
</div> <!-- /quiz-panel -->
<div id="right-panel">
</div> <!-- /right-panel -->
</div> <!-- /content -->
</div>
</body>