-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoding_game.sql
More file actions
3198 lines (2877 loc) · 248 KB
/
coding_game.sql
File metadata and controls
3198 lines (2877 loc) · 248 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
-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3327
-- Generation Time: Oct 07, 2025 at 03:40 PM
-- Server version: 10.4.32-MariaDB
-- PHP Version: 8.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `coding_game`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin_actions_log`
--
-- Creation: Jul 02, 2025 at 02:00 PM
--
CREATE TABLE `admin_actions_log` (
`id` int(11) NOT NULL,
`admin_id` int(11) DEFAULT NULL,
`action_type` varchar(50) NOT NULL,
`target_type` enum('user','admin') NOT NULL,
`target_id` int(11) NOT NULL,
`details` text DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `admin_actions_log`:
-- `admin_id`
-- `admin_users` -> `admin_id`
--
--
-- Dumping data for table `admin_actions_log`
--
INSERT INTO `admin_actions_log` (`id`, `admin_id`, `action_type`, `target_type`, `target_id`, `details`, `created_at`) VALUES
(1, 1, 'unban', 'user', 4, NULL, '2025-07-02 14:00:28'),
(2, 1, 'ban', 'user', 7, NULL, '2025-07-24 06:51:11'),
(3, 1, 'unban', 'user', 7, NULL, '2025-07-24 06:51:30'),
(4, 1, 'ban', 'admin', 2, NULL, '2025-07-24 06:52:28'),
(5, 1, 'unban', 'admin', 2, NULL, '2025-07-24 06:52:45'),
(6, 1, 'ban', 'user', 7, NULL, '2025-07-24 07:53:12'),
(7, 1, 'unban', 'user', 7, NULL, '2025-07-24 07:53:17'),
(8, 1, 'ban', 'user', 1, NULL, '2025-07-24 07:56:33'),
(9, 1, 'unban', 'user', 1, NULL, '2025-07-24 07:56:38'),
(10, 6, 'ban', 'user', 5, NULL, '2025-10-02 14:01:37'),
(11, 6, 'unban', 'user', 5, NULL, '2025-10-02 14:21:50');
-- --------------------------------------------------------
--
-- Table structure for table `admin_users`
--
-- Creation: Sep 27, 2025 at 02:57 PM
--
CREATE TABLE `admin_users` (
`admin_id` int(11) NOT NULL,
`username` varchar(50) NOT NULL,
`email` varchar(100) NOT NULL,
`password_hash` varchar(255) NOT NULL,
`role` enum('admin','super_admin') NOT NULL DEFAULT 'admin',
`profile_picture` varchar(255) DEFAULT NULL,
`is_banned` tinyint(1) NOT NULL DEFAULT 0,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`last_seen` timestamp NULL DEFAULT NULL,
`first_visit` tinyint(1) DEFAULT 1 COMMENT 'Tracks if admin has seen the welcome modal on first visit',
`welcome_dont_show` tinyint(1) DEFAULT 0 COMMENT 'Admin preference to not show welcome modal again'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `admin_users`:
--
--
-- Dumping data for table `admin_users`
--
INSERT INTO `admin_users` (`admin_id`, `username`, `email`, `password_hash`, `role`, `profile_picture`, `is_banned`, `created_at`, `last_seen`, `first_visit`, `welcome_dont_show`) VALUES
(1, 'admin', 'admin@codegame.dev', '$2y$10$D78Au.rfIe/XyWwfvVzb/eIP0qC7FSxlvXQjP2VfSkYNQDcuwEp7e', 'super_admin', NULL, 0, '2025-06-29 03:02:00', '2025-09-19 12:44:07', 1, 0),
(2, 'Amogus', 'admin@yahoo.com', '$2y$10$ekWoB4fuJZUXJ0dv2Z0r8OjZF7swOFD9876s9F4FGdI3U/tIYSeKK', 'admin', NULL, 0, '2025-06-29 04:12:42', '2025-09-12 23:52:34', 1, 0),
(4, 'Areys27', 'aries@codegame.dev', '$2y$10$l2VoDSdJOGQTkHTEa1EYXuvSuGPd0LffAp0VrHJjvd1yZDECtaFIa', 'admin', NULL, 0, '2025-07-04 11:17:42', '2025-10-06 13:06:34', 1, 0),
(6, 'TheGoattt', 'jags@gmail.com', '$2y$10$6YHoxG.ERMRhRk50zmEMAu5Am9rdVqErgIP7DFS.jZ7UCugrL4ZRW', 'admin', 'admin_6_1759419660.PNG', 0, '2025-10-02 11:29:32', '2025-10-02 16:03:08', 1, 0);
-- --------------------------------------------------------
--
-- Table structure for table `announcements`
--
-- Creation: Jul 02, 2025 at 04:10 PM
--
CREATE TABLE `announcements` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`content` text NOT NULL,
`category` varchar(50) DEFAULT 'general',
`status` enum('published','draft') DEFAULT 'published',
`is_pinned` tinyint(1) DEFAULT 0,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`created_by` int(11) DEFAULT NULL,
`is_active` tinyint(1) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `announcements`:
-- `created_by`
-- `admin_users` -> `admin_id`
--
--
-- Dumping data for table `announcements`
--
INSERT INTO `announcements` (`id`, `title`, `content`, `category`, `status`, `is_pinned`, `created_at`, `created_by`, `is_active`) VALUES
(1, 'Welcome to Code Gaming!', 'We are excited to launch our new learning platform. Start your coding journey today!', 'system', 'published', 1, '2025-06-29 03:02:00', 1, 1),
(2, 'New Features Available', 'Check out our latest tutorials and interactive quizzes. More content coming soon!', 'general', 'published', 0, '2025-06-29 03:02:00', 1, 1),
(3, 'System Maintenance', 'Scheduled maintenance on July 1st from 2-4 AM. We apologize for any inconvenience.', 'general', 'published', 0, '2025-06-29 03:02:00', 1, 1),
(4, 'Welcome to Code Gaming! :)', 'Let me know your thoughts!', 'update', 'published', 1, '2025-07-04 11:38:20', 4, 1),
(6, 'Almost There', 'Stay patient y\'all :)', 'system', 'published', 0, '2025-10-02 15:41:59', 6, 1);
-- --------------------------------------------------------
--
-- Table structure for table `challenge_answers`
--
-- Creation: Sep 27, 2025 at 03:46 PM
--
CREATE TABLE `challenge_answers` (
`id` int(11) NOT NULL,
`question_id` int(11) NOT NULL,
`answer_text` text NOT NULL,
`is_correct` tinyint(1) DEFAULT 1,
`explanation` text DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `challenge_answers`:
-- `question_id`
-- `challenge_questions` -> `id`
--
--
-- Dumping data for table `challenge_answers`
--
INSERT INTO `challenge_answers` (`id`, `question_id`, `answer_text`, `is_correct`, `explanation`, `created_at`) VALUES
(1, 1, 'i++', 1, 'Correct! i++ increments the loop counter by 1 each iteration.', '2025-09-27 15:46:38'),
(2, 1, '++i', 1, 'Correct! ++i also increments the loop counter by 1 each iteration.', '2025-09-27 15:46:38'),
(3, 1, 'i--', 0, 'Incorrect. i-- would decrement the counter, creating an infinite loop.', '2025-09-27 15:46:38'),
(4, 1, 'i+1', 0, 'Incorrect. i+1 doesn\'t modify the variable i, creating an infinite loop.', '2025-09-27 15:46:38'),
(5, 2, '[1, 2, 3, 4]', 1, 'Correct! y and x reference the same list object, so modifying y also modifies x.', '2025-09-27 15:46:38'),
(6, 2, '[1, 2, 3]', 0, 'Incorrect. Since y = x creates a reference, not a copy, both variables point to the same list.', '2025-09-27 15:46:38'),
(7, 2, '[4]', 0, 'Incorrect. The append method adds to the existing list, it doesn\'t replace it.', '2025-09-27 15:46:38'),
(8, 2, 'Error', 0, 'Incorrect. This code runs without errors.', '2025-09-27 15:46:38'),
(9, 3, 'function reverseString(str) {\\n let result = \"\";\\n for (let i = str.length - 1; i >= 0; i--) {\\n result += str[i];\\n }\\n return result;\\n}', 1, 'Excellent! This solution iterates backwards through the string and builds the reversed result.', '2025-09-27 15:46:38'),
(10, 3, 'function reverseString(str) {\\n return str.split(\"\").reverse().join(\"\");\\n}', 0, 'This works but uses the built-in reverse() method, which was not allowed in the problem.', '2025-09-27 15:46:38'),
(11, 3, 'function reverseString(str) {\\n if (str.length <= 1) return str;\\n return reverseString(str.slice(1)) + str[0];\\n}', 1, 'Great! This is a recursive solution that works correctly.', '2025-09-27 15:46:38'),
(12, 4, 'Add indexes on user_id and created_date columns', 1, 'Correct! Indexes on frequently queried columns dramatically improve SELECT performance.', '2025-09-27 15:46:38'),
(13, 4, 'Add composite index on (user_id, created_date)', 1, 'Excellent! A composite index is even better for queries filtering on both columns.', '2025-09-27 15:46:38'),
(14, 4, 'Increase server RAM', 0, 'While more RAM can help, adding proper indexes is more cost-effective and targeted.', '2025-09-27 15:46:38'),
(15, 4, 'Partition the table', 0, 'Partitioning can help, but indexes should be tried first as they\'re simpler to implement.', '2025-09-27 15:46:38'),
(16, 5, 'filter', 1, 'Correct! The filter() method creates a new array with elements that pass the test function.', '2025-09-27 15:46:38'),
(17, 5, 'map', 0, 'Incorrect. map() transforms each element but doesn\'t filter them out.', '2025-09-27 15:46:38'),
(18, 5, 'forEach', 0, 'Incorrect. forEach() executes a function for each element but doesn\'t return a new array.', '2025-09-27 15:46:38'),
(19, 5, 'reduce', 0, 'Incorrect. While reduce() could be used for filtering, filter() is the correct method here.', '2025-09-27 15:46:38'),
(20, 6, 'Child', 1, 'Correct! This demonstrates polymorphism - the overridden method in Child is called.', '2025-09-27 15:46:38'),
(21, 6, 'Parent', 0, 'Incorrect. Even though p is declared as Parent, it points to a Child object, so Child\'s method is called.', '2025-09-27 15:46:38'),
(22, 6, 'Compilation Error', 0, 'Incorrect. This code compiles and runs successfully.', '2025-09-27 15:46:38'),
(23, 6, 'Runtime Error', 0, 'Incorrect. This code runs without errors.', '2025-09-27 15:46:38'),
(24, 7, 'function isPalindrome(str) {\\n const cleaned = str.toLowerCase().replace(/[^a-z0-9]/g, \"\");\\n return cleaned === cleaned.split(\"\").reverse().join(\"\");\\n}', 1, 'Great! This solution cleans the string and compares it with its reverse.', '2025-09-27 15:46:38'),
(25, 7, 'function isPalindrome(str) {\\n const cleaned = str.toLowerCase().replace(/\\s/g, \"\");\\n let left = 0, right = cleaned.length - 1;\\n while (left < right) {\\n if (cleaned[left] !== cleaned[right]) return false;\\n left++; right--;\\n }\\n return true;\\n}', 1, 'Excellent! This two-pointer approach is efficient and handles the requirements well.', '2025-09-27 15:46:38'),
(26, 8, 'Event listeners not being removed, causing memory leaks', 1, 'Correct! Unremoved event listeners are a common cause of memory leaks in Node.js.', '2025-09-27 15:46:38'),
(27, 8, 'Circular references preventing garbage collection', 1, 'Correct! Circular references can prevent objects from being garbage collected.', '2025-09-27 15:46:38'),
(28, 8, 'Too many global variables', 0, 'While global variables use memory, they typically don\'t cause growing leaks during idle periods.', '2025-09-27 15:46:38'),
(29, 8, 'Insufficient server RAM', 0, 'RAM amount doesn\'t cause memory leaks - the issue is with code not releasing memory properly.', '2025-09-27 15:46:38'),
(30, 9, 'center center', 1, 'Correct! justify-content: center centers horizontally, align-items: center centers vertically.', '2025-09-27 15:46:38'),
(31, 9, 'center, center', 1, 'Correct! This is another way to express the same answer.', '2025-09-27 15:46:38'),
(32, 9, 'middle middle', 0, 'Incorrect. The correct values are \"center\", not \"middle\".', '2025-09-27 15:46:38'),
(33, 9, 'auto auto', 0, 'Incorrect. \"auto\" doesn\'t center the content in flexbox.', '2025-09-27 15:46:38'),
(34, 10, '3', 1, 'Correct! Alice (25), Bob (30), and Charlie (25) match the condition age >= 25 AND age < 35.', '2025-09-27 15:46:38'),
(35, 10, '2', 0, 'Incorrect. Don\'t forget that both Alice and Charlie have age 25, which satisfies age >= 25.', '2025-09-27 15:46:38'),
(36, 10, '4', 0, 'Incorrect. Diana (35) doesn\'t match because 35 is not less than 35.', '2025-09-27 15:46:38'),
(37, 10, '1', 0, 'Incorrect. Multiple users match the age criteria.', '2025-09-27 15:46:38'),
(38, 11, 'function binarySearch(arr, target) {\\n let left = 0, right = arr.length - 1;\\n while (left <= right) {\\n const mid = Math.floor((left + right) / 2);\\n if (arr[mid] === target) return mid;\\n if (arr[mid] < target) left = mid + 1;\\n else right = mid - 1;\\n }\\n return -1;\\n}', 1, 'Perfect! This is the classic iterative binary search implementation with O(log n) time complexity.', '2025-09-27 15:46:38'),
(39, 11, 'function binarySearch(arr, target) {\\n function search(left, right) {\\n if (left > right) return -1;\\n const mid = Math.floor((left + right) / 2);\\n if (arr[mid] === target) return mid;\\n if (arr[mid] < target) return search(mid + 1, right);\\n return search(left, mid - 1);\\n }\\n return search(0, arr.length - 1);\\n}', 1, 'Excellent! This is the recursive binary search implementation, also correct.', '2025-09-27 15:46:38'),
(40, 12, 'Implement proper authentication and authorization', 1, 'Correct! Authentication verifies who the user is, and authorization ensures they can only access their own data.', '2025-09-27 15:46:38'),
(41, 12, 'Add rate limiting', 0, 'Rate limiting helps prevent abuse but doesn\'t solve the authorization problem described.', '2025-09-27 15:46:38'),
(42, 12, 'Use HTTPS encryption', 0, 'HTTPS is important but doesn\'t prevent authorized users from accessing unauthorized data.', '2025-09-27 15:46:38'),
(43, 12, 'Input validation', 0, 'Input validation is important but doesn\'t address the core authorization issue.', '2025-09-27 15:46:38'),
(44, 13, 'x % 2 == 0', 1, 'Correct! x % 2 == 0 checks if a number is even (remainder is 0 when divided by 2).', '2025-09-27 15:46:38'),
(45, 13, 'x % 2 != 1', 1, 'Correct! This is another way to check for even numbers.', '2025-09-27 15:46:38'),
(46, 13, 'x % 2 == 1', 0, 'Incorrect. This condition checks for odd numbers, not even numbers.', '2025-09-27 15:46:38'),
(47, 13, 'x / 2 == 0', 0, 'Incorrect. This would only be true for x = 0, and uses division instead of modulo.', '2025-09-27 15:46:38'),
(48, 14, '10', 1, 'Correct! ptr points to x, so *ptr = 10 changes the value of x to 10.', '2025-09-27 15:46:38'),
(49, 14, '5', 0, 'Incorrect. The value of x is changed through the pointer dereference *ptr = 10.', '2025-09-27 15:46:38'),
(50, 14, 'Compilation Error', 0, 'Incorrect. This code compiles successfully.', '2025-09-27 15:46:38'),
(51, 14, 'Undefined Behavior', 0, 'Incorrect. This is well-defined behavior in C++.', '2025-09-27 15:46:38'),
(52, 15, 'function fibonacci(n) {\\n if (n <= 1) return n;\\n let a = 0, b = 1;\\n for (let i = 2; i <= n; i++) {\\n [a, b] = [b, a + b];\\n }\\n return b;\\n}', 1, 'Excellent! This iterative solution has O(n) time and O(1) space complexity.', '2025-09-27 15:46:38'),
(53, 15, 'function fibonacci(n) {\\n if (n <= 1) return n;\\n const dp = [0, 1];\\n for (let i = 2; i <= n; i++) {\\n dp[i] = dp[i-1] + dp[i-2];\\n }\\n return dp[n];\\n}', 1, 'Great! This dynamic programming solution with memoization is also correct.', '2025-09-27 15:46:38'),
(54, 16, 'Implement horizontal scaling with load balancers', 1, 'Correct! Horizontal scaling (adding more servers) with load balancing distributes traffic effectively.', '2025-09-27 15:46:38'),
(55, 16, 'Upgrade to a more powerful server (vertical scaling)', 0, 'Vertical scaling has limits and a single point of failure. Horizontal scaling is better for this scale.', '2025-09-27 15:46:38'),
(56, 16, 'Add more RAM to the existing server', 0, 'More RAM alone won\'t handle 100,000 concurrent users on a single server.', '2025-09-27 15:46:38'),
(57, 16, 'Optimize database queries only', 0, 'While database optimization helps, the scale requires architectural changes.', '2025-09-27 15:46:38'),
(58, 17, 'setCount setCount', 1, 'Correct! useState returns an array with the state value and its setter function.', '2025-09-27 15:46:38'),
(59, 17, 'setCount, setCount', 1, 'Correct! This is another way to express the same answer.', '2025-09-27 15:46:38'),
(60, 17, 'updateCount updateCount', 0, 'Incorrect. The convention is to name the setter function \"set\" + state variable name.', '2025-09-27 15:46:38'),
(61, 17, 'changeCount changeCount', 0, 'Incorrect. The setter function should be named setCount by convention.', '2025-09-27 15:46:38'),
(62, 18, 'Reset to the previous commit and discard all changes', 1, 'Correct! --hard resets the working directory and index, HEAD~1 means one commit before current.', '2025-09-27 15:46:38'),
(63, 18, 'Create a new branch from the previous commit', 0, 'Incorrect. This command doesn\'t create a branch, it moves the current branch pointer.', '2025-09-27 15:46:38'),
(64, 18, 'Merge the previous commit into current branch', 0, 'Incorrect. This is a reset operation, not a merge.', '2025-09-27 15:46:38'),
(65, 18, 'Delete the previous commit permanently', 0, 'Incorrect. The commit still exists in Git\'s history, just not in the current branch.', '2025-09-27 15:46:38'),
(66, 19, 'function bubbleSort(arr) {\\n const n = arr.length;\\n for (let i = 0; i < n - 1; i++) {\\n for (let j = 0; j < n - i - 1; j++) {\\n if (arr[j] > arr[j + 1]) {\\n [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];\\n }\\n }\\n }\\n return arr;\\n}', 1, 'Perfect! This is the classic bubble sort implementation with proper optimization.', '2025-09-27 15:46:38'),
(67, 19, 'function bubbleSort(arr) {\\n let swapped;\\n do {\\n swapped = false;\\n for (let i = 0; i < arr.length - 1; i++) {\\n if (arr[i] > arr[i + 1]) {\\n [arr[i], arr[i + 1]] = [arr[i + 1], arr[i]];\\n swapped = true;\\n }\\n }\\n } while (swapped);\\n return arr;\\n}', 1, 'Excellent! This optimized version stops early when no swaps are needed.', '2025-09-27 15:46:38'),
(68, 20, 'Implement distributed transaction management and eventual consistency', 1, 'Correct! Data consistency across distributed services is indeed the biggest challenge in microservices.', '2025-09-27 15:46:38'),
(69, 20, 'Set up service discovery and load balancing', 0, 'While important, service discovery is easier to solve than distributed data consistency.', '2025-09-27 15:46:38'),
(70, 20, 'Implement API gateways', 0, 'API gateways are important but don\'t address the core data consistency challenge.', '2025-09-27 15:46:38'),
(71, 20, 'Containerize all services', 0, 'Containerization is a deployment concern, not the main challenge with data consistency.', '2025-09-27 15:46:38');
-- --------------------------------------------------------
--
-- Table structure for table `challenge_leaderboard`
--
-- Creation: Jul 18, 2025 at 05:10 AM
--
CREATE TABLE `challenge_leaderboard` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`guest_session_id` int(11) DEFAULT NULL,
`nickname` varchar(100) DEFAULT NULL,
`total_score` int(11) NOT NULL,
`total_time` float DEFAULT NULL,
`questions_attempted` int(11) DEFAULT 0,
`questions_correct` int(11) DEFAULT 0,
`completed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `challenge_leaderboard`:
-- `user_id`
-- `users` -> `id`
-- `guest_session_id`
-- `guest_sessions` -> `id`
--
--
-- Dumping data for table `challenge_leaderboard`
--
INSERT INTO `challenge_leaderboard` (`id`, `user_id`, `guest_session_id`, `nickname`, `total_score`, `total_time`, `questions_attempted`, `questions_correct`, `completed_at`) VALUES
(1, 5, NULL, 'James Aries', 0, 198, 20, 0, '2025-07-18 07:13:58'),
(2, 5, NULL, 'James Aries', 0, 184, 20, 0, '2025-07-18 07:17:42'),
(3, 6, NULL, 'areys2003', 0, 119, 20, 0, '2025-07-18 08:16:17'),
(4, NULL, 10, 'Areyszxcv', 0, 150, 20, 0, '2025-07-20 09:15:18'),
(5, 8, NULL, 'Amogus27', 0, 355, 20, 0, '2025-09-13 00:02:05'),
(6, 4, NULL, 'Areyszxc', 90, 150, 20, 3, '2025-09-27 15:52:42'),
(7, NULL, 11, 'Areyszxc36', 0, 205, 20, 0, '2025-09-29 09:42:10'),
(8, NULL, 12, 'Areyszxc36', 0, 150, 20, 0, '2025-09-29 09:45:33');
-- --------------------------------------------------------
--
-- Table structure for table `challenge_questions`
--
-- Creation: Sep 27, 2025 at 03:46 PM
--
CREATE TABLE `challenge_questions` (
`id` int(11) NOT NULL,
`type` enum('fill_blank','output','case_study','code') NOT NULL,
`title` varchar(100) NOT NULL,
`description` text NOT NULL,
`starter_code` text DEFAULT NULL,
`expected_output` text DEFAULT NULL,
`difficulty` enum('expert') NOT NULL DEFAULT 'expert',
`points` int(11) DEFAULT 30,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `challenge_questions`:
--
--
-- Dumping data for table `challenge_questions`
--
INSERT INTO `challenge_questions` (`id`, `type`, `title`, `description`, `starter_code`, `expected_output`, `difficulty`, `points`, `created_at`) VALUES
(1, 'fill_blank', 'Complete the Loop', 'Fill in the blank to complete this for loop that prints numbers 1 to 10:\\n\\nfor (int i = 1; i <= 10; ___) {\\n System.out.println(i);\\n}', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(2, 'output', 'Predict the Output', 'What will be the output of this Python code?\\n\\nx = [1, 2, 3]\\ny = x\\ny.append(4)\\nprint(x)', '', '[1, 2, 3, 4]', 'expert', 30, '2025-09-27 15:46:38'),
(3, 'code', 'Reverse String', 'Write a function that reverses a string without using any built-in reverse methods.', 'function reverseString(str) {\\n // Your code here\\n return \"\";\\n}', '', 'expert', 30, '2025-09-27 15:46:38'),
(4, 'case_study', 'Database Optimization', 'A web application is experiencing slow query performance. The main table has 1 million records and queries often filter by user_id and created_date. What would be the most effective first step to optimize performance?', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(5, 'fill_blank', 'JavaScript Array Method', 'Complete this JavaScript code to filter out even numbers:\\n\\nconst numbers = [1, 2, 3, 4, 5, 6];\\nconst oddNumbers = numbers.____(num => num % 2 !== 0);', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(6, 'output', 'Java Inheritance', 'What will be printed?\\n\\nclass Parent {\\n void show() { System.out.println(\"Parent\"); }\\n}\\nclass Child extends Parent {\\n void show() { System.out.println(\"Child\"); }\\n}\\nParent p = new Child();\\np.show();', '', 'Child', 'expert', 30, '2025-09-27 15:46:38'),
(7, 'code', 'Palindrome Check', 'Write a function that checks if a string is a palindrome (reads the same forwards and backwards). Ignore case and spaces.', 'function isPalindrome(str) {\\n // Your code here\\n return false;\\n}', '', 'expert', 30, '2025-09-27 15:46:38'),
(8, 'case_study', 'Memory Leak Investigation', 'A Node.js application is experiencing memory leaks. The heap usage keeps growing over time, even during idle periods. What is the most likely cause and solution?', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(9, 'fill_blank', 'CSS Flexbox', 'Complete this CSS to center an element both horizontally and vertically using flexbox:\\n\\n.container {\\n display: flex;\\n justify-content: ____;\\n align-items: ____;\\n}', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(10, 'output', 'SQL Query Result', 'Given this table:\\nUsers(id, name, age)\\n1, \"Alice\", 25\\n2, \"Bob\", 30\\n3, \"Charlie\", 25\\n4, \"Diana\", 35\\n\\nWhat will this query return?\\nSELECT COUNT(*) FROM Users WHERE age >= 25 AND age < 35;', '', '3', 'expert', 30, '2025-09-27 15:46:38'),
(11, 'code', 'Binary Search', 'Implement a binary search algorithm to find a target value in a sorted array. Return the index if found, -1 if not found.', 'function binarySearch(arr, target) {\\n // Your code here\\n return -1;\\n}', '', 'expert', 30, '2025-09-27 15:46:38'),
(12, 'case_study', 'API Security', 'A REST API is vulnerable to unauthorized access and data breaches. Users can access other users\' data by changing ID parameters in URLs. What is the most critical security measure to implement first?', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(13, 'fill_blank', 'Python List Comprehension', 'Complete this Python list comprehension to create a list of squares for even numbers only:\\n\\nnumbers = [1, 2, 3, 4, 5, 6]\\nsquares = [x**2 for x in numbers if ____]', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(14, 'output', 'C++ Pointer', 'What will be the output?\\n\\nint x = 5;\\nint *ptr = &x;\\n*ptr = 10;\\ncout << x << endl;', '', '10', 'expert', 30, '2025-09-27 15:46:38'),
(15, 'code', 'Fibonacci Sequence', 'Write a function to generate the nth Fibonacci number using dynamic programming (not recursion) for efficiency.', 'function fibonacci(n) {\\n // Your code here\\n return 0;\\n}', '', 'expert', 30, '2025-09-27 15:46:38'),
(16, 'case_study', 'Load Balancing', 'A web application needs to handle 100,000 concurrent users during peak hours. The current single server setup is failing. What is the most effective scaling strategy?', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(17, 'fill_blank', 'React Hook', 'Complete this React hook to manage state:\\n\\nconst [count, ____] = useState(0);\\n\\nfunction increment() {\\n ____(count + 1);\\n}', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(18, 'output', 'Git Command', 'What will this Git command do?\\n\\ngit reset --hard HEAD~1', '', '', 'expert', 30, '2025-09-27 15:46:38'),
(19, 'code', 'Sort Algorithm', 'Implement a bubble sort algorithm to sort an array in ascending order.', 'function bubbleSort(arr) {\\n // Your code here\\n return arr;\\n}', '', 'expert', 30, '2025-09-27 15:46:38'),
(20, 'case_study', 'Microservices Migration', 'A large monolithic e-commerce application is being migrated to microservices architecture. The team is struggling with data consistency across services. What is the biggest challenge to address first?', '', '', 'expert', 30, '2025-09-27 15:46:38');
-- --------------------------------------------------------
--
-- Table structure for table `challenge_test_cases`
--
-- Creation: Jul 18, 2025 at 05:09 AM
--
CREATE TABLE `challenge_test_cases` (
`id` int(11) NOT NULL,
`question_id` int(11) NOT NULL,
`input` text DEFAULT NULL,
`expected_output` text NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `challenge_test_cases`:
-- `question_id`
-- `challenge_questions` -> `id`
--
-- --------------------------------------------------------
--
-- Table structure for table `code_challenges`
--
-- Creation: Jul 18, 2025 at 05:07 AM
--
CREATE TABLE `code_challenges` (
`id` int(11) NOT NULL,
`topic_id` varchar(50) NOT NULL,
`title` varchar(100) NOT NULL,
`description` text NOT NULL,
`starter_code` text DEFAULT NULL,
`test_cases` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`test_cases`)),
`difficulty` enum('beginner','intermediate','expert') NOT NULL DEFAULT 'expert',
`points` int(11) DEFAULT 30,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `code_challenges`:
--
-- --------------------------------------------------------
--
-- Table structure for table `coding_playlist`
--
-- Creation: Sep 29, 2025 at 06:58 AM
--
CREATE TABLE `coding_playlist` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`artist` varchar(255) DEFAULT NULL,
`file_path` varchar(255) DEFAULT NULL,
`external_url` varchar(255) DEFAULT NULL,
`duration` int(11) DEFAULT NULL,
`genre` varchar(50) DEFAULT NULL,
`is_featured` tinyint(1) DEFAULT 0,
`play_count` int(11) DEFAULT 0,
`display_order` int(11) DEFAULT 0,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `coding_playlist`:
--
--
-- Dumping data for table `coding_playlist`
--
INSERT INTO `coding_playlist` (`id`, `title`, `artist`, `file_path`, `external_url`, `duration`, `genre`, `is_featured`, `play_count`, `display_order`, `created_at`) VALUES
(1, 'Andromeda Sunsets', 'Starjunk 95', 'audio/Andromeda_Sunsets.mp3', NULL, NULL, 'Synthwave, EDM', 1, 0, 1, '2025-10-04 00:47:51');
-- --------------------------------------------------------
--
-- Table structure for table `faq_items`
--
-- Creation: Sep 29, 2025 at 06:58 AM
--
CREATE TABLE `faq_items` (
`id` int(11) NOT NULL,
`question` varchar(500) NOT NULL,
`answer` text NOT NULL,
`category` enum('project','technology','team','general') DEFAULT 'general',
`tags` varchar(255) DEFAULT NULL,
`is_featured` tinyint(1) DEFAULT 0,
`view_count` int(11) DEFAULT 0,
`display_order` int(11) DEFAULT 0,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `faq_items`:
--
--
-- Dumping data for table `faq_items`
--
INSERT INTO `faq_items` (`id`, `question`, `answer`, `category`, `tags`, `is_featured`, `view_count`, `display_order`, `created_at`, `updated_at`) VALUES
(1, 'What is Code Gaming?', 'Code Gaming is an innovative educational platform that teaches programming through interactive games, quizzes, and challenges. We make learning to code fun and engaging for students of all levels.', 'project', 'about,platform,education', 1, 0, 1, '2025-09-29 07:21:28', '2025-09-29 07:21:28'),
(2, 'What technologies do you use?', 'Our platform is built using modern web technologies including PHP, MySQL, JavaScript, HTML5, CSS3, Bootstrap 5, and various libraries like Three.js and ScrollReveal.js for enhanced user experience.', 'technology', 'tech,stack,php,javascript,mysql', 1, 0, 2, '2025-09-29 07:21:28', '2025-09-29 07:21:28'),
(3, 'Who can use this platform?', 'Code Gaming is designed for students, educators, and anyone interested in learning programming. Whether you are a complete beginner or looking to enhance your coding skills, our platform adapts to your learning pace.', 'general', 'users,students,beginners,experts', 1, 0, 3, '2025-09-29 07:21:28', '2025-09-29 07:21:28'),
(4, 'How does the gamification work?', 'We use points, achievements, leaderboards, and interactive challenges to make learning programming feel like playing a game. Users earn rewards for completing tutorials, solving challenges, and participating in quizzes.', 'project', 'gamification,points,achievements', 0, 0, 4, '2025-09-29 07:21:28', '2025-09-29 07:21:28'),
(5, 'Is the platform free to use?', 'Yes! Code Gaming is completely free to use. We believe in making quality programming education accessible to everyone.', 'general', 'free,cost,pricing', 1, 0, 5, '2025-09-29 07:21:28', '2025-09-29 07:21:28'),
(6, 'What programming languages are supported?', 'Currently, we focus on web development technologies including HTML, CSS, JavaScript, Bootstrap, AJAX, and PHP. We plan to expand to other languages based on user feedback and demand.', 'technology', 'languages,html,css,javascript,bootsrap,php', 0, 0, 6, '2025-09-29 07:21:28', '2025-09-29 07:21:28');
-- --------------------------------------------------------
--
-- Table structure for table `feedback_likes`
--
-- Creation: Sep 29, 2025 at 06:58 AM
--
CREATE TABLE `feedback_likes` (
`id` int(11) NOT NULL,
`feedback_id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`ip_address` varchar(45) NOT NULL,
`liked_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `feedback_likes`:
-- `feedback_id`
-- `feedback_messages` -> `id`
-- `user_id`
-- `users` -> `id`
--
--
-- Dumping data for table `feedback_likes`
--
INSERT INTO `feedback_likes` (`id`, `feedback_id`, `user_id`, `ip_address`, `liked_at`) VALUES
(1, 1, NULL, '::1', '2025-09-29 07:44:34'),
(2, 2, NULL, '::1', '2025-10-04 00:39:15');
-- --------------------------------------------------------
--
-- Table structure for table `feedback_messages`
--
-- Creation: Jun 25, 2025 at 02:37 PM
--
CREATE TABLE `feedback_messages` (
`id` int(11) NOT NULL,
`sender_name` varchar(100) NOT NULL,
`sender_email` varchar(100) NOT NULL,
`proponent_email` varchar(100) NOT NULL,
`message` text NOT NULL,
`sent_at` timestamp NOT NULL DEFAULT current_timestamp(),
`likes` int(11) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `feedback_messages`:
--
--
-- Dumping data for table `feedback_messages`
--
INSERT INTO `feedback_messages` (`id`, `sender_name`, `sender_email`, `proponent_email`, `message`, `sent_at`, `likes`) VALUES
(1, 'Unknown User', 'jamesariess76@gmail.com', 'jibelza@paterostechnologicalcollege.edu.ph', 'Looks good! ^^', '2025-06-27 13:58:35', 5),
(2, 'User', 'jamesariess76@gmail.com', 'about-page-feedback', 'Very cool!', '2025-10-02 11:28:13', 0);
-- --------------------------------------------------------
--
-- Table structure for table `guest_challenge_attempts`
--
-- Creation: Jul 18, 2025 at 05:10 AM
--
CREATE TABLE `guest_challenge_attempts` (
`id` int(11) NOT NULL,
`guest_session_id` int(11) NOT NULL,
`question_id` int(11) NOT NULL,
`submitted_answer` text DEFAULT NULL,
`is_correct` tinyint(1) DEFAULT NULL,
`points_earned` int(11) DEFAULT 0,
`time_taken` float DEFAULT NULL,
`attempted_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `guest_challenge_attempts`:
-- `guest_session_id`
-- `guest_sessions` -> `id`
-- `question_id`
-- `challenge_questions` -> `id`
--
--
-- Dumping data for table `guest_challenge_attempts`
--
INSERT INTO `guest_challenge_attempts` (`id`, `guest_session_id`, `question_id`, `submitted_answer`, `is_correct`, `points_earned`, `time_taken`, `attempted_at`) VALUES
(2, 12, 5, '[1,2,3,4]', 0, 0, 54, '2025-09-29 09:43:57'),
(3, 12, 20, 'Child', 0, 0, 77, '2025-09-29 09:44:21'),
(4, 13, 12, 'Filter', 0, 0, 49, '2025-09-29 09:47:02');
-- --------------------------------------------------------
--
-- Table structure for table `guest_quiz_attempts`
--
-- Creation: Jul 10, 2025 at 04:22 AM
--
CREATE TABLE `guest_quiz_attempts` (
`id` int(11) NOT NULL,
`guest_session_id` int(11) NOT NULL,
`question_id` int(11) NOT NULL,
`selected_answer_id` int(11) DEFAULT NULL,
`is_correct` tinyint(1) DEFAULT NULL,
`points_earned` int(11) DEFAULT 0,
`attempted_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `guest_quiz_attempts`:
-- `guest_session_id`
-- `guest_sessions` -> `id`
-- `question_id`
-- `quiz_questions` -> `id`
-- `selected_answer_id`
-- `quiz_answers` -> `id`
--
--
-- Dumping data for table `guest_quiz_attempts`
--
INSERT INTO `guest_quiz_attempts` (`id`, `guest_session_id`, `question_id`, `selected_answer_id`, `is_correct`, `points_earned`, `attempted_at`) VALUES
(1, 1, 85, 313, 1, 1, '2025-07-14 06:28:58'),
(2, 1, 105, 377, 1, 1, '2025-07-14 06:29:07'),
(3, 1, 103, 372, 0, 0, '2025-07-14 06:29:15'),
(4, 1, 86, 316, 1, 1, '2025-07-14 06:29:24'),
(5, 1, 98, 356, 1, 1, '2025-07-14 06:29:33'),
(6, 1, 88, 323, 1, 1, '2025-07-14 06:29:42'),
(7, 1, 108, 391, 1, 1, '2025-07-14 06:30:01'),
(8, 1, 101, 368, 1, 1, '2025-07-14 06:30:22'),
(9, 1, 104, 376, 1, 1, '2025-07-14 06:30:32'),
(10, 1, 97, 353, 1, 1, '2025-07-14 06:30:40'),
(11, 1, 89, 325, 1, 1, '2025-07-14 06:30:49'),
(12, 1, 81, 298, 1, 1, '2025-07-14 06:31:08'),
(13, 1, 87, 321, 1, 1, '2025-07-14 06:31:22'),
(14, 1, 111, 398, 1, 1, '2025-07-14 06:31:40'),
(15, 1, 93, 340, 1, 1, '2025-07-14 06:31:49'),
(16, 1, 115, 414, 1, 1, '2025-07-14 06:31:58'),
(17, 1, 118, 425, 1, 1, '2025-07-14 06:32:14'),
(18, 1, 90, 328, 1, 1, '2025-07-14 06:32:34'),
(19, 1, 106, 382, 1, 1, '2025-07-14 06:32:46'),
(20, 1, 113, 408, 0, 0, '2025-07-14 06:33:04'),
(21, 1, 99, 360, 0, 0, '2025-07-14 06:33:28'),
(22, 1, 116, 420, 0, 0, '2025-07-14 06:33:45'),
(23, 1, 114, 411, 0, 0, '2025-07-14 06:34:02'),
(24, 1, 95, 347, 1, 1, '2025-07-14 06:34:17'),
(25, 1, 84, 311, 0, 0, '2025-07-14 06:34:44'),
(26, 1, 117, 423, 1, 1, '2025-07-14 06:34:57'),
(27, 1, 109, 394, 1, 1, '2025-07-14 06:35:06'),
(28, 1, 91, 333, 1, 1, '2025-07-14 06:35:19'),
(29, 1, 102, 369, 1, 1, '2025-07-14 06:35:30'),
(30, 1, 107, 386, 1, 1, '2025-07-14 06:35:42'),
(31, 1, 82, 301, 1, 1, '2025-07-14 06:36:00'),
(32, 1, 100, 364, 1, 1, '2025-07-14 06:36:14'),
(33, 1, 83, 307, 1, 1, '2025-07-14 06:36:30'),
(34, 1, 112, 404, 0, 0, '2025-07-14 06:36:50');
-- --------------------------------------------------------
--
-- Table structure for table `guest_sessions`
--
-- Creation: Jul 10, 2025 at 03:38 AM
--
CREATE TABLE `guest_sessions` (
`id` int(11) NOT NULL,
`session_id` varchar(255) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`user_agent` text DEFAULT NULL,
`nickname` varchar(100) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `guest_sessions`:
--
--
-- Dumping data for table `guest_sessions`
--
INSERT INTO `guest_sessions` (`id`, `session_id`, `ip_address`, `user_agent`, `nickname`, `created_at`) VALUES
(1, 'gs_00g8h8699wwb1752471914613', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', 'Areyszxc', '2025-07-14 06:28:28'),
(2, 'cs_ljrfnzq84cl1752818938745', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', 'Areyszxc', '2025-07-18 06:08:58'),
(3, 'cs_ljrfnzq84cl1752818938745', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', 'Areyszxcx', '2025-07-18 06:09:06'),
(4, 'cs_ljrfnzq84cl1752818938745', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', 'Areyszxcx', '2025-07-18 06:09:06'),
(5, 'cs_ljrfnzq84cl1752818938745', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', 'Areyszxcx', '2025-07-18 06:09:11'),
(6, 'cs_ljrfnzq84cl1752818938745', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', 'Areyszxcc', '2025-07-18 06:18:00'),
(7, 'cs_ljrfnzq84cl1752818938745', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', 'Areyszxcc', '2025-07-18 06:18:00'),
(8, 'cs_ljrfnzq84cl1752818938745', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', 'Areyszxcxc', '2025-07-18 06:36:07'),
(9, 'cs_ljrfnzq84cl1752818938745', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36 Edg/138.0.0.0', 'Areyszxcxc', '2025-07-18 06:36:08'),
(10, 'cs_pgrpr4hdi0j1753002767974', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36', 'Areyszxcv', '2025-07-20 09:12:47'),
(11, 'cs_2vukp53pgdr1759138724949', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0', 'Areyszxc36', '2025-09-29 09:38:44'),
(12, 'cs_2vukp53pgdr1759138724949', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0', 'Areyszxc36', '2025-09-29 09:43:03'),
(13, 'cs_2vukp53pgdr1759138724949', '0.0.0.0', 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0', 'Areyszxc36', '2025-09-29 09:46:13');
-- --------------------------------------------------------
--
-- Table structure for table `login_logs`
--
-- Creation: Jun 25, 2025 at 02:35 PM
--
CREATE TABLE `login_logs` (
`log_id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`role` varchar(20) NOT NULL,
`ip_address` varchar(45) NOT NULL,
`session_id` varchar(255) DEFAULT NULL,
`login_time` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `login_logs`:
-- `user_id`
-- `users` -> `id`
--
--
-- Dumping data for table `login_logs`
--
INSERT INTO `login_logs` (`log_id`, `user_id`, `role`, `ip_address`, `session_id`, `login_time`) VALUES
(3, 3, 'user', '192.168.1.66', NULL, '2025-06-24 21:02:00'),
(4, 2, 'user', '192.168.1.135', NULL, '2025-06-21 21:02:00'),
(5, 3, 'user', '192.168.1.133', NULL, '2025-06-27 21:02:00'),
(6, 1, 'user', '192.168.1.145', NULL, '2025-06-23 21:02:00'),
(7, 2, 'user', '192.168.1.58', NULL, '2025-06-27 21:02:00'),
(8, 2, 'user', '192.168.1.148', NULL, '2025-06-26 21:02:00'),
(9, 1, 'user', '192.168.1.75', NULL, '2025-06-21 21:02:00'),
(10, 1, 'user', '192.168.1.37', NULL, '2025-06-24 21:02:00'),
(11, 3, 'user', '192.168.1.16', NULL, '2025-06-25 21:02:00'),
(12, 2, 'user', '192.168.1.111', NULL, '2025-06-26 21:02:00'),
(13, 1, 'super_admin', '::1', '2eqnq9bquejn9ribqe5a5sc864', '2025-06-29 03:05:45'),
(14, 1, 'super_admin', '::1', '2eqnq9bquejn9ribqe5a5sc864', '2025-06-29 03:31:46'),
(15, 1, 'super_admin', '::1', '2eqnq9bquejn9ribqe5a5sc864', '2025-06-29 03:31:46'),
(16, 3, 'visitor', '::1', 'a14bush1s3q32972e1vsddoh38', '2025-06-29 03:31:46'),
(17, 1, 'player', '::1', 'a14bush1s3q32972e1vsddoh38', '2025-06-29 03:43:56'),
(18, 1, 'player', '::1', 'a14bush1s3q32972e1vsddoh38', '2025-06-29 03:43:56'),
(21, 4, 'player', '::1', 'heqefe01h8dnfic4jhpk3e79a6', '2025-06-29 03:50:06'),
(22, 4, 'player', '::1', 'heqefe01h8dnfic4jhpk3e79a6', '2025-06-29 03:50:06'),
(24, 4, 'player', '::1', '7s1moc1aaktp8joq40gas5tk49', '2025-06-29 03:55:26'),
(25, 4, 'player', '::1', '7s1moc1aaktp8joq40gas5tk49', '2025-06-29 03:55:26'),
(27, 4, 'player', '::1', 'drssss0kjtmchn84ok6qig3nep', '2025-06-29 04:09:31'),
(28, 4, 'player', '::1', 'drssss0kjtmchn84ok6qig3nep', '2025-06-29 04:09:31'),
(31, 2, 'admin', '::1', 'kgflqg3on3kpr5erc0lo3lo6ek', '2025-06-29 04:23:01'),
(32, 2, 'admin', '::1', 'kgflqg3on3kpr5erc0lo3lo6ek', '2025-06-29 04:23:01'),
(36, 4, 'password_reset', '::1', NULL, '2025-06-28 22:29:17'),
(37, 4, 'password_reset', '::1', NULL, '2025-06-28 22:29:17'),
(40, 5, 'player', '::1', 'lsmoblbaijidlapjfhq3h9d39n', '2025-06-30 12:22:22'),
(41, 5, 'player', '::1', 'lsmoblbaijidlapjfhq3h9d39n', '2025-06-30 12:22:22'),
(43, 1, 'super_admin', '::1', 'hidn8s8dakp4bjp4k40cn9tmli', '2025-06-30 12:31:33'),
(44, 1, 'super_admin', '::1', 'hidn8s8dakp4bjp4k40cn9tmli', '2025-06-30 12:31:33'),
(47, 1, 'super_admin', '::1', '8pqbgjbj21f7a15kji85ssv75v', '2025-06-30 12:45:51'),
(48, 1, 'super_admin', '::1', '8pqbgjbj21f7a15kji85ssv75v', '2025-06-30 12:45:51'),
(50, 1, 'super_admin', '::1', 'b90g2rpk8kuo42c957nu78hjdf', '2025-06-30 12:55:18'),
(51, 1, 'super_admin', '::1', 'b90g2rpk8kuo42c957nu78hjdf', '2025-06-30 12:55:18'),
(53, 5, 'user', '::1', 'd7p5tf5pnhrs7m6qhctsndfrlj', '2025-06-30 12:56:36'),
(54, 5, 'user', '::1', 'd7p5tf5pnhrs7m6qhctsndfrlj', '2025-06-30 12:56:36'),
(56, 1, 'super_admin', '::1', '2nkb8hddirm2loh5c5pj4qj7a7', '2025-06-30 13:06:14'),
(57, 1, 'super_admin', '::1', '2nkb8hddirm2loh5c5pj4qj7a7', '2025-06-30 13:06:14'),
(59, 1, 'super_admin', '::1', 's497gmc65v4h8n3i20lsqb9b52', '2025-06-30 15:34:36'),
(60, 1, 'super_admin', '::1', 's497gmc65v4h8n3i20lsqb9b52', '2025-06-30 15:34:36'),
(63, 1, 'super_admin', '::1', 'airtoh5t1kstpn74273tsspvr4', '2025-07-02 13:30:37'),
(64, 1, 'super_admin', '::1', 'airtoh5t1kstpn74273tsspvr4', '2025-07-02 13:30:37'),
(66, 4, 'user', '::1', 'm2d5smah2h9lu8os3pulfa5g17', '2025-07-02 13:45:43'),
(67, 4, 'user', '::1', 'm2d5smah2h9lu8os3pulfa5g17', '2025-07-02 13:45:43'),
(70, 4, 'admin', '::1', 'ebfevgsi5nedgrvangjpkfnf3u', '2025-07-04 13:59:45'),
(71, 4, 'admin', '::1', 'ebfevgsi5nedgrvangjpkfnf3u', '2025-07-04 13:59:45'),
(76, 5, 'user', '::1', 'diss1ob5gbke0jrrbe16g6553c', '2025-07-10 04:52:20'),
(77, 5, 'user', '::1', 'diss1ob5gbke0jrrbe16g6553c', '2025-07-10 04:52:20'),
(79, 1, 'super_admin', '::1', 'bjhilrchefmsuhd3jusm3vk741', '2025-07-10 05:11:32'),
(80, 1, 'super_admin', '::1', 'bjhilrchefmsuhd3jusm3vk741', '2025-07-10 05:11:32'),
(84, 1, 'super_admin', '::1', 'jiq98dd7j3mem6qp2628n714sp', '2025-07-14 05:16:34'),
(85, 1, 'super_admin', '::1', 'jiq98dd7j3mem6qp2628n714sp', '2025-07-14 05:16:34'),
(89, 5, 'user', '::1', 'pb2gi01974852peuqmlmqq3okf', '2025-07-16 03:25:25'),
(90, 5, 'user', '::1', 'pb2gi01974852peuqmlmqq3okf', '2025-07-16 03:25:25'),
(93, 5, 'user', '::1', '1cjou979pbo72qst221csjfkte', '2025-07-18 06:38:34'),
(94, 5, 'user', '::1', '1cjou979pbo72qst221csjfkte', '2025-07-18 06:38:34'),
(99, 1, 'super_admin', '::1', 'tfn697oaitb90g8lfhnh0nkl1s', '2025-07-24 09:16:59'),
(100, 1, 'super_admin', '::1', 'tfn697oaitb90g8lfhnh0nkl1s', '2025-07-24 09:16:59'),
(103, 1, 'super_admin', '::1', '8lkiemkdh7plo9vcg1epu1k9tu', '2025-09-12 23:51:51'),
(104, 1, 'super_admin', '::1', '8lkiemkdh7plo9vcg1epu1k9tu', '2025-09-12 23:51:51'),
(106, 2, 'admin', '::1', '27hv8lignjtjkbdc7pei8icjv9', '2025-09-12 23:52:34'),
(107, 2, 'admin', '::1', '27hv8lignjtjkbdc7pei8icjv9', '2025-09-12 23:52:34'),
(109, 4, 'admin', '::1', '67onedh6ntfl2r8d2tg7cdnnfq', '2025-09-12 23:53:22'),
(110, 4, 'admin', '::1', '67onedh6ntfl2r8d2tg7cdnnfq', '2025-09-12 23:53:22'),
(113, 4, 'user', '::1', 'ge5m3lmq6ld4s4usglm0elfn3d', '2025-09-19 09:35:31'),
(114, 4, 'user', '::1', 'ge5m3lmq6ld4s4usglm0elfn3d', '2025-09-19 09:35:31'),
(120, 9, 'user', '::1', '2s0k6lnp55ulr4c92to3o3ak5u', '2025-09-29 09:32:58'),
(121, 9, 'user', '::1', '2s0k6lnp55ulr4c92to3o3ak5u', '2025-09-29 09:32:58'),
(123, 4, 'user', '::1', '9b15bl23lkgkbpn1a3nfg5ujkm', '2025-09-29 13:40:01'),
(124, 4, 'user', '::1', '9b15bl23lkgkbpn1a3nfg5ujkm', '2025-09-29 13:40:01'),
(135, 6, 'admin', '::1', 'uj9lki3lfo5cada7vt2r7nm6l8', '2025-10-02 16:03:08'),
(136, 6, 'admin', '::1', 'uj9lki3lfo5cada7vt2r7nm6l8', '2025-10-02 16:03:08'),
(189, 4, 'admin', '::1', '6028risvuc1tp1i65af4317ph5', '2025-10-06 13:06:34'),
(190, 4, 'admin', '::1', '6028risvuc1tp1i65af4317ph5', '2025-10-06 13:06:34');
-- --------------------------------------------------------
--
-- Table structure for table `mini_game_modes`
--
-- Creation: Sep 29, 2025 at 08:16 AM
--
CREATE TABLE `mini_game_modes` (
`id` int(11) NOT NULL,
`mode_key` varchar(50) NOT NULL,
`name` varchar(100) NOT NULL,
`description` text NOT NULL,
`instructions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`instructions`)),
`icon` varchar(50) DEFAULT 'fas fa-code',
`difficulty_levels` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`difficulty_levels`)),
`supported_languages` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`supported_languages`)),
`is_active` tinyint(1) DEFAULT 1,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `mini_game_modes`:
--
--
-- Dumping data for table `mini_game_modes`
--
INSERT INTO `mini_game_modes` (`id`, `mode_key`, `name`, `description`, `instructions`, `icon`, `difficulty_levels`, `supported_languages`, `is_active`, `created_at`, `updated_at`) VALUES
(1, 'guess', 'Guess the Output', 'Test your code comprehension by predicting what code snippets will output. Perfect for understanding language syntax and behavior!', '[\"1. A code snippet will be displayed\", \"2. Analyze the code carefully\", \"3. Type what you think the output will be\", \"4. Submit your answer to see if you\'re correct\", \"5. Learn from explanations for each answer\"]', 'fas fa-search', '[\"beginner\", \"intermediate\", \"expert\"]', '[\"javascript\", \"python\", \"java\", \"cpp\", \"html\", \"css\", \"bootstrap\"]', 1, '2025-09-29 08:35:21', '2025-09-29 08:35:21'),
(2, 'typing', 'Fast Code Typing', 'Improve your coding speed and accuracy by typing code snippets as fast as possible. Great for muscle memory and syntax familiarity!', '[\"1. A code snippet will appear on screen\", \"2. Click \'Start Challenge\' to begin\", \"3. Type the code exactly as shown\", \"4. Complete before time runs out\", \"5. Achieve high WPM (Words Per Minute) scores\"]', 'fas fa-keyboard', '[\"beginner\", \"intermediate\", \"expert\"]', '[\"javascript\", \"python\", \"java\", \"cpp\", \"html\", \"css\", \"bootstrap\"]', 1, '2025-09-29 08:35:21', '2025-09-29 08:35:21');
-- --------------------------------------------------------
--
-- Table structure for table `mini_game_results`
--
-- Creation: Jun 25, 2025 at 02:39 PM
--
CREATE TABLE `mini_game_results` (
`id` int(11) NOT NULL,
`user_id` int(11) DEFAULT NULL,
`game_type` varchar(50) NOT NULL,
`score` int(11) NOT NULL,
`time_taken` float DEFAULT NULL,
`details` text DEFAULT NULL,
`played_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `mini_game_results`:
-- `user_id`
-- `users` -> `id`
--
--
-- Dumping data for table `mini_game_results`
--
INSERT INTO `mini_game_results` (`id`, `user_id`, `game_type`, `score`, `time_taken`, `details`, `played_at`) VALUES
(1, 1, 'guess', 850, NULL, '{\"language\": \"javascript\", \"difficulty\": \"intermediate\", \"correct_answers\": 8, \"total_questions\": 10}', '2025-09-29 08:35:35'),
(2, 1, 'typing', 65, 45.2, '{\"language\": \"javascript\", \"difficulty\": \"beginner\", \"wpm\": 65, \"accuracy\": 95}', '2025-09-29 08:35:35'),
(3, 2, 'guess', 720, NULL, '{\"language\": \"python\", \"difficulty\": \"beginner\", \"correct_answers\": 7, \"total_questions\": 10}', '2025-09-29 08:35:35'),
(4, 2, 'typing', 58, 52.1, '{\"language\": \"python\", \"difficulty\": \"beginner\", \"wpm\": 58, \"accuracy\": 92}', '2025-09-29 08:35:35'),
(5, 4, 'guess', 0, 10.839, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:35:07\",\"details\":{\"correct\":false,\"user_answer\":\"47\",\"correct_answer\":\"5\",\"streak\":0,\"timestamp\":\"2025-09-29T12:35:07.540Z\"}}', '2025-09-29 12:35:07'),
(6, 4, 'guess', 0, 28.373, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:35:25\",\"details\":{\"correct\":false,\"user_answer\":\"hello\",\"correct_answer\":\"string\",\"streak\":0,\"timestamp\":\"2025-09-29T12:35:25.074Z\"}}', '2025-09-29 12:35:25'),
(7, 4, 'guess', 0, 36.284, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:35:33\",\"details\":{\"correct\":false,\"user_answer\":\"123\",\"correct_answer\":\"3\",\"streak\":0,\"timestamp\":\"2025-09-29T12:35:32.985Z\"}}', '2025-09-29 12:35:33'),
(8, 4, 'guess', 0, 49.742, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:35:46\",\"details\":{\"correct\":false,\"user_answer\":\"3\",\"correct_answer\":\"5\",\"streak\":0,\"timestamp\":\"2025-09-29T12:35:46.443Z\"}}', '2025-09-29 12:35:46'),
(9, 4, 'guess', 0, 57.331, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:35:54\",\"details\":{\"correct\":false,\"user_answer\":\"6\",\"correct_answer\":\"0\",\"streak\":0,\"timestamp\":\"2025-09-29T12:35:54.032Z\"}}', '2025-09-29 12:35:54'),
(10, 4, 'guess', 0, 63.634, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:36:00\",\"details\":{\"correct\":false,\"user_answer\":\"3\",\"correct_answer\":\"5\",\"streak\":0,\"timestamp\":\"2025-09-29T12:36:00.336Z\"}}', '2025-09-29 12:36:00'),
(11, 4, 'guess', 100, 71.986, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:36:08\",\"details\":{\"correct\":true,\"user_answer\":\"String\",\"correct_answer\":\"string\",\"streak\":1,\"timestamp\":\"2025-09-29T12:36:08.687Z\"}}', '2025-09-29 12:36:08'),
(12, 4, 'guess', 100, 4.905, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:46:34\",\"details\":{\"correct\":true,\"user_answer\":\"22\",\"correct_answer\":\"22\",\"streak\":1,\"timestamp\":\"2025-09-29T12:46:34.699Z\"}}', '2025-09-29 12:46:34'),
(13, 4, 'guess', 0, 57.788, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:47:27\",\"details\":{\"correct\":false,\"user_answer\":\"5\",\"correct_answer\":\"2\",\"streak\":0,\"timestamp\":\"2025-09-29T12:47:27.582Z\"}}', '2025-09-29 12:47:27'),
(14, 4, 'guess', 100, 65.043, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:47:34\",\"details\":{\"correct\":true,\"user_answer\":\"22\",\"correct_answer\":\"22\",\"streak\":1,\"timestamp\":\"2025-09-29T12:47:34.837Z\"}}', '2025-09-29 12:47:34'),
(15, 4, 'guess', 100, 116.376, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:48:26\",\"details\":{\"correct\":true,\"user_answer\":\"False\",\"correct_answer\":\"false\",\"streak\":2,\"timestamp\":\"2025-09-29T12:48:26.170Z\"}}', '2025-09-29 12:48:26'),
(16, 4, 'guess', 100, 122.903, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 14:48:32\",\"details\":{\"correct\":true,\"user_answer\":\"2\",\"correct_answer\":\"2\",\"streak\":3,\"timestamp\":\"2025-09-29T12:48:32.697Z\"}}', '2025-09-29 12:48:32'),
(17, 4, 'guess', 200, 53.396, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 15:27:18\",\"details\":{\"total_questions\":3,\"correct_answers\":2,\"incorrect_answers\":1,\"accuracy\":67,\"session_duration\":53.396,\"timestamp\":\"2025-09-29T13:27:18.769Z\"}}', '2025-09-29 13:27:18'),
(18, 4, 'typing', 56, 110.984, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-09-29 15:29:28\",\"details\":{\"total_questions\":2,\"correct_answers\":2,\"incorrect_answers\":0,\"accuracy\":100,\"session_duration\":110.984,\"timestamp\":\"2025-09-29T13:29:28.511Z\"}}', '2025-09-29 13:29:28'),
(19, 10, 'guess', 200, 43.757, '{\"language\":\"python\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-10-01 12:43:01\",\"details\":{\"total_questions\":4,\"correct_answers\":2,\"incorrect_answers\":2,\"accuracy\":50,\"session_duration\":43.757,\"timestamp\":\"2025-10-01T10:43:01.737Z\"}}', '2025-10-01 10:43:01'),
(20, 4, 'guess', 1100, 176.62, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-10-01 14:31:33\",\"details\":{\"total_questions\":20,\"correct_answers\":11,\"incorrect_answers\":9,\"accuracy\":55,\"session_duration\":176.62,\"timestamp\":\"2025-10-01T12:31:33.488Z\"}}', '2025-10-01 12:31:33'),
(21, 4, 'guess', 100, 116.176, '{\"language\":\"javascript\",\"difficulty\":\"intermediate\",\"timestamp\":\"2025-10-01 14:34:12\",\"details\":{\"total_questions\":9,\"correct_answers\":1,\"incorrect_answers\":8,\"accuracy\":11,\"session_duration\":116.176,\"timestamp\":\"2025-10-01T12:34:12.412Z\"}}', '2025-10-01 12:34:12'),
(22, 4, 'guess', 1100, 159.211, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-10-01 14:48:29\",\"details\":{\"total_questions\":16,\"correct_answers\":11,\"incorrect_answers\":5,\"accuracy\":69,\"session_duration\":159.211,\"timestamp\":\"2025-10-01T12:48:29.313Z\"}}', '2025-10-01 12:48:29'),
(23, 4, 'guess', 100, 15.975, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-10-01 15:02:36\",\"details\":{\"total_questions\":1,\"correct_answers\":1,\"incorrect_answers\":0,\"accuracy\":100,\"session_duration\":15.975,\"timestamp\":\"2025-10-01T13:02:36.693Z\"}}', '2025-10-01 13:02:36'),
(24, 4, 'guess', 700, 77.899, '{\"language\":\"java\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-10-01 15:06:11\",\"details\":{\"total_questions\":9,\"correct_answers\":7,\"incorrect_answers\":2,\"accuracy\":78,\"session_duration\":77.899,\"timestamp\":\"2025-10-01T13:06:11.270Z\"}}', '2025-10-01 13:06:11'),
(25, 4, 'guess', 1100, 90.288, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-10-01 15:19:00\",\"details\":{\"total_questions\":11,\"correct_answers\":11,\"incorrect_answers\":0,\"accuracy\":100,\"session_duration\":90.288,\"timestamp\":\"2025-10-01T13:19:00.166Z\"}}', '2025-10-01 13:19:00'),
(26, 4, 'guess', 200, 21.644, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-10-01 15:32:57\",\"details\":{\"total_questions\":2,\"correct_answers\":2,\"incorrect_answers\":0,\"accuracy\":100,\"session_duration\":21.644,\"timestamp\":\"2025-10-01T13:32:57.611Z\"}}', '2025-10-01 13:32:57'),
(27, 4, 'typing', 12, 68.165, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-10-01 15:34:14\",\"details\":{\"total_questions\":1,\"correct_answers\":1,\"incorrect_answers\":0,\"accuracy\":100,\"session_duration\":68.165,\"timestamp\":\"2025-10-01T13:34:14.150Z\"}}', '2025-10-01 13:34:14'),
(28, 12, 'guess', 300, 74.075, '{\"language\":\"javascript\",\"difficulty\":\"beginner\",\"timestamp\":\"2025-10-06 16:28:46\",\"details\":{\"total_questions\":7,\"correct_answers\":3,\"incorrect_answers\":4,\"accuracy\":43,\"session_duration\":74.075,\"timestamp\":\"2025-10-06T14:28:46.694Z\"}}', '2025-10-06 14:28:46');
-- --------------------------------------------------------
--
-- Table structure for table `password_reset_requests`
--
-- Creation: Jun 25, 2025 at 02:36 PM
--
CREATE TABLE `password_reset_requests` (
`request_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`reset_token` varchar(255) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`expires_at` datetime NOT NULL,
`used_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `password_reset_requests`:
-- `user_id`
-- `users` -> `id`
--
-- --------------------------------------------------------
--
-- Table structure for table `programming_languages`
--
-- Creation: Jun 23, 2025 at 02:10 PM
--
CREATE TABLE `programming_languages` (
`id` varchar(50) NOT NULL,
`name` varchar(50) NOT NULL,
`icon` varchar(10) NOT NULL,
`description` text DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `programming_languages`:
--
--
-- Dumping data for table `programming_languages`
--
INSERT INTO `programming_languages` (`id`, `name`, `icon`, `description`, `created_at`) VALUES
('bootstrap', 'Bootstrap', '🎯', 'A powerful front-end framework for faster and responsive web development.', '2025-06-23 14:11:20'),
('cpp', 'C++', '⚡', 'A powerful programming language for system and application development.', '2025-06-23 14:11:20'),
('css', 'CSS', '🎨', 'Cascading Style Sheets - the language that styles web content.', '2025-06-23 14:11:20'),
('html', 'HTML', '🌐', 'The standard markup language for creating web pages and web applications.', '2025-06-23 14:11:20'),
('java', 'Java', '☕', 'A robust, object-oriented programming language used for enterprise applications.', '2025-06-23 14:11:20'),
('javascript', 'JavaScript', '📜', 'The programming language of the web, essential for frontend development.', '2025-06-23 14:11:20'),
('python', 'Python', '🐍', 'A versatile programming language known for its simplicity and readability.', '2025-06-23 14:11:20');
-- --------------------------------------------------------
--
-- Table structure for table `project_statistics`
--
-- Creation: Sep 29, 2025 at 06:58 AM
--
CREATE TABLE `project_statistics` (
`id` int(11) NOT NULL,
`stat_name` varchar(100) NOT NULL,
`stat_value` int(11) NOT NULL,
`stat_label` varchar(100) NOT NULL,
`icon` varchar(50) DEFAULT 'fas fa-chart-line',
`description` text DEFAULT NULL,
`is_active` tinyint(1) DEFAULT 1,
`display_order` int(11) DEFAULT 0,
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `project_statistics`:
--
--
-- Dumping data for table `project_statistics`
--
INSERT INTO `project_statistics` (`id`, `stat_name`, `stat_value`, `stat_label`, `icon`, `description`, `is_active`, `display_order`, `updated_at`) VALUES
(1, 'total_users', 500, 'Active Users', 'fas fa-users', 'Total number of registered and active users on the platform', 1, 1, '2025-09-29 07:23:31'),
(2, 'challenges_completed', 1250, 'Challenges Solved', 'fas fa-trophy', 'Total number of coding challenges completed by all users', 1, 2, '2025-09-29 07:23:31'),
(3, 'lines_of_code', 15000, 'Lines of Code', 'fas fa-code', 'Total lines of code written for the platform', 1, 3, '2025-09-29 07:23:31'),
(4, 'quiz_attempts', 3500, 'Quiz Attempts', 'fas fa-question-circle', 'Total number of quiz questions attempted by users', 1, 4, '2025-09-29 07:23:31'),
(5, 'feedback_received', 89, 'Feedback Messages', 'fas fa-comments', 'Total feedback messages received from users', 1, 5, '2025-09-29 07:23:31'),
(6, 'uptime_percentage', 99, 'Platform Uptime', 'fas fa-server', 'Platform availability and uptime percentage', 1, 6, '2025-09-29 07:23:31');
-- --------------------------------------------------------
--
-- Table structure for table `quiz_answers`
--
-- Creation: Jun 25, 2025 at 02:37 PM
--
CREATE TABLE `quiz_answers` (
`id` int(11) NOT NULL,
`question_id` int(11) NOT NULL,
`answer` text NOT NULL,
`is_correct` tinyint(1) NOT NULL,
`explanation` text DEFAULT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- RELATIONSHIPS FOR TABLE `quiz_answers`:
-- `question_id`
-- `quiz_questions` -> `id`
--
--
-- Dumping data for table `quiz_answers`
--
INSERT INTO `quiz_answers` (`id`, `question_id`, `answer`, `is_correct`, `explanation`, `created_at`) VALUES
(1, 1, 'HyperText Markup Language', 1, NULL, '2025-07-10 05:06:39'),
(2, 1, 'Home Tool Markup Language', 0, NULL, '2025-07-10 05:06:39'),
(3, 1, 'Hyperlinks and Text Markup Language', 0, NULL, '2025-07-10 05:06:39'),
(4, 1, 'Hyperlinking Text Management Language', 0, NULL, '2025-07-10 05:06:39'),
(5, 2, '.html', 1, NULL, '2025-07-10 05:06:39'),
(6, 2, '.htnl', 0, NULL, '2025-07-10 05:06:39'),
(7, 2, '.htmll', 0, NULL, '2025-07-10 05:06:39'),
(8, 2, '.htm', 0, NULL, '2025-07-10 05:06:39'),
(9, 3, 'True', 1, NULL, '2025-07-10 05:06:39'),
(10, 3, 'False', 0, NULL, '2025-07-10 05:06:39'),
(11, 4, 'color', 1, NULL, '2025-07-10 05:06:39'),
(12, 4, 'background-color', 0, NULL, '2025-07-10 05:06:39'),
(13, 4, 'font-color', 0, NULL, '2025-07-10 05:06:39'),
(14, 4, 'text-style', 0, NULL, '2025-07-10 05:06:39'),
(15, 5, 'let x = 5;', 1, NULL, '2025-07-10 05:06:39'),
(16, 5, 'var x == 5;', 0, NULL, '2025-07-10 05:06:39'),
(17, 5, 'int x = 5;', 0, NULL, '2025-07-10 05:06:39'),
(18, 5, 'x := 5;', 0, NULL, '2025-07-10 05:06:39'),
(19, 6, 'True', 1, NULL, '2025-07-10 05:06:39'),
(20, 6, 'False', 0, NULL, '2025-07-10 05:06:39'),
(21, 7, '<link>', 0, NULL, '2025-07-14 05:14:23'),
(22, 7, '<a>', 1, NULL, '2025-07-14 05:14:23'),
(23, 7, '<ul>', 0, NULL, '2025-07-14 05:14:23'),
(24, 7, '<div>', 0, NULL, '2025-07-14 05:14:23'),
(25, 8, '<h1>', 1, NULL, '2025-07-14 05:14:23'),
(26, 8, '<h6>', 0, NULL, '2025-07-14 05:14:23'),
(27, 8, '<head>', 0, NULL, '2025-07-14 05:14:23'),
(28, 8, '<b>', 0, NULL, '2025-07-14 05:14:23'),
(29, 9, '<pic>', 0, NULL, '2025-07-14 05:14:23'),
(30, 9, '<figure>', 0, NULL, '2025-07-14 05:14:23'),
(31, 9, '<img>', 1, NULL, '2025-07-14 05:14:23'),
(32, 9, '<src>', 0, NULL, '2025-07-14 05:14:23'),
(33, 10, '<ol>', 0, NULL, '2025-07-14 05:14:24'),
(34, 10, '<li>', 0, NULL, '2025-07-14 05:14:24'),