ch2 part7
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠Cell Structure 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;
}
.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: 350px;
border: 1px solid #ccc;
border-radius: 6px;
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠Cell: Structure and Functions 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. Most cells ke three basic parts kaun-se hote hain?",
options: [
"A. Cell wall, chloroplast aur vacuole",
"B. Plasma membrane, cytoplasm aur nucleus",
"C. Nucleus, mitochondria aur ribosome",
"D. Cytoplasm, cell wall aur lysosome"
],
correct: 1,
explanation: "Most cells mein three basic parts hote hain: <b>plasma membrane, cytoplasm aur prominent nucleus</b>."
},
{
question: "2. Cytoplasm ki nature kaisi hoti hai?",
options: [
"A. Hard aur solid",
"B. Dry aur powdery",
"C. Semi-fluid aur jelly-like",
"D. Completely gaseous"
],
correct: 2,
explanation: "<b>Cytoplasm ek semi-fluid, jelly-like substance</b> hota hai jisme different sub-cellular components present hote hain."
},
{
question: "3. Cytoplasm mein present sub-cellular components ko kya kaha jaata hai?",
options: [
"A. Tissues",
"B. Organs",
"C. Organelles",
"D. Organ systems"
],
correct: 2,
explanation: "Cytoplasm mein present specialised sub-cellular components ko <b>organelles</b> kehte hain. Kai organelles electron microscope se clearly visible hote hain."
},
{
question: "4. Bacterial cells ki important characteristic kya hai?",
options: [
"A. Well-defined nucleus present hota hai",
"B. Membrane-bound organelles present hote hain",
"C. Well-defined nucleus aur membrane-bound organelles absent hote hain",
"D. Cell membrane absent hoti hai"
],
correct: 2,
explanation: "Bacterial cells mein <b>well-defined nucleus nahi hota</b> aur membrane-bound organelles bhi absent hote hain."
},
{
question: "5. Prokaryotic cells mein cellular activities mainly kahan take place karti hain?",
options: [
"A. Nucleus",
"B. Cytoplasm",
"C. Cell wall",
"D. Chloroplast"
],
correct: 1,
explanation: "Prokaryotic cells mein well-defined nucleus aur membrane-bound organelles nahi hote, isliye most cellular activities <b>directly cytoplasm</b> mein hoti hain."
},
{
question: "6. “Prokaryotic” word mein “pro” aur “karyon” ka kya meaning hai?",
options: [
"A. Pro = large, karyon = cell",
"B. Pro = primitive, karyon = nucleus",
"C. Pro = true, karyon = membrane",
"D. Pro = small, karyon = organelle"
],
correct: 1,
explanation: "<b>Pro</b> ka meaning primitive aur <b>karyon</b> ka meaning nucleus hai."
},
{
question: "7. Plant aur animal cells ko kis type ke cells kaha jaata hai?",
options: [
"A. Prokaryotic cells",
"B. Acellular cells",
"C. Eukaryotic cells",
"D. Viral cells"
],
correct: 2,
explanation: "Plant aur animal cells mein <b>well-defined nucleus aur several membrane-bound organelles</b> hote hain, isliye ye eukaryotic cells hain."
},
{
question: "8. “Eukaryotic” word mein “eu” aur “karyon” ka kya meaning hai?",
options: [
"A. Eu = true, karyon = nucleus",
"B. Eu = primitive, karyon = cell",
"C. Eu = small, karyon = membrane",
"D. Eu = false, karyon = organelle"
],
correct: 0,
explanation: "<b>Eu</b> ka meaning <b>true</b> aur <b>karyon</b> ka meaning <b>nucleus</b> hai. Isliye eukaryotic cells mein true/well-defined nucleus hota hai."
},
{
question: "9. Viruses, viroids aur prions ko acellular kyun kaha jaata hai?",
options: [
"A. Kyunki unmein nucleus nahi hota",
"B. Kyunki unmein cell structure nahi hota",
"C. Kyunki woh sirf plants mein milte hain",
"D. Kyunki woh bahut large hote hain"
],
correct: 1,
explanation: "<b>Acellular</b> ka meaning hai <b>without cells</b>. Viruses, viroids aur prions cellular organisms nahi hain."
},
{
question: "10. Virus, viroid aur prion mein correct difference kya hai?",
options: [
"A. Virus mein genetic material + protein coat, viroid mein protein coat nahi, aur prion misfolded protein hota hai",
"B. Virus sirf protein se bana hota hai, viroid mein cell wall hoti hai",
"C. Viroid mein nucleus hota hai aur prion mein DNA hota hai",
"D. Teeno complete cells hote hain"
],
correct: 0,
explanation: "<b>Virus</b> mein genetic material ke around protein coat hota hai. <b>Viroid</b> mein protein coat nahi hota, jabki <b>prion misfolded protein</b> hota hai aur genetic material nahi hota."
}
];
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>