-
Notifications
You must be signed in to change notification settings - Fork 0
/
mcq.js
115 lines (70 loc) · 4.13 KB
/
mcq.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
var n = 1;
function change() {
n++;
var items = document.getElementsByClassName("one"); for (var i = 0; i < items.length; i++) { items[i].innerHTML = n; }
var code = document.getElementById("html");
if (code.style.display === "block") {
code.style.display = "none";
}
var next = document.getElementById("nextbutton");
if (next.style.display === "block") {
next.style.display = "none";
}
}
function showhtml() {
var code = document.getElementById("html");
if (code.style.display === "none") {
code.style.display = "block";
}
var next = document.getElementById("nextbutton");
if (next.style.display === "none") {
next.style.display = "block";
}
var ques = document.getElementById("question").value;
document.getElementById("questioncode").innerHTML = ques;
var opa = document.getElementById("firstoption").value;
document.getElementById("optionAcode").innerHTML = opa;
var opb = document.getElementById("secondoption").value;
document.getElementById("optionBcode").innerHTML = opb;
var opc = document.getElementById("thirdoption").value;
document.getElementById("optionCcode").innerHTML = opc;
var opd = document.getElementById("fourthoption").value;
document.getElementById("optionDcode").innerHTML = opd;
var opA = document.getElementById("Aiscorrect");
if (opA.checked == true) {
document.getElementById("1Acorrectbox").innerHTML = n + "Abox";
document.getElementById("1Bcorrectbox").innerHTML = n + "Abox";
document.getElementById("1Ccorrectbox").innerHTML = n + "Abox";
document.getElementById("1Dcorrectbox").innerHTML = n + "Abox";
}
var opB = document.getElementById("Biscorrect");
if (opB.checked == true) {
document.getElementById("1Acorrectbox").innerHTML = n + "Bbox";
document.getElementById("1Bcorrectbox").innerHTML = n + "Bbox";
document.getElementById("1Ccorrectbox").innerHTML = n + "Bbox";
document.getElementById("1Dcorrectbox").innerHTML = n + "Bbox";
}
var opC = document.getElementById("Ciscorrect");
if (opC.checked == true) {
document.getElementById("1Acorrectbox").innerHTML = n + "Cbox";
document.getElementById("1Bcorrectbox").innerHTML = n + "Cbox";
document.getElementById("1Ccorrectbox").innerHTML = n + "Cbox";
document.getElementById("1Dcorrectbox").innerHTML = n + "Cbox";
}
var opD = document.getElementById("Discorrect");
if (opD.checked == true) {
document.getElementById("1Acorrectbox").innerHTML = n + "Dbox";
document.getElementById("1Bcorrectbox").innerHTML = n + "Dbox";
document.getElementById("1Ccorrectbox").innerHTML = n + "Dbox";
document.getElementById("1Dcorrectbox").innerHTML = n + "Dbox";
}
var correctexpinput = document.getElementById("1correctexp").value;
document.getElementById("1correctexpcode").innerHTML = correctexpinput;
var wrongexpinput = document.getElementById("1wrongexp").value;
document.getElementById("1wrongexpcode").innerHTML = wrongexpinput;
if (opA.checked == true) { document.getElementById("1Aexp").innerHTML = n + "correctexp"; document.getElementById("1Bexp").innerHTML = n + "wrongexp"; document.getElementById("1Cexp").innerHTML = n + "wrongexp"; document.getElementById("1Dexp").innerHTML = n + "wrongexp"; }
if (opB.checked == true) { document.getElementById("1Aexp").innerHTML = n + "wrongexp"; document.getElementById("1Bexp").innerHTML = n + "correctexp"; document.getElementById("1Cexp").innerHTML = n + "wrongexp"; document.getElementById("1Dexp").innerHTML = n + "wrongexp"; }
if (opC.checked == true) { document.getElementById("1Aexp").innerHTML = n + "wrongexp"; document.getElementById("1Bexp").innerHTML = n + "wrongexp"; document.getElementById("1Cexp").innerHTML = n + "correctexp"; document.getElementById("1Dexp").innerHTML = n + "wrongexp"; }
if (opD.checked == true) { document.getElementById("1Aexp").innerHTML = n + "wrongexp"; document.getElementById("1Bexp").innerHTML = n + "wrongexp"; document.getElementById("1Cexp").innerHTML = n + "wrongexp"; document.getElementById("1Dexp").innerHTML = n + "correctexp"; }
return false;
}