ch1 part4
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Science 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;
margin: 0;
}
.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;
margin-bottom: 15px;
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;
}
#userName {
padding: 10px;
width: 90%;
max-width: 350px;
border: 1px solid #ccc;
border-radius: 6px;
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠 Science 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. Resting condition mein ek person approximately kitne breaths per minute leta hai?",
options: [
"A. 2–5 breaths",
"B. 12–15 breaths",
"C. 25–30 breaths",
"D. 40–45 breaths"
],
correct: 1,
explanation: "Text ke according, rest par ek person approximately <b>12–15 breaths per minute</b> leta hai."
},
{
question: "2. Ek day mein total kitne minutes hote hain?",
options: [
"A. 720 minutes",
"B. 1,000 minutes",
"C. 1,440 minutes",
"D. 2,400 minutes"
],
correct: 2,
explanation: "Ek day mein <b>24 hours × 60 minutes = 1,440 minutes</b> hote hain."
},
{
question: "3. Agar person approximately 20,000 breaths per day leta hai aur ek breath mein about 0.5 litre air hoti hai, to daily air intake ka estimate kitna hoga?",
options: [
"A. 1,000 litres",
"B. 5,000 litres",
"C. 10,000 litres",
"D. 20,000 litres"
],
correct: 2,
explanation: "<b>20,000 breaths × 0.5 litre = 10,000 litres</b> air per day. Yeh ek approximate estimate hai, exact value nahi."
},
{
question: "4. Party balloon ko approximately kitni breaths se fill kiya ja sakta hai?",
options: [
"A. 1–2 breaths",
"B. 4–5 breaths",
"C. 10–12 breaths",
"D. 20–25 breaths"
],
correct: 1,
explanation: "Example mein assume kiya gaya hai ki ek typical <b>2-litre balloon ko 4–5 breaths</b> se fill kiya ja sakta hai. Isse one breath ka volume approximately <b>0.5 litre</b> estimate hota hai."
},
{
question: "5. Agar ek balloon approximately 2 litres ka hai aur ek minute mein 3 balloons fill kiye ja sakte hain, to 1,440 minutes mein total air volume approximately kitna hoga?",
options: [
"A. 2,880 litres",
"B. 4,320 litres",
"C. 8,640 litres",
"D. 12,000 litres"
],
correct: 2,
explanation: "<b>3 balloons/min × 2 litres/balloon × 1,440 min = 8,640 litres.</b> Yeh earlier 10,000-litre estimate ke reasonably close hai."
},
{
question: "6. Science ko Physics, Chemistry, Biology aur Earth Science jaise branches mein divide karne ka main purpose kya hai?",
options: [
"A. Natural world ko completely separate karna",
"B. Knowledge ko organise karna",
"C. Different branches ko unrelated banana",
"D. Sirf school subjects ko increase karna"
],
correct: 1,
explanation: "Science ki branches <b>knowledge ko organise</b> karne ke liye banayi gayi hain. Natural world mein ye branches actually interconnected hain."
},
{
question: "7. Climate change jaise real-world problems ko solve karne ke liye kya zaroori hai?",
options: [
"A. Sirf Physics ka knowledge",
"B. Sirf Biology ka knowledge",
"C. Several disciplines ke ideas ko combine karna",
"D. Sirf Mathematics ko use karna"
],
correct: 2,
explanation: "Climate change, medicines aur sustainable technologies jaise problems ko solve karne ke liye <b>multiple scientific disciplines</b> ke ideas together use karne padte hain."
},
{
question: "8. COVID-19 pandemic mein mask kaise work karta hai, ise samajhne ke liye kaun-si disciplines ki knowledge useful hai?",
options: [
"A. Sirf Biology",
"B. Physics, Chemistry, Biology aur Mathematics",
"C. Sirf Chemistry aur History",
"D. Sirf Mathematics"
],
correct: 1,
explanation: "Mask ko understand karne mein <b>Physics</b> particle motion/electrostatic attraction, <b>Chemistry</b> polymer fibres, <b>Biology</b> viruses aur <b>Mathematics</b> airflow/filtration modelling explain karte hain."
},
{
question: "9. Science ko sirf facts, equations aur experiments ka collection kyun nahi maana jaata?",
options: [
"A. Science mein experiments important nahi hain",
"B. Science curiosity, creativity, collaboration aur questioning se develop hoti hai",
"C. Science sirf imagination par based hai",
"D. Science mein evidence ki zaroorat nahi hoti"
],
correct: 1,
explanation: "Science ek <b>human activity</b> hai jo curiosity, creativity, collaboration, careful questioning, testing aur mistakes se learning ke through time ke saath develop hoti hai."
},
{
question: "10. Scientific thinking daily life mein kis tarah useful hai?",
options: [
"A. Sirf school exams mein",
"B. Technology ko understand karne aur information ko critically evaluate karne mein",
"C. Sirf laboratory experiments mein",
"D. Sirf mathematical calculations mein"
],
correct: 1,
explanation: "Scientific thinking humein surrounding <b>technology samajhne</b>, information ko <b>critically evaluate</b> karne aur apne world ko logically samajhne mein help karti hai."
}
];
let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
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() {
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>
<p><strong>${userName}</strong>, ${
score >= 8 ? "Excellent Performance! 🎉" :
score >= 5 ? "Good Attempt! 👍" :
"Keep Practicing! 📚"
}</p>
`;
}
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>