A lightweight, client-side quiz application with a simple login and a strict one-attempt policy per user. Users log in with name and email, take a timed quiz, and are prevented from retaking with the same email.
- Login with name and email
- Timed quiz: 2-minute countdown
- Shuffled questions and answers each run
- Immediate feedback on selected answer
- One attempt per user (by email) enforced via
localStorage - "Done" flow: returns to login screen and shows completion message
- HTML, CSS, JavaScript (no frameworks)
- localStorage for storing user attempts
- Open the app
- Double-click
index.htmlto open in your browser, or - Use VS Code Live Server: Right-click
index.html→ "Open with Live Server".
- Double-click
- Login with your name and a valid email.
- Take the quiz and click Done when finished.
- New users (new emails) can take the quiz normally.
- After finishing, if the same user logs in again with the same email, the quiz will not start.
- The login screen will display: "You have already completed the quiz."
- The quiz remains available to different users who have not attempted it before.
- Timer duration: Update
QUIZ_DURATION_SECONDSinscript.js. - Questions: Edit the
questionsarray inscript.js. Each question has:question: stringoptions: array of stringsanswer: index (0-based) of the correct option
// Example question object in script.js
{
question: "Which language runs in a web browser?",
options: ["Java", "C", "Python", "JavaScript"],
answer: 3,
}- Attempts are stored in
localStorageunder the key:quiz_users_attempts_v1. - Structure per email:
{
"user@example.com": {
"name": "User Name",
"completedAt": "2025-01-01T12:34:56.789Z",
"score": 5,
"total": 7
}
}- Open your browser DevTools → Console and run:
localStorage.removeItem("quiz_users_attempts_v1");QuizApp/
├─ index.html
├─ style.css
├─ script.js
├─ assets/ # (optional assets)
└─ README.md
- Keyboard-friendly buttons
- Focus on clear feedback states (correct/incorrect)
- Timer includes visual urgency indicators
- Blocked login unexpectedly: Clear attempts with the snippet above.
- Changes not visible: Hard refresh your browser (Ctrl+F5) to bypass cache.
MIT License (feel free to replace with your preferred license).