ch5 part14
<!DOCTYPE html>
<html lang="en">
<head>
<title>🧠 Science Quiz – Excretion in Plants and Animals</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 – Excretion in Plants and Animals</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. Plants mein photosynthesis ke during kaunsi gas waste product ke roop mein consider ki ja sakti hai?",
options: [
"A. Oxygen",
"B. Nitrogen",
"C. Carbon dioxide",
"D. Hydrogen"
],
correct: 0,
explanation: "Photosynthesis ke during plants <b>oxygen release</b> karte hain. Isliye oxygen ko plant ka ek <b>waste product</b> maana ja sakta hai."
},
{
question: "2. Plants excess water ko mainly kis process ke through remove karte hain?",
options: [
"A. Respiration",
"B. Transpiration",
"C. Translocation",
"D. Diffusion"
],
correct: 1,
explanation: "Plants apne excess water ko mainly <b>transpiration</b> ke through water vapour ke form mein remove karte hain."
},
{
question: "3. Plants ke waste products ko store karne mein kaunsa cellular structure important role play karta hai?",
options: [
"A. Nucleus",
"B. Chloroplast",
"C. Cell vacuoles",
"D. Ribosomes"
],
correct: 2,
explanation: "Many plant waste products <b>cellular vacuoles</b> mein store kiye ja sakte hain."
},
{
question: "4. Plants mein kuch waste products kis form mein especially old xylem mein store hote hain?",
options: [
"A. Glucose aur starch",
"B. Resins aur gums",
"C. Proteins aur amino acids",
"D. Oxygen aur nitrogen"
],
correct: 1,
explanation: "Plants ke kuch waste products <b>resins aur gums</b> ke form mein store hote hain, especially <b>old xylem</b> mein."
},
{
question: "5. Plants waste products ko leaves ke through kaise remove kar sakte hain?",
options: [
"A. Leaves ko fall off hone dekar",
"B. Leaves ko roots mein bhejkar",
"C. Leaves ko seeds mein convert karke",
"D. Leaves se minerals absorb karke"
],
correct: 0,
explanation: "Kuch waste products <b>leaves mein store</b> hote hain aur jab leaves fall off hoti hain, toh waste bhi plant se remove ho jaata hai."
},
{
question: "6. Plants kuch waste substances ko kahan excrete kar sakte hain?",
options: [
"A. Flowers ke andar",
"B. Fruits ke andar",
"C. Surrounding soil mein",
"D. Sirf seeds mein"
],
correct: 2,
explanation: "Plants kuch waste substances ko directly <b>surrounding soil</b> mein excrete kar sakte hain."
},
{
question: "7. Highly differentiated plants mein water, minerals aur food ka transport kis vascular tissue ke through hota hai?",
options: [
"A. Epidermis aur cortex",
"B. Xylem aur phloem",
"C. Stomata aur guard cells",
"D. Root hairs aur leaves"
],
correct: 1,
explanation: "Plants ka vascular tissue <b>xylem aur phloem</b> se milkar bana hota hai. Ye water, minerals, food aur other materials ke transport mein help karta hai."
},
{
question: "8. Human beings mein soluble nitrogen compounds ko mainly kaun remove karta hai?",
options: [
"A. Lungs",
"B. Heart",
"C. Nephrons in kidneys",
"D. Small intestine"
],
correct: 2,
explanation: "Human beings mein soluble <b>nitrogenous wastes</b> ko kidneys ke <b>nephrons</b> filter karke remove karte hain."
},
{
question: "9. Respiration ke during glucose jaise organic compounds kis purpose ke liye break down hote hain?",
options: [
"A. ATP ke form mein energy provide karne ke liye",
"B. Body mein water store karne ke liye",
"C. Blood pressure increase karne ke liye",
"D. Waste ko store karne ke liye"
],
correct: 0,
explanation: "Respiration mein glucose jaise organic compounds break down hote hain aur <b>ATP ke form mein energy</b> available hoti hai. ATP cell ki other reactions ko energy provide karta hai."
},
{
question: "10. Inmein se plants ke waste material ko remove karne ka correct method kaunsa hai?",
options: [
"A. Cell vacuoles mein storage",
"B. Gums aur resins ke form mein storage",
"C. Falling leaves ke through removal",
"D. Above all"
],
correct: 3,
explanation: "Plants waste material ko <b>cell vacuoles mein store</b>, <b>gums/resins ke form mein store</b>, <b>falling leaves ke through remove</b>, ya <b>surrounding soil mein excrete</b> kar sakte 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>