class 10 science chapter 11

ch11 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 тАУ ELECTRIC CURRENT 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;
  box-sizing: border-box;
}
.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;
  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; }
#userName {
  padding: 10px;
  width: 65%;
  max-width: 300px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
@media (max-width: 600px) {
  body { padding: 10px; }
  .quiz-container { width: 100%; padding: 15px; }
}
</style>
</head>

<body>
<div class="quiz-container">

<h2>ЁЯза APICAL CLASSES тАУ ELECTRIC CURRENT & ELECTRIC CIRCUIT 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. Electric current рдХрдм рдХрд╣рд╛ рдЬрд╛рддрд╛ рд╣реИ?",
  options: [
    "рдЬрдм conductor рдореЗрдВ electric charge flow рдХрд░рддрд╛ рд╣реИ",
    "рдЬрдм conductor рдЧрд░реНрдо рд╣реЛрддрд╛ рд╣реИ",
    "рдЬрдм bulb рдЯреВрдЯ рдЬрд╛рддрд╛ рд╣реИ",
    "рдЬрдм switch рд╣рдореЗрд╢рд╛ OFF рд░рд╣рддрд╛ рд╣реИ"
  ],
  correct: 0,
  explanation: "рдЬрдм electric charges рдХрд┐рд╕реА conductor, рдЬреИрд╕реЗ metallic wire, рдореЗрдВ flow рдХрд░рддреЗ рд╣реИрдВ, рддреЛ conductor рдореЗрдВ electric current рд╣реЛрддрд╛ рд╣реИред"
},
{
  question: "2. Electric circuit рдХреНрдпрд╛ рд╣реЛрддрд╛ рд╣реИ?",
  options: [
    "рдХреЗрд╡рд▓ рдПрдХ battery",
    "рдХреЗрд╡рд▓ рдПрдХ bulb",
    "Electric current рдХреЗ рд▓рд┐рдП continuous рдФрд░ closed path",
    "рдХреЗрд╡рд▓ рдПрдХ switch"
  ],
  correct: 2,
  explanation: "Electric current рдХреЗ flow рдХреЗ рд▓рд┐рдП рдПрдХ continuous рдФрд░ closed path рдЪрд╛рд╣рд┐рдПред рдЗрд╕реА рдХреЛ electric circuit рдХрд╣рддреЗ рд╣реИрдВред"
},
{
  question: "3. Torch рдХрд╛ switch ON рдХрд░рдиреЗ рдкрд░ рдЙрд╕рдХрд╛ рдореБрдЦреНрдп рдХрд╛рдо рдХреНрдпрд╛ рд╣реЛрддрд╛ рд╣реИ?",
  options: [
    "Cell рдХреЛ discharge рд╣реЛрдиреЗ рд╕реЗ рд░реЛрдХрдирд╛",
    "Cell рдФрд░ bulb рдХреЗ рдмреАрдЪ conducting link рдмрдирд╛рдирд╛",
    "Bulb рдХреА resistance рдХреЛ zero рдХрд░рдирд╛",
    "Electrons рдХреЛ positive charge рдореЗрдВ рдмрджрд▓рдирд╛"
  ],
  correct: 1,
  explanation: "Switch ON рд╣реЛрдиреЗ рдкрд░ рд╡рд╣ cell рдФрд░ bulb рдХреЗ рдмреАрдЪ conducting path complete рдХрд░рддрд╛ рд╣реИред рдЗрд╕рд▓рд┐рдП current flow рдХрд░рддрд╛ рд╣реИ рдФрд░ bulb glow рдХрд░рддрд╛ рд╣реИред"
},
{
  question: "4. рдЕрдЧрд░ electric circuit рдХрд╣реАрдВ рд╕реЗ рдЯреВрдЯ рдЬрд╛рдП, рддреЛ рдХреНрдпрд╛ рд╣реЛрдЧрд╛?",
  options: [
    "Current flow рдмрдврд╝ рдЬрд╛рдПрдЧрд╛",
    "Current flow рдмрдВрдж рд╣реЛ рдЬрд╛рдПрдЧрд╛ рдФрд░ bulb glow рдирд╣реАрдВ рдХрд░реЗрдЧрд╛",
    "Bulb рдЬреНрдпрд╛рджрд╛ bright рд╣реЛрдЧрд╛",
    "Battery рдХреА voltage double рд╣реЛ рдЬрд╛рдПрдЧреА"
  ],
  correct: 1,
  explanation: "Current рдХреЛ flow рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП closed circuit рдЪрд╛рд╣рд┐рдПред Circuit рдЯреВрдЯрдиреЗ рдкрд░ path incomplete рд╣реЛ рдЬрд╛рддрд╛ рд╣реИ, рдЗрд╕рд▓рд┐рдП current flow рдирд╣реАрдВ рдХрд░рддрд╛ред"
},
{
  question: "5. Electric current рдХреЛ mathematically рдХрд┐рд╕ relation рд╕реЗ express рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИ?",
  options: [
    "I = Qt",
    "I = Q/t",
    "I = t/Q",
    "I = Q + t"
  ],
  correct: 1,
  explanation: "Electric current charge рдХреЗ flow рдХреА rate рд╣реИред Formula: I = Q/t, рдЬрд╣рд╛рдБ Q = charge рдФрд░ t = time рд╣реИред"
},
{
  question: "6. Conventional electric current рдХреА direction рдХрд┐рд╕ direction рдореЗрдВ рдорд╛рдиреА рдЬрд╛рддреА рд╣реИ?",
  options: [
    "Negative terminal рд╕реЗ positive terminal",
    "Electron flow рдХреА same direction",
    "Positive terminal рд╕реЗ negative terminal",
    "Random direction"
  ],
  correct: 2,
  explanation: "Conventionally electric current рдХреА direction positive terminal рд╕реЗ negative terminal рдорд╛рдиреА рдЬрд╛рддреА рд╣реИред Electrons negative charge рд╣реЛрддреЗ рд╣реИрдВ, рдЗрд╕рд▓рд┐рдП рдЙрдирдХрд╛ flow current рдХреА conventional direction рдХреЗ opposite рд╣реЛрддрд╛ рд╣реИред"
},
{
  question: "7. рдпрджрд┐ рдХрд┐рд╕реА conductor рд╕реЗ 0.5 A current 10 minutes рддрдХ flow рдХрд░рддрд╛ рд╣реИ, рддреЛ рдХрд┐рддрдиреА electric charge flow рд╣реЛрдЧреА?",
  options: [
    "30 C",
    "100 C",
    "300 C",
    "600 C"
  ],
  correct: 2,
  explanation: "рдкрд╣рд▓реЗ time рдХреЛ seconds рдореЗрдВ convert рдХрд░реЗрдВрдЧреЗ: 10 min = 600 sред Formula: Q = Itред рдЗрд╕рд▓рд┐рдП Q = 0.5 ├Ч 600 = 300 Cред"
},
{
  question: "8. Electric current рдХреА SI unit рдХреНрдпрд╛ рд╣реИ?",
  options: [
    "Coulomb",
    "Volt",
    "Ampere",
    "Ohm"
  ],
  correct: 2,
  explanation: "Electric current рдХреА SI unit ampere (A) рд╣реИред рдЗрд╕рдХрд╛ рдирд╛рдо French scientist Andr├й-Marie Amp├иre рдХреЗ рдирд╛рдо рдкрд░ рд░рдЦрд╛ рдЧрдпрд╛ рд╣реИред"
},
{
  question: "9. 1 ampere current рдХрд╛ рд╕рд╣реА meaning рдХреНрдпрд╛ рд╣реИ?",
  options: [
    "1 coulomb charge 1 minute рдореЗрдВ flow рдХрд░реЗ",
    "1 coulomb charge 1 second рдореЗрдВ flow рдХрд░реЗ",
    "1 electron 1 second рдореЗрдВ flow рдХрд░реЗ",
    "1 coulomb charge 1 hour рдореЗрдВ flow рдХрд░реЗ"
  ],
  correct: 1,
  explanation: "1 A = 1 C/1 sред рдпрд╛рдиреА 1 second рдореЗрдВ 1 coulomb charge flow рд╣реЛрдиреЗ рдкрд░ current 1 ampere рд╣реЛрддрд╛ рд╣реИред"
},
{
  question: "10. Ammeter рдХреЛ electric circuit рдореЗрдВ рдХреИрд╕реЗ connect рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИ?",
  options: [
    "Parallel рдореЗрдВ",
    "Series рдореЗрдВ",
    "Battery рдХреЗ рдмрд╛рд╣рд░",
    "рдХреЗрд╡рд▓ bulb рдХреЗ рдКрдкрд░"
  ],
  correct: 1,
  explanation: "Electric current measure рдХрд░рдиреЗ рдХреЗ рд▓рд┐рдП ammeter рдХреЛ рд╣рдореЗрд╢рд╛ series рдореЗрдВ connect рдХрд┐рдпрд╛ рдЬрд╛рддрд╛ рд╣реИ, рддрд╛рдХрд┐ circuit рдХрд╛ рдкреВрд░рд╛ current ammeter рд╕реЗ рд╣реЛрдХрд░ рдЧреБрдЬрд░реЗред<br><br><strong>Extra Facts:</strong><br>1 mA = 10тБ╗┬│ A<br>1 ╬╝A = 10тБ╗тБ╢ A<br>рд▓рдЧрднрдЧ 1 coulomb charge = 6 ├Ч 10┬╣тБ╕ electrons рдХреЗ charge рдХреЗ рдмрд░рд╛рдмрд░ рд╣реЛрддрд╛ рд╣реИред"
}
];

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" : ""}>
          ${String.fromCharCode(65 + i)}. ${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() {
  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}">
        ${String.fromCharCode(65 + i)}. ${opt}
        ${i === correct ? " тЬУ Correct Answer" : ""}
        ${selected === i && selected !== correct ? " тЬЧ Your Answer" : ""}
      </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>`;
}

function saveScore(name, score) {
  let scores = [];

  try {
    scores = JSON.parse(localStorage.getItem("quizScores")) || [];
    if (!Array.isArray(scores)) scores = [];
  } catch (e) {
    scores = [];
  }

  scores.push({
    name,
    score,
    date: new Date().toLocaleString()
  });

  localStorage.setItem("quizScores", JSON.stringify(scores));
}

function loadScoreboard() {
  let scores = [];

  try {
    scores = JSON.parse(localStorage.getItem("quizScores")) || [];
    if (!Array.isArray(scores)) scores = [];
  } catch (e) {
    scores = [];
  }

  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