ch2 part4
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Science Quiz – Human Cell</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: 10px 0;
line-height: 1.6;
}
.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;
line-height: 1.6;
}
.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;
}
#userName {
padding: 10px;
border: 1px solid #ccc;
border-radius: 6px;
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠 Science Quiz – Human Cell</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 cheek cells ko observe karne ke liye cheek ke andar se material kiski help se scrape kiya jaata hai?",
options: [
"A. Sharp knife",
"B. Clean blunt-ended toothpick",
"C. Metal needle",
"D. Scissors"
],
correct: 1,
explanation: "Cheek cells collect karne ke liye clean toothpick ke blunt end se cheek ke inside ko gently scrape kiya jaata hai. Blunt end use karna important hai, taaki injury ka risk kam ho.<br><br><strong>Example:</strong> Scraped material ko clean glass slide par water ki drop mein spread karke microscope se observe kiya ja sakta hai."
},
{
question: "2. Human cheek cells ko microscope mein clearly dekhne ke liye kaunsa stain use kiya jaata hai?",
options: [
"A. Safranin",
"B. Ink",
"C. Methylene blue",
"D. Turmeric water"
],
correct: 2,
explanation: "Methylene blue ek blue-coloured stain hai. Yeh material ka contrast increase karta hai, jisse cheek cells microscope ke neeche zyada clearly dikhte hain.<br><br><strong>Example:</strong> Methylene blue stain karne ke baad cheek cells ke nucleus ko identify karna easier ho sakta hai."
},
{
question: "3. Cheek cells ki slide par glycerin add karne ka main purpose kya hai?",
options: [
"A. Cells ko dry hone se bachana",
"B. Cells ko completely dissolve karna",
"C. Cells ka colour remove karna",
"D. Cells ko grow karna"
],
correct: 0,
explanation: "Glycerin slide par cells ko drying se bachane mein help karta hai, jisse unhe observe karna easier hota hai.<br><br><strong>Example:</strong> Cheek cells par glycerin ki drop add karne ke baad coverslip carefully place ki jaati hai."
},
{
question: "4. Human cheek cells ki shape generally kaisi hoti hai?",
options: [
"A. Perfectly rectangular",
"B. Spiral-shaped",
"C. Star-shaped",
"D. Polygon-shaped"
],
correct: 3,
explanation: "Human cheek cells generally irregular ya polygon-shaped structures ki tarah dikhte hain. Ye cells mouth ki inner lining banate hain.<br><br><strong>Example:</strong> Onion peel cells nearly rectangular hote hain, jabki cheek cells ki shape generally polygonal hoti hai."
},
{
question: "5. Cell ka outer covering, jo cell ko enclose karta hai aur materials ke entry aur exit ko regulate karne mein help karta hai, kya kehlata hai?",
options: [
"A. Nucleus",
"B. Cell membrane",
"C. Cytoplasm",
"D. Cell wall"
],
correct: 1,
explanation: "Cell membrane cell ke contents ko enclose karti hai aur cell ke andar useful materials ke entry aur waste materials ke exit ko control karne mein help karti hai.<br><br><strong>Example:</strong> Cell membrane nutrients ko cell ke andar aane aur kuch waste materials ko bahar jaane dene mein help karti hai."
},
{
question: "6. Cell ke andar cell membrane aur nucleus ke beech ka space kis substance se filled hota hai?",
options: [
"A. Cell wall",
"B. Safranin",
"C. Cytoplasm",
"D. Air"
],
correct: 2,
explanation: "Cytoplasm cell membrane aur nucleus ke beech present hota hai. Ismein cell ke doosre components aur carbohydrates, proteins, fats aur mineral salts jaise compounds hote hain. Most life processes cytoplasm mein take place karte hain.<br><br><strong>Example:</strong> Cell ke andar kai chemical reactions cytoplasm mein hoti hain, jo cell ki functioning mein help karti hain."
},
{
question: "7. Cell ke activities aur growth ko regulate karne wala part kaunsa hai?",
options: [
"A. Nucleus",
"B. Cell wall",
"C. Cell membrane only",
"D. Coverslip"
],
correct: 0,
explanation: "Nucleus cell ki activities ko regulate karta hai aur growth ko control karne mein important role play karta hai.<br><br><strong>Example:</strong> Human cheek cell mein nucleus present hota hai, jo cell ki activities ko coordinate karne mein help karta hai."
},
{
question: "8. Plant cells mein kaunsa extra outer layer present hota hai jo animal cheek cells mein nahi hota?",
options: [
"A. Cytoplasm",
"B. Nucleus",
"C. Cell membrane",
"D. Cell wall"
],
correct: 3,
explanation: "Plant cells mein cell membrane ke outside ek extra layer, cell wall, hoti hai. Yeh plant cells ko rigidity, strength aur support provide karti hai.<br><br><strong>Example:</strong> Onion peel cells ki firm, nearly rectangular arrangement mein cell wall important role play karti hai."
},
{
question: "9. Onion peel cells aur human cheek cells ke baare mein kaunsa statement correct hai?",
options: [
"A. Dono mein cell wall hoti hai",
"B. Dono mein cell membrane, cytoplasm aur nucleus jaise basic parts hote hain",
"C. Dono ki shape hamesha rectangular hoti hai",
"D. Dono mein nucleus absent hota hai"
],
correct: 1,
explanation: "Onion peel cells aur human cheek cells dono mein cell membrane, cytoplasm aur nucleus hote hain. Lekin onion peel plant cells hain, isliye unmein cell wall bhi hoti hai; human cheek cells mein cell wall nahi hoti.<br><br><strong>Example:</strong> Onion peel cells nearly rectangular dikhte hain, jabki cheek cells generally polygon-shaped dikhte hain."
},
{
question: "10. Plant cells ko rigidity aur strength provide karne mein kaunsa structure important role play karta hai?",
options: [
"A. Nucleus",
"B. Cytoplasm only",
"C. Cell wall",
"D. Methylene blue"
],
correct: 2,
explanation: "Cell wall plant cells ko strength aur rigidity provide karti hai. Isse plant tissues ko support milta hai aur cells apni firm structure maintain kar paate hain.<br><br><strong>Example:</strong> Onion peel ko microscope se observe karne par cells ki boundaries clearly dikh sakti hain, jo unki organised arrangement aur firm structure ko samajhne mein help karti 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>