class 9 science chapter 7

ch7 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 – Work Done | 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;
}

.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;
  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;
  color: #1e3c72;
}

@media(max-width:600px) {
  body {
    padding: 10px;
  }
  .quiz-container {
    width: 100%;
    padding: 15px;
  }
}
</style>
</head>

<body>

<div class="quiz-container">

<h2>🧠 Science Quiz – Work Done<br>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. Ek girl dumbbell ko slowly upward lift karti hai. Dumbbell par girl ka applied force aur displacement kis direction mein hote hain?",
options: [
"A. Opposite direction",
"B. Same direction",
"C. Perpendicular direction",
"D. No direction"
],
correct: 1,
explanation: "Dumbbell ko upar lift karte waqt girl ka force upward aur displacement bhi upward hota hai. Isliye girl positive work karti hai."
},

{
question: "2. Jab girl dumbbell ko slowly neeche lower karti hai, to girl ka applied force aur dumbbell ka displacement kis direction mein hote hain?",
options: [
"A. Same direction",
"B. Opposite direction",
"C. Perpendicular direction",
"D. Both zero"
],
correct: 1,
explanation: "Dumbbell downward move karta hai, lekin girl use control karne ke liye upward force lagati hai. Force aur displacement opposite hain, isliye work negative hota hai."
},

{
question: "3. Dumbbell ko upward lift karte samay girl dumbbell par kaisa work karti hai?",
options: [
"A. Negative work",
"B. Zero work",
"C. Positive work",
"D. No work"
],
correct: 2,
explanation: "Upward lifting mein force aur displacement same direction mein hain, isliye girl ka work positive hai."
},

{
question: "4. Dumbbell ko slowly downward lower karte samay girl dumbbell par kaisa work karti hai?",
options: [
"A. Positive work",
"B. Negative work",
"C. Zero work",
"D. Infinite work"
],
correct: 1,
explanation: "Girl ka applied force upward hota hai, jabki dumbbell ka displacement downward. Opposite directions hone ke karan work negative hota hai."
},

{
question: "5. Goalkeeper ball ko stop karte waqt 200 N force lagati hai aur ball ka displacement force ki opposite direction mein 15 cm hai. Work done ka correct value kya hoga?",
options: [
"A. +30 J",
"B. −30 J",
"C. +300 J",
"D. −300 J"
],
correct: 1,
explanation: "15 cm = 0.15 m. Force aur displacement opposite direction mein hain. W = 200 × (−0.15) = −30 J."
},

{
question: "6. Goalkeeper ke case mein work done negative kyun hai?",
options: [
"A. Force aur displacement same direction mein hain.",
"B. Ball rest mein thi.",
"C. Force ball ke displacement ke opposite direction mein hai.",
"D. Force zero hai."
],
correct: 2,
explanation: "Goalkeeper ball ko stop karne ke liye motion ke opposite force lagati hai. Isliye uska work ball par negative hota hai."
},

{
question: "7. Ek weightlifter 30 kg barbell ko apne hands mein steady hold kar rahi hai. Agar barbell ka displacement zero hai, to barbell par weightlifter ka work kitna hoga?",
options: [
"A. Positive",
"B. Negative",
"C. Zero",
"D. 30 J"
],
correct: 2,
explanation: "Weightlifter force laga rahi hai, lekin barbell move nahi kar raha, yani displacement zero hai. Therefore, W = F × 0 = 0."
},

{
question: "8. Ek stack of coins rough surface par move kar raha hai. Friction motion ke opposite direction mein act karta hai. Friction dwara coins par work kaisa hoga?",
options: [
"A. Positive",
"B. Negative",
"C. Zero",
"D. Always infinite"
],
correct: 1,
explanation: "Friction ki direction motion/displacement ke opposite hoti hai. Isliye friction coins par negative work karta hai aur unki speed decrease karta hai."
},

{
question: "9. Agar goalkeeper ball ko stop karne ke liye 200 N force lagati hai aur ball force ki direction mein 0.15 m move karti, to work done ka sign kya hota?",
options: [
"A. Positive",
"B. Negative",
"C. Zero",
"D. Cannot be determined"
],
correct: 0,
explanation: "Agar force aur displacement same direction mein hote, to work positive hota. Negative work tab hota hai jab displacement force ke opposite ho."
},

{
question: "10. Inmein se kis situation mein applied force dwara negative work kiya jaata hai?",
options: [
"A. Girl dumbbell ko upward lift karti hai.",
"B. Boy wheelchair ko forward push karta hai.",
"C. Goalkeeper moving ball ko opposite force laga kar stop karti hai.",
"D. Person stationary wall ko push karta hai."
],
correct: 2,
explanation: "Goalkeeper ka force ball ke displacement ke opposite direction mein hota hai, isliye work negative hota 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>
  `;

  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>
    <p>${score >= 8 ? "Excellent Performance! 🎉" :
      score >= 5 ? "Good Job! Keep Practicing! 👍" :
      "Keep Learning and Try Again! 📚"}</p>
  `;
}

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>

Leave a Comment