ch3 part 1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>How Do Organisms Reproduce? – Science Quiz</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>🧬 How Do Organisms Reproduce? – Science Quiz</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. Reproduction organisms ke liye kyun important hai?",
options: [
"A. Individual ko alive rakhne ke liye",
"B. New individuals produce karne ke liye",
"C. Respiration karne ke liye",
"D. Food digest karne ke liye"
],
correct: 1,
explanation: "Reproduction individual organism ki survival ke liye directly necessary nahi hai, lekin ye new individuals produce karta hai aur species ko continue karne mein help karta hai."
},
{
question: "2. Reproduction ke through new individuals generally kaise hote hain?",
options: [
"A. Parents se completely different",
"B. Parents se similar",
"C. Hamesha smaller",
"D. Hamesha larger"
],
correct: 1,
explanation: "Reproducing organisms aise new individuals create karte hain jo parents ke body design se kaafi similar hote hain."
},
{
question: "3. Organisms ki body design ki information mainly kis molecule mein present hoti hai?",
options: [
"A. Protein",
"B. Glucose",
"C. DNA",
"D. Water"
],
correct: 2,
explanation: "DNA (Deoxyribo Nucleic Acid) mein hereditary information stored hoti hai. Ye information parents se next generation tak features transfer karne mein important hai."
},
{
question: "4. Cell ke nucleus mein DNA kis structure mein present hota hai?",
options: [
"A. Ribosomes",
"B. Chromosomes",
"C. Cell wall",
"D. Vacuoles"
],
correct: 1,
explanation: "Cell ke nucleus mein chromosomes hote hain, jinmein DNA molecules present hote hain. DNA inheritance ki information carry karta hai."
},
{
question: "5. Reproduction ka basic event kya mana jata hai?",
options: [
"A. Food digestion",
"B. DNA copy creation",
"C. Respiration",
"D. Water absorption"
],
correct: 1,
explanation: "Reproduction ke basic level par DNA ki copy create hona important event hai. Cell chemical reactions ka use karke DNA ki copies banata hai."
},
{
question: "6. DNA cell ke liye kis important information ka source hai?",
options: [
"A. Protein banane ki information",
"B. Water banane ki information",
"C. Oxygen store karne ki information",
"D. Food digest karne ki information"
],
correct: 0,
explanation: "Cell nucleus mein present DNA proteins banane ke liye information provide karta hai. Agar DNA ki information change ho jaye, to different proteins ban sakte hain."
},
{
question: "7. DNA ki information mein change hone par kya effect ho sakta hai?",
options: [
"A. Different proteins ban sakte hain",
"B. Cell mein water khatam ho jata hai",
"C. Respiration completely stop ho jata hai",
"D. Food automatically produce hota hai"
],
correct: 0,
explanation: "DNA ki information change hone par different proteins ban sakte hain. Different proteins eventually organism ke altered body design ka reason ban sakte hain."
},
{
question: "8. DNA copying ke baad reproducing cell mein kya banta hai?",
options: [
"A. DNA ki two copies",
"B. Sirf one protein",
"C. Three nuclei",
"D. No genetic material"
],
correct: 0,
explanation: "Reproducing cell mein DNA ki two copies create hoti hain. In copies ko baad mein separating cells mein distribute kiya jata hai."
},
{
question: "9. DNA copying ke process mein variations kyun appear ho sakti hain?",
options: [
"A. DNA copying always perfectly identical nahi hoti",
"B. Food ka colour change hone ke karan",
"C. Respiration ke karan",
"D. Water loss ke karan"
],
correct: 0,
explanation: "DNA copying generally accurate hoti hai, lekin small errors/changes ho sakte hain. In changes ki wajah se offspring mein variations develop ho sakti hain."
},
{
question: "10. Variation species ke liye beneficial kyun ho sakti hai?",
options: [
"A. Ye species ko changing environmental conditions mein survive karne mein help kar sakti hai",
"B. Ye har individual ko stronger banati hai",
"C. Ye reproduction ko completely stop karti hai",
"D. Ye DNA ko destroy kar deti hai"
],
correct: 0,
explanation: "Variation har individual ke liye necessarily beneficial nahi hoti, lekin changing environment mein kuch variations species ke survival ke chances increase kar 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>