ch1 part1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠Science Quiz – Scientific Models and Observations</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;
box-sizing: border-box;
}
.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;
}
.options input {
margin-right: 8px;
}
.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;
}
#result {
text-align: center;
margin-top: 20px;
}
@media(max-width:600px) {
body {
padding: 10px;
}
.quiz-container {
width: 100%;
padding: 15px;
}
}
</style>
</head>
<body>
<div class="quiz-container">
<h2>🧠Science Quiz – Scientific Models and Observations</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"></div>
<div id="scoreboard">
<h3>🏆 Scoreboard</h3>
<ol id="scoreList"></ol>
</div>
</div>
</div>
<script>
const questions = [
{
question: "1. Science mein observations se measurements aur patterns ko express karne ke liye kya use kiya jaata hai?",
options: [
"A. Stories aur imagination",
"B. Symbols aur equations",
"C. Paintings aur colours",
"D. Guesswork aur opinions"
],
correct: 1,
explanation: "Science mein observations measurements tak lead karte hain aur patterns ko symbols aur equations ke through express kiya ja sakta hai."
},
{
question: "2. Science mein models ka main purpose kya hota hai?",
options: [
"A. Natural world ki har detail ko exactly copy karna",
"B. Complex real systems ko simple way mein samajhna",
"C. Experiments ko completely avoid karna",
"D. Scientific observations ko replace karna"
],
correct: 1,
explanation: "Natural world bahut complex hai. Models real systems ko simplify karte hain aur question ke liye important features par focus karne mein help karte hain."
},
{
question: "3. Scientific model banate waqt kuch details ko deliberately ignore kyun kiya jaata hai?",
options: [
"A. Kyunki scientists observations nahi karna chahte",
"B. Kyunki details hamesha incorrect hoti hain",
"C. Taaki system ko simple rakhkar specific question ka answer find kiya ja sake",
"D. Taaki model reality se completely different ho"
],
correct: 2,
explanation: "Details ko ignore karna mistake nahi, balki purposeful simplification hoti hai. Isse important factors par focus karna easy hota hai."
},
{
question: "4. Falling object ke basic motion ko study karte waqt simple model mein kaunsi factor ko ignore kiya ja sakta hai?",
options: [
"A. Gravity",
"B. Object ka motion",
"C. Air resistance",
"D. Object ki position"
],
correct: 2,
explanation: "Basic model mein air resistance ko neglect karke gravity ke effect ko easily study kiya ja sakta hai."
},
{
question: "5. Cricket ball ke six wale simple model mein kaunsa factor important hai?",
options: [
"A. Bat ka brand",
"B. Ball ka colour",
"C. Ball ka mass, speed aur direction",
"D. Field mein grass ki amount"
],
correct: 2,
explanation: "Ball boundary cross karegi ya nahi, is question ke liye mass, speed aur direction important factors hain."
},
{
question: "6. Cricket ball ke simple model mein following mein se kaunsi detail initially ignore ki ja sakti hai?",
options: [
"A. Ball ki speed",
"B. Ball ki direction",
"C. Ball ka mass",
"D. Ball ke seam ki stitching"
],
correct: 3,
explanation: "Seam ki stitching ka effect simple model mein bahut small hota hai, isliye ise initially ignore kiya ja sakta hai."
},
{
question: "7. Jab scientists kisi model mein extra details add karte hain, to generally kya hota hai?",
options: [
"A. Model less accurate ho jaata hai",
"B. Model greater accuracy provide kar sakta hai",
"C. Model completely useless ho jaata hai",
"D. Scientific question disappear ho jaata hai"
],
correct: 1,
explanation: "Simple model se start karke extra details add karne par model more complex aur generally more accurate ban sakta hai."
},
{
question: "8. Biology mein heart ke pumping action ko study karte waqt individual cells ko ignore karna kis purpose se useful hai?",
options: [
"A. Heart ko non-living system prove karne ke liye",
"B. Organ ko ek functioning system ke roop mein samajhne ke liye",
"C. Cells ki existence deny karne ke liye",
"D. Blood ko remove karne ke liye"
],
correct: 1,
explanation: "Individual cells ko ignore karke heart ko ek functioning system ke roop mein samajhna easier ho jaata hai."
},
{
question: "9. Science textbook mein magnifying glass ka symbol kis idea ko represent karta hai?",
options: [
"A. Fast movement",
"B. Careful observation",
"C. Mathematical calculation",
"D. Random exploration"
],
correct: 1,
explanation: "Magnifying glass careful observation ko represent karta hai—patterns notice karna aur small details par attention dena."
},
{
question: "10. Physicist Meghnad Saha ne stars ki light ko study karte waqt star ke matter ko kis simplified form mein treat kiya?",
options: [
"A. Solid rock",
"B. Liquid metal",
"C. Hot gas",
"D. Cold liquid"
],
correct: 2,
explanation: "Meghnad Saha ne star ke matter ko hot gas ke roop mein treat kiya aur mainly temperature, pressure aur atoms ke ion formation par focus kiya. Is simplification se stars ke colour aur temperature ke relationship ko samajhne mein help mili."
}
];
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;">
<strong>Explanation:</strong> ${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: 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>