Quiz
UGC NET English Quiz body { font-family: Arial, sans-serif; background-color: #f0f0f0; margin: 0; padding: 20px; } .container { max-width: 800px; margin: auto; background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 0 10px rgba(0,0,0,0.1); } h2, h3, h4 { text-align: center; } .question { margin-bottom: 20px; } label { display: block; margin: 4px 0; } #result { margin-top: 30px; } button { padding: 10px 15px; background-color: #007BFF; color: white; border: none; border-radius: 5px; cursor: pointer; display: block; margin: 20px auto; } button:hover { background-color: #0056b3; } .answer-review { margin-top: 10px; padding: 10px; background: #f9f9f9; border-left: 5px solid #007BFF; } UGC NET English Quiz Enter Your Name: Start Quiz Submit Quiz const quizData = [ { q: "Who wrote 'Doctor Faustus'?", a: "Christopher Marlow", options: ["Ben Jonson", "John Lyly", "Christopher Marlow", "Thomas Kyd"] }, { q: "Which of the following was NOT a University Wit?", a: "Ben Jonson", options: ["Robert Greene", "Thomas Nashe", "Ben Jonson", "George Peele"] }, { q: "'Astrophel and Stella' is written by?", a: "Sir Philip Sidney", options: ["Francis Bacon", "Edmund Spenser", "Sir Philip Sidney", "William Shakespeare"] }, { q: "Who is the author of 'The Faerie Queene'?", a: "Edmund Spenser", options: ["Edmund Spenser", "Thomas Lodge", "Ben Jonson", "John Lyly"] }, { q: "Which writer is famous for essays and scientific prose?", a: "Francis Bacon", options: ["George Peele", "Francis Bacon", "Thomas Kyd", "Robert Greene"] }, { q: "Which of the following wrote 'Euphues'?", a: "John Lyly", options: ["John Lyly", "Thomas Nashe", "Christopher Marlow", "George Peele"] }, { q: "Who wrote 'Tamburlaine the Great'?", a: "Christopher Marlow", options: ["Thomas Lodge", "Robert Greene", "Christopher Marlow", "Ben Jonson"] }, { q: "Who is the author of 'Volpone'?", a: "Ben Jonson", options: ["Ben Jonson", "William Shakespeare", "Thomas Kyd", "George Peele"] }, { q: "Who among the following was known for satirical prose?", a: "Thomas Nashe", options: ["Thomas Lodge", "Thomas Nashe", "Thomas Kyd", "Francis Bacon"] }, { q: "Which of these is a revenge tragedy?", a: "The Spanish Tragedy by Thomas Kyd", options: ["Euphues", "The Spanish Tragedy by Thomas Kyd", "Volpone", "Doctor Faustus"] }, { q: "Who wrote 'Rosalynde'?", a: "Thomas Lodge", options: ["Thomas Lodge", "George Peele", "Ben Jonson", "Francis Bacon"] }, { q: "Which writer was a pamphleteer and playwright?", a: "Robert Greene", options: ["George Peele", "Robert Greene", "John Lyly", "Thomas Nashe"] }, { q: "'The Advancement of Learning' is written by?", a: "Francis Bacon", options: ["Francis Bacon", "Ben Jonson", "Edmund Spenser", "Thomas Nashe"] }, { q: "Who is the author of 'The Shepherd's Calendar'?", a: "Edmund Spenser", options: ["Sir Philip Sidney", "Edmund Spenser", "Christopher Marlow", "Robert Greene"] }, { q: "'Hamlet' is written by?", a: "William Shakespeare", options: ["William Shakespeare", "Ben Jonson", "Francis Bacon", "George Peele"] }];function startQuiz() { const name = document.getElementById("username").value.trim(); if (name === "") { alert("Please enter your name."); return; } document.getElementById("intro").style.display = "none"; document.getElementById("quizForm").style.display = "block"; const quizContainer = document.getElementById("quizQuestions"); quizContainer.innerHTML = ""; quizData.forEach((item, index) => { const questionDiv = document.createElement("div"); questionDiv.classList.add("question"); const optionsHtml = item.options.map(option => ` <label> <input type="radio" name="q${index}" value="${option}"> ${option} </label>`).join(""); questionDiv.innerHTML = `<strong>Q${index + 1}: ${item.q}</strong><br>${optionsHtml}`; quizContainer.appendChild(questionDiv); });}function submitQuiz() { const userName = document.getElementById("username").value; const resultDiv = document.getElementById("result"); let score = 0; let output = `<h3>Results for ${userName}</h3>`; quizData.forEach((item, index) => { const selected = document.querySelector(`input[name='q${index}']:checked`); const userAnswer = selected ? selected.value : "No Answer"; const correct = item.a; if (userAnswer === correct) score++; output += ` <div class="answer-review"> <strong>Q${index + 1}:</strong> ${item.q}<br> <em>Your Answer:</em> ${userAnswer}<br> <em>Correct Answer:</em> ${correct}<br> <strong>${userAnswer === correct ? '✔ Correct' : '❌ Incorrect'}</strong> </div>`; }); output += `<h4>Your Total Score: ${score} / ${quizData.length}</h4>`; resultDiv.innerHTML = output; // Hide quiz form document.getElementById("quizForm").style.display = "none";}
The post Quiz first appeared on Ronald Hadrian.
Published on May 17, 2025 05:46
No comments have been added yet.


