class 10 science chapter 3

ch3 part 4

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Class 10 Science – Sexual Reproduction 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;
    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;
  }

  #userName {
    padding: 10px;
    width: 90%;
    max-width: 300px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 10px;
  }
</style>
</head>

<body>

<div class="quiz-container">

  <h2>🧠 Class 10 Science Quiz – Sexual Reproduction</h2>
  <p style="text-align:center;"><strong>APICAL CLASSES</strong></p>

  <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. Sexual reproduction mein new generation create karne ke liye kya zaroori hota hai?",
    options: [
      "A. Sirf male",
      "B. Sirf female",
      "C. Male aur female dono",
      "D. Sirf ek parent"
    ],
    correct: 2,
    explanation: "Sexual reproduction mein generally do individuals, ek male aur ek female, ke reproductive cells participate karte hain. Isse new generation create hoti hai."
  },

  {
    question: "2. DNA copying mechanism ke completely accurate na hone ka kya result hota hai?",
    options: [
      "A. Variations",
      "B. No reproduction",
      "C. Cell death always",
      "D. Same DNA in every organism"
    ],
    correct: 0,
    explanation: "DNA copying mein small errors ho sakte hain. Ye errors variations create karte hain, jo population ke survival mein useful ho sakte hain."
  },

  {
    question: "3. Sexual reproduction ka main advantage kya hai?",
    options: [
      "A. Sirf ek organism ki exact copy banana",
      "B. Variations ke naye combinations create karna",
      "C. DNA ko completely remove karna",
      "D. Chromosomes ko double karna"
    ],
    correct: 1,
    explanation: "Sexual reproduction mein do different individuals ke DNA combine hote hain. Isse variations ke naye combinations create hote hain."
  },

  {
    question: "4. Agar DNA copying mechanism bahut zyada inaccurate ho jaaye, to kya problem ho sakti hai?",
    options: [
      "A. Har organism stronger ho jayega",
      "B. DNA copies cellular apparatus ke saath properly work nahi kar payengi",
      "C. Chromosome number automatically half ho jayega",
      "D. Reproduction completely faster ho jayega"
    ],
    correct: 1,
    explanation: "Agar DNA copying bahut inaccurate ho, to many DNA copies properly function nahi karengi aur cells/organisms survive nahi kar paayenge."
  },

  {
    question: "5. Sexual reproduction mein DNA ki amount har generation mein double hone se bachane ke liye kaunsa process important hai?",
    options: [
      "A. Binary fission",
      "B. Budding",
      "C. Meiosis",
      "D. Fragmentation"
    ],
    correct: 2,
    explanation: "Meiosis germ-cells mein chromosomes aur DNA ki amount ko half kar deta hai. Jab male aur female germ-cells combine hote hain, normal chromosome number re-establish ho jata hai."
  },

  {
    question: "6. Meiosis ke through banne wale germ-cells mein non-reproductive body cells ke comparison mein kya hota hai?",
    options: [
      "A. Double chromosomes",
      "B. Half chromosomes",
      "C. No chromosomes",
      "D. Same DNA amount always"
    ],
    correct: 1,
    explanation: "Germ-cells mein half the number of chromosomes aur approximately half DNA content hota hai. Isse fertilisation ke baad chromosome number maintain rehta hai."
  },

  {
    question: "7. Male aur female gametes combine hone par kya form hota hai?",
    options: [
      "A. Spore",
      "B. Bud",
      "C. Zygote",
      "D. Fragment"
    ],
    correct: 2,
    explanation: "Male aur female germ-cells/gametes ke fusion se zygote banta hai. Zygote later divide hokar new organism develop karta hai."
  },

  {
    question: "8. Complex organisms mein female gamete generally kaisa hota hai?",
    options: [
      "A. Small and motile",
      "B. Large and contains food stores",
      "C. Without DNA",
      "D. Always smaller than male gamete"
    ],
    correct: 1,
    explanation: "Complex organisms mein female gamete usually large hota hai aur usmein developing zygote ke liye food stores present hote hain."
  },

  {
    question: "9. Male gamete generally kaisa hota hai?",
    options: [
      "A. Large and non-motile",
      "B. Large with food stores",
      "C. Smaller and likely to be motile",
      "D. Without chromosomes"
    ],
    correct: 2,
    explanation: "Male gamete generally smaller aur motile hota hai. Iski motility usse female gamete tak pahunchne mein help karti hai."
  },

  {
    question: "10. Sexual reproduction mein variations ke naye combinations kaise create hote hain?",
    options: [
      "A. Same individual ke cells ko repeatedly copy karke",
      "B. Do different individuals ke DNA ko combine karke",
      "C. DNA ko destroy karke",
      "D. Chromosomes ko completely remove karke"
    ],
    correct: 1,
    explanation: "Sexual reproduction mein two different individuals ke DNA combine hote hain. Isse previously existing variations ke new combinations bante hain, jo offspring mein variation increase karte hain."
  }

];

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

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

  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>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 work! 🎉" : score >= 5 ? "Good effort! Keep practising." : "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}/${questions.length} (${s.date})</li>`
    ).join("");
}

</script>

</body>
</html>

Leave a Comment