-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
243 lines (159 loc) · 6.97 KB
/
index.html
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
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MCQ generator</title>
<link rel="stylesheet" href="style.css">
<script src="mcq.js" charset="utf-8" language="javascript" type="text/javascript" defer>
</script>
</head>
<body>
<h1>MCQ Generator</h1>
<p> You can use the question generator given below to make your website more
interactive.
<br /> A demo is given below :
</p>
<!-- Demo -->
<div class="">
<p> Javascript is an _______ language? </p>
<div class="border-box">
<div id="1Abox"> <input id="1Ainput" name="option" type=radio
onclick='show("1Ainput","1Abox", "1Abox","1correctexp")'> <label for="1Ainput"> Object-Oriented
</label> </div>
<div id="1Bbox"> <input id="1Binput" name="option" type=radio
onclick='show("1Binput", "1Bbox", "1Abox","1wrongexp")'> <label for="1Binput"> Object
Based </label> </div>
<div id="1Cbox"> <input id="1Cinput" name="option" type=radio
onclick='show("1Cinput","1Cbox","1Abox","1wrongexp")'> <label for="1Cinput"> Procedural
</label> </div>
<div id="1Dbox"> <input id="1Dinput" name="option" type=radio
onclick='show("1Dinput","1Dbox","1Abox","1wrongexp")'> <label for="1Dinput">None of the
above </label> </div>
</div>
<div id="1correctexp" style="display:none; "> Correct </div>
<div id="1wrongexp" style="display:none; "> Wrong </div>
<script type="text/javascript" language="javascript"
charset="utf-8" src="demo.js" defer></script>
<!-- Demo -->
<h2> How to do this?</h2>
<p> It's very simple.
<br />Just fill in the fields given below ,then an <b>html</b> code will be generated.You can copy and paste that
in your blog
</p>
<p> If you are using <b>wordpress</b>, switch to code editor(by clicking the three dots on above right) before
pasting the code.
<br />
if you are using <b>blogger</b>, switch to html-view (by clicking the pencil icon on the above left corner) before
pasting the code.
</p>
<h2 id="questioncreator"> Question no.<span class="one">1</span> </h2>
<p>
<input id="question" type="text" placeholder="Type your question here..." />
</p>
<p><label>A)</label>
<input id="firstoption" type="text" placeholder="Option A" />
<label> <input id="Aiscorrect" name="option" type="radio" />correct</label>
</p>
<p><label>B)</label>
<input id="secondoption" type="text" placeholder="Option B" />
<label> <input id="Biscorrect" name="option" type="radio" />correct </label>
</p>
<p><label>C)</label>
<input id="thirdoption" type="text" placeholder="Option C" />
<label> <input id="Ciscorrect" name="option" type="radio" />correct </label>
</p>
<p><label>D)</label>
<input id="fourthoption" type="text" placeholder="Option D" />
<label> <input id="Discorrect" name="option" type="radio" />correct</label>
</p>
<p><label> Text to show if the user selects the correct answer(Optional):</label>
<input id="1correctexp" type="text" />
</p>
<p><label> Text to show if the user selects the wrong answer(Optional):</label>
<input id="1wrongexp" type="text" />
</p>
<button onclick="showhtml()" class="btn"> Done </button>
<hr />
<div id="html" style="display: none;">
<p> Copy and paste this html code to your blog:</p>
<div class="scroll" id="htmloutput">
<style>
.border-box{
width: fit-content;
}
.border-box div {
background:white;
font-size:20px;
padding:10px;
border: 2px solid black;
border-radius: 10px;
margin-bottom: 5px;
width: 100%;
}
</style>
<div style="background:white;">
<p><span id="questioncode"></span> </p>
<div class="border-box">
<div id="<span class="one">1</span>Abox">
<input id="<span class="one">1</span>Ainput" name="option" type=radio onclick='show("<span
class="one">1</span>Ainput","<span class="one">1</span>Abox", "<span id="1Acorrectbox"></span>","<span
id="1Aexp"></span>")'>
<label for="<span class="one">1</span>Ainput">
<span id="optionAcode"> </span>
</label>
</div>
<div id="<span class="one">1</span>Bbox">
<input id="<span class="one">1</span>Binput" name="option" type=radio onclick='show("<span
class="one">1</span>Binput", "<span class="one">1</span>Bbox", "<span id="1Bcorrectbox"></span>","<span
id="1Bexp"></span>")' >
<label for="<span class="one">1</span>Binput">
<span id="optionBcode"> </span>
</label>
</div>
<div id="<span class="one">1</span>Cbox">
<input id="<span class="one">1</span>Cinput" name="option" type=radio onclick='show("<span
class="one">1</span>Cinput","<span class="one">1</span>Cbox","<span id="1Ccorrectbox"></span>","<span
id="1Cexp"></span>")'>
<label for="<span class="one">1</span>Cinput">
<span id="optionCcode"></span>
</label>
</div>
<div id="<span class="one">1</span>Dbox">
<input id="<span class="one">1</span>Dinput" name="option" type=radio onclick='show("<span
class="one">1</span>Dinput","<span class="one">1</span>Dbox","<span id="1Dcorrectbox"></span>","<span
id="1Dexp"></span>")'>
<label for="<span class="one">1</span>Dinput"><span id="optionDcode"> </span> </label>
</div>
</div>
<div id="<span class="one">1</span>correctexp" >
<span id="1correctexpcode"> </span>
</div>
<div id="<span class="one">1</span>wrongexp" >
<span id="1wrongexpcode"> </span>
</div>
<script type="text/javascript" language="javascript" charset="utf-8">
function show(input,Wbox,Cbox,exp)
{
var answer = document.getElementById(input);
var x = document.getElementById(exp);
if(answer.checked==true)
{ document.getElementById(Wbox).style.backgroundColor="#FAA0A0";
document.getElementById(Cbox).style.backgroundColor="#b0f8b0";}
if (x.style.display==="none")
{
x.style.display = "block";}
}
</script>
</div>
</div>
<a href="#questioncreator">
<button id="nextbutton" onclick="change()" style="display: none;" class="btn">
Add another Question
</button>
</a>
</div>
<div style="text-align: right;"> <a href="#top">
Back to top</a></div>
<style>
</style>
</body>
</html>