I’m writing this with tears in my eyes. As you know, I’m on vacation in London. Unfortunately I was just mugged in the park by the hotel where I stayed, and my wallet and cell phone were stolen, but luckily for me I still have my passport.
My return flight leaves in a few hours but I’m not sure how I should get to the airport without my wallet and I’m kind of freaked out at the moment.
Please, can one of you give me a call at the hotel front desk? I’m not sure what to do. I’ll pay your phone bill and cook you dinner when I get back, I promise.
– Ana
document.addEventListener('DOMContentLoaded', function() {
let score = 0;
const totalQuestions = 5; // Replace with your total number of questions if infutre you add new questions in quiz
// Correct button IDs (legitimate answers)
const correctButtons = ['p1', 'p2', 'l3', 'p4', 'p5']; // Replace with the correct buttons
correctButtons.forEach(buttonId => {
const button = document.getElementById(buttonId);
if (button) {
button.addEventListener('click', function() {
score++;
localStorage.setItem('quizScore', score); // Store the score in local storage
});
}
});
// Incorrect buttons do not affect the score but should ensure the score is stored
const incorrectButtons = ['l1', 'l2', 'p3', 'l4', 'l5']; // Replace with the incorrect buttons
incorrectButtons.forEach(buttonId => {
const button = document.getElementById(buttonId);
if (button) {
button.addEventListener('click', function() {
localStorage.setItem('quizScore', score); // Ensure score is stored
});
}
});
});