Enlightenment age Quiz
Literature Quiz Literature Quiz Enter your name: Start Quiz Next Quiz Results const questions = [ { question: "Which of the following is not a major work of Alexander Pope?", options: ["An Essay on Criticism", "The Rape of the Lock", "Gulliver's Travels", "The Dunciad"], answer: "Gulliver's Travels" }, { question: "Which of the following is considered one of the most epigrammatic of all English authors?", options: ["Jonathan Swift", "Alexander Pope", "Richard Steele", "Joseph Addison"], answer: "Alexander Pope" }, { question: "Which of the following works by Alexander Pope is considered a mock-heroic poem?", options: ["An Essay on Criticism", "The Rape of the Lock", "An Essay on Man", "The Dunciad"], answer: "The Rape of the Lock" }, { question: "Which of the following was a wealthy squire who persuaded Alexander Pope to write \"The Rape of the Lock\"?", options: ["John Caryll", "Martha Blount", "William Wycherley", "William Walsh"], answer: "John Caryll" }, { question: "Which of the following was a major influence on Alexander Pope's early writings?", options: ["John Dryden", "William Shakespeare", "Geoffrey Chaucer", "All of the above"], answer: "All of the above" }, { question: "Which of the following works by Jonathan Swift is considered a masterpiece of satire?", options: ["A Tale of a Tub", "Gulliver's Travels", "A Modest Proposal", "All of the above"], answer: "All of the above" }, { question: "Which of the following is the common sobriquet of Jonathan Swift?", options: ["Dean Swift", "Lemuel Gulliver", "Isaac Bickerstaff", "M.B. Drapier"], answer: "Dean Swift" }, { question: "Which of the following was the influence for parts of Jonathan Swift's \"Gulliver's Travels\"?", options: ["Francis Godwin's \"The Man in the Moone\"", "William Shakespeare", "John Dryden", "None of the above"], answer: "Francis Godwin's \"The Man in the Moone\"" }, { question: "Which of the following writers named Jonathan Swift as one of the writers he most admired, despite disagreeing with him on almost every moral and political issue?", options: ["John Ruskin", "George Orwell", "Edith Sitwell", "None of the above"], answer: "George Orwell" }, { question: "Which of the following was the literary style that Jonathan Swift was a master of?", options: ["Horatian satire", "Juvenalian satire", "Both A and B", "None of the above"], answer: "Both A and B" }, { question: "Which of the following magazines was co-founded by Richard Steele?", options: ["The Spectator", "The Tatler", "Both A and B", "None of the above"], answer: "Both A and B" }, { question: "Which of the following was Richard Steele's first published work?", options: ["The Christian Hero", "The Spectator", "The Tatler", "None of the above"], answer: "The Christian Hero" }, { question: "Which of the following was the rank that Richard Steele attained within two years of joining the Life Guards of the Household Cavalry?", options: ["Private", "Sergeant", "Lieutenant", "Captain"], answer: "Captain" }, { question: "In which novel by William Makepeace Thackeray does Richard Steele play a minor role?", options: ["Vanity Fair", "The History of Henry Esmond", "Pendennis", "None of the above"], answer: "The History of Henry Esmond" }, { question: "Where was Richard Steele buried?", options: ["London", "Dublin", "Carmathen", "None of the above"], answer: "Carmathen" } ]; let currentQuestion = 0; let score = 0; let userName = ""; function startQuiz() { userName = document.getElementById("user-name").value.trim(); if (userName === "") { alert("Please enter your name before starting the quiz."); return; } document.getElementById("name-input").classList.add("hidden"); document.getElementById("quiz").classList.remove("hidden"); showQuestion(); } function showQuestion() { const questionData = questions[currentQuestion]; document.getElementById("question").textContent = `${currentQuestion + 1}. ${questionData.question}`; const optionsContainer = document.getElementById("options"); optionsContainer.innerHTML = ""; questionData.options.forEach((option, index) => { const button = document.createElement("button"); button.textContent = option; button.className = "w-full text-left p-2 border rounded hover:bg-gray-100"; button.onclick = () => selectOption(option); optionsContainer.appendChild(button); }); } function selectOption(selected) { const buttons = document.querySelectorAll("#options button"); buttons.forEach(button => { button.disabled = true; if (button.textContent === selected) { button.classList.add("bg-blue-200"); } if (button.textContent === questions[currentQuestion].answer) { button.classList.add("bg-green-200"); } }); if (selected === questions[currentQuestion].answer) { score++; } } function nextQuestion() { currentQuestion++; if (currentQuestion < questions.length) { showQuestion(); } else { showResults(); } } function showResults() { document.getElementById("quiz").classList.add("hidden"); document.getElementById("results").classList.remove("hidden"); document.getElementById("score").textContent = `${userName}, your score: ${score} out of ${questions.length}`; const answersContainer = document.getElementById("answers"); questions.forEach((q, index) => { const answerDiv = document.createElement("div"); answerDiv.innerHTML = ` <p class="font-semibold">${index + 1}. ${q.question}</p> <p>Correct answer: ${q.answer}</p> `; answersContainer.appendChild(answerDiv); }); }
The post Enlightenment age Quiz first appeared on Ronald Hadrian.
Published on July 16, 2024 22:25
No comments have been added yet.


