ch5part13
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Apical Classes - Emulsions and Colloids 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; }
#userName {
padding: 10px;
width: 65%;
border: 1px solid #ccc;
border-radius: 6px;
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>๐งช APICAL CLASSES<br>Emulsions, Colloids and Separation Techniques 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. Jab dispersed phase aur dispersion medium dono liquids hon, to aise colloid ko kya kaha jaata hai?",
options: [
"A. Suspension",
"B. Emulsion",
"C. Solution",
"D. Alloy"
],
correct: 1,
explanation: "Jab dispersed phase aur dispersion medium dono liquids hote hain, to colloid ko emulsion kehte hain."
},
{
question: "2. Milk kis type ki emulsion ka example hai?",
options: [
"A. Water-in-oil",
"B. Oil-in-water",
"C. Solid-in-liquid",
"D. Gas-in-liquid"
],
correct: 1,
explanation: "Milk mein oil/fat droplets water mein dispersed hote hain, isliye milk oil-in-water emulsion hai."
},
{
question: "3. Inmein se kaunsa water-in-oil emulsion ka example hai?",
options: [
"A. Milk",
"B. Vanishing cream",
"C. Butter",
"D. Sugar solution"
],
correct: 2,
explanation: "Butter, body lotion aur cold cream water-in-oil emulsions ke examples hain."
},
{
question: "4. Emulsifying agents ka main function kya hota hai?",
options: [
"A. Emulsion ko stable banana",
"B. Emulsion ko evaporate karna",
"C. Particles ko dissolve karna",
"D. Boiling point ko zero karna"
],
correct: 0,
explanation: "Emulsifying agents emulsions ko stabilise karte hain. Milk aur butter mein proteins emulsifying agents ki tarah kaam karte hain."
},
{
question: "5. Cooking oil aur water ki emulsion banane ke liye water mein soap solution add karke mixture ko shake karne ka purpose kya hai?",
options: [
"A. Oil ko completely burn karna",
"B. Emulsion form aur stabilise karna",
"C. Water ko solid banana",
"D. Oil ko crystallise karna"
],
correct: 1,
explanation: "Oil aur water ko thoroughly mix/shake karne aur soap solution add karne se emulsion ban sakti hai, kyunki soap emulsifying agent ki tarah help karta hai."
},
{
question: "6. Clouds ko colloid kyun maana ja sakta hai?",
options: [
"A. Tiny water droplets ya ice crystals air mein dispersed hote hain",
"B. Water completely air mein dissolve ho jaata hai",
"C. Clouds sirf pure water hote hain",
"D. Clouds mein koi particles nahi hote"
],
correct: 0,
explanation: "Clouds mein tiny water droplets ya ice crystals air mein dispersed hote hain, isliye unhe colloidal mixture maana ja sakta hai."
},
{
question: "7. Smoke aur dust wale cities mein buildings aur surroundings hazy kyun dikhte hain?",
options: [
"A. Smoke aur dust light ko scatter karte hain",
"B. Smoke light ko completely absorb kar leta hai",
"C. Dust water mein dissolve ho jaati hai",
"D. Air ka temperature zero ho jaata hai"
],
correct: 0,
explanation: "Air mein present smoke aur dust particles light ko scatter karte hain. Ye scattering hazy appearance create karti hai."
},
{
question: "8. Sewage water treatment mein kaunsi processes commonly use hoti hain?",
options: [
"A. Sublimation, distillation aur chromatography",
"B. Sedimentation, coagulation aur filtration",
"C. Melting, freezing aur evaporation",
"D. Crystallization, alloying aur sublimation"
],
correct: 1,
explanation: "Sewage treatment mein sedimentation, coagulation aur filtration jaise separation steps use karke water ko cleaner banaya jaata hai."
},
{
question: "9. Do immiscible liquids ko unki different densities ke basis par separate karne ke liye kaunsa apparatus use hota hai?",
options: [
"A. Separating funnel",
"B. Centrifuge",
"C. Chromatography paper",
"D. China dish"
],
correct: 0,
explanation: "Separating funnel immiscible liquids, jaise oil aur water, ko unki different densities ke basis par separate karta hai."
},
{
question: "10. Kaunsa statement mixtures ki separation techniques ke baare mein correct hai?",
options: [
"A. Crystallization saturated solution se pure solid obtain kar sakti hai",
"B. Sublimation mein solid pehle liquid banta hai",
"C. Centrifugation slow spinning se heavier particles ko upar bhejti hai",
"D. Paper chromatography mein sabhi components same speed se move karte hain"
],
correct: 0,
explanation: "Crystallization saturated solution se pure solid crystals obtain karne ki technique hai. Sublimation mein solid directly vapour banta hai, centrifugation rapid spinning use karti hai, aur chromatography mein components different rates se move karte hain."
}
];
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>
<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() {
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];
let optsHTML = q.options.map((opt, i) => {
let cls = "";
if (i === q.correct) {
cls = "correct";
}
if (selected === i && selected !== q.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 === 10 ? "Excellent! Perfect Score!" :
score >= 7 ? "Very Good! Keep Practising!" :
score >= 5 ? "Good effort! Revise and try again!" :
"Keep practising. You can improve!"}</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>