-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
75 lines (73 loc) · 1.83 KB
/
Copy pathindex.html
File metadata and controls
75 lines (73 loc) · 1.83 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<style>
body
{
display: flex;
flex-direction:column;
justify-content: center;
align-items:center;
}
h1
{
color:#e04321;
}
div
{
width:700px;
height:300px;
border:#e04321 2px solid;
padding:20px;
border-radius:6px;
}
button
{
background-color:#e04321;
color:white;
border:0px;
padding:10px 30px;
text-align:center;
}
</style>
</head>
<body>
<h1>Simple Quiz</h1>
<div id="box">
<p>1. Which of the following AI initiatives is being developed in India</p>
<input type="radio" name="q1" value="Jai AI">Jai AI
<input type="radio" name="q1" value="Veda AI">Veda AI
<input type="radio" name="q1" value="Bharath AI">Bharath AI
<input type="radio" name="q1" value="Open AI">Open AI
<br><br>
<p>2. Which company developed the first smartphone</p>
<input type="radio" name="q2" value="IBM">IBM
<input type="radio" name="q2" value="Nokia">Nokia
<input type="radio" name="q2" value="Samsung">Samsung
<input type="radio" name="q2" value="Motorola">Motorola
<br><br>
<p>3. Which is a scripting language?</p>
<input type="radio" name="q3" value="HTML">HTML
<input type="radio" name="q3" value="CSS">CSS
<input type="radio" name="q3" value="Javascript">Javascript
<input type="radio" name="q3" value="Java">Java
</div>
<br>
<button onclick="Calcscore()">Submit</button>
<br>
<h2 id="result"></h2>
<script>
function Calcscore()
{
let score=0;
var qs1 = document.querySelector('input[name="q1"]:checked');
var qs2 = document.querySelector('input[name="q2"]:checked');
var qs3 = document.querySelector('input[name="q3"]:checked');
if(qs1&&qs1.value==="Veda AI") score++;
if(qs2&&qs2.value==="Samsung") score++;
if(qs3&&qs3.value==="Javascript") score++;
document.getElementById("result").innerHTML="Your score : "+score+"/3";
}
</script>
</body>
</html>