ch13 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 – APICAL CLASSES</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; line-height: 1.6; }
.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;
line-height: 1.6;
}
.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 – APICAL CLASSES</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. Earth par life ki continuity ko maintain karne ke liye kaunsa process essential hai?",
options: [
"A. Respiration",
"B. Reproduction",
"C. Digestion",
"D. Excretion"
],
correct: 1,
explanation: "Reproduction ek biological process hai jisme living organisms apne jaise new individuals produce karte hain. Isse species ki continuity bani rehti hai.<br><br>Example: Cows calves ko aur cats kittens ko janm deti hain. Isse unki species continue rehti hai."
},
{
question: "2. Genetic material ya genes ka main function kya hai?",
options: [
"A. Sirf food digest karna",
"B. Organism ke development ke liye instructions carry karna",
"C. Sunlight produce karna",
"D. Body ka temperature hamesha badhana"
],
correct: 1,
explanation: "Genes mein hereditary information hoti hai, jo organism ke development aur kai characteristics ko influence karti hai. Ye information parents se offspring tak pass ho sakti hai.<br><br>Example: Cat ke genes uske fur colour aur body development se related information carry karte hain."
},
{
question: "3. Genes living organisms ki cells mein kahan present hote hain?",
options: [
"A. Sirf blood mein",
"B. Sirf bones mein",
"C. DNA ke form mein, jo cells mein present hota hai",
"D. Sirf stomach mein"
],
correct: 2,
explanation: "Genes DNA ke specific sections hote hain. Eukaryotic cells mein most DNA nucleus mein present hota hai, aur genes organism ki inherited characteristics aur development ko influence karte hain.<br><br>Example: Humans mein DNA ke genes hair colour aur kuch other inherited traits ko influence kar sakte hain."
},
{
question: "4. Asexual reproduction mein generally kitne parents new individuals produce karte hain?",
options: [
"A. Ek",
"B. Do",
"C. Teen",
"D. Chaar"
],
correct: 0,
explanation: "Asexual reproduction mein ek parent se new individual produce hota hai. Is process mein gametes ka fusion nahi hota. Offspring generally parent ke genetically very similar hote hain, although mutations ho sakte hain.<br><br>Example: Amoeba binary fission ke through divide hokar two daughter cells bana sakta hai."
},
{
question: "5. Sexual reproduction mein offspring mein variation kyun hoti hai?",
options: [
"A. Kyunki offspring ko genes nahi milte",
"B. Kyunki two parents ki genetic information combine hoti hai",
"C. Kyunki sunlight genes ko destroy kar deti hai",
"D. Kyunki offspring hamesha parent se bilkul alag species hota hai"
],
correct: 1,
explanation: "Sexual reproduction mein generally two parents ke gametes ki genetic information combine hoti hai. Is combination se offspring dono parents se kuch traits inherit karta hai, lekin usmein unique differences bhi ho sakte hain.<br><br>Example: Human child ke hair type, eye colour aur other characteristics mein mother aur father dono ka genetic contribution hota hai."
},
{
question: "6. Reproduction se aane wale small genetic changes ka long-term effect kya ho sakta hai?",
options: [
"A. Organisms kabhi change nahi kar sakte",
"B. Evolution aur new adaptations develop ho sakte hain",
"C. Sabhi organisms same ban jayenge",
"D. Reproduction permanently stop ho jayega"
],
correct: 1,
explanation: "Genetic variations generations ke through accumulate ho sakti hain. Natural selection ke through beneficial variations population mein common ho sakti hain. Bahut long time mein evolution ke through major changes aur new species develop ho sakti hain.<br><br>Example: Bacteria mein kuch genetic changes antibiotic resistance de sakte hain. Aise bacteria antibiotic ke presence mein survive aur reproduce kar sakte hain."
},
{
question: "7. Camels ke desert mein survive karne mein unke humps ka kya role hai?",
options: [
"A. Humps water ko directly store karte hain",
"B. Humps fat store karte hain, jo energy provide kar sakta hai",
"C. Humps oxygen produce karte hain",
"D. Humps sunlight ko food mein convert karte hain"
],
correct: 1,
explanation: "Camel ke hump mein fat stored hota hai, water nahi. Jab food available nahi hota, toh camel stored fat ko energy ke liye use kar sakta hai.<br><br>Example: Desert mein food ki availability kam hone par camel apne stored fat se energy obtain kar sakta hai."
},
{
question: "8. Antibiotic resistance ka develop hona kis baat ka example hai?",
options: [
"A. Bacteria ka evolution",
"B. Plants ka photosynthesis",
"C. Animals ka digestion",
"D. Water ka evaporation"
],
correct: 0,
explanation: "Bacteria mein genetic variations ho sakti hain. Antibiotic ke use se susceptible bacteria mar sakte hain, jabki resistant bacteria survive aur reproduce kar sakte hain. Isse population mein antibiotic resistance badh sakti hai.<br><br>Example: Agar kisi bacterial population mein kuch bacteria antibiotic-resistant hain, toh antibiotic treatment ke baad resistant bacteria ki sankhya badh sakti hai."
},
{
question: "9. Asexual reproduction se produce hone wale offspring generally kaise hote hain?",
options: [
"A. Parent se genetically bahut different",
"B. Parent ke genetically almost identical",
"C. Hamesha different species ke",
"D. Unke paas genetic material nahi hota"
],
correct: 1,
explanation: "Asexual reproduction mein offspring ko genetic information ek parent se milti hai. Isliye offspring generally parent ke genetic copies hote hain, lekin mutations ke karan differences aa sakte hain.<br><br>Example: Amoeba binary fission se do daughter cells produce karta hai, jo generally genetically almost identical hote hain."
},
{
question: "10. Sexual reproduction ka ek important advantage kya hai?",
options: [
"A. Har offspring bilkul identical hota hai",
"B. Genetic variation produce karne mein help karta hai",
"C. Genes ka transfer permanently stop ho jata hai",
"D. Organisms ko adapt karna impossible ho jata hai"
],
correct: 1,
explanation: "Sexual reproduction mein genetic information ka combination offspring mein variation create karta hai. Ye variation changing environments mein populations ke adaptation aur evolution ke liye important ho sakti hai.<br><br>Example: Ek hi animal species ke individuals ke fur colour ya body size mein differences ho sakte hain. Kuch conditions mein certain variations survival mein advantage de sakti hain."
}
];
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>