class 9 science chapter 6

ch6 part15

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Science Quiz – Newton's Third Law of Motion</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; }
#userName {
  padding: 10px;
  width: 95%;
  max-width: 350px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
</style>
</head>
<body>

<div class="quiz-container">
  <h2>🧠 Science Quiz – Newton's Third Law of Motion</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. Activity 6.7 mein ek inflated balloon par straw ko adhesive tape se attach karke ek taut thread straw ke through pass kiya gaya. Jab balloon ke neck par bandhi thread hata di jaati hai, to balloon kis direction mein move karta hai?",
    options: [
      "A. Air ke rushing-out direction mein",
      "B. Air ke rushing-out direction ke opposite",
      "C. Sirf downward",
      "D. Balloon move nahi karta"
    ],
    correct: 1,
    explanation: "Balloon se air ek direction mein bahar nikalti hai. Air balloon par equal and opposite force lagati hai, isliye balloon opposite direction mein move karta hai."
  },
  {
    question: "2. Activity 6.7 mein balloon ke stretched material ka air molecules par kya effect hota hai?",
    options: [
      "A. Air molecules ko balloon ke andar rokta hai",
      "B. Air molecules ko bahar expel karne ke liye force lagata hai",
      "C. Air molecules ka mass increase karta hai",
      "D. Air molecules ko freeze karta hai"
    ],
    correct: 1,
    explanation: "Balloon ka stretched material shrink hote waqt andar ke air molecules ko force se bahar push karta hai."
  },
  {
    question: "3. Balloon se air bahar nikalne par balloon opposite direction mein kyun move karta hai?",
    options: [
      "A. Air balloon par equal and opposite force lagati hai",
      "B. Gravity balloon ko push karti hai",
      "C. Balloon ka mass suddenly zero ho jaata hai",
      "D. Air balloon ko same direction mein push karti hai"
    ],
    correct: 0,
    explanation: "Balloon air ko ek direction mein push karta hai. Reaction ke roop mein escaping air balloon par opposite direction mein force lagati hai."
  },
  {
    question: "4. Rocket engine gases ko mainly kis direction mein expel karta hai, jisse rocket upward move kar sake?",
    options: [
      "A. Upward",
      "B. Downward",
      "C. Sideways",
      "D. Random direction"
    ],
    correct: 1,
    explanation: "Rocket engine gases ko downward expel karta hai. Exhaust gases ke reaction force se rocket par upward force lagta hai."
  },
  {
    question: "5. Rocket ground se lift off kab karega?",
    options: [
      "A. Jab rocket ka weight upward force se greater ho",
      "B. Jab upward thrust rocket ke weight se greater ho",
      "C. Jab engine gases produce karna band kar de",
      "D. Jab rocket par net force zero ho"
    ],
    correct: 1,
    explanation: "Jab rocket par upward force uske weight se greater hota hai, net force upward hota hai aur rocket lift off karta hai."
  },
  {
    question: "6. Space mein moving rocket apne engine se exhaust gases ko motion ki direction mein fire karta hai. Rocket par force kis direction mein lagega?",
    options: [
      "A. Motion ki same direction mein",
      "B. Motion ke opposite direction mein",
      "C. Hamesha upward",
      "D. Hamesha downward"
    ],
    correct: 1,
    explanation: "Exhaust gases motion ki direction mein expel hone par gases rocket par opposite direction mein reaction force lagati hain. Isse rocket slow hota hai."
  },
  {
    question: "7. Chandrayaan-3 ke Vikram lander ne Moon par soft landing ke liye rocket propulsion ka use karke apni velocity ko reduce kiya. Ye kaise possible hua?",
    options: [
      "A. Exhaust gases ko motion ke opposite effect wali direction mein expel karke",
      "B. Gravity ko completely remove karke",
      "C. Landing ke time mass increase karke",
      "D. Engine ko permanently off karke"
    ],
    correct: 0,
    explanation: "Exhaust gases ko appropriate direction mein expel karne se reaction force lander ki motion ko oppose kar sakta hai, jisse velocity reduce hoti hai."
  },
  {
    question: "8. Newton’s Third Law kin forces par apply hota hai?",
    options: [
      "A. Sirf contact forces par",
      "B. Sirf gravitational forces par",
      "C. Contact aur non-contact dono forces par",
      "D. Sirf frictional forces par"
    ],
    correct: 2,
    explanation: "Newton’s Third Law contact aur non-contact dono types of forces par apply hota hai."
  },
  {
    question: "9. Do bar magnets ek-doosre ke paas rakhe gaye aur ek magnet doosre par magnetic force lagata hai. Newton’s Third Law ke according kya hoga?",
    options: [
      "A. Sirf pehla magnet force experience karega",
      "B. Doosra magnet bhi equal magnitude ki opposite magnetic force lagayega",
      "C. Dono magnets par same direction mein force lagega",
      "D. Magnetic force sirf contact hone par lagega"
    ],
    correct: 1,
    explanation: "Magnetic force non-contact force hai, phir bhi action-reaction pair banta hai. Dono magnets ek-doosre par equal and opposite forces lagate hain."
  },
  {
    question: "10. Do similarly charged balloons ek-doosre ke paas rakhe gaye. Newton’s Third Law ke according unke beech kya hoga?",
    options: [
      "A. Sirf ek balloon doosre ko repel karega",
      "B. Dono balloons equal and opposite electrostatic forces lagayenge",
      "C. Dono balloons attract karenge",
      "D. Koi force nahi lagega kyunki balloons touch nahi kar rahe"
    ],
    correct: 1,
    explanation: "Similarly charged balloons ek-doosre ko electrostatic repulsion dete hain. Ye non-contact force hai aur dono balloons par equal magnitude ki opposite forces act karti hain."
  }
];

let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
let quizSubmitted = false;

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">Question ${currentQuestion + 1} of ${questions.length}<br><br>${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>
  `;

  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() {
  if (quizSubmitted) return;

  saveAnswer();
  score = 0;

  questions.forEach((q, index) => {
    if (userAnswers[index] === q.correct) {
      score++;
    }
  });

  quizSubmitted = true;
  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>Correct Answer:</strong> ${q.options[correct]}<br>
        <strong>Explanation:</strong> ${q.explanation}
      </div>
      <hr>
    `;
  });

  document.querySelector(".controls").style.display = "none";

  const percentage = (score / questions.length) * 100;

  document.getElementById("result").innerHTML = `
    <h3>Your Score: ${score} / ${questions.length}</h3>
    <h3>Percentage: ${percentage}%</h3>
    <h3>${percentage >= 40 ? "Well Done! 🎉" : "Keep Practising! 💪"}</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