class 9 science chapter 1

ch1 part2


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>🧠 Science Quiz – APICAL CLASSES</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 – APICAL CLASSES</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. Bicycle se school se home jaane ka time model karte waqt kaunsi information sabse relevant hogi?",
options: [
"A. Bicycle ka colour",
"B. Bicycle ka brand",
"C. Distance, speed aur travel conditions",
"D. Rider ke shoes ka colour"
],
correct: 2,
explanation: "Travel time determine karne ke liye <b>distance, speed aur relevant travel conditions</b> important hain. Bicycle ka colour ya brand jaise details generally ignore ki ja sakti hain."
},

{
question: "2. Science mein everyday words jaise “force”, “work”, “cell” aur “reaction” ko specific meaning kyun diya jaata hai?",
options: [
"A. Taaki scientific communication clear aur unambiguous ho",
"B. Taaki difficult language use ki ja sake",
"C. Taaki experiments avoid kiye ja saken",
"D. Taaki sirf ek country ke scientists samajh saken"
],
correct: 0,
explanation: "Science mein terms ke <b>specific meanings</b> hote hain, jisse scientists clearly communicate, observations compare aur ideas develop kar saken."
},

{
question: "3. Science mein mass, velocity, force aur electric current ko represent karne ke liye commonly kaun-se symbols use hote hain?",
options: [
"A. m, v, F, I",
"B. a, b, c, d",
"C. x, y, z, t",
"D. p, q, r, s"
],
correct: 0,
explanation: "Science mein quantities ko standard symbols se represent kiya jaata hai: <b>mass = m, velocity = v, force = F, electric current = I</b>."
},

{
question: "4. Science mein mathematics ka main role kya hai?",
options: [
"A. Sirf numerical answers yaad karna",
"B. Relationships between quantities ko clearly express aur test karna",
"C. Experiments ko replace karna",
"D. Scientific observations ko ignore karna"
],
correct: 1,
explanation: "Mathematics science ki ek <b>powerful language</b> hai jo quantities ke relationships ko clearly express karne aur carefully reason karne mein help karti hai."
},

{
question: "5. Science mein equation ko sirf calculation tool ke roop mein dekhna kyun incomplete hai?",
options: [
"A. Equation ka koi scientific meaning nahi hota",
"B. Equation quantities ke relationship ka compact statement bhi hoti hai",
"C. Equations sirf chemistry mein use hoti hain",
"D. Equations observations ko replace karti hain"
],
correct: 1,
explanation: "Equation sirf calculation nahi hai; yeh <b>different quantities ke beech relationship</b> ko compact way mein express karti hai."
},

{
question: "6. Speed of light ko symbol “c” se denote karne ka historical reason kya hai?",
options: [
"A. c ka meaning “constant” hai",
"B. c Latin word “celeritas” se aaya hai",
"C. c ka meaning “calculation” hai",
"D. c ka meaning “charge” hai"
],
correct: 1,
explanation: "Speed of light ka symbol <b>c</b> Latin word <b>“celeritas”</b>, meaning speed, se derived hai."
},

{
question: "7. Speed of light ki exact defined value kya hai?",
options: [
"A. 3 × 10⁶ m/s",
"B. 29,979,245.8 m/s",
"C. 299,792,458 m/s",
"D. 299,792 m/s"
],
correct: 2,
explanation: "Speed of light ki defined exact value <b>299,792,458 m/s</b> hai."
},

{
question: "8. Airplane fuel miscalculation incident mein main problem kya thi?",
options: [
"A. Fuel ka colour incorrectly measured tha",
"B. Pounds aur kilograms ki units ko mix up kiya gaya",
"C. Aircraft ki speed bahut high thi",
"D. Fuel tank completely empty tha"
],
correct: 1,
explanation: "Ground crew ne fuel density ko <b>pounds per litre</b> mein use kiya, jabki requirement <b>kilograms</b> mein thi. Unit mix-up ki wajah se aircraft fuel short ho gaya."
},

{
question: "9. Standard international units use karna important kyun hai?",
options: [
"A. Har country mein measurements different rakhne ke liye",
"B. Conversions aur measurement errors ko reduce karne ke liye",
"C. Scientific calculations ko difficult banane ke liye",
"D. Local measurements ko promote karne ke liye"
],
correct: 1,
explanation: "<b>Standard units</b> scientific results ko compare karne, fairness maintain karne aur unnecessary <b>conversion errors</b> ko avoid karne mein help karte hain."
},

{
question: "10. Science mein “law” generally kya describe karta hai?",
options: [
"A. Ek personal opinion",
"B. Nature mein repeatedly observed regular pattern",
"C. Ek untested guess",
"D. Sirf laboratory equipment ka design"
],
correct: 1,
explanation: "Scientific <b>law</b> generally nature mein observed <b>regular pattern</b> ko describe karta hai. Isse words ya mathematical relationship ke form mein express kiya ja sakta 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 saveAnswer() {

  const selected = document.querySelector('input[name="option"]:checked');

  userAnswers[currentQuestion] = selected
    ? parseInt(selected.value)
    : null;
}

function nextQuestion() {

  saveAnswer();

  if (currentQuestion < questions.length - 1) {
    currentQuestion++;
    showQuestion();
  }
}

function prevQuestion() {

  saveAnswer();

  if (currentQuestion > 0) {
    currentQuestion--;
    showQuestion();
  }
}

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;">
        <strong>Explanation:</strong> ${q.explanation}
      </div>
      <hr>
    `;

  });

  document.querySelector(".controls").style.display = "none";

  document.getElementById("result").innerHTML = `
    <h3>Your Score: ${score} / ${questions.length}</h3>
    <h3>Percentage: ${(score / questions.length * 100).toFixed(0)}%</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}/${questions.length} (${s.date})</li>
    `).join('');
}

</script>

</body>
</html>

Leave a Comment