class 10 science chapter 7

ch7 part1

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>🧠 Reproduction and DNA Copying 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>🧠 Reproduction and DNA Copying 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. Organisms ke liye reproduction kyun important hai?",
    options: [
      "A. Individual organism ko alive rakhne ke liye",
      "B. New individuals produce karne ke liye",
      "C. Respiration karne ke liye",
      "D. Food digest karne ke liye"
    ],
    correct: 1,
    explanation: "Reproduction individual ki survival ke liye essential nahi hai, lekin ye <b>new individuals produce</b> karta hai aur species ki continuity mein important role play karta hai."
  },
  {
    question: "2. Reproduction individual organism ke liye essential life process kyun nahi hai?",
    options: [
      "A. Kyunki reproduction mein oxygen ki zarurat nahi hoti",
      "B. Kyunki reproduction food produce karta hai",
      "C. Kyunki individual reproduction ke bina bhi apni life maintain kar sakta hai",
      "D. Kyunki reproduction sirf plants mein hota hai"
    ],
    correct: 2,
    explanation: "Nutrition, respiration aur excretion individual ki life maintain karne ke liye essential hain, lekin <b>reproduction individual ke survival ke liye necessary nahi hai</b>."
  },
  {
    question: "3. Reproducing organisms ke new individuals generally kaise dikhte hain?",
    options: [
      "A. Parents se completely different",
      "B. Parents ke body design se similar",
      "C. Hamesha exactly identical",
      "D. Sirf colour mein similar"
    ],
    correct: 1,
    explanation: "Reproduction mein new individuals ke <b>body designs parents se similar</b> hote hain, kyunki body design ki information DNA mein stored hoti hai."
  },
  {
    question: "4. Chromosomes ke andar inheritance ki information kis molecule ke form mein present hoti hai?",
    options: [
      "A. Protein",
      "B. Glucose",
      "C. DNA",
      "D. Fat"
    ],
    correct: 2,
    explanation: "Chromosomes ke nucleus mein <b>DNA (Deoxyribo Nucleic Acid)</b> hota hai. DNA parents se next generation tak inherited features ki information carry karta hai."
  },
  {
    question: "5. Reproduction ke process mein ek basic event kya hai?",
    options: [
      "A. DNA copy banana",
      "B. Blood pressure increase karna",
      "C. Food digest karna",
      "D. Oxygen release karna"
    ],
    correct: 0,
    explanation: "Reproduction ka ek basic event <b>DNA ki copy create karna</b> hai. DNA body design ki information ko carry karta hai."
  },
  {
    question: "6. DNA copying ke saath additional cellular apparatus kyun create hota hai?",
    options: [
      "A. DNA ko destroy karne ke liye",
      "B. New DNA copy ko life processes maintain karne ke liye cellular structure chahiye",
      "C. Cell ko colour dene ke liye",
      "D. Respiration stop karne ke liye"
    ],
    correct: 1,
    explanation: "Sirf DNA copy ko original cell se bahar push kar dena enough nahi hai. New DNA copy ke saath <b>cellular apparatus</b> bhi hona chahiye taaki wo life processes maintain kar sake."
  },
  {
    question: "7. DNA copying ke baad generally kya hota hai?",
    options: [
      "A. Cell divide hokar two cells banata hai",
      "B. DNA dissolve ho jaata hai",
      "C. Cell immediately die kar jaata hai",
      "D. Sirf nucleus disappear hota hai"
    ],
    correct: 0,
    explanation: "DNA copies separate hone ke baad cellular apparatus ke saath <b>ek cell divide hokar two cells</b> bana sakta hai."
  },
  {
    question: "8. Kya DNA copies hamesha original DNA ke absolutely identical hoti hain?",
    options: [
      "A. Haan, 100% identical hoti hain",
      "B. Sirf plants mein identical hoti hain",
      "C. Nahi, copying mein variations ho sakti hain",
      "D. Sirf animals mein identical hoti hain"
    ],
    correct: 2,
    explanation: "Biochemical reactions completely reliable nahi hoti. Isliye DNA copying ke time <b>small variations</b> aa sakti hain, jisse new cells similar but not necessarily identical hote hain."
  },
  {
    question: "9. Agar DNA copying mein variation bahut drastic ho aur new DNA cellular apparatus ke saath work na kar sake, toh kya ho sakta hai?",
    options: [
      "A. New cell simply die kar sakta hai",
      "B. Cell automatically larger ho jaata hai",
      "C. Cell immediately reproduce karta hai",
      "D. Cell mein extra oxygen banne lagti hai"
    ],
    correct: 0,
    explanation: "Kuch variations itni drastic ho sakti hain ki new DNA inherited cellular apparatus ke saath properly function na kare. Aisi <b>newborn cell survive nahi kar paati</b>."
  },
  {
    question: "10. Reproduction ke during DNA copying mein variations kis important process ka basis hain?",
    options: [
      "A. Digestion",
      "B. Evolution",
      "C. Respiration",
      "D. Excretion"
    ],
    correct: 1,
    explanation: "DNA copying ke during <b>variations</b> create hoti hain. Surviving organisms mein ye differences generations ke across accumulate ho sakte hain, aur ye <b>evolution ka basis</b> hain."
  }
];

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