ch12 part10
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Ecosystem Benefits & Conservation 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>🧠 Ecosystem Benefits & Conservation 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. Ecosystems humans ko kaun-kaun se benefits provide karte hain?",
options: [
"A. Sirf entertainment",
"B. Food, fresh air, medicines aur fertile soil",
"C. Sirf buildings banane ke liye land",
"D. Sirf minerals"
],
correct: 1,
explanation: "Ecosystems humans ko essential resources aur services provide karte hain. Forests food, timber, fibres aur medicines dete hain. Ecosystems human well-being aur survival ke liye important hain.<br><br><strong>Example:</strong> Forests se humein fruits, medicinal plants aur timber mil sakta hai."
},
{
question: "2. Aquatic ecosystems humans ko kaun-se important resources provide karte hain?",
options: [
"A. Water aur food",
"B. Sirf timber",
"C. Sirf medicines",
"D. Sirf fresh air"
],
correct: 0,
explanation: "Aquatic ecosystems, jaise rivers, lakes aur ponds, water aur food resources provide karte hain. Inmein fish aur doosre aquatic organisms bhi milte hain.<br><br><strong>Example:</strong> Rivers se humans ko water milta hai aur fisheries se fish food ke roop mein milti hai."
},
{
question: "3. Sundarbans kis type ke forests ke liye famous hai?",
options: [
"A. Coniferous forests",
"B. Mangrove forests",
"C. Desert forests",
"D. Alpine forests"
],
correct: 1,
explanation: "Sundarbans mein large mangrove forests hain. Yeh India aur Bangladesh ke region mein Ganges aur Brahmaputra rivers ke delta area mein located hain.<br><br><strong>Example:</strong> Mangrove trees coastal areas mein salty water aur changing tides ki conditions mein grow kar sakte hain."
},
{
question: "4. Sundarbans ke mangrove forests storms aur floods ke effects ko kaise reduce karte hain?",
options: [
"A. Strong winds aur waves ko slow karke",
"B. Saare rivers ko dry karke",
"C. Storms ko completely stop karke",
"D. Sunlight ko block karke"
],
correct: 0,
explanation: "Mangrove forests ki roots aur trees water flow aur waves ki energy ko reduce karne mein help karte hain. Isse coastal communities ko storms aur floods ke impacts se protection mil sakti hai, lekin protection ki limit hoti hai.<br><br><strong>Example:</strong> Coastal area mein mangrove vegetation storm waves ki force ko kam karne mein help kar sakti hai."
},
{
question: "5. Trees atmosphere mein carbon dioxide ko kaise affect karte hain?",
options: [
"A. Photosynthesis ke dauran carbon dioxide absorb karte hain.",
"B. Carbon dioxide ko food ke roop mein animals ko dete hain.",
"C. Carbon dioxide produce karna hi unka main function hai.",
"D. Carbon dioxide ko water mein completely convert kar dete hain."
],
correct: 0,
explanation: "Plants photosynthesis ke dauran carbon dioxide aur water ka use karke food banate hain aur oxygen release karte hain.<br><br><strong>Example:</strong> Ek healthy green tree photosynthesis ke through carbon dioxide absorb karta hai aur oxygen release karta hai."
},
{
question: "6. UNESCO ne Sundarbans ko World Heritage Site kab declare kiya tha?",
options: [
"A. 1947",
"B. 1975",
"C. 1987",
"D. 2001"
],
correct: 2,
explanation: "Sundarbans ko uski exceptional natural importance aur biodiversity ke liye 1987 mein UNESCO World Heritage Site declare kiya gaya tha.<br><br><strong>Example:</strong> World Heritage recognition important natural places ko conserve karne ke significance ko highlight karti hai."
},
{
question: "7. Sundarbans ke ecosystem ko damage pahunchane wali human activity kaunsi hai?",
options: [
"A. Mangrove trees ki protection",
"B. Illegal hunting aur mangrove trees ki cutting",
"C. Waste management improve karna",
"D. Wildlife conservation"
],
correct: 1,
explanation: "Mangroves ko fuelwood aur farming ke liye cut karna, illegal hunting aur forest resources ka overuse ecosystem ko damage kar sakte hain. Isse wildlife ke habitats aur survival par negative effect padta hai.<br><br><strong>Example:</strong> Mangrove trees cut hone par birds aur doosre animals ke nesting aur shelter areas kam ho sakte hain."
},
{
question: "8. Industrial waste aur untreated sewage rivers mein release hone se kya ho sakta hai?",
options: [
"A. Water pollution badh sakta hai.",
"B. Water hamesha pure ho jaayega.",
"C. Aquatic organisms ko koi effect nahi hoga.",
"D. Rivers mein nutrients aur oxygen ka balance hamesha improve hoga."
],
correct: 0,
explanation: "Industrial waste aur untreated sewage harmful substances aur excess organic matter water mein add kar sakte hain. Isse water quality kharab ho sakti hai aur aquatic organisms ko harm ho sakta hai.<br><br><strong>Example:</strong> Untreated sewage ke kaaran river mein oxygen level kam ho sakta hai, jisse fish ki survival difficult ho sakti hai."
},
{
question: "9. Deforestation ka ecosystem par kya effect ho sakta hai?",
options: [
"A. Wildlife habitats destroy ho sakte hain.",
"B. Har species ki population hamesha badhegi.",
"C. Soil erosion completely stop ho jaayega.",
"D. Natural resources unlimited ho jaayenge."
],
correct: 0,
explanation: "Deforestation mein trees aur forests ko remove kiya jaata hai. Isse animals ka shelter aur food kam ho sakta hai, soil erosion badh sakta hai aur biodiversity reduce ho sakti hai.<br><br><strong>Example:</strong> Forest clear hone par birds aur mammals apna natural habitat lose kar sakte hain."
},
{
question: "10. Ecosystems ko protect karne ke liye community kaunsa step le sakti hai?",
options: [
"A. Rivers mein garbage dump karna",
"B. Trees ko unnecessarily cut karna",
"C. Waste ko properly dispose karna aur trees protect karna",
"D. Wildlife ka illegal hunting karna"
],
correct: 2,
explanation: "Ecosystems ko conserve karne ke liye pollution kam karna, trees protect karna, natural resources ka responsible use karna aur wildlife habitats ko preserve karna important hai.<br><br><strong>Example:</strong> Local community river clean-up drives organise kar sakti hai, plastic waste ko segregate kar sakti hai aur native trees plant karke unki care kar sakti hai."
}
];
let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
function startQuiz() {
userName = document.getElementById("userName").value.trim();
if (!userName) {
alert("Please enter your name.");
return;
}
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}/${questions.length} (${s.date})</li>`
).join("");
}
</script>
</body>
</html>