-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ai-quiz.html
89 lines (82 loc) · 3.31 KB
/
ai-quiz.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Topics Quiz Game</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f2f2f2;
padding: 50px;
}
.quiz-container {
background-color: #fff;
border-radius: 5px;
padding: 20px;
max-width: 600px;
margin: 0 auto;
}
.question {
font-size: 1.2em;
margin-bottom: 10px;
}
label {
display: block;
margin-bottom: 5px;
}
#result {
font-size: 1.5em;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="quiz-container">
<h1>AI Topics Quiz Game</h1>
<form id="quiz-form">
<div class="question">
<p>1. What is a key challenge in developing adaptable AI systems?</p>
<label><input type="radio" name="question1" value="a"> A. Reducing computational power requirements</label>
<label><input type="radio" name="question1" value="b"> B. Improving generalization and adaptability</label>
<label><input type="radio" name="question1" value="c"> C. Increasing the size of training datasets</label>
</div>
<div class="question">
<p>2. Which ethical consideration relates to AI systems potentially perpetuating existing societal biases?</p>
<label><input type="radio" name="question2" value="a"> A. Bias and fairness</label>
<label><input type="radio" name="question2" value="b"> B. Privacy and surveillance</label>
<label><input type="radio" name="question2" value="c"> C. Job displacement</label>
</div>
<div class="question">
<p>3. What is one potential risk of AI-enabled surveillance?</p>
<label><input type="radio" name="question3" value="a"> A. Infringing on privacy and civil liberties</label>
<label><input type="radio" name="question3" value="b"> B. Consuming excessive amounts of electricity</label>
<label><input type="radio" name="question3" value="c"> C. Creating unrealistic expectations for AI capabilities</label>
</div>
<input type="submit" value="Submit">
</form>
<div id="result"></div>
</div>
<script>
const quizForm = document.getElementById('quiz-form');
const resultDiv = document.getElementById('result');
quizForm.addEventListener('submit', (e) => {
e.preventDefault();
const correctAnswers = ['b', 'a', 'a'];
let score = 0;
const userAnswers = [
quizForm.question1.value,
quizForm.question2.value,
quizForm.question3.value
];
userAnswers.forEach((answer, index) => {
if (answer === correctAnswers[index]) {
score++;
}
});
const resultMessage = `You scored ${score} out of ${correctAnswers.length}!`;
resultDiv.textContent = resultMessage;
});
</script>
</body>
</html>