-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1316 lines (1156 loc) · 65.9 KB
/
Copy pathindex.html
File metadata and controls
1316 lines (1156 loc) · 65.9 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Quiz Portal - SEM III & IV MCQs</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
<style>
:root {
--primary: #0891b2;
--secondary: #dc2626;
--bg: #f8fafc;
--glass: rgba(255, 255, 255, 0.8);
--glass-border: rgba(148, 163, 184, 0.2);
--correct: #16a34a;
--wrong: #dc2626;
--text-primary: #0f172a;
--text-secondary: #475569;
--border-color: #e2e8f0;
}
body {
font-family: 'Outfit', sans-serif;
background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
color: var(--text-primary);
overflow-x: hidden;
margin: 0;
-webkit-tap-highlight-color: transparent;
}
#bg-canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
opacity: 0.2;
pointer-events: none;
}
.glass {
background: var(--glass);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.nav-link:hover {
color: var(--primary);
}
.section {
display: none;
opacity: 0;
transform: translateY(20px);
animation: fadeInUp 0.4s forwards;
}
.section.active {
display: block;
}
@keyframes fadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
.hover-card {
transition: transform 0.2s, box-shadow 0.2s;
}
@media (hover: hover) {
.hover-card:hover {
transform: translateY(-5px);
border-color: var(--primary);
box-shadow: 0 20px 25px -5px rgba(8, 145, 178, 0.15), 0 10px 10px -5px rgba(8, 145, 178, 0.1);
}
}
/* Quiz Option Buttons */
.option-btn {
transition: all 0.2s;
cursor: pointer;
position: relative;
}
.option-btn:active {
background: rgba(15, 23, 42, 0.1);
}
.option-btn.correct {
background: rgba(22, 163, 74, 0.1) !important;
border-color: var(--correct) !important;
color: var(--correct) !important;
font-weight: 600;
}
.option-btn.wrong {
background: rgba(220, 38, 38, 0.1) !important;
border-color: var(--wrong) !important;
color: var(--wrong) !important;
font-weight: 600;
}
/* Study Mode Styles */
.study-answer-correct {
background: rgba(22, 163, 74, 0.1);
border: 2px solid var(--correct);
color: var(--correct);
font-weight: 600;
}
.study-answer-normal {
border: 1px solid var(--border-color);
color: var(--text-secondary);
background: rgba(255, 255, 255, 0.6);
}
button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
</style>
</head>
<body>
<canvas id="bg-canvas"></canvas>
<nav class="fixed top-0 w-full z-50 glass border-b border-gray-200 bg-white/90 backdrop-blur-xl shadow-sm">
<div class="container mx-auto px-6 py-4">
<div class="flex flex-wrap justify-between items-center">
<button onclick="showSection('home')" class="flex items-center gap-3 group z-50 focus:outline-none">
<div
class="w-10 h-10 bg-gradient-to-br from-cyan-400 to-blue-600 rounded-lg flex items-center justify-center text-white font-bold text-xl shadow-lg">
QZ
</div>
<span class="text-xl font-bold tracking-tight text-gray-900">Quiz Portal</span>
</button>
<button id="menu-btn" class="md:hidden text-2xl text-gray-900 p-2 focus:outline-none z-50"
onclick="toggleMenu()">
<i class="fa-solid fa-bars" id="menu-icon"></i>
</button>
<div id="nav-content"
class="hidden w-full md:block md:w-auto mt-4 md:mt-0 transition-all duration-300 max-h-[80vh] overflow-y-auto md:max-h-none md:overflow-visible">
<div
class="flex flex-col md:flex-row md:items-center gap-2 md:gap-8 bg-white md:bg-transparent p-4 md:p-0 rounded-2xl md:rounded-none border border-gray-200 md:border-0 shadow-lg md:shadow-none">
<button onclick="showSection('home')"
class="nav-link text-left text-gray-700 font-semibold py-3 px-2 rounded hover:bg-gray-100 md:hover:bg-transparent">Home</button>
<div class="h-px w-full md:h-6 md:w-px bg-gray-300 mx-0 md:mx-2 my-2 md:my-0"></div>
<span class="text-xs text-gray-400 font-bold uppercase tracking-widest md:hidden">SEM III</span>
<button onclick="selectSubject('python')"
class="text-left text-yellow-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-yellow-50 md:hover:bg-transparent text-sm">
<i class="fa-brands fa-python"></i> Python
</button>
<button onclick="selectSubject('de')"
class="text-left text-purple-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-purple-50 md:hover:bg-transparent text-sm">
<i class="fa-solid fa-microchip"></i> DE
</button>
<button onclick="selectSubject('etc')"
class="text-left text-green-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-green-50 md:hover:bg-transparent text-sm">
<i class="fa-solid fa-comments"></i> ETC
</button>
<button onclick="selectSubject('ci')"
class="text-left text-orange-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-orange-50 md:hover:bg-transparent text-sm">
<i class="fa-solid fa-scale-balanced"></i> CI
</button>
<div class="h-px w-full md:h-6 md:w-px bg-gray-300 mx-0 md:mx-2 my-2 md:my-0"></div>
<span class="text-xs text-gray-400 font-bold uppercase tracking-widest md:hidden">SEM IV</span>
<button onclick="selectSubject('dm')"
class="text-left text-sky-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-sky-50 md:hover:bg-transparent text-sm">
<i class="fa-solid fa-diagram-project"></i> DM
</button>
<button onclick="selectSubject('coa')"
class="text-left text-rose-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-rose-50 md:hover:bg-transparent text-sm">
<i class="fa-solid fa-server"></i> COA
</button>
<button onclick="selectSubject('python2')"
class="text-left text-amber-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-amber-50 md:hover:bg-transparent text-sm">
<i class="fa-brands fa-python"></i> Py-2
</button>
<button onclick="selectSubject('fsd2')"
class="text-left text-indigo-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-indigo-50 md:hover:bg-transparent text-sm">
<i class="fa-solid fa-layer-group"></i> FSD-2
</button>
<button onclick="selectSubject('toc')"
class="text-left text-teal-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-teal-50 md:hover:bg-transparent text-sm">
<i class="fa-solid fa-infinity"></i> TOC
</button>
<div class="h-px w-full md:h-6 md:w-px bg-gray-300 mx-0 md:mx-2 my-2 md:my-0"></div>
<button onclick="showLeaderboard()"
class="text-left text-pink-600 font-semibold flex items-center gap-3 py-2 px-2 rounded hover:bg-pink-50 md:hover:bg-transparent text-sm">
<i class="fa-solid fa-trophy"></i> Leaderboard
</button>
</div>
</div>
</div>
</div>
</nav>
<main class="pt-28 pb-24 container mx-auto px-6 min-h-screen relative z-10">
<section id="home" class="section active">
<div class="text-center max-w-3xl mx-auto mb-10">
<span class="text-primary text-xs font-bold tracking-[0.2em] uppercase mb-4 block">Free Learning</span>
<h1 class="text-4xl md:text-6xl font-extrabold mb-6 leading-tight text-gray-900">
<span class="bg-gradient-to-r from-cyan-500 to-blue-600 bg-clip-text text-transparent">Quiz
Portal</span>
</h1>
<p class="text-gray-600">Select your semester below to start practicing.</p>
</div>
<!-- SEM-III Section -->
<div class="max-w-6xl mx-auto mb-16">
<div class="flex items-center gap-4 mb-8">
<div
class="w-12 h-12 bg-gradient-to-br from-violet-500 to-purple-700 rounded-xl flex items-center justify-center text-white font-black text-lg shadow-lg">
III</div>
<div>
<h2 class="text-2xl md:text-3xl font-extrabold text-gray-900">Semester III</h2>
<p class="text-gray-500 text-sm">ETC, CI, Python, DE</p>
</div>
<div class="flex-1 h-px bg-gradient-to-r from-purple-300 to-transparent ml-4"></div>
</div>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4 md:gap-6">
<button onclick="selectSubject('etc')"
class="text-center glass hover-card rounded-2xl p-6 md:p-8 group relative overflow-hidden focus:outline-none transform transition-all duration-300 hover:scale-105 border border-green-500/20">
<div
class="absolute top-0 right-0 w-32 h-32 bg-green-500/10 rounded-full blur-2xl -mr-10 -mt-10 group-hover:bg-green-500/20 transition-all">
</div>
<div class="relative z-10 flex flex-col items-center">
<div
class="w-16 h-16 bg-gradient-to-br from-green-400/30 to-green-600/20 rounded-xl flex items-center justify-center mb-4 shadow-lg border-2 border-green-500/40 group-hover:border-green-500/70 transition-all">
<i
class="fa-solid fa-comments text-3xl text-green-600 group-hover:scale-110 transition-transform"></i>
</div>
<h3
class="text-xl font-black text-gray-900 mb-1 group-hover:text-green-700 transition-colors">
ETC</h3>
<p class="text-gray-500 text-xs font-semibold">All Units</p>
</div>
</button>
<button onclick="selectSubject('ci')"
class="text-center glass hover-card rounded-2xl p-6 md:p-8 group relative overflow-hidden focus:outline-none transform transition-all duration-300 hover:scale-105 border border-orange-500/20">
<div
class="absolute top-0 right-0 w-32 h-32 bg-orange-500/10 rounded-full blur-2xl -mr-10 -mt-10 group-hover:bg-orange-500/20 transition-all">
</div>
<div class="relative z-10 flex flex-col items-center">
<div
class="w-16 h-16 bg-gradient-to-br from-orange-400/30 to-orange-600/20 rounded-xl flex items-center justify-center mb-4 shadow-lg border-2 border-orange-500/40 group-hover:border-orange-500/70 transition-all">
<i
class="fa-solid fa-scale-balanced text-3xl text-orange-600 group-hover:scale-110 transition-transform"></i>
</div>
<h3
class="text-xl font-black text-gray-900 mb-1 group-hover:text-orange-700 transition-colors">
CI</h3>
<p class="text-gray-500 text-xs font-semibold">All Units</p>
</div>
</button>
<button onclick="selectSubject('python')"
class="text-center glass hover-card rounded-2xl p-6 md:p-8 group relative overflow-hidden focus:outline-none transform transition-all duration-300 hover:scale-105 border border-yellow-500/20">
<div
class="absolute top-0 right-0 w-32 h-32 bg-yellow-500/10 rounded-full blur-2xl -mr-10 -mt-10 group-hover:bg-yellow-500/20 transition-all">
</div>
<div class="relative z-10 flex flex-col items-center">
<div
class="w-16 h-16 bg-gradient-to-br from-yellow-400/30 to-yellow-600/20 rounded-xl flex items-center justify-center mb-4 shadow-lg border-2 border-yellow-500/40 group-hover:border-yellow-500/70 transition-all">
<i
class="fa-brands fa-python text-3xl text-yellow-600 group-hover:scale-110 transition-transform"></i>
</div>
<h3
class="text-xl font-black text-gray-900 mb-1 group-hover:text-yellow-700 transition-colors">
Python</h3>
<p class="text-gray-500 text-xs font-semibold">T1 – T4</p>
</div>
</button>
<button onclick="selectSubject('de')"
class="text-center glass hover-card rounded-2xl p-6 md:p-8 group relative overflow-hidden focus:outline-none transform transition-all duration-300 hover:scale-105 border border-purple-500/20">
<div
class="absolute top-0 right-0 w-32 h-32 bg-purple-500/10 rounded-full blur-2xl -mr-10 -mt-10 group-hover:bg-purple-500/20 transition-all">
</div>
<div class="relative z-10 flex flex-col items-center">
<div
class="w-16 h-16 bg-gradient-to-br from-purple-400/30 to-purple-600/20 rounded-xl flex items-center justify-center mb-4 shadow-lg border-2 border-purple-500/40 group-hover:border-purple-500/70 transition-all">
<i
class="fa-solid fa-microchip text-3xl text-purple-600 group-hover:scale-110 transition-transform"></i>
</div>
<h3
class="text-xl font-black text-gray-900 mb-1 group-hover:text-purple-700 transition-colors">
DE</h3>
<p class="text-gray-500 text-xs font-semibold">T1 – T4</p>
</div>
</button>
</div>
</div>
<!-- SEM-IV Section -->
<div class="max-w-6xl mx-auto">
<div class="flex items-center gap-4 mb-8">
<div
class="w-12 h-12 bg-gradient-to-br from-cyan-500 to-blue-700 rounded-xl flex items-center justify-center text-white font-black text-lg shadow-lg">
IV</div>
<div>
<h2 class="text-2xl md:text-3xl font-extrabold text-gray-900">Semester IV</h2>
<p class="text-gray-500 text-sm">DM, COA, Python-2, FSD-2, TOC</p>
</div>
<div class="flex-1 h-px bg-gradient-to-r from-cyan-300 to-transparent ml-4"></div>
</div>
<div class="grid grid-cols-2 md:grid-cols-5 gap-4 md:gap-6">
<button onclick="selectSubject('dm')"
class="text-center glass hover-card rounded-2xl p-6 md:p-8 group relative overflow-hidden focus:outline-none transform transition-all duration-300 hover:scale-105 border border-sky-500/20">
<div
class="absolute top-0 right-0 w-32 h-32 bg-sky-500/10 rounded-full blur-2xl -mr-10 -mt-10 group-hover:bg-sky-500/20 transition-all">
</div>
<div class="relative z-10 flex flex-col items-center">
<div
class="w-16 h-16 bg-gradient-to-br from-sky-400/30 to-sky-600/20 rounded-xl flex items-center justify-center mb-4 shadow-lg border-2 border-sky-500/40 group-hover:border-sky-500/70 transition-all">
<i
class="fa-solid fa-diagram-project text-3xl text-sky-600 group-hover:scale-110 transition-transform"></i>
</div>
<h3
class="text-xl font-black text-gray-900 mb-1 group-hover:text-sky-700 transition-colors">
DM</h3>
<p class="text-gray-500 text-xs font-semibold">T1 – T4</p>
</div>
</button>
<button onclick="selectSubject('coa')"
class="text-center glass hover-card rounded-2xl p-6 md:p-8 group relative overflow-hidden focus:outline-none transform transition-all duration-300 hover:scale-105 border border-rose-500/20">
<div
class="absolute top-0 right-0 w-32 h-32 bg-rose-500/10 rounded-full blur-2xl -mr-10 -mt-10 group-hover:bg-rose-500/20 transition-all">
</div>
<div class="relative z-10 flex flex-col items-center">
<div
class="w-16 h-16 bg-gradient-to-br from-rose-400/30 to-rose-600/20 rounded-xl flex items-center justify-center mb-4 shadow-lg border-2 border-rose-500/40 group-hover:border-rose-500/70 transition-all">
<i
class="fa-solid fa-server text-3xl text-rose-600 group-hover:scale-110 transition-transform"></i>
</div>
<h3
class="text-xl font-black text-gray-900 mb-1 group-hover:text-rose-700 transition-colors">
COA</h3>
<p class="text-gray-500 text-xs font-semibold">T1 – T4</p>
</div>
</button>
<button onclick="selectSubject('python2')"
class="text-center glass hover-card rounded-2xl p-6 md:p-8 group relative overflow-hidden focus:outline-none transform transition-all duration-300 hover:scale-105 border border-amber-500/20">
<div
class="absolute top-0 right-0 w-32 h-32 bg-amber-500/10 rounded-full blur-2xl -mr-10 -mt-10 group-hover:bg-amber-500/20 transition-all">
</div>
<div class="relative z-10 flex flex-col items-center">
<div
class="w-16 h-16 bg-gradient-to-br from-amber-400/30 to-amber-600/20 rounded-xl flex items-center justify-center mb-4 shadow-lg border-2 border-amber-500/40 group-hover:border-amber-500/70 transition-all">
<i
class="fa-brands fa-python text-3xl text-amber-600 group-hover:scale-110 transition-transform"></i>
</div>
<h3
class="text-xl font-black text-gray-900 mb-1 group-hover:text-amber-700 transition-colors">
Python-2</h3>
<p class="text-gray-500 text-xs font-semibold">T1 – T4</p>
</div>
</button>
<button onclick="selectSubject('fsd2')"
class="text-center glass hover-card rounded-2xl p-6 md:p-8 group relative overflow-hidden focus:outline-none transform transition-all duration-300 hover:scale-105 border border-indigo-500/20">
<div
class="absolute top-0 right-0 w-32 h-32 bg-indigo-500/10 rounded-full blur-2xl -mr-10 -mt-10 group-hover:bg-indigo-500/20 transition-all">
</div>
<div class="relative z-10 flex flex-col items-center">
<div
class="w-16 h-16 bg-gradient-to-br from-indigo-400/30 to-indigo-600/20 rounded-xl flex items-center justify-center mb-4 shadow-lg border-2 border-indigo-500/40 group-hover:border-indigo-500/70 transition-all">
<i
class="fa-solid fa-layer-group text-3xl text-indigo-600 group-hover:scale-110 transition-transform"></i>
</div>
<h3
class="text-xl font-black text-gray-900 mb-1 group-hover:text-indigo-700 transition-colors">
FSD-2</h3>
<p class="text-gray-500 text-xs font-semibold">T1 – T4</p>
</div>
</button>
<button onclick="selectSubject('toc')"
class="text-center glass hover-card rounded-2xl p-6 md:p-8 group relative overflow-hidden focus:outline-none transform transition-all duration-300 hover:scale-105 border border-teal-500/20">
<div
class="absolute top-0 right-0 w-32 h-32 bg-teal-500/10 rounded-full blur-2xl -mr-10 -mt-10 group-hover:bg-teal-500/20 transition-all">
</div>
<div class="relative z-10 flex flex-col items-center">
<div
class="w-16 h-16 bg-gradient-to-br from-teal-400/30 to-teal-600/20 rounded-xl flex items-center justify-center mb-4 shadow-lg border-2 border-teal-500/40 group-hover:border-teal-500/70 transition-all">
<i
class="fa-solid fa-infinity text-3xl text-teal-600 group-hover:scale-110 transition-transform"></i>
</div>
<h3
class="text-xl font-black text-gray-900 mb-1 group-hover:text-teal-700 transition-colors">
TOC</h3>
<p class="text-gray-500 text-xs font-semibold">T1 – T4</p>
</div>
</button>
</div>
</div>
</section>
<section id="topics" class="section">
<div class="max-w-4xl mx-auto">
<button onclick="showSection('home')"
class="text-gray-600 hover:text-primary flex items-center gap-2 mb-8 transition-colors font-semibold">
<i class="fa-solid fa-arrow-left"></i> Back to Home
</button>
<div class="text-center mb-10">
<h2 class="text-3xl font-bold mb-2 text-gray-900">Select Topic</h2>
<p id="topic-subtitle" class="text-gray-600">Practice or View Answers</p>
</div>
<div id="topic-cards-container" class="grid grid-cols-1 md:grid-cols-2 gap-6">
<!-- Topic cards will be dynamically injected here -->
</div>
</div>
</section>
<section id="study" class="section">
<div class="max-w-3xl mx-auto">
<div
class="flex items-center justify-between mb-8 sticky top-24 bg-white/95 backdrop-blur-xl p-4 -mx-4 z-40 border-b border-gray-200 shadow-sm rounded-b-xl">
<button onclick="showSection('topics')"
class="text-gray-600 hover:text-primary flex items-center gap-2 font-semibold">
<i class="fa-solid fa-arrow-left"></i> Back
</button>
<h2 id="study-title" class="text-xl font-bold text-gray-900"></h2>
</div>
<div id="study-content" class="space-y-8 pb-10">
</div>
</div>
</section>
<section id="quiz" class="section">
<div class="max-w-3xl mx-auto">
<div class="flex items-center justify-between mb-6">
<button onclick="endQuiz()"
class="text-gray-600 hover:text-primary flex items-center gap-2 py-2 font-semibold transition-colors">
<i class="fa-solid fa-arrow-left"></i> Quit
</button>
<div class="flex items-center gap-4">
<div class="text-sm font-bold text-primary bg-primary/10 px-3 py-1 rounded-lg">
<i class="fa-regular fa-clock mr-2"></i><span id="q-timer">20:00</span>
</div>
<div class="text-sm font-mono text-gray-600">
Sr. No. <span id="q-current" class="text-gray-900 font-bold">1</span> / <span
id="q-total">10</span>
</div>
</div>
</div>
<div class="glass rounded-3xl p-6 md:p-10 border border-gray-200">
<h2 id="q-text" class="text-xl md:text-2xl font-bold mb-8 leading-snug text-gray-900"></h2>
<div id="q-options" class="grid gap-3"></div>
<div class="mt-8 flex justify-between items-center border-t border-gray-200 pt-6">
<button id="btn-prev" onclick="prevQ()"
class="px-4 py-2 rounded-lg text-gray-700 hover:text-gray-900 bg-gray-100 hover:bg-gray-200 disabled:opacity-50 font-semibold transition-colors">Prev</button>
<button id="btn-skip" onclick="skipQ()"
class="px-4 py-2 rounded-lg text-yellow-600 hover:text-yellow-700 bg-yellow-50 hover:bg-yellow-100 font-semibold transition-colors">
Skip
</button>
<button id="btn-next" onclick="nextQ()"
class="px-6 py-2 bg-gradient-to-r from-green-400 to-emerald-600 text-white font-bold rounded-lg shadow-lg hover:shadow-green-500/25 active:scale-95 transition-all">Next</button>
</div>
</div>
</div>
</section>
<!-- Result Section -->
<section id="result" class="section">
<div class="max-w-md mx-auto">
<div class="glass p-8 rounded-3xl border border-gray-200 text-center relative overflow-hidden">
<div class="absolute top-0 right-0 w-64 h-64 bg-primary/10 rounded-full blur-3xl -mr-20 -mt-20">
</div>
<div class="absolute bottom-0 left-0 w-64 h-64 bg-secondary/10 rounded-full blur-3xl -ml-20 -mb-20">
</div>
<div class="relative z-10">
<div
class="w-24 h-24 mx-auto bg-gradient-to-br from-cyan-400 to-blue-600 rounded-full flex items-center justify-center shadow-lg mb-6 text-white text-4xl font-bold">
<i class="fa-solid fa-trophy"></i>
</div>
<h2 class="text-3xl font-extrabold text-gray-900 mb-2">Quiz Completed!</h2>
<p class="text-gray-600 mb-8" id="result-stat-msg">Great job!</p>
<div class="grid grid-cols-2 gap-4 mb-6">
<div class="bg-white/50 p-4 rounded-2xl border border-gray-100">
<span
class="block text-gray-500 text-xs font-bold uppercase tracking-wider mb-1">Score</span>
<span class="text-3xl font-black text-gray-900" id="result-score">0/0</span>
</div>
<div class="bg-white/50 p-4 rounded-2xl border border-gray-100">
<span
class="block text-gray-500 text-xs font-bold uppercase tracking-wider mb-1">Accuracy</span>
<span class="text-3xl font-black text-primary" id="result-accuracy">0%</span>
</div>
<div class="bg-white/50 p-4 rounded-2xl border border-gray-100">
<span class="block text-gray-500 text-xs font-bold uppercase tracking-wider mb-1">Time
Taken</span>
<span class="text-xl font-black text-gray-900" id="result-time">0m 0s</span>
</div>
<div class="bg-white/50 p-4 rounded-2xl border border-gray-100">
<span
class="block text-gray-500 text-xs font-bold uppercase tracking-wider mb-1">Speed</span>
<span class="text-xl font-black text-blue-600" id="result-speed">0 Q/min</span>
</div>
</div>
<div class="bg-yellow-50 p-4 rounded-2xl border border-yellow-100 mb-8 mx-auto w-full max-w-xs">
<span class="block text-yellow-600 text-xs font-bold uppercase tracking-wider mb-1">Best
Accuracy</span>
<div class="flex items-center justify-center gap-2">
<i class="fa-solid fa-crown text-yellow-500"></i>
<span class="text-2xl font-black text-yellow-700" id="result-best">0%</span>
</div>
</div>
<div class="flex flex-col gap-3">
<button onclick="showSection('topics')"
class="w-full py-4 bg-gray-900 text-white font-bold rounded-xl shadow-lg hover:bg-gray-800 transition-all">
Back to Topics
</button>
</div>
</div>
</div>
</div>
</section>
<!-- Chapter Selection Modal (Modified for Dynamic Content) -->
<div id="chapter-modal" class="fixed inset-0 z-[100] hidden">
<div class="absolute inset-0 bg-black/50 backdrop-blur-sm" onclick="closeChapterModal()"></div>
<div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-full max-w-md p-4">
<div class="glass rounded-2xl p-6 md:p-8 animate-fadeInUp">
<div class="text-center mb-8">
<h3 class="text-2xl font-bold text-gray-900 mb-2">Select Chapter</h3>
<p class="text-gray-600">Choose which chapter you want to cover</p>
</div>
<div id="chapter-list" class="grid gap-4">
<!-- Content injected by JS -->
</div>
<button onclick="closeChapterModal()"
class="mt-6 w-full py-3 text-gray-500 font-semibold hover:text-gray-700 transition-colors">
Cancel
</button>
</div>
</div>
</div>
<div class="fixed bottom-2 right-4 text-xs text-gray-400 z-50 pointer-events-none">v1.1</div>
<!-- Leaderboard Section -->
<section id="leaderboard" class="section">
<div class="max-w-4xl mx-auto">
<div class="flex items-center justify-between mb-8">
<button onclick="showSection('home')"
class="text-gray-600 hover:text-primary flex items-center gap-2 font-semibold transition-colors">
<i class="fa-solid fa-arrow-left"></i> Back
</button>
<h2 class="text-3xl font-bold text-gray-900">Leaderboard</h2>
<button onclick="clearLeaderboard()" title="Clear History"
class="text-red-500 hover:text-red-700 transition-colors">
<i class="fa-solid fa-trash-can"></i>
</button>
</div>
<div class="glass p-6 rounded-3xl border border-gray-200 shadow-sm min-h-[50vh]">
<!-- Filters -->
<div class="flex flex-wrap gap-2 mb-6 justify-center">
<button onclick="renderLeaderboard('all')"
class="lb-filter px-4 py-2 rounded-full text-sm font-bold bg-gray-100 text-gray-600 hover:bg-gray-200 transition-all active-filter"
data-filter="all">All</button>
<button onclick="renderLeaderboard('python')"
class="lb-filter px-4 py-2 rounded-full text-sm font-bold bg-yellow-100 text-yellow-700 hover:bg-yellow-200 transition-all"
data-filter="python">Python</button>
<button onclick="renderLeaderboard('de')"
class="lb-filter px-4 py-2 rounded-full text-sm font-bold bg-purple-100 text-purple-700 hover:bg-purple-200 transition-all"
data-filter="de">DE</button>
<button onclick="renderLeaderboard('etc')"
class="lb-filter px-4 py-2 rounded-full text-sm font-bold bg-green-100 text-green-700 hover:bg-green-200 transition-all"
data-filter="etc">ETC</button>
<button onclick="renderLeaderboard('ci')"
class="lb-filter px-4 py-2 rounded-full text-sm font-bold bg-orange-100 text-orange-700 hover:bg-orange-200 transition-all"
data-filter="ci">CI</button>
<button onclick="renderLeaderboard('dm')"
class="lb-filter px-3 py-2 rounded-full text-sm font-bold bg-sky-100 text-sky-700 hover:bg-sky-200 transition-all"
data-filter="dm">DM</button>
<button onclick="renderLeaderboard('coa')"
class="lb-filter px-3 py-2 rounded-full text-sm font-bold bg-rose-100 text-rose-700 hover:bg-rose-200 transition-all"
data-filter="coa">COA</button>
<button onclick="renderLeaderboard('python2')"
class="lb-filter px-3 py-2 rounded-full text-sm font-bold bg-amber-100 text-amber-700 hover:bg-amber-200 transition-all"
data-filter="python2">Py-2</button>
<button onclick="renderLeaderboard('fsd2')"
class="lb-filter px-3 py-2 rounded-full text-sm font-bold bg-indigo-100 text-indigo-700 hover:bg-indigo-200 transition-all"
data-filter="fsd2">FSD-2</button>
<button onclick="renderLeaderboard('toc')"
class="lb-filter px-3 py-2 rounded-full text-sm font-bold bg-teal-100 text-teal-700 hover:bg-teal-200 transition-all"
data-filter="toc">TOC</button>
</div>
<!-- Table -->
<div class="overflow-x-auto">
<table class="w-full text-left border-collapse">
<thead>
<tr class="text-gray-500 text-xs uppercase tracking-wider border-b border-gray-200">
<th class="pb-3 pl-2">Rank</th>
<th class="pb-3">Subject</th>
<th class="pb-3">Score</th>
<th class="pb-3 text-center">Accuracy</th>
<th class="pb-3 text-right pr-2">Date</th>
</tr>
</thead>
<tbody id="leaderboard-body" class="text-gray-700 text-sm font-medium">
<!-- JS Injected -->
</tbody>
</table>
</div>
</div>
</div>
</section>
<div class="fixed bottom-2 right-4 text-xs text-gray-400 z-50 pointer-events-none">v2.0</div>
</main>
<script>
// --- DATA ---
let QUESTION_BANK = {};
async function loadQuestionBank() {
try {
const v = Date.now();
const [pythonRes, deRes, etcRes, ciRes, dmRes, coaRes, python2Res, fsd2Res, tocRes] = await Promise.all([
fetch(`questions/python.json?v=${v}`),
fetch(`questions/de.json?v=${v}`),
fetch(`questions/etc.json?v=${v}`),
fetch(`questions/ci.json?v=${v}`),
fetch(`questions/dm.json?v=${v}`),
fetch(`questions/coa.json?v=${v}`),
fetch(`questions/python2.json?v=${v}`),
fetch(`questions/fsd2.json?v=${v}`),
fetch(`questions/toc.json?v=${v}`)
]);
QUESTION_BANK = {
python: await pythonRes.json(),
de: await deRes.json(),
etc: await etcRes.json(),
ci: await ciRes.json(),
dm: await dmRes.json(),
coa: await coaRes.json(),
python2: await python2Res.json(),
fsd2: await fsd2Res.json(),
toc: await tocRes.json()
};
console.log("Question Bank Loaded Successfully (SEM III + IV)");
} catch (error) {
console.error("Failed to load question bank:", error);
alert("Error loading quiz data. Please check your connection or local server.");
}
}
loadQuestionBank();
let currentSubject = '';
let currentQuizData = [];
let currentQIdx = 0;
let answers = {};
let answeredState = {};
let timerInterval;
let remainingSeconds = 1200; // 20 minutes
const TOTAL_QUIZ_TIME = 1200;
// --- NAVIGATION ---
function showSection(id) {
document.querySelectorAll('.section').forEach(el => {
el.classList.remove('active');
el.style.display = 'none';
});
// Allow returning directly to home from anywhere
if (id === 'home') {
currentSubject = '';
}
const target = document.getElementById(id);
target.style.display = 'block';
setTimeout(() => target.classList.add('active'), 10);
// Auto close menu
document.getElementById('nav-content').classList.add('hidden');
document.getElementById('menu-icon').classList.replace('fa-xmark', 'fa-bars');
}
function toggleMenu() {
const nav = document.getElementById('nav-content');
const icon = document.getElementById('menu-icon');
if (nav.classList.contains('hidden')) {
nav.classList.remove('hidden');
icon.classList.replace('fa-bars', 'fa-xmark');
} else {
nav.classList.add('hidden');
icon.classList.replace('fa-xmark', 'fa-bars');
}
}
// --- VIEW ANSWERS MODE ---
let selectionMode = ''; // 'view' or 'quiz'
let pendingTopic = '';
function viewAnswers(topic) {
// Only show chapter modal for T4 in CI, Python, and DE
// This excludes the newly added sections in CI (which are not named 'T4')
const subjectsWithChapters = ['python', 'de', 'ci', 'dm', 'coa', 'python2', 'fsd2', 'toc'];
if (topic === 'T4' && subjectsWithChapters.includes(currentSubject)) {
selectionMode = 'view';
pendingTopic = topic;
openChapterModal();
return;
}
startViewAnswers(topic);
}
function startViewAnswers(topic, filterUnit = null) {
let topicData = QUESTION_BANK[currentSubject][topic];
if (filterUnit) {
topicData = topicData.filter(q => q.unit === filterUnit);
}
if (!topicData || topicData.length === 0) {
alert("No questions found for this selection.");
return;
}
const container = document.getElementById('study-content');
let title = `${currentSubject.toUpperCase()} - ${topic}`;
if (filterUnit) title += ` (Chapter ${filterUnit})`;
document.getElementById('study-title').innerText = title + " Answer Key";
let html = '';
topicData.forEach((item, index) => {
html += `
<div class="glass p-6 rounded-2xl border border-gray-200 shadow-sm">
<div class="flex gap-4 mb-4">
<span class="text-primary font-bold text-lg">Sr. No. ${index + 1}.</span>
<h3 class="text-lg font-semibold text-gray-900 leading-relaxed">${item.q}</h3>
</div>
<div class="space-y-2 ml-0 md:ml-10">
`;
item.options.forEach((opt, optIdx) => {
const isCorrect = (optIdx === item.ans);
const styleClass = isCorrect ? 'study-answer-correct' : 'study-answer-normal';
const icon = isCorrect ? '<i class="fa-solid fa-check ml-auto"></i>' : '';
html += `
<div class="p-3 rounded-lg text-sm flex items-center ${styleClass}">
<span>${opt}</span>
${icon}
</div>
`;
});
html += `</div></div>`;
});
container.innerHTML = html;
showSection('study');
}
// --- NAVIGATION ---
function selectSubject(subject) {
currentSubject = subject;
const colors = {
'python': 'yellow',
'de': 'purple',
'etc': 'green',
'ci': 'orange',
'fsd': 'blue',
'dm': 'sky',
'coa': 'rose',
'python2': 'amber',
'fsd2': 'indigo',
'toc': 'teal'
};
const displayNames = {
'python': 'Python', 'de': 'DE', 'etc': 'ETC', 'ci': 'CI',
'dm': 'Discrete Mathematics', 'coa': 'Computer Organization',
'python2': 'Python-2', 'fsd2': 'FSD-2', 'toc': 'Theory of Computation'
};
const color = colors[subject] || 'blue';
const displayName = displayNames[subject] || subject.toUpperCase();
document.getElementById('topic-subtitle').innerHTML =
`Select a <span class="text-${color}-600 font-bold uppercase">${subject}</span> module`;
const container = document.getElementById('topic-cards-container');
container.innerHTML = '';
const subjectData = QUESTION_BANK[subject] || {};
Object.keys(subjectData).forEach(topic => {
// If it's etc or ci, previously we only showed T4.
// But now we want to show all including act_questions etc.
// Optionally filter out empty modules
if (subjectData[topic].length === 0) return;
const card = document.createElement('div');
card.className = "glass p-6 rounded-2xl border border-gray-200 hover:border-primary/50 transition-all shadow-sm";
// Format topic name for display: replace underscores with spaces and capitalize
const displayName = topic.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase());
card.innerHTML = `
<div class="flex justify-between items-start mb-6">
<div class="flex-1 pr-2">
<span class="text-xs font-bold text-gray-500 block mb-1 tracking-widest">MODULE</span>
<span class="text-2xl font-extrabold text-gray-900 break-words">${displayName}</span>
</div>
<div class="p-3 bg-primary/10 rounded-lg text-primary">
<i class="fa-solid fa-bookmark"></i>
</div>
</div>
<div class="grid grid-cols-2 gap-3">
<button onclick="viewAnswers('${topic}')"
class="py-3 rounded-lg bg-primary/10 hover:bg-primary/20 text-primary font-semibold transition-colors flex justify-center items-center gap-2">
<i class="fa-solid fa-eye"></i> View
</button>
<button onclick="initQuiz('${topic}')"
class="py-3 rounded-lg bg-emerald-600 hover:bg-emerald-700 text-white font-bold shadow-md hover:shadow-lg transition-all flex justify-center items-center gap-2">
<i class="fa-solid fa-play"></i> Test
</button>
</div>
`;
container.appendChild(card);
});
showSection('topics');
}
// --- CHAPTER MODAL (DYNAMIC) ---
function openChapterModal() {
const list = document.getElementById('chapter-list');
list.innerHTML = ''; // Clear previous
let chapters = [];
const data = QUESTION_BANK[currentSubject][pendingTopic] || [];
const uniqueUnits = [...new Set(data.map(q => q.unit))];
// If they are numbered strings, sort numerically. Otherwise just sort.
chapters = uniqueUnits.sort((a, b) => {
const numA = parseInt(a);
const numB = parseInt(b);
if (!isNaN(numA) && !isNaN(numB)) return numA - numB;
return a.localeCompare(b);
});
// Container
const container = document.createElement('div');
container.className = "flex flex-col gap-5";
// Styled Wrapper for Select
const selectWrapper = document.createElement('div');
selectWrapper.className = "relative";
// Select Element
const select = document.createElement('select');
select.id = "chapter-dropdown";
select.className = "w-full appearance-none bg-gray-50 border border-gray-300 text-gray-900 text-lg rounded-xl py-4 px-5 pr-10 focus:outline-none focus:border-primary focus:ring-4 focus:ring-primary/10 transition-all font-semibold cursor-pointer shadow-sm hover:border-gray-400";
// Arrow Icon
const arrow = document.createElement('div');
arrow.className = "absolute right-5 top-1/2 transform -translate-y-1/2 text-gray-500 pointer-events-none";
arrow.innerHTML = '<i class="fa-solid fa-chevron-down text-sm"></i>';
// Default Option
const defaultOpt = document.createElement('option');
defaultOpt.value = "";
defaultOpt.innerText = "Select a Chapter";
defaultOpt.disabled = true;
defaultOpt.selected = true;
select.appendChild(defaultOpt);
// Populate Options
chapters.forEach(ch => {
const opt = document.createElement('option');
opt.value = ch;
opt.innerText = `Chapter ${ch}`;
select.appendChild(opt);
});
selectWrapper.appendChild(select);
selectWrapper.appendChild(arrow);
container.appendChild(selectWrapper);
// Enter Button
const btn = document.createElement('button');
btn.innerHTML = 'Start Practice <i class="fa-solid fa-arrow-right ml-2 group-hover:translate-x-1 transition-transform"></i>';
btn.className = "group w-full py-4 bg-primary text-white font-bold text-lg rounded-xl shadow-lg hover:shadow-primary/30 hover:bg-cyan-700 active:scale-[0.98] transition-all flex justify-center items-center";
btn.onclick = () => {
const val = select.value;
if (!val) {
select.classList.add('ring-2', 'ring-red-500', 'border-red-500');
setTimeout(() => select.classList.remove('ring-2', 'ring-red-500', 'border-red-500'), 500);
return;
}
selectChapter(val);
};
container.appendChild(btn);
list.appendChild(container);
document.getElementById('chapter-modal').classList.remove('hidden');
}
function initQuiz(topic) {
const subjectsWithChapters = ['python', 'de', 'ci', 'dm', 'coa', 'python2', 'fsd2', 'toc'];
if (topic === 'T4' && subjectsWithChapters.includes(currentSubject)) {
selectionMode = 'quiz';
pendingTopic = topic;
openChapterModal();
return;
}
startQuiz(topic);
}
function closeChapterModal() {
document.getElementById('chapter-modal').classList.add('hidden');
selectionMode = '';
pendingTopic = '';
}
function selectChapter(chapter) {
const mode = selectionMode;
const topic = pendingTopic;
closeChapterModal();
if (mode === 'view') {
startViewAnswers(topic, chapter);
} else if (mode === 'quiz') {
startQuiz(topic, chapter);
}
}
function startQuiz(topic, filterUnit = null) {
let topicData = QUESTION_BANK[currentSubject][topic];
if (filterUnit) {
topicData = topicData.filter(q => q.unit === filterUnit);
}
if (!topicData || topicData.length === 0) {
alert("No questions found for this selection.");
return;
}
// 1. Select Questions (Shuffle & Limit)
let selectedData = [];
if (currentSubject === 'etc' || currentSubject === 'ci') {
selectedData = [...topicData].sort(() => 0.5 - Math.random());
} else {
selectedData = [...topicData].sort(() => 0.5 - Math.random()).slice(0, 10);
}
// 2. Shuffle Options for each question
currentQuizData = selectedData.map(q => {
// Deep copy to avoid modifying original QUESTION_BANK
const newQ = JSON.parse(JSON.stringify(q));
// Create an array of indices [0, 1, 2, 3...]
const indices = newQ.options.map((_, i) => i);
// Shuffle the indices
indices.sort(() => Math.random() - 0.5);
// Reorder options based on shuffled indices
newQ.options = indices.map(i => q.options[i]);