ch9part3
<!DOCTYPE html>
<html lang="en">
<head>
<title>🧠 Science Quiz – Law of Conservation of Mass</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>🧠 Science Quiz – Law of Conservation of Mass</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. Law of Conservation of Mass ke according chemical reaction ke before aur after total mass ka kya hota hai?",
options: [
"A. Mass increase hota hai",
"B. Mass decrease hota hai",
"C. Total mass same rehta hai",
"D. Mass completely disappear ho jata hai"
],
correct: 2,
explanation: "Chemical reaction mein matter <b>na create hota hai aur na destroy</b>. Isliye reaction se pehle aur baad total mass same rehta hai."
},
{
question: "2. Law of Conservation of Mass kis scientist ne <b>1789</b> mein propose kiya tha?",
options: [
"A. John Dalton",
"B. Antoine Lavoisier",
"C. J. J. Thomson",
"D. Ernest Rutherford"
],
correct: 1,
explanation: "<b>Antoine Lavoisier</b> ne 1789 mein Law of Conservation of Mass propose kiya tha. Unhe <b>Father of Modern Chemistry</b> bhi kaha jata hai."
},
{
question: "3. Lavoisier ke Law of Conservation of Mass ka basic meaning kya hai?",
options: [
"A. Matter chemical reaction mein create ho sakta hai",
"B. Matter chemical reaction mein destroy ho sakta hai",
"C. Matter chemical reaction mein na create hota hai, na destroy",
"D. Sirf gases ka mass conserve hota hai"
],
correct: 2,
explanation: "Chemical reaction mein atoms rearrange hote hain, lekin total matter conserved rehta hai. Isliye total mass same rehta hai."
},
{
question: "4. Activity 9.3 mein sodium sulfate aur barium chloride solutions ko mix karne par kya observation hoti hai?",
options: [
"A. Blue gas form hoti hai",
"B. White precipitate of barium sulfate form hota hai",
"C. Water completely disappear ho jata hai",
"D. No reaction hoti hai"
],
correct: 1,
explanation: "Sodium sulfate aur barium chloride ko mix karne par <b>white precipitate of barium sulfate</b> aur sodium chloride form hote hain."
},
{
question: "5. Activity 9.3 mein sodium sulfate solution aur barium chloride solution ki approximately kitni quantity li gayi thi?",
options: [
"A. 5 mL each",
"B. 10 mL each",
"C. 20 mL each",
"D. 50 mL each"
],
correct: 1,
explanation: "Conical flask A mein approximately <b>10 mL of 1% m/v sodium sulfate solution</b> aur flask B mein approximately <b>10 mL of 1% m/v barium chloride solution</b> liya gaya."
},
{
question: "6. Activity 9.3 mein solutions ko mix karne ke baad weighing balance ki reading ko dobara check karne ka purpose kya tha?",
options: [
"A. Colour measure karna",
"B. Temperature measure karna",
"C. Check karna ki total mass conserve hua ya nahi",
"D. Precipitate ka colour check karna"
],
correct: 2,
explanation: "Initial aur final total mass compare karke verify kiya jata hai ki chemical reaction ke during <b>mass conserved</b> raha ya nahi."
},
{
question: "7. Sodium sulfate aur barium chloride ki reaction mein products ka correct combination kya hai?",
options: [
"A. Barium sulfate + sodium chloride",
"B. Sodium sulfate + hydrogen",
"C. Barium chloride + oxygen",
"D. Sodium chloride + carbon dioxide"
],
correct: 0,
explanation: "Reaction mein sodium sulfate aur barium chloride react karke <b>barium sulfate precipitate</b> aur <b>sodium chloride</b> form karte hain."
},
{
question: "8. Zinc aur dilute hydrochloric acid ki chemical reaction mein kaunsi gas produce hoti hai?",
options: [
"A. Oxygen",
"B. Nitrogen",
"C. Hydrogen",
"D. Carbon dioxide"
],
correct: 2,
explanation: "Zinc jab dilute hydrochloric acid ke saath react karta hai, toh <b>zinc chloride aur hydrogen gas</b> form hoti hai."
},
{
question: "9. Zinc + dilute hydrochloric acid → zinc chloride + hydrogen reaction mein mass conservation test karne ke liye sabse important condition kya hogi?",
options: [
"A. Produced hydrogen gas ko system se escape hone dena",
"B. Reaction ko closed system mein perform karna aur initial-final mass compare karna",
"C. Sirf zinc ka mass measure karna",
"D. Sirf hydrochloric acid ka mass measure karna"
],
correct: 1,
explanation: "Hydrogen gas escape ho gayi toh measured mass kam ho sakta hai. Isliye gas ko <b>closed system mein contain</b> karke initial aur final total mass compare karna better test hai."
},
{
question: "10. Agar Activity 9.3 mein mixing ke baad white precipitate form ho jaye, phir bhi total mass practically same rahe, toh ye kya prove karta hai?",
options: [
"A. Chemical reaction mein matter destroy ho gaya",
"B. Chemical reaction mein new matter create hua",
"C. Chemical reaction ke during total mass conserved raha",
"D. Precipitate ka koi mass nahi hota"
],
correct: 2,
explanation: "Precipitate ka form hona ek <b>chemical change</b> hai, lekin reaction ke before aur after total mass same rehne se <b>Law of Conservation of Mass</b> verify hota hai. Matter ka form change ho sakta hai, but total mass conserved rehta hai."
}
];
let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
let quizSubmitted = false;
function startQuiz() {
userName = document.getElementById("userName").value.trim();
if (!userName) return alert("Please enter your name.");
currentQuestion = 0;
score = 0;
userAnswers = [];
quizSubmitted = false;
document.getElementById("nameSection").style.display = "none";
document.getElementById("quizSection").style.display = "block";
document.getElementById("result").innerHTML = "";
document.querySelector(".controls").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() {
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;">${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>