class 10 science chapter5

ch5 part11

<!DOCTYPE html>
<html lang="en">
<head>
<title>🧠 Biology Quiz – 17 NOVEMBER 2026</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>🧠 Biology Quiz – Translocation in Plants</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. Photosynthesis ke products ko leaves se plant ke other parts tak transport karne ko kya kehte hain?",
    options: [
      "A. Transpiration",
      "B. Translocation",
      "C. Respiration",
      "D. Diffusion"
    ],
    correct: 1,
    explanation: "Photosynthesis se bane soluble products ko leaves se other parts tak transport karne ki process ko <b>translocation</b> kehte hain."
  },
  {
    question: "2. Plants mein translocation kis vascular tissue mein hoti hai?",
    options: [
      "A. Xylem",
      "B. Epidermis",
      "C. Phloem",
      "D. Cortex"
    ],
    correct: 2,
    explanation: "<b>Phloem</b> photosynthesis ke products, mainly food, ko plant ke different parts tak transport karta hai."
  },
  {
    question: "3. Phloem photosynthesis ke products ke alawa aur kya transport karta hai?",
    options: [
      "A. Amino acids aur other substances",
      "B. Sirf oxygen",
      "C. Sirf water",
      "D. Carbon dioxide only"
    ],
    correct: 0,
    explanation: "Phloem <b>photosynthesis ke products ke saath amino acids aur other substances</b> bhi transport karta hai."
  },
  {
    question: "4. Phloem mein food aur other substances mainly kahan transport hote hain?",
    options: [
      "A. Sirf leaves mein",
      "B. Storage organs aur growing organs ki taraf",
      "C. Sirf roots se soil mein",
      "D. Sirf flowers se leaves mein"
    ],
    correct: 1,
    explanation: "Phloem substances ko <b>roots, fruits, seeds jaise storage organs</b> aur growing organs tak deliver karta hai."
  },
  {
    question: "5. Phloem mein translocation kis direction mein ho sakti hai?",
    options: [
      "A. Sirf upward",
      "B. Sirf downward",
      "C. Upward aur downward dono",
      "D. Sirf roots ki taraf"
    ],
    correct: 2,
    explanation: "Phloem mein food aur other substances ki translocation <b>both upward and downward directions</b> mein ho sakti hai."
  },
  {
    question: "6. Phloem mein food ki translocation mainly kis structures mein hoti hai?",
    options: [
      "A. Stomata",
      "B. Sieve tubes",
      "C. Alveoli",
      "D. Root hairs"
    ],
    correct: 1,
    explanation: "Food aur other substances ka translocation <b>sieve tubes</b> mein hota hai, jisme adjacent <b>companion cells</b> help karti hain."
  },
  {
    question: "7. Phloem mein translocation ke liye kis form of energy ka use hota hai?",
    options: [
      "A. ATP",
      "B. Sunlight directly",
      "C. Heat",
      "D. Sound energy"
    ],
    correct: 0,
    explanation: "Sucrose jaise materials ko phloem tissue mein transfer karne ke liye <b>ATP se energy</b> use hoti hai."
  },
  {
    question: "8. Phloem mein sucrose transfer hone ke baad osmotic pressure par kya effect padta hai?",
    options: [
      "A. Osmotic pressure decrease hota hai",
      "B. Osmotic pressure increase hota hai",
      "C. Osmotic pressure zero ho jata hai",
      "D. Koi effect nahi hota"
    ],
    correct: 1,
    explanation: "Sucrose ko phloem mein energy ki help se transfer karne se <b>osmotic pressure increase</b> hota hai. Iske kaaran water phloem mein move karta hai."
  },
  {
    question: "9. Phloem mein increased pressure material ko kis direction mein move karne mein help karta hai?",
    options: [
      "A. High-pressure tissue se low-pressure tissue ki taraf",
      "B. Low-pressure se high-pressure tissue ki taraf only",
      "C. Sirf roots ki taraf",
      "D. Sirf leaves ki taraf"
    ],
    correct: 0,
    explanation: "Phloem mein pressure difference develop hota hai. Ye pressure material ko <b>higher pressure wale region se lower pressure wale region</b> ki taraf move karta hai."
  },
  {
    question: "10. Spring season mein roots ya stem mein stored sugar buds tak kyun transport hoti hai?",
    options: [
      "A. Buds ko water absorb karna hota hai",
      "B. Buds ko growth ke liye energy chahiye hoti hai",
      "C. Buds photosynthesis stop kar dete hain",
      "D. Roots ko oxygen chahiye hoti hai"
    ],
    correct: 1,
    explanation: "Spring mein stored sugar <b>buds tak transport</b> hoti hai kyunki growing buds ko <b>energy for growth</b> ki zarurat hoti 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