-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindextest15.js
117 lines (87 loc) · 3.09 KB
/
indextest15.js
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
let c=0,p=0;
document.addEventListener("DOMContentLoaded", function () {
if(document.getElementsByClassName("MCorrect")){
const btncount=document.getElementsByClassName("MCorrect")
const btncounter=Array.from(btncount);
btncounter.forEach((btncounter, index) => {
btncounter.addEventListener("click", () => {
// Check if the radio button has not been clicked before
if (!btncounter.disabled) {
// Increment the click count for this radio button
c++;
p++;
console.log(c,k,p)
// Disable the radio button to prevent further clicks
btncounter.disabled = true;
SubmitTest(c,k)
}
});
console.log("Hello");
});}
if(document.getElementsByClassName("CheckerW")){
const btncounti=document.getElementsByClassName("CheckerW")
const btncounteri=Array.from(btncounti);
btncounteri.forEach((btncounteri, index) => {
btncounteri.addEventListener("click", () => {
if (!btncounteri.disabled){
p++;
console.log(c,k,p);
btncounteri.disabled = true;
SubmitTest(c,k,p);
}
});
});
}
let k=0;
const btncountMod=document.getElementsByClassName("GCorrect")
const btncounterMod=Array.from(btncountMod);
btncounterMod.forEach((btncounter, index) => {
btncounter.addEventListener("click", () => {
// Check if the radio button has not been clicked before
if (!btncounter.disabled) {
// Increment the click count for this radio button
k++;
p++;
console.log(c,k,p)
// Disable the radio button to prevent further clicks
btncounter.disabled = true;
SubmitTest(c,k,p)
}
});
console.log("Hello");
});
let t=0;
const btncountModL=document.getElementsByClassName("Correct")
const btncounterModL=Array.from(btncountModL);
btncounterModL.forEach((btncounterModL, index) => {
btncounterModL.addEventListener("click", () => {
// Check if the radio button has not been clicked before
if (!btncounterModL.disabled) {
// Increment the click count for this radio button
t++;
p++;
console.log(c,k,p)
// Disable the radio button to prevent further clicks
btncounterModL.disabled = true;
SubmitTest(c,k,p)
}
});
console.log("Hello");
});
function SubmitTest(c,k,p){
let Submit=document.getElementById("Test");
Submit.addEventListener("click", () => {
if(c<k && p==12){
console.log("Weak In Maths");
window.location.href="math15.html";
}
if(k<c && p==12){
console.log("Weak In English");
window.location.href="english15.html";
}
});
}
$('#modal-body').on('show.bs.modal', function (e) {
SubmitTest(c,k);
});
});