class 8 science chapter 13

ch13 part10

<!DOCTYPE html>
<html lang="en">
<head>
<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;
  }
  .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 – 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" 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. Potato ke kis part se new plant grow ho sakta hai?",
    options: [
      "A. Flower petals",
      "B. Eyes",
      "C. Fruit pulp",
      "D. Dry leaves"
    ],
    correct: 1,
    explanation: "Potato ek modified underground stem hai. Iski surface par present β€œeyes” buds hote hain, jinse suitable conditions mein shoots grow kar sakte hain.<br><br>Example: Potato ke sprouted eyes ko soil mein plant karne par new potato plant develop ho sakta hai."
  },
  {
    question: "2. Ginger mein vegetative propagation kis part ke through hota hai?",
    options: [
      "A. Rhizome",
      "B. Flower petals",
      "C. Seeds only",
      "D. Fruit skin"
    ],
    correct: 0,
    explanation: "Ginger ka rhizome ek underground modified stem hai. Iske buds se new shoots develop ho sakte hain, jisse new plants grow karte hain.<br><br>Example: Ginger ke rhizome ke ek piece ko, jisme healthy bud ho, moist soil mein plant karne par new plant grow ho sakta hai."
  },
  {
    question: "3. Planaria ki body ka chhota fragment suitable conditions mein kya kar sakta hai?",
    options: [
      "A. Sirf food digest kar sakta hai",
      "B. Regenerate hokar new individual bana sakta hai",
      "C. Pollen produce kar sakta hai",
      "D. Seed ban sakta hai"
    ],
    correct: 1,
    explanation: "Planaria ek flatworm hai jisme regeneration ki strong ability hoti hai. Suitable conditions mein body ka ek fragment missing parts regrow kar sakta hai aur kuch cases mein complete individual develop kar sakta hai.<br><br>Example: Laboratory studies mein Planaria ki regeneration ability ka use scientists body development ko samajhne ke liye karte hain."
  },
  {
    question: "4. Sexual reproduction mein zygote kaise banta hai?",
    options: [
      "A. Ek leaf ke soil mein girne se",
      "B. Male aur female gametes ke fusion se",
      "C. Sirf pollination se",
      "D. Ek organism ke binary fission se"
    ],
    correct: 1,
    explanation: "Fertilisation ke dauran male aur female gametes combine hote hain aur zygote form hota hai. Zygote aage develop hokar embryo ban sakta hai.<br><br>Example: Humans mein sperm aur egg ke fusion se zygote banta hai."
  },
  {
    question: "5. Sexual reproduction se born hone wale siblings mein differences kyun ho sakte hain?",
    options: [
      "A. Har sibling ka genetic material bilkul same hota hai",
      "B. Parents se inherited genetic information different combinations mein combine hoti hai",
      "C. Siblings ko genes inherit nahi hote",
      "D. Sirf environment hi sabhi differences decide karta hai"
    ],
    correct: 1,
    explanation: "Sexual reproduction mein gametes genetic information ke different combinations carry kar sakte hain. Isliye siblings ke inherited traits mein differences ho sakte hain.<br><br>Example: Ek family mein siblings ke hair type, height aur eye colour mein differences ho sakte hain."
  },
  {
    question: "6. Plants mein seeds ke dispersal ka ek benefit kya hai?",
    options: [
      "A. Sabhi seeds parent plant ke bilkul paas hi grow karte hain",
      "B. New plants parent plant se door grow kar sakte hain",
      "C. Seeds ko water ki kabhi zaroorat nahi hoti",
      "D. Plants ko photosynthesis ki zaroorat nahi rehti"
    ],
    correct: 1,
    explanation: "Seed dispersal se seeds parent plant se door pahunch sakte hain. Isse new plants ko suitable places mil sakti hain aur ek hi jagah competition kam ho sakta hai.<br><br>Example: Birds banyan fruit khane ke baad seeds ko doosri jagah drop kar sakte hain, jahan suitable conditions mein new banyan plant grow ho sakta hai."
  },
  {
    question: "7. Seed germination ke initial stage mein seed stored nutrients ka use kyun karta hai?",
    options: [
      "A. Kyunki seedling shuru mein apna food banane ke liye fully developed nahi hoti",
      "B. Kyunki seed sunlight ko destroy karta hai",
      "C. Kyunki roots nutrients absorb nahi kar sakti",
      "D. Kyunki seed mein embryo nahi hota"
    ],
    correct: 0,
    explanation: "Germination ke dauran seed ka embryo stored food reserves ka use growth ke liye karta hai. Jab seedling develop ho jati hai aur leaves functional ho jati hain, toh woh photosynthesis se food bana sakti hai.<br><br>Example: Germinating bean seed apne stored nutrients ka use karke root aur shoot develop karta hai."
  },
  {
    question: "8. Birds ke eggs mein stored nutrients ka main function kya hai?",
    options: [
      "A. Developing embryo ko nutrition provide karna",
      "B. Eggshell ko oxygen mein badalna",
      "C. Pollination karna",
      "D. Embryo ko food ki zaroorat se permanently free karna"
    ],
    correct: 0,
    explanation: "Bird egg mein yolk jaise stored food reserves developing embryo ko nutrients provide karte hain. Ye nutrients embryo ki growth aur development ke liye important hain.<br><br>Example: Hen ke egg mein yolk developing chick embryo ke liye major nutrient source hota hai."
  },
  {
    question: "9. External fertilisation ke liye frogs aur many fish mein water important kyun hai?",
    options: [
      "A. Water sperm aur eggs ko milne mein help karta hai",
      "B. Water genes ko completely remove kar deta hai",
      "C. Water fertilisation ko impossible banata hai",
      "D. Water eggs ko seeds mein convert karta hai"
    ],
    correct: 0,
    explanation: "External fertilisation mein gametes body ke bahar combine hote hain. Frogs aur many fish mein water sperm aur eggs ko milne ka medium provide karta hai.<br><br>Example: Pond mein frogs ke released eggs aur sperm suitable conditions mein combine hokar zygotes bana sakte hain."
  },
  {
    question: "10. Sexual reproduction aur asexual reproduction ke beech ek main difference kya hai?",
    options: [
      "A. Dono mein hamesha two parents required hote hain",
      "B. Asexual reproduction mein generally one parent hota hai, jabki sexual reproduction mein gametes fuse karte hain",
      "C. Sexual reproduction mein genetic material transfer nahi hota",
      "D. Asexual reproduction sirf animals mein hota hai"
    ],
    correct: 1,
    explanation: "Asexual reproduction mein generally one parent se new individual develop hota hai. Sexual reproduction mein gametes fuse karte hain aur offspring mein genetic variation aa sakti hai.<br><br>Example: Amoeba binary fission se asexual reproduction karta hai, jabki humans mein sperm aur egg ke fusion se sexual reproduction 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>

Leave a Comment