Repository navigation
Expand file tree
/
Copy pathquestion-service.js
More file actions
1065 lines (1028 loc) · 40.7 KB
/
Copy pathquestion-service.js
File metadata and controls
1065 lines (1028 loc) · 40.7 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
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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
const axios = require('axios');
const valkeyClient = require('./valkey-client');
const { cleanupLegacyCache } = require('./cleanup-legacy-cache');
// Sanitizes log values by removing control characters and truncating length
// to prevent log injection attacks and improve readability
function sanitizeLogValue(value) {
return String(value || '').replace(/[\r\n\t\x00-\x1f\x7f-\x9f<>"'&]/g, ' ').slice(0, 200);
}
function validateUserId(userId) {
if (!userId || typeof userId !== 'string' || userId.length > 100) {
throw new Error('Invalid user ID');
}
if (!/^[a-zA-Z0-9\-_@.]+$/.test(userId)) {
throw new Error('User ID contains invalid characters');
}
return userId;
}
function validateCategory(category) {
const validCategories = ['general', 'science', 'history', 'sports', 'entertainment'];
if (category && (!validCategories.includes(category.toLowerCase()) || typeof category !== 'string')) {
throw new Error('Invalid category');
}
return category ? category.toLowerCase() : 'general';
}
// Comprehensive HTML entity mapping for better performance
const HTML_ENTITIES = {
'&': '&',
'<': '<',
'>': '>',
'"': '"',
''': "'",
''': "'",
''': "'",
' ': ' ',
'’': "'",
'‘': "'",
'”': '"',
'“': '"',
'æ': 'æ',
'í': 'í',
'ó': 'ó',
'ç': 'ç',
'ü': 'ü',
'ö': 'ö',
'ä': 'ä',
'é': 'é',
'è': 'è',
'ê': 'ê',
'ë': 'ë',
'ñ': 'ñ',
'à': 'à',
'á': 'á',
'â': 'â',
'ã': 'ã',
'ù': 'ù',
'ú': 'ú',
'û': 'û',
'ì': 'ì',
'î': 'î',
'ï': 'ï',
'ò': 'ò',
'ô': 'ô',
'õ': 'õ',
'‎': '',
'‏': ''
};
function sanitizeQuestionText(text) {
if (!text || typeof text !== 'string') {
return '';
}
// Use single regex replace with callback for better performance
const entityRegex = /&(?:amp|lt|gt|quot|#x27|#039|apos|nbsp|rsquo|lsquo|rdquo|ldquo|aelig|[ioa](?:acute|grave|circ|tilde|uml)|[eun](?:acute|grave|circ|tilde|uml)|ccedil|[lr]m);/g;
const decoded = text.replace(entityRegex, (match) => {
return HTML_ENTITIES[match] || match;
});
// Then sanitize any remaining dangerous characters
return decoded.replace(/[<>]/g, '').substring(0, 500);
}
class QuestionService {
constructor() {
this.lastApiCall = 0;
this.minInterval = 1500;
}
async fetchAndCacheQuestions(category = 'general') {
try {
// Check if cleanup needed via cache
const cleanupKey = `cleanup:${new Date().toISOString().split('T')[0]}`;
try {
const cleanupDone = await valkeyClient.client?.get(cleanupKey);
if (!cleanupDone) {
await cleanupLegacyCache();
await valkeyClient.client?.setex(cleanupKey, 86400, 'done');
}
} catch (err) {
console.error('Cleanup error:', sanitizeLogValue(err.message));
}
// First check weekly questions cache
const weekKey = this.getWeekKey();
let weeklyQuestions = await valkeyClient.getWeeklyQuestions(weekKey);
if (weeklyQuestions && weeklyQuestions.length >= 100) {
return weeklyQuestions;
}
// Fallback to previous week if current week not ready
const previousWeekKey = this.getPreviousWeekKey(weekKey);
weeklyQuestions = await valkeyClient.getWeeklyQuestions(previousWeekKey);
if (weeklyQuestions && weeklyQuestions.length >= 100) {
console.log(`Using previous week questions: ${sanitizeLogValue(previousWeekKey)}`);
return weeklyQuestions;
}
} catch (error) {
console.error('Weekly cache check failed:', error);
}
// Fallback: return mock questions
console.log('No cached questions available, using mock questions');
return this.getMockQuestions();
}
getWeekKey() {
const now = new Date();
const year = now.getFullYear();
const week = this.getWeekNumber(now);
return `${year}-W${week.toString().padStart(2, '0')}`;
}
getPreviousWeekKey(currentWeekKey) {
if (!currentWeekKey || !currentWeekKey.includes('-W')) {
throw new Error('Invalid week key format');
}
const [year, weekStr] = currentWeekKey.split('-W');
const week = parseInt(weekStr);
if (isNaN(week) || week < 1 || week > 53) {
throw new Error('Invalid week number');
}
if (week === 1) {
// Check if previous year has 53 weeks
const prevYear = parseInt(year) - 1;
const lastWeekOfPrevYear = this.getWeeksInYear(prevYear);
return `${prevYear}-W${lastWeekOfPrevYear.toString().padStart(2, '0')}`;
} else {
return `${year}-W${(week - 1).toString().padStart(2, '0')}`;
}
}
getWeeksInYear(year) {
const jan1 = new Date(year, 0, 1);
const dec31 = new Date(year, 11, 31);
return jan1.getDay() === 4 || dec31.getDay() === 4 ? 53 : 52;
}
getWeekNumber(date) {
const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()));
const dayNum = d.getUTCDay() || 7;
d.setUTCDate(d.getUTCDate() + 4 - dayNum);
const yearStart = new Date(Date.UTC(d.getUTCFullYear(), 0, 1));
return Math.ceil((((d - yearStart) / 86400000) + 1) / 7);
}
async getGameQuestions(userId, category = 'general') {
try {
validateUserId(userId);
const validatedCategory = validateCategory(category);
const allQuestions = await this.fetchAndCacheQuestions(validatedCategory);
let seenQuestions = [];
try {
let timeoutId;
const timeoutPromise = new Promise((_, reject) => {
timeoutId = setTimeout(() => reject(new Error('Timeout')), 1000);
});
seenQuestions = await Promise.race([
valkeyClient.getSeenQuestions(userId),
timeoutPromise
]);
clearTimeout(timeoutId);
} catch (error) {
console.error('Failed to get seen questions, using empty set:', sanitizeLogValue(error.message));
}
const sanitizedQuestions = allQuestions.map(q => ({
...q,
question: sanitizeQuestionText(q.question),
correct_answer: sanitizeQuestionText(q.correct_answer),
incorrect_answers: Array.isArray(q.incorrect_answers)
? q.incorrect_answers.map(a => sanitizeQuestionText(a))
: []
}));
const seenQuestionsSet = new Set(seenQuestions);
const unseenQuestions = sanitizedQuestions.filter(q =>
q.id && !seenQuestionsSet.has(q.id)
);
if (unseenQuestions.length < 5) {
return this.shuffleArray(sanitizedQuestions).slice(0, 5);
}
return this.shuffleArray(unseenQuestions).slice(0, 5);
} catch (error) {
console.error('Error getting game questions, using mock:', sanitizeLogValue(error.message));
return this.getMockQuestions().slice(0, 5);
}
}
getMockQuestions() {
// General Knowledge category only - easy and medium difficulty
return [
{
"id": "mock-1",
"question": "What is the capital of France?",
"correct_answer": "Paris",
"incorrect_answers": [
"London",
"Berlin",
"Madrid"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-2",
"question": "What is the largest ocean on Earth?",
"correct_answer": "Pacific Ocean",
"incorrect_answers": [
"Atlantic Ocean",
"Indian Ocean",
"Arctic Ocean"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-3",
"question": "In which year did World War II end?",
"correct_answer": "1945",
"incorrect_answers": [
"1944",
"1946",
"1943"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-4",
"question": "What is the capital of Australia?",
"correct_answer": "Canberra",
"incorrect_answers": [
"Sydney",
"Melbourne",
"Brisbane"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-5",
"question": "What is the smallest country in the world?",
"correct_answer": "Vatican City",
"incorrect_answers": [
"Monaco",
"San Marino",
"Liechtenstein"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-6",
"question": "What is the currency of Japan?",
"correct_answer": "Yen",
"incorrect_answers": [
"Won",
"Yuan",
"Rupee"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-7",
"question": "What is the largest continent?",
"correct_answer": "Asia",
"incorrect_answers": [
"Africa",
"North America",
"Europe"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-8",
"question": "Which country invented paper?",
"correct_answer": "China",
"incorrect_answers": [
"Egypt",
"Greece",
"India"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-9",
"question": "What does WWW stand for?",
"correct_answer": "World Wide Web",
"incorrect_answers": [
"World War Web",
"Wide World Web",
"World Web Wide"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-10",
"question": "What is the currency of the United Kingdom?",
"correct_answer": "Pound Sterling",
"incorrect_answers": [
"Euro",
"Dollar",
"Franc"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-11",
"question": "Which is the longest river in the world?",
"correct_answer": "Nile River",
"incorrect_answers": [
"Amazon River",
"Mississippi River",
"Yangtze River"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-12",
"question": "How many continents are there?",
"correct_answer": "7",
"incorrect_answers": [
"5",
"6",
"8"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-13",
"question": "What is the most spoken language in the world?",
"correct_answer": "Mandarin Chinese",
"incorrect_answers": [
"English",
"Spanish",
"Hindi"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-14",
"question": "Which country is known as the Land of the Rising Sun?",
"correct_answer": "Japan",
"incorrect_answers": [
"China",
"South Korea",
"Thailand"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-15",
"question": "What is the tallest mountain in the world?",
"correct_answer": "Mount Everest",
"incorrect_answers": [
"K2",
"Kangchenjunga",
"Lhotse"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-16",
"question": "How many days are there in a leap year?",
"correct_answer": "366",
"incorrect_answers": [
"365",
"367",
"364"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-17",
"question": "Which planet is closest to Earth?",
"correct_answer": "Venus",
"incorrect_answers": [
"Mars",
"Mercury",
"Jupiter"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-18",
"question": "What is the capital of Canada?",
"correct_answer": "Ottawa",
"incorrect_answers": [
"Toronto",
"Vancouver",
"Montreal"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-19",
"question": "How many sides does a hexagon have?",
"correct_answer": "6",
"incorrect_answers": [
"5",
"7",
"8"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-20",
"question": "Which is the largest desert in the world?",
"correct_answer": "Antarctica",
"incorrect_answers": [
"Sahara",
"Gobi",
"Arabian"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-21",
"question": "What color is the sun?",
"correct_answer": "White",
"incorrect_answers": [
"Yellow",
"Orange",
"Red"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-22",
"question": "How many minutes are in a full day?",
"correct_answer": "1440",
"incorrect_answers": [
"1400",
"1480",
"1420"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-23",
"question": "What is the hardest natural substance on Earth?",
"correct_answer": "Diamond",
"incorrect_answers": [
"Quartz",
"Topaz",
"Corundum"
],
"category": "General Knowledge",
"difficulty": "easy"
},
{
"id": "mock-24",
"question": "Which country has the most time zones?",
"correct_answer": "France",
"incorrect_answers": [
"Russia",
"United States",
"China"
],
"category": "General Knowledge",
"difficulty": "medium"
},
{
"id": "mock-25",
"question": "What is the most abundant gas in Earth's atmosphere?",
"correct_answer": "Nitrogen",
"incorrect_answers": [
"Oxygen",
"Carbon Dioxide",
"Argon"
],
"category": "General Knowledge",
"difficulty": "easy"
}
];
}
getFullMockQuestions() {
// Full dataset available if needed
return [
{
"id": "mock-1",
"question": "In "A Hat in Time", what must Hat Kid collect to finish a level",
"correct_answer": "A time piece",
"incorrect_answers": [
"A heart fragment",
"A relic fragment",
"A hat"
]
},
{
"id": "mock-2",
"question": "What is the name of the virus in "Metal Gear Solid 1"?",
"correct_answer": "FOXDIE",
"incorrect_answers": [
"FOXENGINE",
"FOXALIVE",
"FOXKILL"
]
},
{
"id": "mock-3",
"question": "What is the name of New Zealand's indigenous people?",
"correct_answer": "Maori",
"incorrect_answers": [
"Vikings",
"Polynesians",
"Samoans"
]
},
{
"id": "mock-4",
"question": "What year was Super Mario Bros. released?",
"correct_answer": "1985",
"incorrect_answers": [
"1983",
"1987",
"1986"
]
},
{
"id": "mock-5",
"question": "How many zombies need to be killed to get the "Zombie Genocider" achievement in Dead Rising (2006)?",
"correct_answer": "53,594",
"incorrect_answers": [
"53,593",
"53,595",
"53,596"
]
},
{
"id": "mock-6",
"question": "Which country hosted the 2022 FIFA World Cup?",
"correct_answer": "Qatar",
"incorrect_answers": [
"USA",
"Japan",
"Switzerland"
]
},
{
"id": "mock-7",
"question": "What was the name of the German offensive operation in October 1941 to take Moscow before winter?",
"correct_answer": "Operation Typhoon",
"incorrect_answers": [
"Operation Sunflower",
"Operation Barbarossa",
"Case Blue"
]
},
{
"id": "mock-8",
"question": "Better known by his nickname Logan, what is Wolverine's birth name?",
"correct_answer": "James Howlett",
"incorrect_answers": [
"Logan Wolf",
"Thomas Wilde",
"John Savage"
]
},
{
"id": "mock-9",
"question": "Which of these musicals won the Tony Award for Best Musical?",
"correct_answer": "Rent",
"incorrect_answers": [
"The Color Purple",
"American Idiot",
"Newsies"
]
},
{
"id": "mock-10",
"question": "The fictional movie 'Rochelle, Rochelle' features in which sitcom?",
"correct_answer": "Seinfeld",
"incorrect_answers": [
"Frasier",
"Cheers",
"Friends"
]
},
{
"id": "mock-11",
"question": "Which of the following bands is Tom DeLonge not a part of?",
"correct_answer": "+44",
"incorrect_answers": [
"Box Car Racer",
"Blink-182",
"Angels & Airwaves"
]
},
{
"id": "mock-12",
"question": "Which band is the longest active band in the world with no breaks or line-up changes?",
"correct_answer": "U2",
"incorrect_answers": [
"Radiohead",
"Rush",
"Rolling Stones"
]
},
{
"id": "mock-13",
"question": "Who scored the injury time winning goal in the 1999 UEFA Champions League final between Manchester United and Bayern Munich?",
"correct_answer": "Ole Gunnar Solskjær",
"incorrect_answers": [
"Dwight Yorke",
"Andy Cole",
"David Beckham"
]
},
{
"id": "mock-14",
"question": ""Gimmick!" is a Japanese Famicom game that uses a sound chip expansion in the cartridge. What is it called?",
"correct_answer": "FME-7",
"incorrect_answers": [
"VRC7",
"VRC6",
"MMC5"
]
},
{
"id": "mock-15",
"question": "In what year was "Antichamber" released?",
"correct_answer": "2013",
"incorrect_answers": [
"2012",
"2014",
"2011"
]
},
{
"id": "mock-16",
"question": "What is the capital of Chile?",
"correct_answer": "Santiago",
"incorrect_answers": [
"Valparaíso",
"Copiapó",
"Antofagasta"
]
},
{
"id": "mock-17",
"question": "Which of the following languages is used as a scripting language in the Unity 3D game engine?",
"correct_answer": "C#",
"incorrect_answers": [
"Java",
"C++",
"Objective-C"
]
},
{
"id": "mock-18",
"question": "In "Donkey Kong Country", why does Donkey Kong want to know the secret of the crystal coconut?",
"correct_answer": "He's the big kahuna.",
"incorrect_answers": [
"To find out where all the bananas are.",
"Because Diddy Kong forced him.",
"He wants to punish brutes."
]
},
{
"id": "mock-19",
"question": "Which car manufacturer created the "Aventador"?",
"correct_answer": "Lamborghini",
"incorrect_answers": [
"Ferrari",
"Pagani",
"Bugatti"
]
},
{
"id": "mock-20",
"question": "What was the first movie to ever use a Wilhelm Scream?",
"correct_answer": "Distant Drums",
"incorrect_answers": [
"Treasure of the Sierra Madre",
"The Charge at Feather River",
"Indiana Jones"
]
},
{
"id": "mock-21",
"question": "In the 1969 Cartoon show "Dastardly and Muttley in Their Flying Machines", which were NOT one of the lyrics in the opening theme?",
"correct_answer": "Stab him",
"incorrect_answers": [
"Nab him",
"Jab him",
"Tab him"
]
},
{
"id": "mock-22",
"question": "What is the name of the planet that the Doctor from television series "Doctor Who" comes from?",
"correct_answer": "Gallifrey",
"incorrect_answers": [
"Sontar",
"Skaro",
"Mondas"
]
},
{
"id": "mock-23",
"question": ""The Big Bang Theory" was first theorized by a priest of what religious ideology?",
"correct_answer": "Catholic",
"incorrect_answers": [
"Christian",
"Jewish",
"Islamic"
]
},
{
"id": "mock-24",
"question": "The Touhou Project series of games is often associated with which genre?",
"correct_answer": "Shoot 'em up",
"incorrect_answers": [
"Strategy",
"FPS",
"Casual"
]
},
{
"id": "mock-25",
"question": "Where are Terror Fiends more commonly found in the Nintendo game Miitopia?",
"correct_answer": "New Lumos",
"incorrect_answers": [
"Peculia",
"The Sky Scraper",
"Otherworld"
]
},
{
"id": "mock-26",
"question": "Which of these is not a playable character in "Enter The Gungeon?"",
"correct_answer": "The Heavy",
"incorrect_answers": [
"The Bullet",
"The Robot",
"The Cultist"
]
},
{
"id": "mock-27",
"question": "Which of these two plates are best know for forming earthquakes and tsunami's? ",
"correct_answer": "Convergent Plate Boundaries/Oceanic Crust",
"incorrect_answers": [
"Divergent Plate Boundaries/Convergent/Oceanic Crust",
"Transform Plate Boundaries/Divergent Plate Boundaries",
"Oceanic & Continental Crust/Transform Plate Boundaries"
]
},
{
"id": "mock-28",
"question": "What year did Albrecht Dürer create the painting "The Young Hare"?",
"correct_answer": "1502",
"incorrect_answers": [
"1702",
"1402",
"1602"
]
},
{
"id": "mock-29",
"question": "In what sport does Fanny Chmelar compete for Germany?",
"correct_answer": "Skiing",
"incorrect_answers": [
"Swimming",
"Showjumping",
"Gymnastics"
]
},
{
"id": "mock-30",
"question": "Which mathematician refused the Fields Medal?",
"correct_answer": "Grigori Perelman",
"incorrect_answers": [
"Andrew Wiles",
"Terence Tao",
"Edward Witten"
]
},
{
"id": "mock-31",
"question": "Which horror movie had a sequel in the form of a video game released in August 20, 2002?",
"correct_answer": "The Thing",
"incorrect_answers": [
"The Evil Dead",
"Saw",
"Alien"
]
},
{
"id": "mock-32",
"question": "What does the "MP" stand for in MP3?",
"correct_answer": "Moving Picture",
"incorrect_answers": [
"Music Player",
"Multi Pass",
"Micro Point"
]
},
{
"id": "mock-33",
"question": "Generally, which component of a computer draws the most power?",
"correct_answer": "Video Card",
"incorrect_answers": [
"Hard Drive",
"Processor",
"Power Supply"
]
},
{
"id": "mock-34",
"question": "In the first Left 4 Dead, you can play as either of these four characters.",
"correct_answer": "Francis, Bill, Zoey, and Louis",
"incorrect_answers": [
"Bender, Andrew, Allison, and Brian",
"Coach, Ellis, Nick, and Rochelle",
"Harry, Ron, Hermione and Dumbledore"
]
},
{
"id": "mock-35",
"question": "Which gas forms about 78% of the Earth’s atmosphere?",
"correct_answer": "Nitrogen",
"incorrect_answers": [
"Oxygen",
"Argon",
"Carbon Dioxide"
]
},
{
"id": "mock-36",
"question": "How many members are there in the band Nirvana?",
"correct_answer": "Three",
"incorrect_answers": [
"Two",
"Four",
"Five"
]
},
{
"id": "mock-37",
"question": "Which wrestler won the 2019 Men’s Royal Rumble?",
"correct_answer": "Seth Rollins",
"incorrect_answers": [
"Braun Strowman",
"AJ Styles",
"Andrade"
]
},
{
"id": "mock-38",
"question": "The character Plum from "No Game No Life" is of what race?",
"correct_answer": "Dhampir",
"incorrect_answers": [
"Flügel",
"Imanity",
"Seiren"
]
},
{
"id": "mock-39",
"question": "Under which name was Rodrigo Borgia made Pope?",
"correct_answer": "Alexander VI",
"incorrect_answers": [
"Rodrigo I",
"John Paul II",
"Pius VII"
]
},
{
"id": "mock-40",
"question": "In what year was "Super Mario Sunshine" released?",
"correct_answer": "2002",
"incorrect_answers": [
"2003",
"2000",
"2004"
]
},
{
"id": "mock-41",
"question": "What game mode was not in the original "Wii Sports"?",
"correct_answer": "Table Tennis",
"incorrect_answers": [
"Boxing",
"Baseball",
"Bowling"
]
},
{
"id": "mock-42",
"question": "In "PAYDAY 2", what weapon has the highest base weapon damage on a per-shot basis?",
"correct_answer": "HRL-7",
"incorrect_answers": [
"Heavy Crossbow",
"Thanatos .50 cal",
"Broomstick Pistol"
]
},
{
"id": "mock-43",
"question": "What is the highest belt you can get in Taekwondo?",
"correct_answer": "Black",
"incorrect_answers": [
"White",
"Red",
"Green"
]
},
{
"id": "mock-44",
"question": "What is the name of the child performing the Black Sacrament, in The Elder Scrolls V: Skyrim?",
"correct_answer": "Aventus Aretino",
"incorrect_answers": [
"Proventus Avenicci",
"Aval Atheron",
"Arngeir"
]
},
{
"id": "mock-45",
"question": "Which of these online games was originally named LindenWorld in it's early development?",
"correct_answer": "SecondLife",
"incorrect_answers": [
"ActiveWorlds",
"IMVU",
"HabboHotel"
]
},
{
"id": "mock-46",
"question": "When did the British hand-over sovereignty of Hong Kong back to China?",
"correct_answer": "1997",
"incorrect_answers": [
"1999",
"1841",
"1900"
]
},
{
"id": "mock-47",
"question": "What is the area of a circle with a diameter of 20 inches if π= 3.1415?",
"correct_answer": "314.15 Inches",
"incorrect_answers": [
"380.1215 Inches",
"3141.5 Inches",
"1256.6 Inches"