ch2 part8
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cell Biology Quiz – APICAL CLASSES</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;
margin: 0;
}
.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; }
#userName {
padding: 10px;
width: 90%;
max-width: 300px;
border: 1px solid #ccc;
border-radius: 6px;
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠 Cell Biology Quiz – APICAL CLASSES</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. Eukaryotic cells mein different life processes ko independently aur simultaneously carry out karne mein kya help karta hai?",
options: [
"A. Cell wall",
"B. Cell organelles",
"C. Cell membrane only",
"D. Chromosomes only"
],
correct: 1,
explanation: "Different <b>cell organelles specialised functions</b> perform karte hain, jaise energy production, waste removal aur new materials banana."
},
{
question: "2. Cell ko ek “tiny living factory” kyun kaha ja sakta hai?",
options: [
"A. Kyunki cell sirf energy store karta hai",
"B. Kyunki cell ka har part specific job perform karta hai",
"C. Kyunki cell hamesha divide karta hai",
"D. Kyunki cell mein sirf ek organelle hota hai"
],
correct: 1,
explanation: "Cell ke different parts <b>specific functions</b> perform karte hain aur together cell ke complete functions ko carry out karte hain."
},
{
question: "3. Nucleus ko “house of coded instructions” kyun kaha jaata hai?",
options: [
"A. Kyunki nucleus water store karta hai",
"B. Kyunki nucleus mein genetic information present hoti hai",
"C. Kyunki nucleus energy produce karta hai",
"D. Kyunki nucleus waste remove karta hai"
],
correct: 1,
explanation: "Nucleus mein <b>chromosomes aur DNA</b> hote hain, jisme genetic information stored hoti hai."
},
{
question: "4. Nucleus ko surround karne wali covering ko kya kaha jaata hai?",
options: [
"A. Cell wall",
"B. Nuclear membrane",
"C. Plasma membrane",
"D. Chromatin"
],
correct: 1,
explanation: "Nucleus ke around <b>double-layered nuclear membrane</b> hoti hai. Is membrane mein pores bhi present hote hain."
},
{
question: "5. Nuclear membrane ke pores ka main function kya hai?",
options: [
"A. Energy produce karna",
"B. Material ka nucleus aur cytoplasm ke beech transfer allow karna",
"C. DNA ko destroy karna",
"D. Cell wall banana"
],
correct: 1,
explanation: "Nuclear membrane ke <b>pores</b> nucleus aur cytoplasm ke beech materials ke movement/transfer ko allow karte hain."
},
{
question: "6. Nucleolus mein mainly kya hota hai?",
options: [
"A. DNA replication only",
"B. Ribosomal subunits ki synthesis",
"C. Energy production",
"D. Waste digestion"
],
correct: 1,
explanation: "<b>Nucleolus</b> nucleus ka dense, round body hai jahan <b>ribosomal subunits</b> ki synthesis hoti hai."
},
{
question: "7. Ribosome formation ke liye large aur small subunits kahan assemble hote hain?",
options: [
"A. Nucleus ke andar",
"B. Cytoplasm mein",
"C. Cell wall mein",
"D. Vacuole mein"
],
correct: 1,
explanation: "Ribosomal subunits nucleus mein bante hain aur cytoplasm mein aakar <b>one large aur one small subunit assemble hokar ribosome</b> banate hain."
},
{
question: "8. Chromosomes mein inheritance of characters ki information kis molecule ke form mein hoti hai?",
options: [
"A. Lipid",
"B. DNA",
"C. Glucose",
"D. Cellulose"
],
correct: 1,
explanation: "<b>DNA (Deoxyribonucleic acid)</b> genetic information contain karta hai jo parents se next generation tak characters ke inheritance mein important hai."
},
{
question: "9. DNA ke functional segments ko kya kaha jaata hai?",
options: [
"A. Tissues",
"B. Genes",
"C. Ribosomes",
"D. Nucleoli"
],
correct: 1,
explanation: "DNA ke <b>functional segments ko genes</b> kehte hain. Genes genetic information ko carry karte hain."
},
{
question: "10. Non-dividing cell mein DNA kis form mein present hota hai aur cell division ke time kya hota hai?",
options: [
"A. DNA free molecules ke form mein rehta hai aur disappear ho jaata hai",
"B. DNA chromatin material ka part hota hai aur division se pehle chromosomes mein organised ho jaata hai",
"C. DNA cell wall mein store hota hai aur nucleus se bahar aa jaata hai",
"D. DNA ribosomes mein convert ho jaata hai"
],
correct: 1,
explanation: "Non-dividing cell mein DNA <b>thread-like chromatin material</b> ka part hota hai. Cell division se pehle chromatin <b>organised hokar chromosomes</b> banata 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>