ch10 part1
<!DOCTYPE html>
<html lang="en">
<head>
<title>🧠 Class 10 Science Quiz – Spherical Mirrors</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; line-height: 1.6; }
.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;
line-height: 1.6;
}
.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>🧠 Class 10 Science Quiz – Spherical Mirrors</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. Spherical mirror kise kehte hain?",
options: [
"A. Jiska reflecting surface bilkul flat ho",
"B. Jiska reflecting surface spherical shape mein curved ho",
"C. Jo sirf light ko absorb kare",
"D. Jo light ko produce kare"
],
correct: 1,
explanation: "Spherical mirror ek curved mirror hota hai jiska reflecting surface hollow sphere ke kisi part jaisa hota hai.<br><br>Example: Shiny metallic spoon ki curved surface spherical mirror ki tarah kaam kar sakti hai."
},
{
question: "2. Concave mirror ka reflecting surface kis direction mein curved hota hai?",
options: [
"A. Bahar ki taraf",
"B. Andar ki taraf",
"C. Bilkul flat hota hai",
"D. Kisi bhi direction mein nahi hota"
],
correct: 1,
explanation: "Concave mirror ka reflecting surface andar ki taraf curve hota hai. Isse inward-curved mirror bhi kehte hain.<br><br>Example: Spoon ki inner surface ko dekho. Yeh concave mirror ki tarah behave karti hai."
},
{
question: "3. Convex mirror ka reflecting surface kis direction mein curved hota hai?",
options: [
"A. Andar ki taraf",
"B. Bahar ki taraf",
"C. Flat surface mein",
"D. Neeche ki taraf"
],
correct: 1,
explanation: "Convex mirror ka reflecting surface bahar ki taraf ubhra hua hota hai. Isliye ise outward-curved mirror bhi kehte hain.<br><br>Example: Spoon ki outer surface convex mirror ki tarah kaam karti hai."
},
{
question: "4. Plane mirror mein image aam taur par kaisi hoti hai?",
options: [
"A. Hamesha chhoti aur inverted",
"B. Same size aur erect",
"C. Hamesha badi aur inverted",
"D. Hamesha invisible"
],
correct: 1,
explanation: "Plane mirror mein image object ke size ke barabar aur seedhi (erect) hoti hai.<br><br>Example: Jab hum normal flat dressing mirror mein apna face dekhte hain, toh image seedhi aur lagbhag same size ki hoti hai."
},
{
question: "5. Concave mirror ke paas face rakhne par image kaisi dikh sakti hai?",
options: [
"A. Badi aur erect",
"B. Hamesha invisible",
"C. Hamesha same size",
"D. Sirf chhoti aur erect"
],
correct: 0,
explanation: "Jab object concave mirror ke bahut paas hota hai, toh uski image virtual, erect aur magnified (badi) ho sakti hai. Object ki distance badalne par image badal sakti hai.<br><br>Example: Shaving mirror ya makeup mirror mein face ko paas se dekhne par face bada dikh sakta hai."
},
{
question: "6. Spoon ki outer curved surface mein face ki image aam taur par kaisi dikhti hai?",
options: [
"A. Inverted aur badi",
"B. Erect aur chhoti",
"C. Erect aur hamesha same size",
"D. Inverted aur same size"
],
correct: 1,
explanation: "Spoon ki outer surface convex mirror ki tarah behave karti hai. Convex mirror aam taur par virtual, erect aur diminished (chhoti) image banata hai.<br><br>Example: Steel spoon ki bahar wali surface mein apna face dekhne par face chhota aur seedha dikh sakta hai."
},
{
question: "7. Concave mirror aur convex mirror mein main difference kya hai?",
options: [
"A. Concave mirror light produce karta hai",
"B. Convex mirror light absorb karta hai",
"C. Concave andar ki taraf aur convex bahar ki taraf curved hota hai",
"D. Dono ka reflecting surface flat hota hai"
],
correct: 2,
explanation: "Dono spherical mirrors hain, lekin unki reflecting surfaces ki curvature opposite directions mein hoti hai.<br><br>Example: Spoon ki inner surface concave aur outer surface convex mirror ki tarah behave karti hai."
},
{
question: "8. Spherical mirrors kaise banaye ja sakte hain?",
options: [
"A. Sirf paper ko fold karke",
"B. Glass ko grind aur polish karke curved surface banana",
"C. Paani ko freeze karke",
"D. Wood ko paint karke"
],
correct: 1,
explanation: "Spherical mirrors banane ke liye glass ki surface ko grind aur polish karke curve diya ja sakta hai. Reflective coating bhi lagayi jaati hai.<br><br>Example: Ek specially shaped aur polished glass par aluminium ki thin layer lagakar mirror banaya ja sakta hai."
},
{
question: "9. Concave mirror ki schematic representation mein non-reflecting surface ko kaise dikhaya jaata hai?",
options: [
"A. Shaded region se",
"B. Dotted circle se hi",
"C. Green colour se",
"D. Arrow se"
],
correct: 0,
explanation: "Diagram mein shaded part mirror ki non-reflecting surface ko show karta hai, jabki doosri surface light reflect karti hai.<br><br>Example: Science textbook mein concave mirror ke diagram ko dekho; uske peeche ka shaded region non-reflecting side ko indicate karta hai."
},
{
question: "10. Meena ne spoon ki inner surface mein apni image inverted dekhi. Spoon ki inner surface kis mirror ki tarah kaam kar rahi thi?",
options: [
"A. Plane mirror",
"B. Convex mirror",
"C. Concave mirror",
"D. Koi mirror nahi"
],
correct: 2,
explanation: "Spoon ki inner surface inward-curved hoti hai, isliye woh concave mirror ki tarah behave karti hai. Kuch distances par concave mirror inverted image bana sakta hai.<br><br>Example: Jab spoon ko face se door le jaate hain, toh usmein face ki image ulti dikh sakti hai. Yeh object aur mirror ke beech distance par depend karta 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;">
<strong>Explanation:</strong><br>${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>