ch12 part11
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Science Quiz – Ecosystems and Sustainable Farming</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 – Ecosystems and Sustainable Farming</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. Human-made ecosystem ka example kaunsa hai?",
options: [
"A. Natural forest",
"B. Fish pond created by humans",
"C. Natural river",
"D. Ocean"
],
correct: 1,
explanation: "Human-made ecosystems woh ecosystems hote hain jinhe humans apni needs ke liye create karte hain. Inki proper care aur management karna zaroori hota hai.<br><br>Example: Ek artificial fish pond jahan log machhliyan paalne ke liye paani aur food ka management karte hain."
},
{
question: "2. Natural ecosystems ke comparison mein human-made ecosystems ko kis cheez ki zyada zaroorat hoti hai?",
options: [
"A. Human care and management",
"B. Sirf sunlight",
"C. Sirf rainfall",
"D. Kisi bhi care ki zaroorat nahi hoti"
],
correct: 0,
explanation: "Human-made ecosystems ko healthy rakhne ke liye humans ko regular maintenance aur management karna padta hai.<br><br>Example: Ek park mein plants ko water dena, trees ki trimming karna aur waste ko clean karna."
},
{
question: "3. India mein 1950 se 1965 ke beech food crisis ka main reason kya tha?",
options: [
"A. Bahut zyada crop production",
"B. Low crop production",
"C. Forests ki badhti sankhya",
"D. Pesticides ka complete ban"
],
correct: 1,
explanation: "Is period mein India ko food crisis ka saamna karna pada kyunki crop production kam tha. Food production badhane ke liye baad mein modern farming techniques ka use badha.<br><br>Example: Tractors, machines aur fertilisers ki help se farmers kam samay mein zyada land par farming kar sake."
},
{
question: "4. Green Revolution ka main purpose kya tha?",
options: [
"A. Food production ko kam karna",
"B. Farming ko completely band karna",
"C. Food production ko badhana",
"D. Sirf forests ko develop karna"
],
correct: 2,
explanation: "Green Revolution ke dauraan tractors, machines, synthetic fertilisers aur pesticides ke use se agricultural production badhane mein help mili.<br><br>Example: Fertilisers aur improved farming techniques ki help se wheat production badhana."
},
{
question: "5. Synthetic fertilisers ke excessive use se soil ki fertility kyun kam ho sakti hai?",
options: [
"A. Soil mein humus hamesha badhta hai",
"B. Friendly microorganisms aur organic matter kam ho sakte hain",
"C. Soil mein biodiversity hamesha badhti hai",
"D. Soil ko kisi nutrients ki zaroorat nahi rehti"
],
correct: 1,
explanation: "Synthetic fertilisers ka long-term excessive use soil health ko harm kar sakta hai. Soil ke beneficial microorganisms aur humus mein kami aane se soil ki quality affect ho sakti hai.<br><br>Example: Agar kisi farm mein organic matter maintain na kiya jaye, toh soil ki structure aur water-holding capacity kharab ho sakti hai."
},
{
question: "6. Humus soil ke liye important kyun hota hai?",
options: [
"A. Yeh soil ko completely dry karta hai",
"B. Yeh soil particles ko bind karne mein help karta hai",
"C. Yeh saare insects ko destroy karta hai",
"D. Yeh soil erosion ko badhata hai"
],
correct: 1,
explanation: "Humus decomposed plant aur animal material se banta hai. Yeh soil structure aur fertility ko improve karta hai. Humus ki kami se soil erosion ka risk badh sakta hai.<br><br>Example: Compost milane se garden ki soil ki quality aur structure improve ho sakti hai."
},
{
question: "7. Ek hi crop ko baar-baar same land par ugane ko kya kehte hain?",
options: [
"A. Pollination",
"B. Decomposition",
"C. Monoculture",
"D. Afforestation"
],
correct: 2,
explanation: "Monoculture ka matlab hai ek hi type ki crop ko repeatedly grow karna. Isse biodiversity kam ho sakti hai aur soil mein kuch nutrients ki kami develop ho sakti hai.<br><br>Example: Ek field mein har season sirf wheat ugana, bina crop rotation ke."
},
{
question: "8. Pesticides ke excessive use ka ek possible effect kya hai?",
options: [
"A. Natural predators ki population kam ho sakti hai",
"B. Sabhi pests permanently khatam ho jaate hain",
"C. Soil mein humus hamesha badhta hai",
"D. Pollinators ki population hamesha badhti hai"
],
correct: 0,
explanation: "Excessive pesticide use harmful pests ke saath beneficial organisms aur natural predators ko bhi affect kar sakta hai. Natural predators kam hone par pests ki population badh sakti hai.<br><br>Example: Agar pesticides se pest-eating insects mar jaayein, toh crop ko damage karne wale pests ki sankhya badh sakti hai."
},
{
question: "9. Sustainable farming ke liye kaunsi practice useful hai?",
options: [
"A. Pesticides ka unlimited use",
"B. Har season same crop ugana",
"C. Organic manure aur compost ka use",
"D. Groundwater ka excessive extraction"
],
correct: 2,
explanation: "Organic manure aur compost soil mein organic matter add karte hain aur soil health ko support karte hain. Sustainable farming ka aim food production ke saath environment ko protect karna bhi hai.<br><br>Example: Farmers kitchen waste, dry leaves aur plant residues se compost bana kar fields mein use kar sakte hain."
},
{
question: "10. Vrikshayurveda mein Kunapa Jala ka kya importance bataya gaya hai?",
options: [
"A. Yeh chemical pesticide hai",
"B. Yeh animal aur plant waste se banaya gaya liquid fertiliser hai",
"C. Yeh soil ko polluted karta hai",
"D. Yeh irrigation ke liye machine hai"
],
correct: 1,
explanation: "Kunapa Jala animal aur plant waste ko fermentation process se decompose karke banaya jaane wala liquid fertiliser hai. Vrikshayurveda soil ko continuously nourish karne ke liye organic manure aur composted materials par zor deta hai.<br><br>Example: Fermented organic material se bana liquid fertiliser plants ko nutrients provide karne ke liye use kiya ja sakta 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>