Submarines – Phrasal Verbs Quiz
body {
font-family: Arial, sans-serif;
margin: 40px;
background-color: #f8f8f8;
}
.question {
display: none;
margin-bottom: 30px;
background: #fff;
padding: 20px;
border-radius: 10px;
box-shadow: 1px 1px 5px rgba(0,0,0,0.1);
}
.question.active {
display: block;
}
button {
margin-top: 10px;
}
.options label {
display: block;
margin: 8px 0;
}
.feedback {
font-weight: bold;
margin-top: 10px;
}
Which Phrasal Verb Best Fits the Sentence?
1. "Jules Verne studied in depth Europe’s interest in discovery and technology."
2. "His novels emphasized futuristic inventions like submarines."
3. "Over the years, new versions of submarines were developed."
4. "Submarines became more efficient as technology advanced."
5. "The early versions of submarines were inspired by military needs."
function checkAnswer(currentId, correctAnswer, nextId) {
const selected = document.querySelector(`input[name="${currentId}"]:checked`);
const feedback = document.getElementById("f" + currentId.slice(1));
if (!selected) {
feedback.innerHTML = "Please select an answer.";
feedback.style.color = "orange";
return;
}
if (selected.value === correctAnswer) {
feedback.innerHTML = "✅ Correct!";
feedback.style.color = "green";
if (nextId) {
setTimeout(() => {
document.getElementById(currentId).classList.remove("active");
document.getElementById(nextId).classList.add("active");
window.scrollTo({ top: 0, behavior: 'smooth' });
}, 1000);
} else {
feedback.innerHTML += "
🎉 Congratulations! You've completed the quiz.";
}
} else {
feedback.innerHTML = "❌ Incorrect. Try again!";
feedback.style.color = "red";
}
}