ch2 part5
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Cell Membrane and Tonicity 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>🧠 Cell Membrane and Tonicity 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. Agar extracellular medium aur intracellular medium mein solute concentration equal ho, toh solution ko kya kaha jaata hai?",
options: [
"A. Hypotonic",
"B. Hypertonic",
"C. Isotonic",
"D. Concentrated"
],
correct: 2,
explanation: "Jab extracellular aur intracellular solute concentration equal hoti hai, solution isotonic hota hai."
},
{
question: "2. Agar extracellular medium ki solute concentration intracellular medium se kam ho, toh extracellular solution kya hoga?",
options: [
"A. Isotonic",
"B. Hypotonic",
"C. Hypertonic",
"D. Saturated"
],
correct: 1,
explanation: "Jab extracellular medium mein solute concentration kam hoti hai, use hypotonic solution kehte hain."
},
{
question: "3. Agar extracellular medium ki solute concentration intracellular medium se zyada ho, toh solution kya hoga?",
options: [
"A. Hypotonic",
"B. Isotonic",
"C. Hypertonic",
"D. Dilute"
],
correct: 2,
explanation: "Extracellular medium mein solute concentration higher hone par solution hypertonic hota hai."
},
{
question: "4. Cell membrane ki approximate thickness kitni hoti hai?",
options: [
"A. 1–2 nm",
"B. 7–10 nm",
"C. 20–30 nm",
"D. 50–100 nm"
],
correct: 1,
explanation: "Cell membrane bahut thin hoti hai aur approximately 7–10 nanometres thick hoti hai."
},
{
question: "5. Cell membrane mainly kin substances se bani hoti hai?",
options: [
"A. Carbohydrates aur water",
"B. Lipids aur proteins",
"C. DNA aur RNA",
"D. Minerals aur vitamins"
],
correct: 1,
explanation: "Cell membrane mainly lipids (fats) aur proteins se composed hoti hai."
},
{
question: "6. Fluid-mosaic model ke according cell membrane mein lipid molecules kis arrangement mein hote hain?",
options: [
"A. Single layer",
"B. Lipid bilayer",
"C. Triple layer",
"D. Solid layer"
],
correct: 1,
explanation: "Cell membrane mein lipid bilayer hota hai, yani special lipid molecules ki two layers hoti hain."
},
{
question: "7. Fluid-mosaic model mein lipid molecules ke water-attracting heads aur water-repelling tails ka arrangement kya hota hai?",
options: [
"A. Heads inward, tails outward",
"B. Heads aur tails dono outward",
"C. Heads outward, tails inward",
"D. Heads aur tails dono inward"
],
correct: 2,
explanation: "Water-attracting heads outward face karte hain, jabki water-repelling tails membrane ke andar ki taraf arranged hote hain."
},
{
question: "8. Cell membrane ke proteins ka important function kya hai?",
options: [
"A. Cell ko colour dena",
"B. Substances ke passage mein gatekeepers ki tarah help karna",
"C. Cell ko divide karna",
"D. DNA ko destroy karna"
],
correct: 1,
explanation: "Membrane proteins gatekeepers ki tarah kaam karte hain aur different substances ke membrane ke through movement mein help karte hain."
},
{
question: "9. Plant, fungi aur bacteria cells mein cell membrane ke outside additional layer kaunsi hoti hai?",
options: [
"A. Nuclear membrane",
"B. Cell wall",
"C. Cytoplasm",
"D. Chromosome"
],
correct: 1,
explanation: "Plants, fungi aur bacteria mein cell membrane ke around ek additional protective layer hoti hai jise cell wall kehte hain."
},
{
question: "10. 20% sugar solution mein plant cell ko rakhne par kya observation hota hai?",
options: [
"A. Cell wall completely disappear ho jaati hai",
"B. Cell ka inner content shrink karta hai",
"C. Cell ka inner content expand karta hai",
"D. Cell wall bhi completely shrink ho jaati hai"
],
correct: 1,
explanation: "Concentrated sugar solution mein plant cell ka inner content shrink karta hai, jabki outer cell wall ki boundary same rehti hai. Is process mein inner aur outer boundaries ke beech space increase ho jaata 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">
Question ${currentQuestion + 1} of ${questions.length}<br><br>
${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;">
<strong>Explanation:</strong> ${q.explanation}
</div>
<hr>
`;
});
document.querySelector(".controls").style.display = "none";
document.getElementById("result").innerHTML = `
<h3>Your Score: ${score} / ${questions.length}</h3>
<p>${score === questions.length ? "Excellent! Perfect Score! 🎉" : "Keep Practising! 👍"}</p>
`;
}
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>