-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
53 lines (51 loc) · 2.08 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>DuTi</title>
</head>
<body>
<h1>QUIZ </h1>
<P>Kur eshte pavarsia e shqiperise</P>
<input type="radio" name="question1" value="1">1910
<input type="radio" name="question1" value="2">1920
<input type="radio" name="question1" value="3">1912
<br><br>
<P>si eshte emri i verter i YEPMk</P>
<input type="radio" name="question2" value="1">Youth Empowerment Platform
<input type="radio" name="question2" value="2">Your Entertaiment Platform
<input type="radio" name="question2" value="3">Youth East Platformn
<br><br>
<button type="button" onclick="tfunction()">Results</button>
<div id="results"></div>
<script>
function tfunction()
{
var truequestion = 0; // pergjigjet fillestare te sakta
var falsequestion = 0; // pergjigjet fillestare te gabuara
let fquestion = document.querySelector('input[name="question1"]:checked').value; //marja e vleres per pyetjen e pare
var lquestion = document.querySelector('input[name="question2"]:checked').value; // marja e vleres per pyetjen e dyte
if(fquestion == "3") // kontrollimi i pergjigjes ne qoftese eshte e sakte
{
truequestion++; // nese pergjigja e pare eshte e sakte
}
else
{
falsequestion++; // nese pergjigja e pare eshte e gabuar
}
if (lquestion == "1") // kontrollimi i pergjigjes se dyte
{
truequestion++; // nese pergjigja e dyte eshte esakte
}
else
{
falsequestion++; // nese pergjigja e dyte eshte e gabuar
}
// printimi i rezultatit
document.getElementById("results").innerHTML = "Correct answers :" + truequestion + " Incorrect answers: "+ falsequestion;
}
</script>
</body>
</html>