Metaphyical Poetry quiz
Metaphysical Poets Quiz body { font-family: 'Inter', sans-serif; } /* Custom styles for radio buttons */ .custom-radio:checked { background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3c... cx='8' cy='8' r='3'/%3e%3c/svg%3e"); border-color: #3b82f6; background-color: #3b82f6; } Metaphysical Poets Quiz
Test your knowledge on the 17th-century literary movement.
Enter your name to begin: Start Quiz Good luck! Submit Answers Quiz Results Take Again const nameSection = document.getElementById('name-section'); const quizSection = document.getElementById('quiz-section'); const resultsSection = document.getElementById('results-section'); const startBtn = document.getElementById('start-btn'); const usernameInput = document.getElementById('username'); const quizHeader = document.getElementById('quiz-header'); const quizForm = document.getElementById('quiz-form'); const questionsContainer = document.getElementById('questions-container'); const resultHeader = document.getElementById('result-header'); const scoreEl = document.getElementById('score'); const correctAnswersEl = document.getElementById('correct-answers'); const restartBtn = document.getElementById('restart-btn'); // --- Quiz Questions --- // Based on the provided PDF "The Metaphysical Poets.pdf" const quizData = [ { question: "Who first used the term 'metaphysical poets'?", options: ["T.S. Eliot", "John Dryden", "Samuel Johnson", "John Donne"], answer: "John Dryden" }, { question: "Which 18th-century critic famously said the Metaphysical poets' ideas were 'yoked by violence together'?", options: ["Alexander Pope", "William Wordsworth", "Dr. Samuel Johnson", "H.J.C. Grierson"], answer: "Dr. Samuel Johnson" }, { question: "Which 20th-century poet and critic was instrumental in reviving the reputation of the Metaphysical poets with his 1921 essay?", options: ["W.B. Yeats", "Ezra Pound", "T.S. Eliot", "George Herbert"], answer: "T.S. Eliot" }, { question: "What term did T.S. Eliot coin to describe a split between thought and feeling in poetry?", options: ["Unified Sensibility", "Objective Correlative", "Negative Capability", "Dissociation of Sensibility"], answer: "Dissociation of Sensibility" }, { question: "Who is considered the leading and most canonical figure among the Metaphysical poets?", options: ["Andrew Marvell", "George Herbert", "John Donne", "Henry Vaughan"], answer: "John Donne" }, { question: "What is a 'conceit' in the context of Metaphysical poetry?", options: ["A simple rhyme scheme", "A short, lyrical poem", "A startling, far-fetched comparison between two very different things", "A type of conversational tone"], answer: "A startling, far-fetched comparison between two very different things" }, { question: "According to T.S. Eliot's argument, what is a necessary quality for modern poetry?", options: ["Simplicity", "Complexity", "Romanticism", "Sentimentality"], answer: "Complexity" } ]; let currentUsername = ''; // --- Event Listeners --- startBtn.addEventListener('click', startQuiz); quizForm.addEventListener('submit', showResults); restartBtn.addEventListener('click', restartQuiz); // --- Functions --- /** * Starts the quiz after the user enters their name. */ function startQuiz() { currentUsername = usernameInput.value.trim(); if (currentUsername === "") { // Simple validation: prompt user if name is empty alert("Please enter your name to start the quiz."); return; } quizHeader.textContent = `Good luck, ${currentUsername}!`; nameSection.classList.add('hidden'); resultsSection.classList.add('hidden'); quizSection.classList.remove('hidden'); loadQuestions(); } /** * Loads and displays the quiz questions. */ function loadQuestions() { questionsContainer.innerHTML = ''; // Clear previous questions quizData.forEach((q, index) => { const questionEl = document.createElement('div'); questionEl.classList.add('mb-6', 'p-4', 'border', 'border-gray-200', 'rounded-lg'); let optionsHTML = ''; q.options.forEach(option => { optionsHTML += ` <label class="flex items-center p-3 rounded-lg hover:bg-gray-50 transition cursor-pointer"> <input type="radio" name="question${index}" value="${option}" class="h-4 w-4 custom-radio text-blue-600 border-gray-300 focus:ring-blue-500"> <span class="ml-3 text-gray-700">${option}</span> </label> `; }); questionEl.innerHTML = ` <p class="text-lg font-semibold text-gray-800 mb-3">${index + 1}. ${q.question}</p> <div class="space-y-2">${optionsHTML}</div> `; questionsContainer.appendChild(questionEl); }); } /** * Calculates score and displays the results section. * @param {Event} e - The form submission event. */ function showResults(e) { e.preventDefault(); let score = 0; const userAnswers = []; // Collect user answers quizData.forEach((q, index) => { const selectedOption = document.querySelector(`input[name="question${index}"]:checked`); const userAnswer = selectedOption ? selectedOption.value : null; userAnswers.push(userAnswer); if (userAnswer === q.answer) { score++; } }); // Display results quizSection.classList.add('hidden'); resultsSection.classList.remove('hidden'); resultHeader.textContent = `Well done, ${currentUsername}!`; scoreEl.textContent = `You scored ${score} out of ${quizData.length}.`; correctAnswersEl.innerHTML = ''; quizData.forEach((q, index) => { const userAnswer = userAnswers[index]; const isCorrect = userAnswer === q.answer; const resultEl = document.createElement('div'); resultEl.classList.add('p-4', 'rounded-lg', 'border'); resultEl.classList.add(isCorrect ? 'bg-green-50 border-green-200' : 'bg-red-50 border-red-200'); let answerHTML = `<p class="text-sm font-semibold text-green-700">Correct Answer: ${q.answer}</p>`; if (!isCorrect) { answerHTML += `<p class="text-sm font-semibold text-red-700">Your Answer: ${userAnswer || 'Not answered'}</p>`; } resultEl.innerHTML = ` <p class="font-semibold text-gray-800 mb-2">${index + 1}. ${q.question}</p> ${answerHTML} `; correctAnswersEl.appendChild(resultEl); }); } /** * Resets the quiz to the initial name entry screen. */ function restartQuiz() { resultsSection.classList.add('hidden'); nameSection.classList.remove('hidden'); usernameInput.value = ''; // Clear the name input quizForm.reset(); // Reset the form selections }The post Metaphyical Poetry quiz first appeared on Ronald Hadrian.
Published on August 18, 2025 07:20
No comments have been added yet.


