<!
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bleach Anime Quiz</title>
<style>
body {
font-family: Arial, sans-serif;
}
.quiz-container {
max-width: 600px;
margin: 20px auto;
padding: 20px;
border: 1px solid #ccc;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.question {
margin-bottom: 15px;
}
.options {
margin-left: 20px;
}
img {
max-width: 100%;
height: auto;
margin-top: 10px;
}
#result {
margin-top: 20px;
font-weight: bold;
}
</style>
</head>
<body>
<div class="quiz-container">
<h1>Bleach Anime Quiz</h1>
<form id="quiz-form">
<div class="question">
<p>1. What is the main character's name in Bleach?</p>
<div class="options">
<label><input type="radio" name="q1" value="a"> Ichigo Kurosaki</label>
<label><input type="radio" name="q1" value="b"> Naruto Uzumaki</label>
<label><input type="radio" name="q1" value="c"> Monkey D. Luffy</label>
</div>
</div>
<!-- Repeat the above block for each question -->
<!-- Example Question -->
<div class="question">
<p>2. What is the name of Ichigo's sword?</p>
<div class="options">
<label><input type="radio" name="q2" value="a"> Zanpakuto</label>
<label><input type="radio" name="q2" value="b"> Excalibur</label>
<label><input type="radio" name="q2" value="c"> Nunchaku</label>
</div>
<img src="image_url_for_question_2.jpg" alt="Question 2 Image">
</div>
<!-- Repeat the above block for each question -->
<input type="button" value="Submit" onclick="calculateScore()">
</form>
<div id="result"></div>
</div>
<script>
function calculateScore() {
let score = 0;
// Replace 'correct_answer' with the correct answer for each question
const answers = {
q1: 'a',
q2: 'a',
// Add more questions and answers as needed
};
// Calculate the score
for (const question in answers) {
const selectedAnswer = document.querySelector(`input[name=$
{question}]:checked`);
if (selectedAnswer) {
const userAnswer = selectedAnswer.value;
if (userAnswer === answers[question]) {
score++;
}
}
}
// Display the result
document.getElementById('result').innerHTML = `Your total score is:
${score}/10`;
}
</script>
</body>
</html>