class 9 science chapter 1

ch1 part3

<!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;
  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;
  line-height: 1.5;
}
.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: 12px;
  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 – 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"></div>

  <div id="scoreboard">
    <h3>🏆 Scoreboard</h3>
    <ol id="scoreList"></ol>
  </div>
</div>

</div>

<script>

const questions = [

{
question: "1. Science mein theory kya provide karti hai?",
options: [
"A. Sirf ek guess",
"B. Observed patterns ke “why” ka evidence-based explanation",
"C. Sirf numerical calculation",
"D. Ek untested opinion"
],
correct: 1,
explanation: "Scientific <b>theory</b> batati hai ki observed patterns <b>kyun occur hote hain</b>. Yeh evidence, testing aur critical examination par based hoti hai."
},

{
question: "2. Science mein theory ko guess ya untested idea maanna kyun incorrect hai?",
options: [
"A. Theory sirf mathematics mein use hoti hai",
"B. Theory careful testing aur evidence par based explanation hoti hai",
"C. Theory ko kabhi test nahi kiya jaata",
"D. Theory personal belief par based hoti hai"
],
correct: 1,
explanation: "Scientific theory <b>careful testing, evidence aur critical examination</b> ke baad developed explanation hoti hai. Yeh simple guess nahi hoti."
},

{
question: "3. Scientific theories new evidence aane par change ya improve kyun ho sakti hain?",
options: [
"A. Science fixed beliefs par based hai",
"B. Scientific ideas evidence ke according revise kiye ja sakte hain",
"C. Scientists observations ko ignore karte hain",
"D. Theories ka evidence se koi relation nahi hota"
],
correct: 1,
explanation: "Science ki important feature hai ki scientific ideas <b>new evidence ke basis par improve ya change</b> ho sakti hain."
},

{
question: "4. Well-established scientific laws, theories aur models scientists ko kya karne mein help karte hain?",
options: [
"A. Future conditions mein possible outcomes predict karne mein",
"B. Experiments ko completely avoid karne mein",
"C. Evidence ko ignore karne mein",
"D. Har situation ka exact answer bina data ke dene mein"
],
correct: 0,
explanation: "Established scientific knowledge <b>predictions</b> karne mein help karta hai. Predictions evidence aur reasoning par based <b>reasoned expectations</b> hoti hain."
},

{
question: "5. Agar scientific prediction observations se match nahi karti, to scientists ko kya karna chahiye?",
options: [
"A. Prediction ko bina check kiye correct maan lena",
"B. Assumptions, models ya measurements ko re-examine karna",
"C. Evidence ko reject kar dena",
"D. Opinion ke basis par theory change karna"
],
correct: 1,
explanation: "Prediction fail hone par scientists <b>assumptions, models aur measurements</b> ko dobara examine karte hain. Isse scientific understanding improve hoti hai."
},

{
question: "6. Varsha kehti hai, “Dark clouds hain, isliye afternoon mein rain hogi.” Is prediction ko scientifically testable banane ke liye Meghna ko kya poochna useful hoga?",
options: [
"A. Kya tumhe dark clouds beautiful lagte hain?",
"B. Aaj humidity aur wind speed kya hai?",
"C. Clouds ka colour favourite hai?",
"D. Rain ka naam kisne rakha?"
],
correct: 1,
explanation: "Scientific prediction ke liye <b>measurable evidence</b> chahiye. Humidity, wind speed aur direction jaise data prediction ko testable banate hain."
},

{
question: "7. Weather forecasts future mein zyada uncertain kyun ho jaate hain?",
options: [
"A. Weather sirf ek factor par depend karta hai",
"B. Weather mein temperature, pressure, humidity aur wind jaise many changing factors hote hain",
"C. Weather models kabhi measurements use nahi karte",
"D. Weather completely random hota hai"
],
correct: 1,
explanation: "Weather multiple changing factors par depend karta hai. <b>Tiny differences in conditions</b> time ke saath grow kar sakte hain, isliye long-term forecasts less certain hote hain."
},

{
question: "8. Agar koi viral claim ho ki “eclipse ke time food harmful ho jaata hai”, to scientific approach kya hogi?",
options: [
"A. Claim ko sirf social media popularity ke basis par accept karna",
"B. Evidence aur physical, chemical ya biological mechanism check karna",
"C. Family belief ke basis par accept karna",
"D. Bina question kiye claim forward karna"
],
correct: 1,
explanation: "Science mein claims ko <b>evidence aur testable mechanisms</b> ke through check kiya jaata hai. Sirf viral hone se koi claim scientifically true nahi ho jaata."
},

{
question: "9. Scientific estimation ka main benefit kya hai?",
options: [
"A. Har answer ko exact banana",
"B. Result reasonable hai ya impossible, yeh quickly check karna",
"C. Measurements ki need completely remove karna",
"D. Calculations ko avoid karna"
],
correct: 1,
explanation: "<b>Estimation</b> se hum quickly check kar sakte hain ki answer sensible hai ya nahi. Isse errors detect karne aur scientific intuition develop karne mein help milti hai."
},

{
question: "10. Scientific thinking mein kisi problem ko solve karte waqt first step kya hona chahiye?",
options: [
"A. Directly exact calculation start karna",
"B. Situation ko pehle understand karna",
"C. Random answer guess karna",
"D. Formula ko bina situation samjhe apply karna"
],
correct: 1,
explanation: "Scientific reasoning mein pehle <b>situation ko understand</b> karna chahiye, phir relevant quantities identify karke rough estimate aur mathematical relationships ka use karna chahiye."
}

];

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 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>

Leave a Comment