ch5 part8
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Science Quiz – Circulation</title>
<style>
body {
font-family: Arial, sans-serif;
background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
display: flex;
justify-content: center;
align-items: flex-start;
padding: 30px;
min-height: 100vh;
}
.quiz-container {
background: #fff;
padding: 25px;
border-radius: 12px;
box-shadow: 0 4px 10px rgba(0,0,0,0.2);
width: 90%;
max-width: 800px;
}
h2 { text-align: center; color: #1e3c72; }
.question { font-weight: bold; margin: 10px 0; }
.options label {
display: block;
margin: 8px 0;
padding: 10px;
border-radius: 6px;
border: 1px solid #ccc;
cursor: pointer;
transition: 0.3s;
}
.options label:hover { background: #f0f0f0; }
.correct {
background-color: #c8f7c5 !important;
border-color: #28a745 !important;
}
.wrong {
background-color: #f8d7da !important;
border-color: #dc3545 !important;
}
.explanation {
background: #e9ecef;
padding: 10px;
margin-top: 10px;
border-left: 5px solid #2a5298;
display: none;
}
.controls { text-align: center; margin-top: 15px; }
button {
background-color: #2a5298;
color: white;
border: none;
padding: 10px 20px;
border-radius: 6px;
cursor: pointer;
margin: 5px;
}
button:hover { background-color: #1e3c72; }
#scoreboard {
margin-top: 25px;
background: #eef3f7;
padding: 15px;
border-radius: 8px;
}
#scoreboard h3 { text-align: center; }
ol { padding-left: 20px; }
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠 Science Quiz – Human Heart & Blood Circulation</h2>
<div id="nameSection">
<p><strong>Enter your name to start:</strong></p>
<input type="text" id="userName" placeholder="Your Name">
<button onclick="startQuiz()">Start Quiz</button>
</div>
<div id="quizSection" style="display:none;">
<div id="questionContainer"></div>
<div class="controls">
<button onclick="prevQuestion()" id="prevBtn">Previous</button>
<button onclick="nextQuestion()" id="nextBtn">Next</button>
<button onclick="submitQuiz()" id="submitBtn" style="display:none;">Submit</button>
</div>
<div id="result" style="text-align:center; margin-top:20px;"></div>
<div id="scoreboard">
<h3>🏆 Scoreboard</h3>
<ol id="scoreList"></ol>
</div>
</div>
</div>
<script>
const questions = [
{
question: "1. Heart ke right aur left side ka separation oxygenated aur deoxygenated blood ko kya hone se rokta hai?",
options: [
"A. Blood clotting",
"B. Blood mixing",
"C. Blood filtration",
"D. Blood pressure"
],
correct: 1,
explanation: "Right aur left side ka separation <b>oxygenated aur deoxygenated blood ko mix hone se rokta hai</b>, jisse body ko oxygen ki efficient supply milti hai."
},
{
question: "2. Heart ke right aur left sides ka complete separation kin animals mein especially useful hai?",
options: [
"A. Fish aur amphibians",
"B. Birds aur mammals",
"C. Sirf reptiles",
"D. Sirf amphibians"
],
correct: 1,
explanation: "Birds aur mammals ki <b>energy requirements high</b> hoti hain aur ye body temperature maintain karne ke liye continuously energy use karte hain. Isliye oxygen ki efficient supply important hai."
},
{
question: "3. Amphibians aur many reptiles mein generally kitne chambers ka heart hota hai?",
options: [
"A. Two-chambered",
"B. Three-chambered",
"C. Four-chambered",
"D. Five-chambered"
],
correct: 1,
explanation: "Amphibians aur many reptiles ke <b>three-chambered hearts</b> hote hain. Inmein oxygenated aur deoxygenated blood ka kuch mixing tolerate hota hai."
},
{
question: "4. Fish ke heart mein kitne chambers hote hain?",
options: [
"A. One",
"B. Two",
"C. Three",
"D. Four"
],
correct: 1,
explanation: "Fish ka heart <b>two-chambered</b> hota hai. Blood heart se gills mein jata hai, wahan oxygenated hota hai aur phir directly body mein circulate karta hai."
},
{
question: "5. Fish mein blood ek complete circulation cycle ke during heart se kitni baar pass hota hai?",
options: [
"A. Once",
"B. Twice",
"C. Three times",
"D. Four times"
],
correct: 0,
explanation: "Fish mein blood <b>heart se sirf ek baar</b> pass hota hai during one complete cycle. Iske opposite, other vertebrates mein blood heart se twice pass hota hai."
},
{
question: "6. Other vertebrates mein blood ka heart se twice pass hona kya kehlata hai?",
options: [
"A. Single circulation",
"B. Double circulation",
"C. Open circulation",
"D. Diffusion"
],
correct: 1,
explanation: "Jab blood ek complete cycle mein <b>heart se do baar pass</b> hota hai, ise <b>double circulation</b> kehte hain."
},
{
question: "7. Blood pressure ka correct meaning kya hai?",
options: [
"A. Blood mein oxygen ki amount",
"B. Blood ka temperature",
"C. Blood dwara blood vessel ki wall par exert kiya gaya force",
"D. Heart ka weight"
],
correct: 2,
explanation: "<b>Blood pressure</b> woh force hai jo blood blood vessel ki walls par exert karta hai. Yeh pressure arteries mein veins se zyada hota hai."
},
{
question: "8. Ventricular systole ke time artery mein blood pressure ko kya kaha jata hai?",
options: [
"A. Diastolic pressure",
"B. Systolic pressure",
"C. Pulse pressure",
"D. Venous pressure"
],
correct: 1,
explanation: "<b>Ventricular systole</b> heart ventricles ki contraction phase hai. Is time artery mein pressure ko <b>systolic pressure</b> kehte hain."
},
{
question: "9. Normal human blood pressure approximately kitna hota hai?",
options: [
"A. 80/120 mm of Hg",
"B. 120/80 mm of Hg",
"C. 100/60 mm of Hg",
"D. 140/100 mm of Hg"
],
correct: 1,
explanation: "Normal blood pressure approximately <b>120 mm Hg systolic</b> aur <b>80 mm Hg diastolic</b> hota hai."
},
{
question: "10. Blood pressure measure karne ke liye kaunsa instrument use kiya jata hai?",
options: [
"A. Stethoscope",
"B. Thermometer",
"C. Sphygmomanometer",
"D. Spirometer"
],
correct: 2,
explanation: "<b>Sphygmomanometer</b> ek instrument hai jiska use blood pressure measure karne ke liye kiya jata hai. High blood pressure ko <b>hypertension</b> kaha jata hai."
}
];
let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
function startQuiz() {
userName = document.getElementById("userName").value.trim();
if (!userName) return alert("Please enter your name.");
document.getElementById("nameSection").style.display = "none";
document.getElementById("quizSection").style.display = "block";
showQuestion();
loadScoreboard();
}
function showQuestion() {
const q = questions[currentQuestion];
const container = document.getElementById("questionContainer");
container.innerHTML = `
<div class="question">${q.question}</div>
<div class="options">
${q.options.map((opt, i) => `
<label>
<input type="radio" name="option" value="${i}"
${userAnswers[currentQuestion] == i ? 'checked' : ''}>
${opt}
</label>
`).join('')}
</div>
<div class="explanation" id="explain${currentQuestion}">
${q.explanation}
</div>
`;
document.getElementById("prevBtn").style.display =
currentQuestion === 0 ? "none" : "inline-block";
document.getElementById("nextBtn").style.display =
currentQuestion === questions.length - 1 ? "none" : "inline-block";
document.getElementById("submitBtn").style.display =
currentQuestion === questions.length - 1 ? "inline-block" : "none";
}
function nextQuestion() {
saveAnswer();
if (currentQuestion < questions.length - 1) {
currentQuestion++;
showQuestion();
}
}
function prevQuestion() {
saveAnswer();
if (currentQuestion > 0) {
currentQuestion--;
showQuestion();
}
}
function saveAnswer() {
const selected = document.querySelector('input[name="option"]:checked');
userAnswers[currentQuestion] = selected
? parseInt(selected.value)
: null;
}
function submitQuiz() {
saveAnswer();
score = 0;
questions.forEach((q, index) => {
if (userAnswers[index] === q.correct) {
score++;
}
});
showResults();
saveScore(userName, score);
loadScoreboard();
}
function showResults() {
const container = document.getElementById("questionContainer");
container.innerHTML = "";
questions.forEach((q, index) => {
const selected = userAnswers[index];
const correct = q.correct;
let optsHTML = q.options.map((opt, i) => {
let cls = "";
if (i === correct) cls = "correct";
if (selected === i && selected !== correct) {
cls = "wrong";
}
return `<label class="${cls}">${opt}</label>`;
}).join('');
container.innerHTML += `
<div class="question">${q.question}</div>
<div class="options">${optsHTML}</div>
<div class="explanation" style="display:block;">
${q.explanation}
</div>
<hr>
`;
});
document.querySelector(".controls").style.display = "none";
document.getElementById("result").innerHTML = `
<h3>Your Score: ${score} / ${questions.length}</h3>
`;
}
function saveScore(name, score) {
let scores = JSON.parse(localStorage.getItem("quizScores")) || [];
scores.push({
name,
score,
date: new Date().toLocaleString()
});
localStorage.setItem("quizScores", JSON.stringify(scores));
}
function loadScoreboard() {
let scores = JSON.parse(localStorage.getItem("quizScores")) || [];
scores.sort((a, b) => b.score - a.score);
document.getElementById("scoreList").innerHTML =
scores.map(s =>
`<li>${s.name} - ${s.score}/10 (${s.date})</li>`
).join('');
}
</script>
</body>
</html>