Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 130 additions & 0 deletions Test
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<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>
</head>
<body>
<div class="container">
<h1>Тест бо забони англисӣ</h1>
<form id="quizForm">
<!-- Саволи 1 -->
<div class="question">
<h3>1. What is the opposite of "happy"?</h3>
<div class="options">
<label><input type="radio" name="q1" value="sad"> a) sad</label>
<label><input type="radio" name="q1" value="angry"> b) angry</label>
<label><input type="radio" name="q1" value="tired"> c) tired</label>
<label><input type="radio" name="q1" value="funny"> d) funny</label>
</div>
</div>

<!-- Саволи 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>
</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>
</body>
</html>