class 10 science chapter10

ch10 part1

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>APICAL CLASSES - Human Eye 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 12px;
    min-height: 100vh;
    margin: 0;
  }
  .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;
    line-height: 1.5;
  }
  .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: 12px;
    margin-top: 10px;
    border-left: 5px solid #2a5298;
    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; }
  input[type="text"] {
    padding: 10px;
    width: 65%;
    max-width: 300px;
    border: 1px solid #ccc;
    border-radius: 6px;
  }
  #scoreboard {
    margin-top: 25px;
    background: #eef3f7;
    padding: 15px;
    border-radius: 8px;
  }
  #scoreboard h3 { text-align: center; }
  ol { padding-left: 20px; }
  hr { border: 0; border-top: 1px solid #ddd; margin: 22px 0; }
  @media (max-width: 600px) {
    .quiz-container { padding: 18px; width: 95%; }
    body { padding: 15px 5px; }
    input[type="text"] { width: 90%; }
  }
</style>
</head>
<body>

<div class="quiz-container">
  <h2>🧠 APICAL CLASSES – Human Eye and the Colourful World 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. Human eye mein lens ka main function kya hai?",
    options: [
      "(a) Light ko completely absorb karna",
      "(b) Retina par object ka image form karna",
      "(c) Brain ko electrical signals directly bhejna",
      "(d) Pupil ka size control karna"
    ],
    correct: 1,
    explanation: "Human eye ka <b>lens light rays ko focus</b> karta hai aur retina par object ka <b>inverted real image</b> form karta hai."
  },
  {
    question: "2. Human eye mein light sabse pehle kis transparent structure se enter karti hai?",
    options: [
      "(a) Iris",
      "(b) Retina",
      "(c) Cornea",
      "(d) Optic nerve"
    ],
    correct: 2,
    explanation: "Light eye mein <b>cornea</b> ke through enter karti hai. Cornea eyeball ke front par ek transparent bulge hota hai."
  },
  {
    question: "3. Human eye mein entering light ke rays ka maximum refraction mainly kahan hota hai?",
    options: [
      "(a) Retina par",
      "(b) Cornea ki outer surface par",
      "(c) Iris ke andar",
      "(d) Optic nerve par"
    ],
    correct: 1,
    explanation: "Eye mein entering light ka <b>most refraction cornea ki outer surface</b> par hota hai. Eye lens mainly focal length ki fine adjustment karta hai."
  },
  {
    question: "4. Iris ka main function kya hai?",
    options: [
      "(a) Retina par image banana",
      "(b) Electrical signals generate karna",
      "(c) Pupil ka size control karna",
      "(d) Brain ko signals bhejna"
    ],
    correct: 2,
    explanation: "<b>Iris ek dark muscular diaphragm</b> hai jo pupil ka size control karta hai. Pupil eye mein enter hone wali light ki quantity ko regulate karta hai."
  },
  {
    question: "5. Retina ka main function kya hai?",
    options: [
      "(a) Light-sensitive cells ke through signals generate karna",
      "(b) Pupil ko control karna",
      "(c) Lens ki curvature change karna",
      "(d) Eye ko rotate karna"
    ],
    correct: 0,
    explanation: "Retina mein bahut saare <b>light-sensitive cells</b> hote hain. Light padne par ye cells <b>electrical signals</b> generate karte hain, jo optic nerves ke through brain tak jaate hain."
  },
  {
    question: "6. Ciliary muscles contract karne par eye lens mein kya change hota hai?",
    options: [
      "(a) Lens thin ho jata hai aur focal length increase hoti hai",
      "(b) Lens thicker ho jata hai aur focal length decrease hoti hai",
      "(c) Lens completely flat ho jata hai",
      "(d) Lens retina ke peeche chala jata hai"
    ],
    correct: 1,
    explanation: "Nearby object ko dekhte waqt <b>ciliary muscles contract</b> karte hain. Lens ki curvature increase hoti hai, lens <b>thicker</b> hota hai aur focal length <b>decrease</b> hoti hai."
  },
  {
    question: "7. Jab hum distant objects dekhte hain, to ciliary muscles ki condition kya hoti hai?",
    options: [
      "(a) Contracted",
      "(b) Relaxed",
      "(c) Completely inactive forever",
      "(d) Damaged"
    ],
    correct: 1,
    explanation: "Distant objects ko clearly dekhne ke liye ciliary muscles <b>relaxed</b> hote hain. Eye lens thin hota hai aur uski focal length <b>increase</b> hoti hai."
  },
  {
    question: "8. Eye lens ki focal length ko adjust karne ki ability ko kya kehte hain?",
    options: [
      "(a) Refraction",
      "(b) Dispersion",
      "(c) Accommodation",
      "(d) Reflection"
    ],
    correct: 2,
    explanation: "Eye lens apni <b>focal length adjust</b> karke different distances par objects ko clearly focus karta hai. Is ability ko <b>power of accommodation</b> kehte hain."
  },
  {
    question: "9. Normal young adult eye ka least distance of distinct vision approximately kitna hota hai?",
    options: [
      "(a) 2.5 cm",
      "(b) 10 cm",
      "(c) 25 cm",
      "(d) 100 cm"
    ],
    correct: 2,
    explanation: "Normal young adult ke liye <b>near point approximately 25 cm</b> hota hai. Is distance par object ko clearly aur bina strain ke dekha ja sakta hai."
  },
  {
    question: "10. Normal human eye ka far point kya hota hai aur cataract kya hai?",
    options: [
      "(a) Far point = 25 cm; cataract = retina ka damage",
      "(b) Far point = infinity; cataract = eye lens ka cloudy/milky hona",
      "(c) Far point = 10 cm; cataract = pupil ka enlarge hona",
      "(d) Far point = 1 m; cataract = cornea ka transparent hona"
    ],
    correct: 1,
    explanation: "Normal eye ka <b>far point infinity</b> hota hai. Old age mein crystalline lens <b>milky aur cloudy</b> ho sakta hai; is condition ko <b>cataract</b> kehte hain. Isse partial ya complete loss of vision ho sakta hai."
  }
];

let currentQuestion = 0;
let score = 0;
let userAnswers = [];
let userName = "";
let quizSubmitted = false;

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>
  `;

  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() {
  if (quizSubmitted) return;

  saveAnswer();

  score = 0;
  questions.forEach((q, index) => {
    if (userAnswers[index] === q.correct) score++;
  });

  quizSubmitted = true;
  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;

    const 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">
        <b>Correct Answer:</b> ${q.options[correct]}<br><br>
        <b>Explanation:</b> ${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: name,
    score: 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>${escapeHTML(s.name)} - ${s.score}/10 (${escapeHTML(s.date)})</li>`
    ).join("");
}

function escapeHTML(value) {
  return String(value).replace(/[&<>"']/g, char => ({
    "&": "&amp;",
    "<": "&lt;",
    ">": "&gt;",
    '"': "&quot;",
    "'": "&#39;"
  })[char]);
}
</script>

</body>
</html>

Leave a Comment