class 10 science chapter 6

ch6 part4

<!DOCTYPE html>
<html lang="en">
<head>
<title>Science Quiz – Control and Movement 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; }
  .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 – Control and Movement 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 animals ki tarah nervous system aur muscles kyun nahi rakhte?",
    options: [
      "A. Plants mein cells nahi hote",
      "B. Plants mein nervous aur muscle tissues specialised form mein nahi hote",
      "C. Plants move nahi karte",
      "D. Plants mein water nahi hota"
    ],
    correct: 1,
    explanation: "Plants mein animals ki tarah nervous tissue aur muscle tissue nahi hote, phir bhi plants stimuli ke response mein movement kar sakte hain."
  },
  {
    question: "2. Chhui-mui plant ko touch karne par leaves fold aur droop kyun karte hain?",
    options: [
      "A. Growth ke kaaran",
      "B. Touch stimulus ke response mein",
      "C. Photosynthesis ke kaaran",
      "D. Gravity ke kaaran"
    ],
    correct: 1,
    explanation: "Chhui-mui plant touch ko detect karke bahut quickly leaves ko fold karta hai. Is movement mein growth involved nahi hoti."
  },
  {
    question: "3. Plants mein movement ke do main types kaun-se hain?",
    options: [
      "A. Fast aur slow movement",
      "B. Internal aur external movement",
      "C. Growth-dependent aur growth-independent movement",
      "D. Voluntary aur involuntary movement"
    ],
    correct: 2,
    explanation: "Plants mein kuch movements growth ke kaaran hote hain, jabki kuch movements growth ke bina bhi ho sakte hain, jaise chhui-mui ke leaves ka fold hona."
  },
  {
    question: "4. Plants touch ki information ko cells ke beech kaise convey karte hain?",
    options: [
      "A. Sirf muscles ke through",
      "B. Electrical-chemical means se",
      "C. Blood ke through",
      "D. Bones ke through"
    ],
    correct: 1,
    explanation: "Plants information ko electrical-chemical means se cell-to-cell convey kar sakte hain, lekin animals ki tarah unmein specialised nervous tissue nahi hota."
  },
  {
    question: "5. Plant cells apni shape change karne ke liye kya change karte hain?",
    options: [
      "A. DNA ki quantity",
      "B. Water ki amount",
      "C. Blood pressure",
      "D. Oxygen ki quantity"
    ],
    correct: 1,
    explanation: "Plant cells mein water ki amount change hone se cells swell ya shrink karte hain. Isse unki shape change hoti hai aur movement ho sakta hai."
  },
  {
    question: "6. Tendril kisi support ke around kaise coil hoti hai?",
    options: [
      "A. Support wali side ka growth faster hota hai",
      "B. Dono sides bilkul same grow karti hain",
      "C. Object se door wali side faster grow karti hai",
      "D. Tendril growth completely stop kar deti hai"
    ],
    correct: 2,
    explanation: "Support ke contact wali side slowly grow karti hai, jabki away side faster grow karti hai. Is unequal growth ke kaaran tendril support ke around coil kar leti hai."
  },
  {
    question: "7. Shoot ka light ki taraf bend hona kis type ka movement hai?",
    options: [
      "A. Geotropism",
      "B. Hydrotropism",
      "C. Phototropism",
      "D. Chemotropism"
    ],
    correct: 2,
    explanation: "Photo = light, isliye light ke response mein plant parts ka directional growth phototropism kehlata hai. Shoots generally light ki taraf bend karte hain."
  },
  {
    question: "8. Roots ka gravity ke response mein downward grow karna kya kehlata hai?",
    options: [
      "A. Phototropism",
      "B. Geotropism",
      "C. Chemotropism",
      "D. Hydrotropism"
    ],
    correct: 1,
    explanation: "Geo = earth/gravity. Roots gravity ke pull ki direction mein downward grow karte hain, isliye ise geotropism kehte hain."
  },
  {
    question: "9. Pollen tubes ka ovules ki taraf grow karna kis tropism ka example hai?",
    options: [
      "A. Hydrotropism",
      "B. Phototropism",
      "C. Geotropism",
      "D. Chemotropism"
    ],
    correct: 3,
    explanation: "Chemo = chemicals. Pollen tube chemical signals ke response mein ovule ki taraf grow karta hai, isliye ye chemotropism ka example hai."
  },
  {
    question: "10. Plant hormone auxin ka main role kya hai?",
    options: [
      "A. Cell division ko completely stop karna",
      "B. Shoot cells ko grow longer karna",
      "C. Leaves ko immediately dry karna",
      "D. Roots ko destroy karna"
    ],
    correct: 1,
    explanation: "Auxin shoot tip mein synthesise hota hai aur cells ko longer banane mein help karta hai. Light ek side se aane par auxin shady side par accumulate hota hai, jisse shoot light ki taraf bend karta 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