Skip to content

Conversation

@dustovidris2511-a11y
Copy link

<title>Тест бо забони англисӣ</title> <style> body { font-family: Arial, sans-serif; background-color: #f4f4f4; padding: 20px; } .container { max-width: 600px; margin: 0 auto; background: white; padding: 20px; border-radius: 10px; box-shadow: 0 0 10px rgba(0,0,0,0.1); } h1 { text-align: center; color: #333; } .question { margin-bottom: 20px; } .question h3 { margin-bottom: 10px; } .options label { display: block; margin: 5px 0; cursor: pointer; } button { display: block; margin: 20px auto; padding: 10px 20px; background-color: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; } button:hover { background-color: #45a049; } #result { margin-top: 20px; padding: 15px; background-color: #e9f7ef; border-radius: 5px; text-align: center; font-weight: bold; display: none; } </style>

Тест бо забони англисӣ

1. What is the opposite of "happy"?

a) sad b) angry c) tired d) funny
  <!-- Саволи 2 -->
  <div class="question">
    <h3>2. Choose the correct sentence:</h3>
    <div class="options">
      <label><input type="radio" name="q2" value="She go to school"> a) She go to school</label>
      <label><input type="radio" name="q2" value="She goes to school"> b) She goes to school</label>
      <label><input type="radio" name="q2" value="She going to school"> c) She going to school</label>
      <label><input type="radio" name="q2" value="She gone to school"> d) She gone to school</label>
    </div>
  </div>

  <!-- Саволи 3 -->
  <div class="question">
    <h3>3. What does "book" mean in English?</h3>
    <div class="options">
      <label><input type="radio" name="q3" value="китоб"> a) китоб</label>
      <label><input type="radio" name="q3" value="дафтар"> b) дафтар</label>
      <label><input type="radio" name="q3" value="қалам"> c) қалам</label>
      <label><input type="radio" name="q3" value="мактаб"> d) мактаб</label>
    </div>
  </div>

  <button type="button" onclick="checkAnswers()">Натиҷа</button>
</form>

<div id="result"></div>
<script> function checkAnswers() { // Ҷавобҳои дуруст const correctAnswers = { q1: "sad", q2: "She goes to school", q3: "китоб" }; let score = 0; let total = 3; // Баррасии ҳар як савол for (let i = 1; i <= total; i++) { const selectedOption = document.querySelector(`input[name="q${i}"]:checked`); if (selectedOption && selectedOption.value === correctAnswers[`q${i}`]) { score++; } } // Намоиши натиҷа const resultDiv = document.getElementById("result"); resultDiv.style.display = "block"; resultDiv.innerHTML = `Шумо ${score} аз ${total} саволро дуруст ҷавоб додед!`; } </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant