ch6 part2
<!DOCTYPE html>
<html lang="en">
<head>
<title>🧠 Science Quiz – Reflex Action</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 – Reflex Action</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. Reflex action ka simple meaning kya hai?",
options: [
"A. Bina kisi response ke rehna",
"B. Environment mein change ke response mein sudden action",
"C. Sirf growth ke kaaran movement",
"D. Conscious thinking ke baad slow movement"
],
correct: 1,
explanation: "Reflex action ek <b>sudden response</b> hota hai jo environment mein kisi change ke response mein hota hai, jaise flame touch karte hi hand ko withdraw karna."
},
{
question: "2. Reflex action ke time hum generally kya karte hain?",
options: [
"A. Pehle long time tak sochte hain",
"B. Action ko completely control karte hain",
"C. Bina consciously soche action kar dete hain",
"D. Sirf brain ke through action karte hain"
],
correct: 2,
explanation: "Reflex action mein response <b>without conscious thinking</b> quickly ho jata hai. Isliye hum reaction ko immediately feel karte hain, bina pehle consciously decide kiye."
},
{
question: "3. Hot object touch karne par hand ko quickly withdraw karne ka main advantage kya hai?",
options: [
"A. Body ko injury se protect karna",
"B. Digestion improve karna",
"C. Growth increase karna",
"D. Blood pressure reduce karna"
],
correct: 0,
explanation: "Hot object se hand quickly withdraw karne par burning ya injury ka risk <b>kam</b> hota hai."
},
{
question: "4. Agar hot object ko touch karne ke baad pehle brain mein complete thinking ho aur phir response aaye, toh kya problem ho sakti hai?",
options: [
"A. Response bahut fast hoga",
"B. Body ko food nahi milega",
"C. Response mein enough time lag sakta hai aur burn ho sakta hai",
"D. Muscles permanently stop ho jayengi"
],
correct: 2,
explanation: "Thinking ek <b>complex activity</b> hai aur ismein many nerve impulses involved hote hain. Agar response ke liye thinking ka wait kiya jaaye, toh dangerous situation mein injury ho sakti hai."
},
{
question: "5. Reflex arc kya hota hai?",
options: [
"A. Blood vessels ka network",
"B. Input nerve aur output nerve ke beech simple connection",
"C. Digestive system ka part",
"D. Muscles ka group"
],
correct: 1,
explanation: "<b>Reflex arc</b> input ko detect karne wali nerve aur muscles ko action karwane wali nerve ke beech ka relatively simple connection hai, jo quick response mein help karta hai."
},
{
question: "6. Human body mein reflex arcs mainly kahan form hote hain?",
options: [
"A. Heart",
"B. Brain ke skull ke bahar",
"C. Spinal cord",
"D. Stomach"
],
correct: 2,
explanation: "Body se aane wali nerves <b>spinal cord</b> mein bundle ke form mein milti hain. Reflex arcs mainly <b>spinal cord mein</b> form hote hain."
},
{
question: "7. Reflex action ke time information ka kya hota hai?",
options: [
"A. Information brain tak kabhi nahi pahunchti",
"B. Information sirf muscles tak jaati hai",
"C. Reflex response ke saath information brain tak bhi reach kar sakti hai",
"D. Information blood mein dissolve ho jaati hai"
],
correct: 2,
explanation: "Reflex arc spinal cord mein quick response generate karta hai, lekin <b>sensory information brain tak bhi jaati hai</b>, jahan us sensation ko process kiya ja sakta hai."
},
{
question: "8. Reflex arcs animals mein kyun important hain?",
options: [
"A. Ye slow thinking ko increase karte hain",
"B. Ye quick responses provide karte hain",
"C. Ye digestion control karte hain",
"D. Ye blood ko filter karte hain"
],
correct: 1,
explanation: "Reflex arcs <b>quick and efficient responses</b> provide karte hain, especially jab immediate action ki zarurat ho."
},
{
question: "9. Thinking process mainly kis type ke neuron network se associated hai?",
options: [
"A. Dense aur intricately arranged network of neurons",
"B. Sirf ek neuron",
"C. Blood cells ka network",
"D. Muscle fibres ka network"
],
correct: 0,
explanation: "Thinking ek complex activity hai, isliye brain ke thinking region mein <b>densely arranged aur interconnected neurons</b> ka complex network hota hai."
},
{
question: "10. Bright light eyes par focus hone par correct sequence ka basic idea kya hai?",
options: [
"A. Light → receptors → nerve impulses → nervous system → appropriate response",
"B. Light → stomach → muscles",
"C. Light → kidneys → brain",
"D. Light → blood → bones"
],
correct: 0,
explanation: "Bright light ko <b>eye ke receptors detect</b> karte hain. Is information se nerve impulses generate hote hain, jo nervous system tak jaate hain aur appropriate response coordinate hota 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;">
${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>