class 8 science chapter 6

ch6 part 5

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Air Pressure and High-Speed Winds 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>🧠 Air Pressure and High-Speed Winds 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. Jab hum do balloons ke beech mein air blow karte hain, toh balloons ek-doosre ke paas kyun aate hain?",
options: [
"A. Beech mein air pressure badh jaata hai.",
"B. Beech mein air pressure kam ho jaata hai.",
"C. Balloons ka weight badh jaata hai.",
"D. Balloons ki air khatam ho jaati hai."
],
correct: 1,
explanation: "Jab hum balloons ke beech mein air blow karte hain, toh air ki speed badh jaati hai aur beech mein pressure kam ho jaata hai. Bahar ka higher air pressure balloons ko ek-doosre ki taraf push karta hai.<br><br><b>Example:</b> Do paper strips ke beech zor se phoonk maarne par woh ek-doosre ke paas aa sakti hain."
},

{
question: "2. High-speed winds ke saath air pressure mein kya change hota hai?",
options: [
"A. Air pressure badh jaata hai.",
"B. Air pressure kam ho jaata hai.",
"C. Air pressure hamesha same rehta hai.",
"D. Air pressure zero ho jaata hai."
],
correct: 1,
explanation: "Is activity mein hum observe karte hain ki high-speed airflow ke region mein pressure kam ho sakta hai. Isliye fast-moving air aur reduced air pressure ke beech sambandh hota hai.<br><br><b>Example:</b> Tez hawa jab ghar ki roof ke upar se guzarti hai, toh roof ke upar low-pressure area ban sakta hai."
},

{
question: "3. Jab hum balloons ke beech zyada zor se air blow karte hain, toh kya hota hai?",
options: [
"A. Balloons door chale jaate hain.",
"B. Balloons ka size double ho jaata hai.",
"C. Balloons ek-doosre ki taraf aur tezi se aa sakte hain.",
"D. Balloons ka movement band ho jaata hai."
],
correct: 2,
explanation: "Zyada zor se phoonk maarne par balloons ke beech air ki speed badh jaati hai. Isse pressure difference badh sakta hai aur surrounding air balloons ko ek-doosre ki taraf push karti hai.<br><br><b>Example:</b> Agar tum paper ki do halki strips ko latka kar unke beech tez hawa blow karo, toh strips paas aa sakti hain."
},

{
question: "4. Storm ke time kisi ghar ki roof udne ka ek main reason kya ho sakta hai?",
options: [
"A. Roof ke upar air pressure bahut badh jaana.",
"B. Roof ke upar air pressure kam ho jaana.",
"C. Ghar ke andar temperature zero ho jaana.",
"D. Roof ka colour badal jaana."
],
correct: 1,
explanation: "Tez hawa roof ke upar se guzarti hai, toh roof ke upar pressure kam ho sakta hai. Agar ghar ke andar pressure comparatively zyada ho aur roof weak ho, toh pressure difference roof ko upar ki taraf utha sakta hai.<br><br><b>Example:</b> Storm ke dauraan weakly attached tin roof tez hawa mein ud sakti hai."
},

{
question: "5. Roof ke neeche aur roof ke upar air pressure mein bada difference hone par kya ho sakta hai?",
options: [
"A. Roof aur mazboot ho jaati hai.",
"B. Roof hawa mein ud sakti hai.",
"C. Ghar ka weight badh jaata hai.",
"D. Hawa chalna band ho jaati hai."
],
correct: 1,
explanation: "Roof ke neeche ka pressure agar roof ke upar ke pressure se zyada ho, toh roof par upward force lag sakta hai. Weak roof is force ko withstand nahi kar paati.<br><br><b>Example:</b> Purane ghar ki loose tin sheets storm ke time nikal kar ud sakti hain."
},

{
question: "6. Textbook ke according, high-speed winds ke storm ke time doors aur windows kholne se kya benefit ho sakta hai?",
options: [
"A. Ghar ke andar aur roof ke upar pressure difference kam ho sakta hai.",
"B. Hawa chalna band ho jaati hai.",
"C. Roof ka weight badh jaata hai.",
"D. Air pressure hamesha zero ho jaata hai."
],
correct: 0,
explanation: "Textbook ke explanation ke according, openings se pressure difference reduce ho sakta hai, jisse roof par lagne wala upward force kam ho sakta hai. Lekin real storms mein doors aur windows kholna safe nahi maana jaata; unhe band rakho aur local disaster-safety instructions follow karo.<br><br><b>Example:</b> Cyclone ke time ghar ke andar rehkar windows se door rehna aur authorities ki safety advice follow karna chahiye."
},

{
question: "7. Air pressure ka matlab kya hai?",
options: [
"A. Air ka colour.",
"B. Air dwara kisi surface par lagaya gaya pressure.",
"C. Air ka taste.",
"D. Air ka weight zero hona."
],
correct: 1,
explanation: "Air ke particles surfaces par force lagate hain. Unit area par lagne wale force ko pressure kehte hain.<br><br><b>Example:</b> Balloon ke andar air bharne se balloon phool jaata hai, kyunki air balloon ki walls par pressure lagati hai."
},

{
question: "8. Jab high-speed wind kisi building ki roof ke upar se guzarti hai, toh roof ke upar generally kya create ho sakta hai?",
options: [
"A. High-pressure area.",
"B. Low-pressure area.",
"C. Vacuum har situation mein.",
"D. No air movement."
],
correct: 1,
explanation: "Tez hawa roof ke upar se flow karti hai, toh pressure kam ho sakta hai. Roof ke neeche comparatively higher pressure hone par roof ko upward force mil sakta hai.<br><br><b>Example:</b> Tez aandhi mein lightweight shed ki roof hawa ke pressure difference ki wajah se damage ho sakti hai."
},

{
question: "9. Balloons wali activity se humein kya conclusion milta hai?",
options: [
"A. Air pressure ka wind speed se koi relation nahi hai.",
"B. Fast-moving air ke region mein pressure kam ho sakta hai.",
"C. Air sirf neeche ki taraf pressure lagati hai.",
"D. Balloons sirf gravity ke kaaran paas aate hain."
],
correct: 1,
explanation: "Balloons ke beech fast-moving air ka pressure kam hota hai. Bahar ki air ka comparatively higher pressure balloons ko andar ki taraf push karta hai.<br><br><b>Example:</b> Perfume spray aur atomizer jaise devices mein fast-moving air aur pressure differences ka use liquid ko spray karne mein kiya ja sakta hai."
},

{
question: "10. High-speed winds ke saath storms mein aur kaun-se natural events ho sakte hain?",
options: [
"A. Thunder aur lightning.",
"B. Sirf snowfall.",
"C. Sirf rainbow.",
"D. Sirf earthquake."
],
correct: 0,
explanation: "Thunderstorms mein tez hawa ke saath lightning aur thunder bhi ho sakte hain. Lightning ek electrical discharge hai aur thunder lightning se hawa ke achanak heat aur expand hone ke kaaran sunai deta hai.<br><br><b>Example:</b> Monsoon ke time dark clouds, tez hawa, bijli chamakna aur garajna ek thunderstorm ke signs ho 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