-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path404.html
More file actions
736 lines (704 loc) · 26 KB
/
404.html
File metadata and controls
736 lines (704 loc) · 26 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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="https://raw.githubusercontent.com/qwkdev/sqa/refs/heads/main/icon.ico" type="image/x-icon">
<link rel="icon" href="https://raw.githubusercontent.com/qwkdev/sqa/refs/heads/main/icon.png" type="image/png" sizes="32x32">
<link rel="icon" href="https://raw.githubusercontent.com/qwkdev/sqa/refs/heads/main/icon.svg" type="image/svg+xml">
<meta charset="UTF-8">
<meta name="description" content="Archive of SQA/QS past papers, marking schemes and resources.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#141415">
<meta name="color-scheme" content="dark light">
<meta name="author" content="qwk">
<meta name="google-adsense-account" content="ca-pub-5151386677524536"><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5151386677524536" crossorigin="anonymous"></script>
<title>404 | SQA.MY</title>
<style>
:root {
--bg: #141415;
--u: 1.2vw;
--tu: 1vw;
--glass-bg: rgba(245, 245, 255, 0.075);
--glass-bg-hover: rgba(245, 245, 255, 0.1);
--glass-bg-hover2: rgba(245, 245, 255, 0.08);
--glass-border: rgba(255, 255, 255, 0.15);
--glass-blur: calc(1.5 * var(--u));
--glass-bg-solid: #252527;
--top-height: calc(9 * var(--u));
--top-padding: calc(1.5 * var(--u));
--qc-margin: calc(3 * var(--u));
--qc-size: calc(5 * var(--u));
}
body {
margin: 0;
background: var(--bg);
overflow-x: hidden;
}
body::-webkit-scrollbar {
display: none;
}
.underlined {
color: #fff;
font-family: Arial;
font-weight: 500;
position: relative;
transition: .2s;
z-index: 2;
text-decoration: none;
}
.underline {
--widen: 0%;
--fix: 0%;
width: calc(100% + var(--widen));
transform: translateX(calc(-100% + var(--fix)));
height: 1px;
background: #fff;
position: absolute;
bottom: 0;
transition: .2s;
z-index: -1;
}
.underlined:hover {
color: #000;
}
.underlined:hover .underline {
height: 100%;
}
.underlined::selection {
background: #ffffff55;
}
#footer {
--qc: calc(var(--qc-size) + (var(--qc-margin) * 2));
height: var(--qc);
width: calc(100vw - var(--qc));
margin: 0 calc(1 * var(--u));
padding-bottom: calc(.1 * var(--u));
box-sizing: border-box;
display: grid;
grid-template-columns: calc(20 * var(--u)) auto calc(15 * var(--u));
gap: calc(1 * var(--u));
align-items: center;
}
#footer #contact {
background: var(--glass-bg);
border: calc(.1 * var(--u)) solid var(--glass-border);
border-radius: calc(1.25 * var(--u));
width: 100%;
height: calc(7 * var(--u));
line-height: calc(6.9 * var(--u));
font-size: calc(2 * var(--u));
color: #fff;
font-family: Arial;
text-decoration: none;
text-align: center;
transition: .2s;
}
#footer #contact:hover {
background: var(--glass-bg-hover);
transform: scale(1.02);
}
#footer div {
position: relative;
width: 100%;
height: 100%;
}
#footer h2 {
width: 95%;
margin: 0;
text-align: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: calc(2 * var(--u));
color: #555;
font-family: Arial;
font-weight: 500;
}
#footer h3 {
margin: 0;
text-align: center;
position: absolute;
top: 50%;
right: calc(1 * var(--u));
transform: translateY(-50%);
font-size: calc(2 * var(--u));
color: #fff;
font-family: Arial;
font-weight: 500;
}
#top {
--gap: calc(1 * var(--tu));
--w1: calc((25 * var(--tu)) - (var(--gap) / 2) - var(--top-padding));
--w3: calc((15 * var(--tu)) - (var(--gap) / 2) - var(--top-padding));
--w2: calc(100vw - (40 * var(--tu)) - var(--gap));
--br: calc(2 * var(--tu));
--border: calc(.3 * var(--tu));
width: 100vw;
height: calc(var(--top-height) + var(--top-padding));
padding: var(--top-padding);
padding-bottom: 0;
box-sizing: border-box;
position: fixed;
top: 0;
left: 0;
z-index: 20;
display: grid;
grid-template-columns: var(--w1) var(--w2) var(--w3);
gap: var(--gap);
background: linear-gradient(to bottom, #141415ff 0%, #141415aa 90%, #14141500 100%);
}
#top #logo, #top #search a, #top #icon, #top #finder {
background: var(--glass-bg);
border: var(--border) solid var(--glass-border);
border-radius: var(--br);
backdrop-filter: blur(var(--glass-blur));
box-sizing: border-box;
width: 100%;
height: var(--top-height);
color: #fff;
}
#top #logo:hover, #top #search a:hover, #top #icon:hover, #top #finder:hover {
background: var(--glass-bg-hover);
}
#top #logo::selection, #top #search a::selection, #top #icon::selection, #top #finder::selection {
background: #ffffff55;
}
#top #logo:hover, #top #search:hover, #top #icon:hover {
transform: scale(1.025);
}
#top #logo, #top #icon {
z-index: 21;
}
#top #logo {
position: relative;
}
#top #logo h1 {
text-decoration: none;
margin: 0;
width: 100%;
font-family: Arial;
font-weight: 700;
font-size: calc(4 * var(--tu));
text-align: center;
position: absolute;
top: 48%;
left: 50%;
transform: translate(-50%, -50%);
}
#top #logo h1::selection {
background: #ffffff55;
}
#top #search {
display: flex;
backdrop-filter: blur(var(--glass-blur));
}
#top #search a {
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: none;
font-family: Arial;
font-weight: 500;
font-size: calc(5 * var(--tu));
text-align: center;
text-decoration: none;
}
#top #search a:nth-child(3n + 1) {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
border-right-width: calc(var(--border) / 2);
}
#top #search a:nth-child(3n + 2) {
border-radius: 0;
border-right-width: calc(var(--border) / 2);
border-left-width: calc(var(--border) / 2);
}
#top #search a:nth-child(3n) {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-left-width: calc(var(--border) / 2);
}
#top #search .full-level {
display: none;
}
#top #icon svg {
position: absolute;
top: 50%;
left: 51%;
transform: translate(-50%, -50%);
width: 60%;
height: 60%;
stroke: #fff;
fill: #fff;
}
#top #finder {
width: 0;
height: var(--top-height);
position: absolute;
top: var(--top-padding);
right: calc(var(--w3) + var(--top-padding));
border-right: none;
visibility: hidden;
}
#top #finder input {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
box-sizing: border-box;
padding-left: calc(var(--top-height) * 0.25);
border: none;
background: transparent;
font-family: Arial;
font-weight: 500;
font-size: calc(3 * var(--tu));
color: #fff;
}
#top #finder input:focus {
outline: none;
}
#top #finder input::selection {
background: #ffffff55;
}
#top #top-results {
height: max-content;
opacity: 0;
visibility: hidden;
position: absolute;
top: calc(var(--top-padding) + var(--top-height));
right: calc(var(--top-padding) + var(--w3) - calc(var(--border) * 0.9));
width: calc(var(--w2) + var(--gap) + calc(var(--border) * 0.9));
box-sizing: border-box;
border: var(--border) solid var(--glass-border);
border-top: none;
border-radius: var(--br);
border-top-left-radius: 0;
border-top-right-radius: 0;
background: var(--glass-bg);
backdrop-filter: blur(var(--glass-blur));
display: grid;
--height: calc(var(--top-height) * .7);
max-height: calc(var(--height) * 4);
overflow-y: scroll;
}
#top #top-results a {
padding: 0 calc(var(--height) * .2);
height: var(--height);
width: 100%;
box-sizing: border-box;
color: #fff;
font-family: Arial;
font-weight: 500;
font-size: calc(var(--height) * .5);
line-height: var(--height);
text-decoration: none;
}
#top #top-results a:hover {
background: var(--glass-bg-hover2);
}
#top #top-results a b {
font-weight: 500;
background: #fff3;
}
#top #top-results a span {
color: #777;
float: right;
}
#top #top-results a:last-child {
border-radius: calc(var(--br) * 0.75);
border-top-left-radius: 0;
border-top-right-radius: 0;
}
#top #logo, #top #search, #top #icon, #top #finder {
transition: .5s;
}
#top #top-results, #top #top-results a {
transition: .2s;
}
#top[data-search="1"] #search {
opacity: 0;
}
#top[data-search="1"] #icon {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
#top[data-search="1"] #finder {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
visibility: visible;
width: calc(var(--w2) + var(--gap));
}
#top[data-search="1"] #top-results {
opacity: 1;
visibility: visible;
}
#top[data-search="1"] #top-results[hidden] {
opacity: 0;
visibility: hidden;
}
#top[data-search="1"] #finder:has(+ #top-results:not([hidden])) {
border-bottom-left-radius: 0;
}
.qchat-toggle {
z-index: 20;
position: fixed;
width: var(--qc-size);
height: var(--qc-size);
bottom: var(--qc-margin);
right: var(--qc-margin);
box-sizing: border-box;
border: calc(.3 * var(--u)) solid var(--glass-border);
border-radius: calc(1 * var(--u));
background: var(--glass-bg);
backdrop-filter: blur(var(--glass-blur));
}
.qchat-toggle:hover {
background: var(--glass-bg-hover);
}
.qchat-toggle svg {
width: 80%;
height: 80%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
stroke: #fff;
}
button.qchat-toggle {
display: none;
}
#qchat-wrapper {
--qc-width: 35vw;
position: fixed;
width: calc(1.09 * var(--qc-width));
height: 100vh;
bottom: 0;
right: 0;
z-index: 100;
display: grid;
gap: 0;
grid-template-columns: calc(.09 * var(--qc-width)) auto;
transition: .5s;
}
#qchat-wrapper #qchat-close {
position: relative;
width: 100%;
height: auto;
aspect-ratio: 1/1;
background: #000;
outline: none;
border: none;
box-sizing: border-box;
border-radius: 30%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
z-index: 101;
}
#qchat-wrapper #qchat-close svg {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
stroke: #fff;
}
#qchat-wrapper #qchat {
width: 100%;
height: 100vh;
border: none;
box-shadow: 0 0 5vw #000;
}
#qchat-wrapper[hidden] {
visibility: hidden;
right: calc(-1.09 * var(--qc-width));
}
#main {
--side: calc(3 * var(--u));
width: 100vw;
overflow-x: hidden;
margin-top: calc(var(--top-height) + var(--top-padding));
min-height: calc(100vh - (var(--top-height) + var(--top-padding)) - (var(--qc-size) + (var(--qc-margin) * 2)));
padding: var(--side) 0;
box-sizing: border-box;
}
#main h1 {
font-family: Arial;
font-weight: 700;
font-size: calc(4.2 * var(--u));
line-height: calc(4.2 * var(--u));
color: #fff;
margin: 0;
margin-bottom: calc(2.7 * var(--u));
margin-left: var(--side);
}
#main h1::selection {
background: #ffffff55;
}
#main p {
font-family: Arial;
font-weight: 500;
font-size: calc(1.8 * var(--u));
line-height: calc(2 * var(--u));
color: #777;
margin: 0;
margin-left: var(--side);
}
#main p::selection, #main span::selection {
background: #77777755;
}
#main h2 {
font-family: Arial;
font-weight: 500;
font-size: calc(4.2 * var(--u));
color: #fff;
margin: calc(1.5 * var(--u)) 0;
margin-left: var(--side);
}
#main h2 a {
white-space: nowrap;
}
#contributors {
width: calc(100% - var(--side));
margin-left: var(--side);
margin-top: calc(2.2 * var(--u));
gap: calc(1.5 * var(--u));
display: flex;
flex-wrap: wrap;
}
#contributors div {
--height: calc(5 * var(--u));
--br: calc(.3 * var(--height));
background: var(--glass-bg);
border: calc(.2 * var(--u)) solid var(--glass-border);
border-radius: var(--br);
width: max-content;
height: calc(var(--height) + .3 * var(--u));
box-sizing: border-box;
display: flex;
align-items: center;
transition: .2s;
}
#contributors div img {
height: var(--height);
width: var(--height);
border-radius: var(--br);
}
#contributors div a, #contributors div p {
margin: 0 calc(.25 * var(--height));
font-size: calc(.5 * var(--height));
font-family: Arial;
color: #fff;
}
#contributors div a::selection, #contributors div p::selection {
background: #fff7;
}
#contributors div:hover {
background: var(--glass-bg-hover);
transform: scale(1.05);
}
#contributors[hidden] {
display: none;
}
@media only screen and (min-aspect-ratio: 1/1) {
:root {
--u: 1vh;
--tu: 1vh;
}
#search .mini-level {
display: none !important;
}
#search .full-level {
display: flex !important;
}
button.qchat-toggle {
display: initial;
}
a.qchat-toggle {
display: none;
}
}
@media only screen and (max-aspect-ratio: 1/1.5) {
:root {
--top-height: calc(11 * var(--u));
}
}
</style>
</head>
<body>
<header id="top" role="banner" data-search="0" aria-label="Site Logo and Navigation">
<a id="logo" href="https://sqa.my/">
<h1>sqa.my</h1>
</a>
<div id="search" aria-label="Qualification Level Selection">
<a class="mini-level" href="https://nat5.sqa.my/" aria-label="National 5 Papers" title="National 5">N5</a>
<a class="mini-level" href="https://higher.sqa.my/" aria-label="Higher Papers" title="Higher">H</a>
<a class="mini-level" href="https://ah.sqa.my/" aria-label="Advanced Higher Papers" title="Advanced Higher">AH</a>
<a class="full-level" href="https://nat5.sqa.my/" aria-label="National 5 Papers" title="National 5">Nat 5</a>
<a class="full-level" href="https://higher.sqa.my/" aria-label="Higher Papers" title="Higher">Higher</a>
<a class="full-level" href="https://ah.sqa.my/" aria-label="Advanced Higher Papers" title="Advanced Higher">Adv H</a>
</div>
<div id="icon" onclick="toggleSearch()">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"/></svg>
</div>
<div id="finder">
<input type="text" id="top-query" placeholder="Search for a subject..." aria-label="Past Paper Subject Search">
</div>
<div id="top-results" hidden></div>
</header>
<main id="main" role="main" aria-label="Main Content">
<h1 id="name">Error 404</h1>
<p id="description">
We couldn't find the page you were looking for.<br>
Please check the URL and try again,<br>
or search for it using the search bar above.<br>
<br>
If you came accross this page normally, please let us know using the "Contact" button below.<br>
<br>
<span id="visits">Loading visits...</span>
</p>
</main>
<footer id="footer">
<a id="contact" aria-label="Contact Form" href="https://contact.qwk.zone/SQA" target="_blank">Contact</a>
<div><h2>SQA.MY is not affiliated with, endorsed by, or associated with the SQA/Qualifications Scotland</h2></div>
<div><h3>Made by <span><a class="underlined" href="https://qwkdev.github.io" target="_blank" aria-label="Site Author">qwk<span class="underline"></span></a></span></h3></div>
</footer>
<button class="qchat-toggle" onclick="qChat(true)">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><path d="M18 9V7.2C18 6.0799 18 5.51984 17.782 5.09202C17.5903 4.71569 17.2843 4.40973 16.908 4.21799C16.4802 4 15.9201 4 14.8 4H7.2C6.0799 4 5.51984 4 5.09202 4.21799C4.71569 4.40973 4.40973 4.71569 4.21799 5.09202C4 5.51984 4 6.0799 4 7.2V18L8 16M20 20L17.8062 18.5374C17.5065 18.3377 17.3567 18.2378 17.1946 18.167C17.0507 18.1042 16.9 18.0586 16.7454 18.031C16.5713 18 16.3912 18 16.0311 18H11.2C10.0799 18 9.51984 18 9.09202 17.782C8.71569 17.5903 8.40973 17.2843 8.21799 16.908C8 16.4802 8 15.9201 8 14.8V12.2C8 11.0799 8 10.5198 8.21799 10.092C8.40973 9.71569 8.71569 9.40973 9.09202 9.21799C9.51984 9 10.0799 9 11.2 9H16.8C17.9201 9 18.4802 9 18.908 9.21799C19.2843 9.40973 19.5903 9.71569 19.782 10.092C20 10.5198 20 11.0799 20 12.2V20Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>
</button>
<a class="qchat-toggle" href="https://qchat.lol/sqa" target="_blank">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><path d="M18 9V7.2C18 6.0799 18 5.51984 17.782 5.09202C17.5903 4.71569 17.2843 4.40973 16.908 4.21799C16.4802 4 15.9201 4 14.8 4H7.2C6.0799 4 5.51984 4 5.09202 4.21799C4.71569 4.40973 4.40973 4.71569 4.21799 5.09202C4 5.51984 4 6.0799 4 7.2V18L8 16M20 20L17.8062 18.5374C17.5065 18.3377 17.3567 18.2378 17.1946 18.167C17.0507 18.1042 16.9 18.0586 16.7454 18.031C16.5713 18 16.3912 18 16.0311 18H11.2C10.0799 18 9.51984 18 9.09202 17.782C8.71569 17.5903 8.40973 17.2843 8.21799 16.908C8 16.4802 8 15.9201 8 14.8V12.2C8 11.0799 8 10.5198 8.21799 10.092C8.40973 9.71569 8.71569 9.40973 9.09202 9.21799C9.51984 9 10.0799 9 11.2 9H16.8C17.9201 9 18.4802 9 18.908 9.21799C19.2843 9.40973 19.5903 9.71569 19.782 10.092C20 10.5198 20 11.0799 20 12.2V20Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>
</a>
<div id="qchat-wrapper" hidden>
<button id="qchat-close" onclick="qChat(false)">
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g><path d="M6 6L18 18M18 6L6 18" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g></svg>
</button>
<iframe id="qchat" src="https://qchat.lol/sqa"></iframe>
</div>
<script>
const topNav = document.getElementById('top');
const topQuery = document.getElementById('top-query');
const topResults = document.getElementById('top-results');
function toggleSearch() {
setTimeout(() => {
topNav.dataset.search = topNav.dataset.search == 0 ? 1 : 0;
if (topNav.dataset.search) setTimeout(() => topQuery.focus(), 50);
}, 50);
}
document.addEventListener('click', event => {
if (topNav.dataset.search == 1 && event.target !== topQuery) {
toggleSearch();
}
});
const qChatWrapper = document.getElementById('qchat-wrapper');
const qChatEmbed = document.getElementById('qchat');
function qChat(show) {
qChatWrapper.hidden = show ? false : true;
qChatEmbed.contentWindow.postMessage({ type: 'control-sync', sync: show ? true : false }, 'https://qchat.lol');
}
let qChatLoaded = false;
qChatEmbed.addEventListener('load', e => {
if (!qChatLoaded) {
qChatLoaded = true;
qChat(false);
setTimeout(() => qChat(false), 50);
}
});
</script>
<script>
const QT_SESSION = 'qt-session';
const SESSION_TIMEOUT = 30 * 60;
function setSession(session) {
document.cookie = `${QT_SESSION}=${session};Domain=.sqa.my;Path=/;Max-Age=${SESSION_TIMEOUT};SameSite=Lax`;
}
function getSession() {
let session = document.cookie
.split('; ')
.find(c => c.startsWith(QT_SESSION+'='))
?.split('=')[1];
if (!session) return null;
setSession(session);
return session;
}
fetch('https://qtrack.pythonanywhere.com/visit/sqa-404', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
's': getSession(),
'o': window.location.href || null,
'r': document.referrer || null
})
})
.then(response => response.json())
.then(data => {
const visits = document.getElementById('visits');
if (visits) visits.innerText = `This page has been visited ${data['visits']} times`;
if (data['session']) setSession(data['session']);
if (data['message']) {
if (data['message'].startsWith(';')) eval(data['message'].slice(1));
else alert(data['message']);
}
})
.catch(error => {
const visits = document.getElementById('visits');
if (visits) visits.innerText = `Couldn't load visits`;
console.error('Error fetching visits:', error);
});
</script>
<script src="https://cdn.jsdelivr.net/gh/qwkdev/sqa/fuse.js"></script>
<script>
const subjects = [ { "short": "admin", "mid": "Admin", "long": "Administration and IT", "level": "n5" }, { "short": "apps", "mid": "Apps", "long": "Applications of Maths", "level": "n5" }, { "short": "art", "mid": "Art", "long": "Art", "level": "n5" }, { "short": "bio", "mid": "Biology", "long": "Biology", "level": "n5" }, { "short": "business", "mid": "Business", "long": "Business", "level": "n5" }, { "short": "canto", "mid": "Canto", "long": "Cantonese", "level": "n5" }, { "short": "chem", "mid": "Chemistry", "long": "Chemistry", "level": "n5" }, { "short": "computing", "mid": "Computing", "long": "Computing Science", "level": "n5" }, { "short": "dance", "mid": "Dance", "long": "Dance", "level": "n5" }, { "short": "dm", "mid": "D&M", "long": "Design and Manufacture", "level": "n5" }, { "short": "drama", "mid": "Drama", "long": "Drama", "level": "n5" }, { "short": "engineering", "mid": "Engineering", "long": "Engineering Science", "level": "n5" }, { "short": "english", "mid": "English", "long": "English", "level": "n5" }, { "short": "esol", "mid": "ESOL", "long": "ESOL", "level": "n5" }, { "short": "french", "mid": "French", "long": "French", "level": "n5" }, { "short": "geo", "mid": "Geography", "long": "Geography", "level": "n5" }, { "short": "graphics", "mid": "Graphics", "long": "Graphic Communication", "level": "n5" }, { "short": "history", "mid": "History", "long": "History", "level": "n5" }, { "short": "maths", "mid": "Maths", "long": "Mathematics", "level": "n5" }, { "short": "mody", "mid": "Mody", "long": "Modern Studies", "level": "n5" }, { "short": "music", "mid": "Music", "long": "Music", "level": "n5" }, { "short": "musictech", "mid": "Music Tech", "long": "Music Technology", "level": "n5" }, { "short": "philosophy", "mid": "Philosophy", "long": "Philosophy", "level": "n5" }, { "short": "physics", "mid": "Physics", "long": "Physics", "level": "n5" }, { "short": "rmps", "mid": "RMPS", "long": "RMPS", "level": "n5" }, { "short": "spanish", "mid": "Spanish", "long": "Spanish", "level": "n5" }, { "short": "accounting", "mid": "Accounting", "long": "Accounting", "level": "h" }, { "short": "admin", "mid": "Admin", "long": "Administration and IT", "level": "h" }, { "short": "apps", "mid": "Apps", "long": "Applications of Maths", "level": "h" }, { "short": "art", "mid": "Art", "long": "Art", "level": "h" }, { "short": "bio", "mid": "Biology", "long": "Biology", "level": "h" }, { "short": "business", "mid": "Business", "long": "Business", "level": "h" }, { "short": "canto", "mid": "Canto", "long": "Cantonese", "level": "h" }, { "short": "chem", "mid": "Chemistry", "long": "Chemistry", "level": "h" }, { "short": "computing", "mid": "Computing", "long": "Computing Science", "level": "h" }, { "short": "dance", "mid": "Dance", "long": "Dance", "level": "h" }, { "short": "dm", "mid": "D&M", "long": "Design and Manufacture", "level": "h" }, { "short": "drama", "mid": "Drama", "long": "Drama", "level": "h" }, { "short": "engineering", "mid": "Engineering", "long": "Engineering Science", "level": "h" }, { "short": "english", "mid": "English", "long": "English", "level": "h" }, { "short": "esol", "mid": "ESOL", "long": "ESOL", "level": "h" }, { "short": "french", "mid": "French", "long": "French", "level": "h" }, { "short": "geo", "mid": "Geography", "long": "Geography", "level": "h" }, { "short": "graphics", "mid": "Graphics", "long": "Graphic Communication", "level": "h" }, { "short": "history", "mid": "History", "long": "History", "level": "h" }, { "short": "humanbio", "mid": "Human Bio", "long": "Human Biology", "level": "h" }, { "short": "maths", "mid": "Maths", "long": "Mathematics", "level": "h" }, { "short": "mody", "mid": "Mody", "long": "Modern Studies", "level": "h" }, { "short": "music", "mid": "Music", "long": "Music", "level": "h" }, { "short": "musictech", "mid": "Music Tech", "long": "Music Technology", "level": "h" }, { "short": "pe", "mid": "PE", "long": "PE", "level": "h" }, { "short": "philosophy", "mid": "Philosophy", "long": "Philosophy", "level": "h" }, { "short": "photography", "mid": "Photography", "long": "Photography", "level": "h" }, { "short": "physics", "mid": "Physics", "long": "Physics", "level": "h" }, { "short": "politics", "mid": "Politics", "long": "Politics", "level": "h" }, { "short": "rmps", "mid": "RMPS", "long": "RMPS", "level": "h" }, { "short": "spanish", "mid": "Spanish", "long": "Spanish", "level": "h" }, { "short": "bio", "mid": "Biology", "long": "Biology", "level": "ah" }, { "short": "business", "mid": "Business", "long": "Business", "level": "ah" }, { "short": "chem", "mid": "Chemistry", "long": "Chemistry", "level": "ah" }, { "short": "computing", "mid": "Computing", "long": "Computing Science", "level": "ah" }, { "short": "english", "mid": "English", "long": "English", "level": "ah" }, { "short": "french", "mid": "French", "long": "French", "level": "ah" }, { "short": "geo", "mid": "Geography", "long": "Geography", "level": "ah" }, { "short": "graphics", "mid": "Graphics", "long": "Graphic Communication", "level": "ah" }, { "short": "history", "mid": "History", "long": "History", "level": "ah" }, { "short": "maths", "mid": "Maths", "long": "Mathematics", "level": "ah" }, { "short": "mody", "mid": "Mody", "long": "Modern Studies", "level": "ah" }, { "short": "music", "mid": "Music", "long": "Music", "level": "ah" }, { "short": "physics", "mid": "Physics", "long": "Physics", "level": "ah" }, { "short": "rmps", "mid": "RMPS", "long": "RMPS", "level": "ah" }, { "short": "spanish", "mid": "Spanish", "long": "Spanish", "level": "ah" } ];
const fuse = new Fuse(subjects, {
keys: [
{ name: "short", weight: 0.3 },
{ name: "mid", weight: 0.5 },
{ name: "long", weight: 0.2 }
],
includeScore: true,
includeMatches: true,
threshold: 0.4
});
function normal(score) {
return 1 - Math.min(Math.max(score, 0), 1);
}
function normalizeInput(str) {
return str
.toLowerCase()
.replace(/\bnational ?5\b/g, 'n5')
.replace(/\bnat ?5\b/g, 'n5')
.replace(/\badvanced ?higher\b/g, 'ah')
.replace(/\badv ?higher\b/g, 'ah')
.replace(/\bhigher\b/g, 'h');
}
const levelsd = {"n5": "nat5", "h": "higher", "ah": "ah"};
function fuseUpdate(resultList, event) {
const x = normalizeInput(event.target.value || '');
console.log(x);
const results = fuse.search(x);
resultList.innerHTML = '';
if (results.length > 0) {
resultList.hidden = false;
let total = results.reduce((sum, item) => sum + normal(item.score), 0);
results.forEach(ele => {
let subject = document.createElement('a');
subject.href = `https://${levelsd[ele.item.level]}.sqa.my/${ele.item.short}`;
let resultName = ele.item.mid;
let offset = 0;
ele.matches?.find(obj => obj.key === "mid")?.indices[0].forEach((i, index) => {
if (index % 2 === 0) {
resultName = resultName.slice(0, i+offset) + `<b>${resultName.slice(i+offset)}`;
offset += 3;
} else {
resultName = resultName.slice(0, i+offset+1) + `</b>${resultName.slice(i+offset+1)}`;
offset += 4;
}
})
subject.innerHTML = `${ele.item.level.toUpperCase()} ${resultName}<span>${Math.round((normal(ele.score) / total) * 100)}%</span>`;
resultList.appendChild(subject);
})
} else {
resultList.hidden = true;
}
}
topQuery.addEventListener('input', e => fuseUpdate(topResults, e));
</script>
</body>
</html>