ch1 part 4
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Science Quiz – 20 November 2026</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;
box-sizing: border-box;
}
.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: 15px 0;
line-height: 1.6;
}
.options label {
display: block;
margin: 8px 0;
padding: 12px;
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: 12px;
margin-top: 12px;
margin-bottom: 15px;
border-left: 5px solid #2a5298;
display: none;
line-height: 1.6;
}
.controls {
text-align: center;
margin-top: 20px;
}
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;
}
#result {
text-align: center;
margin-top: 20px;
}
#userName {
padding: 10px;
width: 65%;
border: 1px solid #ccc;
border-radius: 6px;
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠 Science Quiz – 20 November 2026</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"></div>
<div id="scoreboard">
<h3>🏆 Scoreboard</h3>
<ol id="scoreList"></ol>
</div>
</div>
</div>
<script>
const questions = [
{
question: "1. Moon ke phases ko regularly observe karne se early humans ko kya develop karne mein help mili?",
options: [
"A. Electric machines",
"B. Modern microscopes",
"C. First calendars",
"D. Artificial satellites"
],
correct: 2,
explanation: "Moon ke phases ek regular cycle mein repeat hote hain. Early humans ne is cycle ko observe karke time aur days ko organise karne ke methods develop kiye.<br><br><strong>Example:</strong> Moon ke changing phases ko observe karke log months ka estimation karte the."
},
{
question: "2. Early calendars develop karne mein kaun-si observations important thi?",
options: [
"A. Sirf animals ki movement",
"B. Sunrises, sunsets aur lunar cycles",
"C. Sirf ocean waves",
"D. Sirf plants ki height"
],
correct: 1,
explanation: "Sun aur Moon ki regular movements ko carefully observe karne se humans ko time aur seasons ke patterns samajhne mein help mili.<br><br><strong>Example:</strong> Sunrise aur sunset se day-night ka cycle samajh aata hai, jabki Moon ke phases se lunar month ka idea milta hai."
},
{
question: "3. Ecosystem kya hota hai?",
options: [
"A. Sirf ek type ke animal ka group",
"B. Sirf non-living things ka collection",
"C. Sirf plants se bana hua area",
"D. Living organisms aur unke environment ke beech relationships ka system"
],
correct: 3,
explanation: "Ecosystem mein plants, animals, microorganisms aur air, water, sunlight jaise non-living factors ek-doosre ke saath interact karte hain.<br><br><strong>Example:</strong> Pond ecosystem mein fish, aquatic plants, insects, water aur sunlight ek doosre se connected hote hain."
},
{
question: "4. Plants aur animals apne environment par depend kyun karte hain?",
options: [
"A. Food, water, air, sunlight aur suitable conditions ke liye",
"B. Sirf shelter ke liye",
"C. Sirf sunlight ko block karne ke liye",
"D. Environment ka living organisms par koi effect nahi hota"
],
correct: 0,
explanation: "Living organisms survive aur grow karne ke liye environmental resources par depend karte hain.<br><br><strong>Example:</strong> Plants sunlight, water aur carbon dioxide use karke photosynthesis karte hain, jabki animals ko food, water aur oxygen ki zaroorat hoti hai."
},
{
question: "5. Grassland ecosystem mein grass aur deer ke beech kya relationship hota hai?",
options: [
"A. Grass deer se food obtain karti hai",
"B. Dono ek-doosre se completely independent hote hain",
"C. Deer grass ko food ke roop mein use karta hai",
"D. Grass deer ko oxygen dena band kar deti hai"
],
correct: 2,
explanation: "Ecosystem mein organisms food ke through connected hote hain. Deer ek herbivore hai jo grass jaise plants ko khata hai.<br><br><strong>Example:</strong> Grass → Deer → Tiger ek simple food chain ka example hai."
},
{
question: "6. Earth ko life ke liye suitable banane wala important factor kaunsa hai?",
options: [
"A. Earth par bilkul atmosphere na hona",
"B. Sun se suitable distance, jahan water liquid reh sakta hai",
"C. Earth par sunlight ka kabhi na aana",
"D. Earth par sirf solid water ka hona"
],
correct: 1,
explanation: "Earth Sun se aisi distance par hai jahan suitable conditions mein liquid water exist kar sakta hai. Liquid water life ke liye essential hai.<br><br><strong>Example:</strong> Rivers aur lakes mein liquid water humans, plants aur animals ko support karta hai."
},
{
question: "7. Earth ka atmosphere humans ke liye kaise useful hai?",
options: [
"A. Yeh sunlight ko completely block kar deta hai",
"B. Yeh Earth par saare microorganisms ko destroy kar deta hai",
"C. Yeh gravity ko khatam kar deta hai",
"D. Yeh breathing ke liye oxygen provide karta hai aur harmful ultraviolet radiation se protection deta hai"
],
correct: 3,
explanation: "Atmosphere mein oxygen hoti hai, jo humans aur kai other organisms ki respiration ke liye important hai. Atmosphere ki ozone layer harmful UV radiation ka major part absorb karti hai.<br><br><strong>Example:</strong> Ozone layer protection ke bina harmful UV exposure skin aur eyes ko damage kar sakta hai."
},
{
question: "8. Human activities Earth ke climate ko kaise affect kar sakti hain?",
options: [
"A. Greenhouse gases badhakar global temperature aur climate patterns ko change kar sakti hain",
"B. Earth ki rotation turant band karke",
"C. Moon ke phases ko permanently stop karke",
"D. Saare oceans ko turant freeze karke"
],
correct: 0,
explanation: "Fossil fuels jalane aur forests ko destroy karne jaisi activities greenhouse gases ki quantity badha sakti hain. Isse global warming aur climate patterns mein changes ho sakte hain.<br><br><strong>Example:</strong> Coal aur petrol jalane se carbon dioxide release hoti hai, jo global warming mein contribute karti hai."
},
{
question: "9. Climate change agriculture ko kaise affect kar sakta hai?",
options: [
"A. Har jagah crops ki production hamesha badha deta hai",
"B. Rainfall ko hamesha same rakhta hai",
"C. Temperature aur rainfall patterns badalkar crop production ko affect kar sakta hai",
"D. Soil aur water ki importance khatam kar deta hai"
],
correct: 2,
explanation: "Crops ko suitable temperature, water aur growing conditions chahiye. Climate change in conditions ko disturb kar sakta hai.<br><br><strong>Example:</strong> Long drought se crops ko water nahi milta, jabki excessive rainfall fields mein flooding cause kar sakti hai."
},
{
question: "10. Earth par life ko protect karne ke liye humans ko kya karna chahiye?",
options: [
"A. Natural resources ko bina limit use karna",
"B. Pollution kam karna, resources conserve karna aur ecosystems protect karna",
"C. Forests ko unnecessarily destroy karna",
"D. Climate aur environment ke changes ko ignore karna"
],
correct: 1,
explanation: "Responsible human activities environment ko protect karne aur climate change ke effects ko limit karne mein help kar sakti hain.<br><br><strong>Example:</strong> Trees plant karna, electricity save karna aur public transport use karna environmental impact ko reduce karne ke useful steps hain."
}
];
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 saveAnswer() {
const selected = document.querySelector('input[name="option"]:checked');
userAnswers[currentQuestion] = selected
? parseInt(selected.value)
: null;
}
function nextQuestion() {
saveAnswer();
if (currentQuestion < questions.length - 1) {
currentQuestion++;
showQuestion();
}
}
function prevQuestion() {
saveAnswer();
if (currentQuestion > 0) {
currentQuestion--;
showQuestion();
}
}
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>
<p><strong>${score === 10 ? "Excellent! Perfect Score!" :
score >= 7 ? "Very Good! Keep Practising!" :
score >= 5 ? "Good Effort! Keep Learning!" :
"Keep Practising! You Can Improve!"}</strong></p>
`;
}
function saveScore(name, score) {
let scores = JSON.parse(localStorage.getItem("quizScores")) || [];
scores.push({
name: name,
score: 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>${escapeHTML(s.name)} - ${s.score}/10 (${escapeHTML(s.date)})</li>`
).join('');
}
function escapeHTML(value) {
return String(value).replace(/[&<>"']/g, char => ({
'&': '&',
'<': '<',
'>': '>',
'"': '"',
"'": '''
})[char]);
}
</script>
</body>
</html>