ch5part11
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Science Quiz – Centrifugation and Coagulation</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: 65%;
border: 1px solid #ccc;
border-radius: 6px;
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠 Science Quiz – Centrifugation and Coagulation</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. Centrifugation mein mixture ko separate karne ke liye kya kiya jaata hai?",
options: [
"A. Mixture ko slowly heat kiya jaata hai",
"B. Mixture ko high speed par spin kiya jaata hai",
"C. Mixture ko freeze kiya jaata hai",
"D. Mixture ko sunlight mein rakha jaata hai"
],
correct: 1,
explanation: "Centrifugation mein mixture ko tube ke andar <b>high speed par spin</b> kiya jaata hai, jisse different components separate hote hain."
},
{
question: "2. Centrifugation ke during heavier particles tube mein kahan move karte hain?",
options: [
"A. Centre ki taraf",
"B. Outwards aur bottom ki taraf",
"C. Sirf surface par",
"D. Vapour ke form mein bahar"
],
correct: 1,
explanation: "Centrifugal force heavier particles ko <b>outwards move</b> karati hai, jahan woh tube ke bottom par settle ho jaate hain."
},
{
question: "3. Centrifugation ke baad lighter liquid generally kahan remain karta hai?",
options: [
"A. Tube ke top par",
"B. Tube ke bottom par",
"C. Tube ke bahar",
"D. Solid form mein"
],
correct: 0,
explanation: "Heavier particles bottom par settle ho jaate hain, jabki <b>lighter liquid top par</b> remain karta hai."
},
{
question: "4. Blood ko centrifugation se separate karne par kaunse components alag kiye ja sakte hain?",
options: [
"A. Red blood cells aur plasma",
"B. Water aur salt",
"C. Sugar aur water",
"D. Oxygen aur nitrogen"
],
correct: 0,
explanation: "Laboratories mein centrifugation ka important use <b>blood ke red blood cells aur plasma</b> ko separate karna hai."
},
{
question: "5. Paperfuge kya hai?",
options: [
"A. Electricity se chalne wali large centrifuge machine",
"B. Hand-powered, low-cost centrifugation device",
"C. Water purification chemical",
"D. Paper chromatography ka solvent"
],
correct: 1,
explanation: "<b>Paperfuge</b> ek simple, low-cost aur <b>hand-powered device</b> hai jo electricity ke bina centrifugation kar sakta hai."
},
{
question: "6. Paperfuge jaise low-cost device ka remote areas mein kya benefit ho sakta hai?",
options: [
"A. Sirf cooking mein help karta hai",
"B. Blood samples ko separate karke diseases detect karne mein help karta hai",
"C. Petrol refine karta hai",
"D. Food ko freeze karta hai"
],
correct: 1,
explanation: "Paperfuge blood sample ke components ko separate karke <b>malaria aur anaemia</b> jaise diseases ki detection mein help kar sakta hai, especially remote areas mein."
},
{
question: "7. Muddy water mein powdered alum (fitkari) add karne par fine suspended particles ke saath kya hota hai?",
options: [
"A. Woh completely dissolve ho jaate hain",
"B. Woh clump together karke larger particles banaate hain",
"C. Woh vapour ban jaate hain",
"D. Woh gas mein convert ho jaate hain"
],
correct: 1,
explanation: "Alum fine suspended particles ko <b>clump together</b> kar deta hai. Is process ko <b>coagulation</b> kehte hain."
},
{
question: "8. Muddy water purification mein alum ko kya kaha jaata hai?",
options: [
"A. Solvent",
"B. Solute",
"C. Coagulant",
"D. Indicator"
],
correct: 2,
explanation: "Alum coagulation karata hai, isliye alum ko <b>coagulant</b> kaha jaata hai."
},
{
question: "9. Alum ke addition ke baad bane larger clumps muddy water se kaise separate kiye ja sakte hain?",
options: [
"A. Sedimentation ke baad decantation ya filtration se",
"B. Sublimation se",
"C. Chromatography se",
"D. Distillation se only"
],
correct: 0,
explanation: "Coagulation se larger clumps bante hain. Ye <b>gravity se settle</b> hote hain aur phir <b>decantation ya filtration</b> se water se separate kiye ja sakte hain."
},
{
question: "10. Milk se paneer banane mein coagulation kaise hoti hai?",
options: [
"A. Salt add karne se",
"B. Lemon juice ya vinegar jaise acid ko coagulant ke roop mein use karne se",
"C. Water evaporate karne se",
"D. Milk ko centrifuge karne se"
],
correct: 1,
explanation: "Lemon juice ya vinegar ka acid <b>milk proteins ko coagulate</b> karta hai, jisse solid <b>paneer/cheese</b> form hota hai."
}
];
let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
let quizSubmitted = false;
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>
`;
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() {
if (quizSubmitted) return;
saveAnswer();
score = 0;
questions.forEach((q, index) => {
if (userAnswers[index] === q.correct) {
score++;
}
});
quizSubmitted = true;
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";
const percentage = (score / questions.length) * 100;
document.getElementById("result").innerHTML = `
<h3>Your Score: ${score} / ${questions.length}</h3>
<h3>Percentage: ${percentage}%</h3>
<p><strong>${userName}</strong>, ${
percentage >= 80 ? "Excellent work!" :
percentage >= 50 ? "Good effort! Keep practising." :
"Keep learning and try again!"
}</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>${s.name} - ${s.score}/10 (${s.date})</li>`
).join("");
}
</script>
</body>
</html>