June 2022
English Literature Quiz body { font-family: Arial, sans-serif; max-width: 800px; margin: 0 auto; padding: 20px; background-color: #f5f5f5; } .quiz-container { background-color: white; padding: 20px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } .question { margin-bottom: 20px; padding: 15px; border: 1px solid #ddd; border-radius: 4px; } .options { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; } .option { padding: 10px; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; } .option:hover { background-color: #f0f0f0; } .option.selected { background-color: #e3f2fd; border-color: #2196f3; } .name-input { margin-bottom: 20px; } .name-input input { padding: 8px; font-size: 16px; border: 1px solid #ddd; border-radius: 4px; width: 200px; } button { background-color: #2196f3; color: white; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; font-size: 16px; margin-top: 10px; } button:hover { background-color: #1976d2; } .results { margin-top: 20px; } .correct { color: #4caf50; } .incorrect { color: #f44336; } .hidden { display: none; } English Literature Quiz Start Quiz Next Question Quiz Results Take Quiz Again const questions = [ { question: "Which literary movement emerged as a reaction against materialism and rapid mechanization?", options: [ "Romanticism", "Expressionism", "Realism", "Naturalism" ], correct: 1 }, { question: "What is the primary focus of Cultural Studies as it emerged in the 1960s?", options: [ "High culture", "Popular culture", "Ancient literature", "Classical texts" ], correct: 1 }, { question: "Which of these is a characteristic of Kitchen Sink Drama?", options: [ "Fantasy elements", "Historical settings", "Daily struggles of working-class people", "Supernatural themes" ], correct: 2 }, { question: "What is the term for when a learner's second language learning system seems to freeze at a certain stage?", options: [ "Language block", "Fossilization", "Stagnation", "Learning plateau" ], correct: 1 }, { question: "Which of these authors is associated with the fictional town of Malgudi?", options: [ "Salman Rushdie", "R.K. Narayan", "Arundhati Roy", "Vikram Seth" ], correct: 1 }, { question: "What is the science that systematically studies the function of signs called?", options: [ "Semantics", "Syntax", "Semiology", "Phonetics" ], correct: 2 }, { question: "Which concept did Stuart Hall consider crucial to Cultural Studies?", options: [ "Interpellation", "Dispositive", "Hegemony", "Discourse" ], correct: 2 }, { question: "What type of motivation refers to language learning for personal growth and cultural enrichment?", options: [ "Instrumental", "Practical", "Integrative", "Academic" ], correct: 2 }, { question: "Which playwright is known for the concept of 'Epic Theatre'?", options: [ "Samuel Beckett", "Bertolt Brecht", "Eugene O'Neill", "Arthur Miller" ], correct: 1 }, { question: "What type of drama depicts the daily struggles of ordinary working-class people?", options: [ "Theatre of the Absurd", "Epic Theatre", "Kitchen Sink Drama", "Symbolic Drama" ], correct: 2 }, { question: "Which novel features the character Dr. Primrose?", options: [ "Nicholas Nickleby", "The Vicar of Wakefield", "Adam Bede", "Joseph Andrews" ], correct: 1 }, { question: "What is the term for the distribution of rewards and punishments in proportion to characters' virtue or vice?", options: [ "Poetic justice", "Moral retribution", "Divine comedy", "Dramatic irony" ], correct: 0 }, { question: "Which year marked a significant change in the official language of the East India Company?", options: [ "1857", "1835", "1813", "1858" ], correct: 1 }, { question: "What is the primary focus of Cyberpunk as a genre?", options: [ "Historical fiction", "Romance", "Low life and high tech", "Political intrigue" ], correct: 2 }, { question: "Which book is considered R.K. Narayan's open-ended novel?", options: [ "The Guide", "The Vendor of Sweets", "Malgudi Days", "The English Teacher" ], correct: 0 } ]; let currentQuestion = 0; let answers = {}; let userName = ''; function showScreen(screenId) { document.getElementById('welcome-screen').classList.add('hidden'); document.getElementById('quiz-screen').classList.add('hidden'); document.getElementById('results-screen').classList.add('hidden'); document.getElementById(screenId).classList.remove('hidden'); } function startQuiz() { userName = document.getElementById('name-input').value.trim(); if (!userName) { alert('Please enter your name'); return; } currentQuestion = 0; answers = {}; showScreen('quiz-screen'); displayQuestion(); } function displayQuestion() { const question = questions[currentQuestion]; document.getElementById('question-number').textContent = `Question ${currentQuestion + 1} of ${questions.length}`; document.getElementById('question-text').textContent = question.question; const optionsHtml = question.options.map((option, index) => ` <div class="option ${answers[currentQuestion] === index ? 'selected' : ''}" onclick="selectOption(${index})"> ${option} </div> `).join(''); document.getElementById('options').innerHTML = optionsHtml; const nextButton = document.getElementById('next-button'); nextButton.textContent = currentQuestion === questions.length - 1 ? 'Finish Quiz' : 'Next Question'; } function selectOption(optionIndex) { answers[currentQuestion] = optionIndex; document.querySelectorAll('.option').forEach(option => option.classList.remove('selected')); document.querySelectorAll('.option')[optionIndex].classList.add('selected'); } function handleNext() { if (!answers.hasOwnProperty(currentQuestion)) { alert('Please select an answer before proceeding'); return; } if (currentQuestion < questions.length - 1) { currentQuestion++; displayQuestion(); } else { showResults(); } } function calculateScore() { return Object.entries(answers).reduce((score, [questionIndex, answer]) => { return score + (answer === questions[questionIndex].correct ? 1 : 0); }, 0); } function showResults() { showScreen('results-screen'); const score = calculateScore(); document.getElementById('result-name').textContent = `Hello ${userName}!`; document.getElementById('score').textContent = `Your score: ${score} out of ${questions.length}`; const resultsHtml = questions.map((q, index) => ` <div class="question"> <p><strong>Question ${index + 1}:</strong> ${q.question}</p> <p>Your answer: <span class="${answers[index] === q.correct ? 'correct' : 'incorrect'}"> ${q.options[answers[index]]} </span></p> <p>Correct answer: <span class="correct">${q.options[q.correct]}</span></p> </div> `).join(''); document.getElementById('results-details').innerHTML = resultsHtml; } function restartQuiz() { showScreen('welcome-screen'); document.getElementById('name-input').value = ''; } // Initialize quiz showScreen('welcome-screen');
The post June 2022 first appeared on Ronald Hadrian.
Published on November 21, 2024 23:57
No comments have been added yet.


