class 8 science chapter 6

ch6 part 9

<!DOCTYPE html>
<html lang="en">
<head>
<title>🧠 Cyclones: Formation, Effects and Safety Quiz</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>🧠 Cyclones: Formation, Effects and Safety Quiz</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. Cyclone generally kis jagah form hota hai?",
    options: [
      "A. Cold desert ke upar",
      "B. Warm ocean waters ke upar",
      "C. Snow-covered mountains par",
      "D. Dry grasslands mein"
    ],
    correct: 1,
    explanation: "Cyclones generally warm ocean waters ke upar develop hote hain. Ocean water heat hone par uske upar ki warm, moist air rise karti hai, jisse low-pressure area develop hota hai.<br><br><b>Example:</b> Bay of Bengal ka warm water cyclone develop hone ke liye favourable conditions provide kar sakta hai."
  },
  {
    question: "2. Water vapour jab condense hokar raindrops banata hai, toh atmosphere mein kya hota hai?",
    options: [
      "A. Heat release hoti hai.",
      "B. Heat destroy ho jaati hai.",
      "C. Air movement completely stop ho jaata hai.",
      "D. Ocean water freeze ho jaata hai."
    ],
    correct: 0,
    explanation: "Evaporation ke time water heat absorb karta hai. Jab water vapour condense hokar liquid water banta hai, toh latent heat release hoti hai. Yeh heat rising air ko aur upar rise karne mein help karti hai.<br><br><b>Example:</b> Warm ocean se evaporated water vapour jab clouds mein condense hota hai, toh released heat cyclone ko energy provide kar sakti hai."
  },
  {
    question: "3. Cyclone ke centre mein lowest-pressure region ko kya kaha jaata hai?",
    options: [
      "A. Eye of the cyclone",
      "B. Storm wall",
      "C. High-pressure zone",
      "D. Rain belt"
    ],
    correct: 0,
    explanation: "Cyclone ke centre mein lowest atmospheric pressure hota hai. Is region ko eye kaha jaata hai. Eye mein winds relatively calm ho sakti hain, jabki surrounding region mein strong winds aur heavy rainfall hoti hai.<br><br><b>Example:</b> Satellite image mein powerful cyclone ke centre par comparatively clear circular region eye ho sakta hai."
  },
  {
    question: "4. Cyclone mein surrounding high-pressure areas ki air generally kis taraf move karti hai?",
    options: [
      "A. Low-pressure area ki taraf",
      "B. Sirf upar ki taraf",
      "C. High-pressure area se door, bina kisi direction ke",
      "D. Sirf ocean ke neeche"
    ],
    correct: 0,
    explanation: "Air pressure difference ki wajah se air generally high-pressure regions se low-pressure regions ki taraf move karti hai. Earth ki rotation aur atmospheric forces winds ko rotate karne mein help karte hain.<br><br><b>Example:</b> Surrounding air cyclone ke low-pressure centre ki taraf flow karti hai."
  },
  {
    question: "5. Earth ki rotation cyclone ki formation mein kya role play karti hai?",
    options: [
      "A. Moving air ko spin karne mein help karti hai.",
      "B. Ocean water ko freeze karti hai.",
      "C. Clouds ko completely remove karti hai.",
      "D. Atmospheric pressure ko zero kar deti hai."
    ],
    correct: 0,
    explanation: "Earth ki rotation se Coriolis effect hota hai, jo moving air ki direction ko deflect karta hai. Isse cyclone ka rotating wind system develop hone mein help milti hai.<br><br><b>Example:</b> Northern Hemisphere mein tropical cyclones generally anticlockwise rotate karte hain."
  },
  {
    question: "6. Cyclone land par pahunchne ke baad generally weak kyun hone lagta hai?",
    options: [
      "A. Moist ocean air aur energy ka supply kam ya band ho jaata hai.",
      "B. Land par gravity nahi hoti.",
      "C. Land par clouds form nahi ho sakte.",
      "D. Air pressure hamesha same ho jaata hai."
    ],
    correct: 0,
    explanation: "Cyclone warm ocean se moisture aur energy leta hai. Land par aane ke baad yeh supply cut off ho jaati hai. Land ki surface friction bhi winds ko slow karti hai, isliye cyclone generally weaken hota hai.<br><br><b>Example:</b> Bay of Bengal se landfall karne wala cyclone kuch samay baad gradually weak ho sakta hai."
  },
  {
    question: "7. Cyclone ke strong winds ocean water ko shore ki taraf push karte hain. Isse kya ho sakta hai?",
    options: [
      "A. Storm surge",
      "B. Earthquake",
      "C. Drought",
      "D. Frost"
    ],
    correct: 0,
    explanation: "Cyclone ki strong winds aur low atmospheric pressure se sea level unusually rise kar sakta hai. Is water surge se coastal areas mein severe flooding ho sakti hai.<br><br><b>Example:</b> Coastal villages mein storm surge ki wajah se seawater roads aur houses tak pahunch sakta hai."
  },
  {
    question: "8. Cyclone ke saath hone wali heavy rainfall ka kaunsa effect ho sakta hai?",
    options: [
      "A. Rivers overflow aur landslides",
      "B. Rivers hamesha dry ho jaana",
      "C. Soil ka salt-free ho jaana",
      "D. Roads ka automatically repair ho jaana"
    ],
    correct: 0,
    explanation: "Heavy rainfall se rivers ka water level badh sakta hai aur flooding ho sakti hai. Hilly areas mein waterlogged soil slopes se slide kar sakti hai, jisse landslides ka risk badhta hai.<br><br><b>Example:</b> Cyclone ke time heavy rainfall mountain roads ko landslides se block kar sakti hai."
  },
  {
    question: "9. Cyclone ke baad seawater farmland mein ghusne se soil ki fertility kyun kam ho sakti hai?",
    options: [
      "A. Seawater mein salt hota hai.",
      "B. Seawater mein sunlight hoti hai.",
      "C. Seawater soil ko plastic mein badal deta hai.",
      "D. Seawater gravity ko kam kar deta hai."
    ],
    correct: 0,
    explanation: "Seawater ke salt se soil ki salinity badh sakti hai. Excess salt plants ke liye water absorb karna difficult bana sakta hai, jisse crops ki growth affect hoti hai.<br><br><b>Example:</b> Coastal farmland mein seawater flooding ke baad rice crops ko damage ho sakta hai."
  },
  {
    question: "10. Cyclone-prone area mein rehne wale logon ko cyclone warning milne par kya karna chahiye?",
    options: [
      "A. Weather alerts ignore karne chahiye.",
      "B. Beach par jaakar waves dekhni chahiye.",
      "C. IMD warnings follow karke designated cyclone shelter mein jaana chahiye.",
      "D. Open field mein wait karna chahiye."
    ],
    correct: 2,
    explanation: "India Meteorological Department (IMD) weather reports aur cyclone warnings issue karta hai. Emergency kit ready rakhna aur authorities ke instructions ke according shelter mein jaana life aur property ko protect karne mein help karta hai.<br><br><b>Example:</b> Emergency kit mein drinking water, medicines, torch, batteries, dry food aur important documents rakhe ja sakte 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