-
Notifications
You must be signed in to change notification settings - Fork 2
/
index2.php
1274 lines (1173 loc) · 70.5 KB
/
index2.php
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
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', false);
/*
require_once __DIR__.'\SimpleXLSX.php';
if ( $xlsx = SimpleXLSX::parse('test.xlsx') ) {
print_r( $xlsx->rows() );
} else {
echo SimpleXLSX::parseError();
}*/
set_include_path(__DIR__ . '/phpexcel/Classes/');
include __DIR__ . '/phpexcel/Classes/PHPExcel/IOFactory.php';
$file = __DIR__ . '/test.xlsx';
$inputFileType = PHPExcel_IOFactory::identify($file);
$objReader = PHPExcel_IOFactory::createReader($inputFileType);
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load($file);
$objWorksheet = $objPHPExcel->getActiveSheet();
$CurrentWorkSheetIndex = 0;
// header('Content-Type: text/csv');
// header('Content-Disposition: attachment; filename="sample.csv"');
function store_Result($file_name, $line)
{ //echo '<script>alert(1)</script>';
$fp = fopen($file_name, 'a'); //opens file in append mode
fwrite($fp, $line);
fclose($fp);
//echo '<script>alert(2)</script>';
}
if (isset($_POST['name'])) {
$name = $_POST['name'];
$std = $_POST['std'];
$phy_A = $_POST['phy_attempted'];
$phy_C = $_POST['phy_correct'];
$chem_A = $_POST['chem_attempted'];
$chem_C = $_POST['chem_correct'];
$math_A = $_POST['math_attempted'];
$math_C = $_POST['math_correct'];
$total_A=$math_A+$phy_A+$chem_A;
$total_C=$math_C+$phy_C+$chem_C;
$total_I=$total_A-$total_C;
//PA,PC,PW,CA,CC,CW,MA,MC,MW,TOTAL
$total_marks = $_POST['total_marks'];
$line = $name . "," . $std . "," .$phy_A. "," .$phy_C. "," .$chem_A. "," .$chem_C. "," .$math_A. "," .$math_C. "," .$total_A. "," .$total_C. "," .$total_I. "," . $total_marks . "\n";
store_Result("Results FOCUS " . date("Y.m.d") . " .csv", $line);
echo '<script>alert("You GOT TOTAL MARKS='.$total_marks.'")</script>';
}
function isInAP($a, $d, $x)
{
if ($d == 0) {
return ($x == $a) ? 1 : 0;
}
return (($x - $a) % $d == 0 && ($x - $a) / $d >= 0) ? 1 : 0;
}
// isInAP(1,3,7);
$marks = array();
$phy_single = array();
$phy_multi = array();
$phy_integer = array();
$phy_match = array();
$chem_single = array();
$chem_multi = array();
$chem_integer = array();
$chem_match = array();
$math_single = array();
$math_multi = array();
$math_integer = array();
$math_match = array();
$partial = 0;
foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
// echo ("<br/><br/>");
// echo 'WorkSheet' . $CurrentWorkSheetIndex++ . "\n";
// echo 'Worksheet:', $objPHPExcel->getIndex($worksheet), PHP_EOL;
$highestRow = $worksheet->getHighestDataRow();
$highestColumn = $worksheet->getHighestDataColumn();
$headings = $worksheet->rangeToArray('A1:' . $highestColumn . 1, '', true, false);
$positive = $headings[0][1];
$negative = $headings[0][2];
if ($objPHPExcel->getIndex($worksheet) != 1) {
$questions_each = $headings[0][3];
} else {
$partial = $headings[0][3];
$questions_each = $headings[0][4];
}
// echo ("TOTAL=" . $questions_each);
if ($questions_each < 1) {
array_push($marks, 0, 0);
continue;
} else {
array_push($marks, $positive, $negative);
}
// echo ("<br/>");
switch ($objPHPExcel->getIndex($worksheet)) {
case 0:
//SINGLE
for ($i = 0; $i < 3; $i++) {
for ($row = 3 + $i * ($questions_each + 1); $row <= 3 + $i * ($questions_each + 1) + $questions_each - 1; $row++) {
$rowData = $worksheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, ' ', true, false);
$v = $rowData[0][0];
switch ($i) {
case 0:
array_push($phy_single, $v);
break;
case 1:
array_push($chem_single, $v);
break;
case 2:
array_push($math_single, $v);
break;
}
}
}
break;
case 1:
//MULTI
for ($i = 0; $i < 3; $i++) {
for ($row = 3 + $i * ($questions_each + 1); $row <= 3 + $i * ($questions_each + 1) + $questions_each - 1; $row++) {
$rowData = $worksheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, ' ', true, false);
$v = $rowData[0][0];
switch ($i) {
case 0:
array_push($phy_multi, $v);
break;
case 1:
array_push($chem_multi, $v);
break;
case 2:
array_push($math_multi, $v);
break;
}
}
}
break;
case 2:
//INTEGER
for ($i = 0; $i < 3; $i++) {
for ($row = 3 + $i * ($questions_each + 1); $row <= 3 + $i * ($questions_each + 1) + $questions_each - 1; $row++) {
$rowData = $worksheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, ' ', true, false);
$v = $rowData[0][0];
switch ($i) {
case 0:
array_push($phy_integer, $v);
break;
case 1:
array_push($chem_integer, $v);
break;
case 2:
array_push($math_integer, $v);
break;
}
}
}
break;
case 3:
//MATCH
for ($i = 0; $i < 3; $i++) {
for ($row = 3 + $i * ($questions_each + 1); $row <= 3 + $i * ($questions_each + 1) + $questions_each - 1; $row++) {
$rowData = $worksheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, ' ', true, false);
$v = $rowData[0][0];
switch ($i) {
case 0:
array_push($phy_match, $v);
break;
case 1:
array_push($chem_match, $v);
break;
case 2:
array_push($math_match, $v);
break;
}
}
}
break;
}
}
$marks = json_encode($marks);
$phy_single = json_encode($phy_single);
$phy_multi = json_encode($phy_multi);
$phy_integer = json_encode($phy_integer);
$phy_match = json_encode($phy_match);
$math_single = json_encode($math_single);
$math_multi = json_encode($math_multi);
$math_integer = json_encode($math_integer);
$math_match = json_encode($math_match);
$chem_single = json_encode($chem_single);
$chem_multi = json_encode($chem_multi);
$chem_integer = json_encode($chem_integer);
$chem_match = json_encode($chem_match);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" />
<title>TEST</title>
<!-- CSS only -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6" crossorigin="anonymous" />
<style>
body {
overflow: hidden;
}
.box {
width: 50px;
margin: 5px;
}
/* The Modal (background) */
.modal {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 1;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: rgb(0, 0, 0);
/* Fallback color */
background-color: rgba(0, 0, 0, 0.4);
/* Black w/ opacity */
}
/* Modal Content/Box */
.modal-content {
background-color: #fefefe;
margin: 15% auto;
/* 15% from the top and centered */
padding: 20px;
border: 1px solid #888;
width: 20%;
/* Could be more or less, depending on screen size */
}
/* The Close Button */
.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover,
.close:focus {
color: black;
text-decoration: none;
cursor: pointer;
}
</style>
</head>
<body >
<button class="btn-danger" id="submit_btn" style="margin-left:80vw; margin-top:2vh; width:150px;">SUBMIT</button>
<div class="container-fluid">
<div class="row">
<div class="col">
<!-- <embed src="test.pdf" style="
width: 60vw;
height: 85vh;
margin-top: 3vw;
margin-left: 5vw;
margin-right: 0;
" /> <iframe id="fraDisabled" src="test.pdf" frameborder="0" style="
width: 60vw;
height: 85vh;
margin-top: 3vw;
margin-left: 5vw;
margin-right: 0;
">
</iframe>-->
<iframe id="fraDisabled" src="test.pdf" style="
width: 60vw;
height: 85vh;
margin-top: 3vw;
margin-left: 5vw;
margin-right: 0;
"></iframe>
</div>
<div class="col" id="test_box" style="
margin-top: 3vw;
margin-right: 5vw;
height: 85vh;
background-color: #00ff99;
overflow-y: scroll;
width: 60vw;
">
<div class="col">
<label id="q1">Q1)</label><input class="box" /> <label>Q2)</label><input class="box" />
</div>
<div class="col">
<label>Q3)</label><input class="box" /> <label>Q4)</label><input class="box" />
</div>
</div>
</div>
</div>
<div id="myModal" class="modal">
<!-- Modal content -->
<div class="modal-content">
<span class="close" style="margin-left:90%;">×</span>
<br />
<form method="POST" action="/index2.php">
<input id="name" name="name" placeholder="Enter Name.." />
<br />
<input id="std" name="std" list="datalist" placeholder="Enter CLASS/STD.." />
<datalist id="datalist">
<option value="11">
<option value="12">
<option value="13">
</datalist>
<br />
<input id="phy_attempted" name="phy_attempted" style="display:none;" />
<input id="chem_attempted" name="chem_attempted" style="display:none;" />
<input id="math_attempted" name="math_attempted" style="display:none;" />
<input id="phy_correct" name="phy_correct" style="display:none;" />
<input id="chem_correct" name="chem_correct" style="display:none;" />
<input id="math_correct" name="math_correct" style="display:none;" />
<input id="total_marks" name="total_marks" style="display:none;" />
<br />
<button class="btn-danger" id="submit" style="width:150px;">CONFIRM SEND!</button>
</form>
<br />
</div>
</div>
<!-- JavaScript Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script>
function isSubsequence(str1, str2) {
let i = 0;
let j = 0;
while (i < str1.length) {
if (j === str2.length) {
return false;
}
if (str1[i] === str2[j]) {
i++;
}
j++;
};
return true;
};
var sub = ["PHYSICS", "CHEMISTRY", "MATHS"];
var k = "<Center>";
var marks = <?php echo $marks ?>;
//=======================CORRECT ANS==========================
var phy_single_correct = <?php echo ($phy_single) ?>;
var phy_multi_correct = <?php echo ($phy_multi) ?>;
var phy_integer_correct = <?php echo ($phy_integer) ?>;
var phy_match_correct = <?php echo ($phy_match) ?>;
var math_single_correct = <?php echo ($math_single) ?>;
var math_multi_correct = <?php echo ($math_multi) ?>;
var math_integer_correct = <?php echo ($math_integer) ?>;
var math_match_correct = <?php echo ($math_match) ?>;
var chem_single_correct = <?php echo ($chem_single) ?>;
var chem_multi_correct = <?php echo ($chem_multi) ?>;
var chem_integer_correct = <?php echo ($chem_integer) ?>;
var chem_match_correct = <?php echo ($chem_match) ?>;
var phy_attempted = 0;
var phy_correct = 0;
var math_attempted = 0;
var math_correct = 0;
var chem_attempted = 0;
var chem_correct = 0;
var analysis=[phy_attempted,phy_correct,phy_attempted-phy_correct,chem_attempted,chem_correct,chem_attempted-chem_correct,math_attempted,math_correct,math_attempted-math_correct];
//analysis = PA,PC,PW,CA,CC,CW,MA,MC,MW,TOTAL
//analysis = 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9
var single_correct = [phy_single_correct, chem_single_correct, math_single_correct];
var multi_correct = [phy_multi_correct, chem_multi_correct, math_multi_correct];
var integer_correct = [phy_integer_correct, chem_integer_correct, math_integer_correct];
var match_correct = [phy_match_correct, chem_match_correct, math_match_correct];
//============================================================
var partial = <?php echo $partial ?>;
var single = <?php echo $phy_single ?>;
single = single.length;
var multiple = <?php echo $phy_multi ?>;
multiple = multiple.length;
var integer = <?php echo $phy_integer ?>;
integer = integer.length;
var match = <?php echo $phy_match ?>;
match = match.length;
for (var t = 0; t < 3; t++) {
k += "<br/>===========================<br/>";
k += "<div class='" + sub[t].toLocaleLowerCase() + "'><h2>" + sub[t] + "</h2>";
//===============================SINGLE===================================
if (single > 0) {
k += "<br/><h3> SINGLE CORRECT</h3>";
k +=
"<div class='col' id='" + sub[t].toLocaleLowerCase() + "_single'style='background-color:#caebd8;border-radius:5px;'>";
for (var i = 0; i < single - 1; i += 2) {
k += "<div class='col'>";
for (var j = i + 1; j < i + 3; j++) {
k +=
"<label class='box'> Q" +
j +
") </label><input onkeypress='return /[A-E]/i.test(event.key)' style='text-transform:uppercase' maxlength='1' class='box' />";
}
k += "</div>";
}
if (single & 1) {
k += "<div class='col'>";
k +=
"<label class='box'> Q" +
single +
") </label><input onkeypress='return /[A-E]/i.test(event.key)' style='text-transform:uppercase' maxlength='1' class='box' />";
k += "</div>";
}
k += "</div>";
}
//==============================================================================
//=============================MULTIPLE=========================================
if (multiple > 0) {
k += "<br/><h3> MULTIPLE CORRECT</h3>";
k +=
"<div class='col' id='" + sub[t].toLocaleLowerCase() + "_multi' style='background-color:#caebd8; border-radius:5px;'>";
for (var i = 0; i < multiple - 1; i += 2) {
k += "<div class='col'>";
for (var j = i + 1; j < i + 3; j++) {
k +=
"<label class='box'> Q" +
j +
") </label><input onkeypress='return /[A-E]/i.test(event.key)' style='text-transform:uppercase' maxlength='5' class='box' />";
}
k += "</div>";
}
if (multiple & 1) {
k += "<div class='col'>";
k +=
"<label class='box'> Q" + multiple + ") </label><input class='box' />";
k += "</div>";
}
k += "</div>";
}
//==============================================================================
//====================================INTEGER===================================
if (integer > 0) {
k += "<br/><h3>INTEGER TYPE</h3>";
k +=
"<div class='col' id='" + sub[t].toLocaleLowerCase() + "_integer' style='background-color:#caebd8; border-radius:5px;'>";
for (
var i = 0; i < integer - 1; i += 2
) {
k += "<div class='col'>";
for (var j = i + 1; j < i + 3; j++) {
k +=
"<label class='box'> Q" +
j +
") </label><input onkeypress='return /[0-9.]/i.test(event.key)' maxlength='6' class='box' />";
}
k += "</div>";
}
if (integer & 1) {
var to = integer;
k += "<div class='col'>";
k +=
"<label class='box'> Q" +
to +
") </label><input onkeypress='return /[0-9.]/i.test(event.key)' maxlength='6' class='box' />";
k += "</div>";
}
k += "</div>";
}
//==============================================================================
//====================================MATCH===================================
if (match > 0) {
k += "<br/><h3>MATCH TYPE</h3>";
k +=
"<div class='col' id='" + sub[t].toLocaleLowerCase() + "_match'style='background-color:#caebd8; border-radius:5px; '>";
for (
var i = 0; i < match - 1; i += 2
) {
k += "<div class='col'>";
for (var j = i + 1; j < i + 3; j++) {
k +=
"<label class='box'> Q" +
j +
") </label><input onkeypress='return /[A-H]/i.test(event.key)' maxlength='6' class='box' />";
}
k += "</div>";
}
if (match & 1) {
var to = match;
k += "<div class='col'>";
k +=
"<label class='box'> Q" +
to +
") </label><input onkeypress='return /[A-H]/i.test(event.key)' maxlength='6' class='box' />";
k += "</div>";
}
k += "</div>";
}
//==============================================================================
k += "</div>";
}
k += "<br/>"
k += "</center>";
$("#test_box").html(k);
var total_marks = 0;
var modal = document.getElementById("myModal");
var span = document.getElementsByClassName("close")[0];
span.onclick = function() {
modal.style.display = "none";
}
$("#submit_btn").click(function() {
modal.style.display = "block";
//marks
total_marks = 0;
for (var t = 0; t < 3; t++) {
if ($("." + sub[t].toLocaleLowerCase()).find("div#" + sub[t].toLocaleLowerCase() + "_single").length) {
//=========================PHY SINGLE=============================
var q = $("." + sub[t].toLocaleLowerCase()).find("div#" + sub[t].toLocaleLowerCase() + "_single").find("input");
for (var i = 0; i < q.length; i++) {
if (q[i].value == "") continue;
if (q[i].value == single_correct[t][i]) {
total_marks += marks[0];
//analysis = PA,PC,PW,CA,CC,CW,MA,MC,MW,TOTAL 0,3,6
//analysis = 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9
analysis[t*3]++;
analysis[t*3+1]++;
} else {
total_marks += marks[1];
analysis[t*3]++;
analysis[t*3+2]++;
}
// console.log(total_marks);
}
//==============================================================
}
if ($("." + sub[t].toLocaleLowerCase()).find("div#" + sub[t].toLocaleLowerCase() + "_multi").length) {
//=========================PHY MULTI=============================
var q = $("." + sub[t].toLocaleLowerCase()).find("div#" + sub[t].toLocaleLowerCase() + "_multi").find("input");
for (var i = 0; i < q.length; i++) {
if (q[i].value == "") continue;
if (q[i].value == multi_correct[t][i]) {
total_marks += marks[2];
analysis[t*3]++;
analysis[t*3+1]++;
} else if (isSubsequence(q[i].value, phy_multi_correct[i])) {
total_marks += q[i].value.length;
// console.log(q[i].value.length);
analysis[t*3]++;
analysis[t*3+1]++;
} else {
total_marks += marks[3];
analysis[t*3]++;
analysis[t*3+2]++;
}
// console.log(total_marks);
}
//==============================================================
}
if ($("." + sub[t].toLocaleLowerCase()).find("div#" + sub[t].toLocaleLowerCase() + "_integer").length) {
//=========================PHY INTEGER=============================
var q = $("." + sub[t].toLocaleLowerCase()).find("div#" + sub[t].toLocaleLowerCase() + "_multi").find("input");
for (var i = 0; i < q.length; i++) {
if (q[i].value == "") continue;
if (q[i].value == integer_correct[t][i]) {
total_marks += marks[4];
analysis[t*3]++;
analysis[t*3+1]++;
} else {
total_marks += marks[5];
analysis[t*3]++;
analysis[t*3+2]++;
}
// console.log(total_marks);
}
//==============================================================
}
if ($("." + sub[t].toLocaleLowerCase()).find("div#" + sub[t].toLocaleLowerCase() + "_match").length) {
//=========================PHY MATCH=============================
var q = $("." + sub[t].toLocaleLowerCase()).find("div#" + sub[t].toLocaleLowerCase() + "_match").find("input");
for (var i = 0; i < q.length; i++) {
if (q[i].value == "") continue;
if (q[i].value == match_correct[t][i]) {
total_marks += marks[6];
analysis[t*3]++;
analysis[t*3+1]++;
} else {
total_marks += marks[7];
analysis[t*3]++;
analysis[t*3+2]++;
}
console.log(total_marks);
}
//==============================================================
}
}
//analysis = PA,PC,PW,CA,CC,CW,MA,MC,MW,TOTAL 0,3,6
//analysis = 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9
$("#total_marks").val(total_marks);
$("#phy_attempted").val(analysis[0]);
$("#chem_attempted").val(analysis[3]);
$("#math_attempted").val(analysis[6]);
$("#phy_correct").val(analysis[1]);
$("#chem_correct").val(analysis[4]);
$("#math_correct").val(analysis[7]);
});
var today = new Date();
var dd = String(today.getDate()).padStart(2, '0');
var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!
var yyyy = today.getFullYear();
today = mm + '/' + dd + '/' + yyyy;
$("#submit").click(function() {
Email(total_marks);
var line = $("#name").val() + "," + today + "\n";
var filename = String(today) + ".csv";
});
function Email() {
var emailTo = "[email protected]";
var emailSubject = "Marks of " + $("#name").val() + " on " + today;
var emailBody = String("MARKS: " + total_marks);
location.href = "mailto:" + emailTo + "?" +
(emailSubject ? "&subject=" + emailSubject : "") +
(emailBody ? "&body=" + emailBody : "");
}
// 0,1,2,3,4,5,6,7
// SS,MM,II,MM
</script>
<script>
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
</script>
<script type="text/javascript">
window.onload = maxWindow;
function maxWindow() {
window.moveTo(0, 0);
if (document.all) {
top.window.resizeTo(screen.availWidth, screen.availHeight);
}
else if (document.layers || document.getElementById) {
if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth) {
top.window.outerHeight = screen.availHeight;
top.window.outerWidth = screen.availWidth;
}
}
}
</script>
<script>
document.onkeyup = function(e) {
if (e.which == 28) {
e.preventDefault();
} else if (e.ctrlKey && e.shiftKey && e.which == 105 || e.ctrlKey && e.shiftKey && e.which == 73) {
e.preventDefault();
} else if (e.ctrlKey && e.altKey && e.which == 89) {
alert("Ctrl + Alt + Y shortcut combination was pressed");
} else if (e.ctrlKey && e.which == 85) {
e.preventDefault();
}
};
</script>
<script>
! function(e, t) {
"object" == typeof exports && "undefined" != typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define(t) : (e = e || self).hotkeys = t()
}(this, (function() {
"use strict";
function e(t) {
return (e = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
return typeof e
} : function(e) {
return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
})(t)
}
var t = "undefined" != typeof navigator && navigator.userAgent.toLowerCase().indexOf("firefox") > 0;
function n(e, t, n) {
e.addEventListener ? e.addEventListener(t, n, !1) : e.attachEvent && e.attachEvent("on".concat(t), (function() {
n(window.event)
}))
}
function o(e, t) {
for (var n = t.slice(0, t.length - 1), o = 0; o < n.length; o++) n[o] = e[n[o].toLowerCase()];
return n
}
function r(e) {
"string" != typeof e && (e = "");
for (var t = (e = e.replace(/\s/g, "")).split(","), n = t.lastIndexOf(""); n >= 0;) t[n - 1] += ",", t.splice(n, 1), n = t.lastIndexOf("");
return t
}
for (var i = {
backspace: 8,
tab: 9,
clear: 12,
enter: 13,
return: 13,
esc: 27,
escape: 27,
space: 32,
left: 37,
up: 38,
right: 39,
down: 40,
del: 46,
delete: 46,
ins: 45,
insert: 45,
home: 36,
end: 35,
pageup: 33,
pagedown: 34,
capslock: 20,
"⇪": 20,
",": 188,
".": 190,
"/": 191,
"`": 192,
"-": t ? 173 : 189,
"=": t ? 61 : 187,
";": t ? 59 : 186,
"'": 222,
"[": 219,
"]": 221,
"\\": 220
}, f = {
"⇧": 16,
shift: 16,
"⌥": 18,
alt: 18,
option: 18,
"⌃": 17,
ctrl: 17,
control: 17,
"⌘": 91,
cmd: 91,
command: 91
}, c = {
16: "shiftKey",
18: "altKey",
17: "ctrlKey",
91: "metaKey",
shiftKey: 16,
ctrlKey: 17,
altKey: 18,
metaKey: 91
}, a = {
16: !1,
18: !1,
17: !1,
91: !1
}, l = {}, s = 1; s < 20; s++) i["f".concat(s)] = 111 + s;
var p = [],
y = "all",
u = [],
d = function(e) {
return i[e.toLowerCase()] || f[e.toLowerCase()] || e.toUpperCase().charCodeAt(0)
};
function h(e) {
y = e || "all"
}
function v() {
return y || "all"
}
var g = function(e) {
var t = e.key,
n = e.scope,
i = e.method,
c = e.splitKey,
a = void 0 === c ? "+" : c;
r(t).forEach((function(e) {
var t = e.split(a),
r = t.length,
c = t[r - 1],
s = "*" === c ? "*" : d(c);
if (l[s]) {
n || (n = v());
var p = r > 1 ? o(f, t) : [];
l[s] = l[s].map((function(e) {
return (!i || e.method === i) && e.scope === n && function(e, t) {
for (var n = e.length >= t.length ? e : t, o = e.length >= t.length ? t : e, r = !0, i = 0; i < n.length; i++) - 1 === o.indexOf(n[i]) && (r = !1);
return r
}(e.mods, p) ? {} : e
}))
}
}))
};
function w(e, t, n) {
var o;
if (t.scope === n || "all" === t.scope) {
for (var r in o = t.mods.length > 0, a) Object.prototype.hasOwnProperty.call(a, r) && (!a[r] && t.mods.indexOf(+r) > -1 || a[r] && -1 === t.mods.indexOf(+r)) && (o = !1);
(0 !== t.mods.length || a[16] || a[18] || a[17] || a[91]) && !o && "*" !== t.shortcut || !1 === t.method(e, t) && (e.preventDefault ? e.preventDefault() : e.returnValue = !1, e.stopPropagation && e.stopPropagation(), e.cancelBubble && (e.cancelBubble = !0))
}
}
function k(e) {
var t = l["*"],
n = e.keyCode || e.which || e.charCode;
if (m.filter.call(this, e)) {
if (93 !== n && 224 !== n || (n = 91), -1 === p.indexOf(n) && 229 !== n && p.push(n), ["ctrlKey", "altKey", "shiftKey", "metaKey"].forEach((function(t) {
var n = c[t];
e[t] && -1 === p.indexOf(n) ? p.push(n) : !e[t] && p.indexOf(n) > -1 && p.splice(p.indexOf(n), 1)
})), n in a) {
for (var o in a[n] = !0, f) f[o] === n && (m[o] = !0);
if (!t) return
}
for (var r in a) Object.prototype.hasOwnProperty.call(a, r) && (a[r] = e[c[r]]);
var i = v();
if (t)
for (var s = 0; s < t.length; s++) t[s].scope === i && ("keydown" === e.type && t[s].keydown || "keyup" === e.type && t[s].keyup) && w(e, t[s], i);
if (n in l)
for (var y = 0; y < l[n].length; y++)
if (("keydown" === e.type && l[n][y].keydown || "keyup" === e.type && l[n][y].keyup) && l[n][y].key) {
for (var u = l[n][y], h = u.splitKey, g = u.key.split(h), k = [], b = 0; b < g.length; b++) k.push(d(g[b]));
k.sort().join("") === p.sort().join("") && w(e, u, i)
}
}
}
function m(e, t, i) {
p = [];
var c = r(e),
s = [],
y = "all",
h = document,
v = 0,
g = !1,
w = !0,
b = "+";
for (void 0 === i && "function" == typeof t && (i = t), "[object Object]" === Object.prototype.toString.call(t) && (t.scope && (y = t.scope), t.element && (h = t.element), t.keyup && (g = t.keyup), void 0 !== t.keydown && (w = t.keydown), "string" == typeof t.splitKey && (b = t.splitKey)), "string" == typeof t && (y = t); v < c.length; v++) s = [], (e = c[v].split(b)).length > 1 && (s = o(f, e)), (e = "*" === (e = e[e.length - 1]) ? "*" : d(e)) in l || (l[e] = []), l[e].push({
keyup: g,
keydown: w,
scope: y,
mods: s,
shortcut: c[v],
method: i,
key: c[v],
splitKey: b
});
void 0 !== h && ! function(e) {
return u.indexOf(e) > -1
}(h) && window && (u.push(h), n(h, "keydown", (function(e) {
k(e)
})), n(window, "focus", (function() {
p = []
})), n(h, "keyup", (function(e) {
k(e),
function(e) {
var t = e.keyCode || e.which || e.charCode,
n = p.indexOf(t);
if (n >= 0 && p.splice(n, 1), e.key && "meta" === e.key.toLowerCase() && p.splice(0, p.length), 93 !== t && 224 !== t || (t = 91), t in a)
for (var o in a[t] = !1, f) f[o] === t && (m[o] = !1)
}(e)
})))
}
var b = {
setScope: h,
getScope: v,
deleteScope: function(e, t) {
var n, o;
for (var r in e || (e = v()), l)
if (Object.prototype.hasOwnProperty.call(l, r))
for (n = l[r], o = 0; o < n.length;) n[o].scope === e ? n.splice(o, 1) : o++;
v() === e && h(t || "all")
},
getPressedKeyCodes: function() {
return p.slice(0)
},
isPressed: function(e) {
return "string" == typeof e && (e = d(e)), -1 !== p.indexOf(e)
},
filter: function(e) {
var t = e.target || e.srcElement,
n = t.tagName,
o = !0;
return !t.isContentEditable && ("INPUT" !== n && "TEXTAREA" !== n || t.readOnly) || (o = !1), o
},
unbind: function(t) {
if (t) {
if (Array.isArray(t)) t.forEach((function(e) {
e.key && g(e)
}));
else if ("object" === e(t)) t.key && g(t);
else if ("string" == typeof t) {
for (var n = arguments.length, o = new Array(n > 1 ? n - 1 : 0), r = 1; r < n; r++) o[r - 1] = arguments[r];
var i = o[0],
f = o[1];
"function" == typeof i && (f = i, i = ""), g({
key: t,
scope: i,
method: f,
splitKey: "+"
})
}
} else Object.keys(l).forEach((function(e) {
return delete l[e]
}))
}
};
for (var O in b) Object.prototype.hasOwnProperty.call(b, O) && (m[O] = b[O]);
if ("undefined" != typeof window) {
var K = window.hotkeys;
m.noConflict = function(e) {
return e && window.hotkeys === m && (window.hotkeys = K), m
}, window.hotkeys = m
}
return m
}));
</script>
<script>
var mdpUnGrabber = {
"selectAll": "on",
"copy": "on",
"cut": "on",
"paste": "on",
"save": "on",
"viewSource": "on",
"printPage": "on",
"developerTool": "on",
"readerMode": "on",
"rightClick": "on",
"textSelection": "on",
"imageDragging": "on"
};
</script>
<script>
"use strict";
const UnGrabber = function() {
function _ungrabber() {
function init() {
"on" === mdpUnGrabber.selectAll && disable_select_all(), "on" === mdpUnGrabber.copy && disable_copy(), "true" === mdpUnGrabber.cut && disable_cut(), "on" === mdpUnGrabber.paste && disable_paste(), "on" === mdpUnGrabber.save && disable_save(), "on" === mdpUnGrabber.viewSource && disable_view_source(), "on" === mdpUnGrabber.printPage && disable_print_page(), "on" === mdpUnGrabber.developerTool && disable_developer_tool(), "on" === mdpUnGrabber.readerMode && disable_reader_mode(), "on" === mdpUnGrabber.rightClick && disable_right_click(), "on" === mdpUnGrabber.textSelection && disable_text_selection(), "on" === mdpUnGrabber.imageDragging && disable_image_dragging()
}
function disable_select_all() {
disable_key(65)
}
function disable_copy() {