class 10 science chapter5

ch5 part10

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Science Quiz – Transportation in Plants</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; }
</style>
</head>
<body>

<div class="quiz-container">
  <h2>🧠 Science Quiz – Transportation 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. Plants mein soil se nitrogen, phosphorus aur other minerals mainly kis part ke through absorb hote hain?",
    options: [
      "A. Leaves",
      "B. Flowers",
      "C. Roots",
      "D. Fruits"
    ],
    correct: 2,
    explanation: "Soil plants ke liye raw materials ka rich source hai. <b>Roots</b> soil ke contact mein hoti hain, isliye minerals aur other substances roots ke through absorb hote hain."
  },
  {
    question: "2. Agar soil-contacting organs aur chlorophyll-containing organs ke beech distance bahut zyada ho, toh diffusion alone kyun sufficient nahi hota?",
    options: [
      "A. Plant mein chlorophyll nahi hota",
      "B. Distance bahut large hone ke kaaran",
      "C. Roots water absorb nahi karti",
      "D. Leaves photosynthesis nahi karti"
    ],
    correct: 1,
    explanation: "Tall plants mein roots aur leaves ke beech distance bahut large ho sakta hai. Isliye <b>diffusion sufficient nahi hota</b> aur proper transportation system ki need hoti hai."
  },
  {
    question: "3. Plants mein water aur minerals ko soil se transport karne wala tissue kaunsa hai?",
    options: [
      "A. Phloem",
      "B. Epidermis",
      "C. Xylem",
      "D. Stomata"
    ],
    correct: 2,
    explanation: "<b>Xylem</b> roots se absorbed <b>water aur minerals</b> ko plant ke different parts, especially leaves, tak transport karta hai."
  },
  {
    question: "4. Phloem ka main function kya hai?",
    options: [
      "A. Soil se water absorb karna",
      "B. Photosynthesis ke products ko transport karna",
      "C. Oxygen ko absorb karna",
      "D. Water ko roots mein store karna"
    ],
    correct: 1,
    explanation: "<b>Phloem</b> leaves mein photosynthesis se bane products ko leaves se plant ke other parts tak transport karta hai."
  },
  {
    question: "5. Plants mein xylem ke vessels aur tracheids kya form karte hain?",
    options: [
      "A. Continuous water-conducting channels",
      "B. Food storage chambers",
      "C. Protective layers",
      "D. Stomata"
    ],
    correct: 0,
    explanation: "Xylem ke <b>vessels aur tracheids interconnected</b> hote hain aur ek continuous system banate hain jo plant ke different parts tak water conduct karta hai."
  },
  {
    question: "6. Roots mein soil se water root xylem mein enter karne ka main reason kya hai?",
    options: [
      "A. Photosynthesis",
      "B. Difference in ion concentration",
      "C. High temperature",
      "D. Phloem pressure"
    ],
    correct: 1,
    explanation: "Root cells soil se ions actively absorb karti hain, jisse root aur soil ke beech ion concentration difference create hota hai. Is difference ko reduce karne ke liye <b>water root mein move karta hai</b>."
  },
  {
    question: "7. Leaves se water vapour ke form mein water loss ko kya kehte hain?",
    options: [
      "A. Respiration",
      "B. Translocation",
      "C. Transpiration",
      "D. Photosynthesis"
    ],
    correct: 2,
    explanation: "Plant ke aerial parts, especially leaves, se water vapour ke form mein water loss ko <b>transpiration</b> kehte hain."
  },
  {
    question: "8. Transpiration ke kaaran xylem mein water ko upward move karne mein kya create hota hai?",
    options: [
      "A. Suction/pull",
      "B. Food pressure",
      "C. Heat energy",
      "D. Ion storage"
    ],
    correct: 0,
    explanation: "Leaf cells se water molecules evaporate hote hain. Is evaporation se <b>suction create hota hai</b>, jo roots ke xylem se water ko upward pull karta hai."
  },
  {
    question: "9. Transpiration plant mein water movement ke alawa aur kis function mein help karti hai?",
    options: [
      "A. Seed formation",
      "B. Temperature regulation",
      "C. Flower colour change",
      "D. Protein digestion"
    ],
    correct: 1,
    explanation: "<b>Transpiration temperature regulation</b> mein bhi help karti hai. Water loss ke process se plant ke temperature ko regulate karne mein madad milti hai."
  },
  {
    question: "10. Din ke time jab stomata open hote hain, water ko xylem mein upward move karne ki major driving force kya hoti hai?",
    options: [
      "A. Root pressure",
      "B. Photosynthesis",
      "C. Transpiration pull",
      "D. Phloem pressure"
    ],
    correct: 2,
    explanation: "Day time mein stomata open hote hain aur transpiration zyada hoti hai. Isliye <b>transpiration pull</b> xylem mein water movement ki major driving force hoti hai. Root pressure ka effect night mein relatively more important 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>
    <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