-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
349 lines (292 loc) · 13.7 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="keywords" content="HTML, CSS, JavaScript">
<meta name="Quiz app" content="Free Web tutorials for HTML and CSS and javascript">
<meta name="author" content="Mohamed Mahmoud">
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport" />
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
<title>5 Minutes Quiz</title>
<style>
* {
box-sizing: border-box;
}
body {
background-color: lightblue;
font-family: Verdana, Helvetica, sans-serif;
}
.glow {
font-size: 3vmax;
color: #fff;
text-align: center;
-webkit-animation: glow 1s ease-in-out infinite alternate;
-moz-animation: glow 1s ease-in-out infinite alternate;
animation: glow 1s ease-in-out infinite alternate;
}
@-webkit-keyframes glow {
from {
text-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #0400ff, 0 0 40px #0400ff, 0 0 50px #0400ff;
}
to {
text-shadow: 0 0 20px #fff, 0 0 30px #8ef8a0, 0 0 40px #00ff2a, 0 0 50px #00ff2a, 0 0 60px #00ff2a;
}
}
#main {
width: 80%;
max-width: 950px;
border: 1px gray solid;
margin: auto;
padding: 10px;
background-color: white;
border-radius: 10px;
font-size: .9em;
}
#header {
border: 5px solid lightgreen;
padding: 5px;
height: auto;
background-image: url("code.jpg");
opacity: 90%;
color: #00ff2a;
border-top-left-radius: 40px;
border-top-right-radius: 2px;
border-bottom-left-radius: 2px;
border-bottom-right-radius: 40px;
}
.spec {
font-size: 2.5vmax;
color: yellowgreen;
text-align: center;
}
.quesions {
clear: both;
background-color: lightgreen;
padding: 5px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
font-size: 1.2em;
}
label {
display: block;
background-color: white;
margin: 10px;
font-size: 1.2em;
}
input {
width: 30px;
margin-left: 20px;
}
button {
width: 100px;
margin-top: 20px;
}
button:hover {
background-color: lightgreen;
}
button:hover>span {
color: rgb(0, 4, 250);
}
button>span:hover {
color: red;
}
footer {
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: top;
text-align: center;
background: rgb(75, 75, 75);
color: rgb(75, 189, 30);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
}
footer>ul {
display: inline-block;
}
footer>ul>li {
display: inline-block;
padding: 10px;
}
footer>ul>li>a {
color: rgb(75, 189, 30);
}
.image {
border-radius: 50%;
border: 2px solid lightgreen;
width: 12vw;
padding: 2px;
}
.imgcontainer {
/* set display position here */
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: top;
background: rgb(75, 75, 75);
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
margin: 5px;
border: 3px solid gold;
}
.imgbox {
width: auto;
height: auto;
text-align: center;
padding: 1%;
}
a {
font-size: .8em;
text-align: center;
color: rgb(75, 189, 30);
}
h1 {
text-align: center;
font-size: 2.5vmax;
}
</style>
</head>
<body>
<div id="main">
<!-- open main div -->
<div id="header">
<!-- open header div -->
<h1><span class="glow">5</span> Minutes Quiz</h1>
<h2 class="spec">Web Development Challenge Track</h2>
</div><!-- close header div -->
<div class="imgcontainer">
<div class="imgbox"> <img src="CodeActually.jpg" alt="CodeActually photo" class="image">
<div style="display:inline-block;">
<a href="https://codeactually.com/interactivequiz.html" target="_blank">Original code: CodeActually</a>
</div>
</div>
<div class="imgbox"> <img src="salah.jpg" alt="tutor photo" class="image">
<div style="display:inline-block;">
<a href="https://nfpdiscussions.udacity.com/t/5-minutes-quiz-challenge-track/14205" target="_blank">Quiz By: Eng.Salah Selim</a>
</div>
</div>
<div class="imgbox"> <img src="mma.jpg" alt="student photo" class="image">
<div style="display:inline-block;">
<a href="https://www.linkedin.com/in/mohamed-mahmoud-303713a" target="_blank">Code Edited By: Mohamed Mahmoud</a>
</div>
</div>
<div class="imgbox"> <img src="mmagithub.gif" alt="GitCode" class="image">
<div style="display:inline-block;">
<a href="https://github.com/moh2661978/quizzcode" target="_blank">Edited Code@GitHub</a>
</div>
</div>
</div>
<form id="form1" action=" ">
<h2 class="quesions">Q1-Which of the following selector selects all paragraph elements whose lang attribute has a value of exactly “fr”?</h2>
<label for="var_string"><input type="radio" name="variable" value="0" id="var_string" />p[lang]</label>
<label for="var_join"><input type="radio" name="variable" value="25" id="var_join" />p[lang=“fr”]</label>
<label for="var_info"><input type="radio" name="variable" value="0" id="var_info" />p[lang~=“fr”]</label>
<label for="var_condition"><input type="radio" name="variable" value="0" id="var_condition" />p[lang|=“fr”]</label>
<h2 class="quesions">Q2-Which of the following property is used to control the scrolling of an image in the background?</h2>
<label for="sub_string"><input type="radio" name="sub" value="25" id="sub_string" />background-attachment</label>
<label for="sub_join"><input type="radio" name="sub" value="0" id="sub_join" />background</label>
<label for="sub_info"><input type="radio" name="sub" value="0" id="sub_info" />background-repeat</label>
<label for="sub_condition"><input type="radio" name="sub" value="0" id="sub_condition" />background-position</label>
<h2 class="quesions">Q3-Which of the following property is used to add or subtract space between the words of a sentence?</h2>
<label for="cat_string"><input type="radio" name="con" value="0" id="cat_string" />color</label>
<label for="cat_join"><input type="radio" name="con" value="0" id="cat_join" />direction</label>
<label for="cat_info"><input type="radio" name="con" value="0" id="cat_info" />letter-spacing</label>
<label for="cat_condition"><input type="radio" name="con" value="25" id="cat_condition" />word-spacing</label>
<h2 class="quesions">Q4-Which of the following property of a anchor element signifies unvisited hyperlinks?</h2>
<label for="if_string"><input type="radio" name="ifstate" value="25" id="if_string" />link</label>
<label for="if_join"><input type="radio" name="ifstate" value="0" id="if_join" />visited</label>
<label for="if_info"><input type="radio" name="ifstate" value="0" id="if_info" />hover</label>
<label for="if_condition"><input type="radio" name="ifstate" value="0" id="if_condition" />active</label>
<h2 class="quesions">Q5-Which of the following property of a table element specifies whether the browser should control the appearance of the adjacent borders that touch each other or whether each cell should maintain its style?</h2>
<label for="var_string2"><input type="radio" name="variable2" value="25" id="var_string2" />border-collapse</label>
<label for="var_join2"><input type="radio" name="variable2" value="0" id="var_join2" />border-spacing</label>
<label for="var_info2"><input type="radio" name="variable2" value="0" id="var_info2" />caption-side</label>
<label for="var_condition2"><input type="radio" name="variable2" value="0" id="var_condition2" />empty-cells</label>
<h2 class="quesions">Q6-Which of the following property changes the width of top border?</h2>
<label for="sub_string2"><input type="radio" name="sub2" value="0" id="sub_string2" />border-bottom-width</label>
<label for="sub_join2"><input type="radio" name="sub2" value="25" id="sub_join2" />border-top-width</label>
<label for="sub_info2"><input type="radio" name="sub2" value="0" id="sub_info2" />border-left-width</label>
<label for="sub_condition2"><input type="radio" name="sub2" value="0" id="sub_condition2" />border-right-width</label>
<h2 class="quesions">Q7-Which of the following property specifies an image for the marker rather than a bullet point or number?</h2>
<label for="cat_string2"><input type="radio" name="con2" value="0" id="cat_string2" />list-style-type</label>
<label for="cat_join2"><input type="radio" name="con2" value="0" id="cat_join2" />list-style-position</label>
<label for="cat_info2"><input type="radio" name="con2" value="25" id="cat_info2" />list-style-image</label>
<label for="cat_condition2"><input type="radio" name="con2" value="0" id="cat_condition2" />list-style</label>
<h2 class="quesions">Q8-Which of the following value of cursor shows it as an arrow?</h2>
<label for="if_string2"><input type="radio" name="ifstate2" value="0" id="if_string2" />crosshair</label>
<label for="if_join2"><input type="radio" name="ifstate2" value="25" id="if_join2" />default</label>
<label for="if_info2"><input type="radio" name="ifstate2" value="0" id="if_info2" />pointer</label>
<label for="if_condition2"><input type="radio" name="ifstate2" value="0" id="if_condition2" />move</label>
<button type="submit" value="Submit"><span>Submit</span></button>
</form>
<p>Your grade is: <span id="grade">__</span></p>
<p id="grade2"></p>
<script>
document.getElementById("form1").onsubmit = function() {
variable = parseInt(document.querySelector('input[name = "variable"]:checked').value);
sub = parseInt(document.querySelector('input[name = "sub"]:checked').value);
con = parseInt(document.querySelector('input[name = "con"]:checked').value);
ifstate = parseInt(document.querySelector('input[name = "ifstate"]:checked').value);
variable2 = parseInt(document.querySelector('input[name = "variable2"]:checked').value);
sub2 = parseInt(document.querySelector('input[name = "sub2"]:checked').value);
con2 = parseInt(document.querySelector('input[name = "con2"]:checked').value);
ifstate2 = parseInt(document.querySelector('input[name = "ifstate2"]:checked').value);
result = variable + sub + con + ifstate + variable2 + sub2 + con2 + ifstate2;
document.getElementById("grade").innerHTML = result;
if (result == 0) {
result2 = "I don't think you studied.<br /><img src='none.jpg' width='300' />"
};
if (result == 25) {
result2 = "I don't think you studied.<br /><img src='none.jpg' width='300' />"
};
if (result == 50) {
result2 = "You need to spend more time. Try again.<br /><img src='poor.jpg' width='300' />"
};
if (result == 75) {
result2 = "You need to spend more time. Try again.<br /><img src='poor.jpg' width='300' />"
};
if (result == 100) {
result2 = "I think you could do better. Try again.<br /><img src='avg.jpg' width='300' />"
};
if (result == 125) {
result2 = "I think you could do better. Try again.<br /><img src='avg.jpg' width='300' />"
};
if (result == 150) {
result2 = "So close. Try again.<br /><img src='above.jpg' width='300' />"
};
if (result == 175) {
result2 = "So close. Try again.<br /><img src='above.jpg' width='300' />"
};
if (result == 200) {
result2 = "You're a JavaScript pro!<br /><img src='excellent.jpg' width='300' />"
};
document.getElementById("grade2").innerHTML = result2;
return false; // required to not refresh the page; just leave this here
} //this ends the submit function
</script>
<footer>
<ul>
<li>©2020EgyptFWD <a href="https://egfwd.com" target="_blank"><img src="footer_logo.png" alt="fwd" style="float:inline-start;vertical-align:middle;width:12em;"></a></li>
<li><a href="https://egfwd.com/about/" target="_blank">About</a></li>
<li><a href="https://egfwd.com/web/" target="_blank">Web Specialization</a></li>
<li><a href="https://www.facebook.com/groups/egyptfwd/" target="_blank">Facebook</a></li>
<li><a href="https://egfwd.com/faqs/" target="_blank">FAQ</a></li>
<li><a href="https://egfwd.com/enroll-now/" target="_blank">ENROLL NOW</a></li>
</ul>
</footer>
</div>
</body>
</html>