A simple, static HTML-based quiz application. Questions and answers are stored in JSON files, making it easy to add new quiz topics.
- Multiple quiz topics
- Multiple choice questions
- Instant feedback on answers
- Score tracking
- Responsive design
Since this is a static web app, you can run it with any HTTP server:
# Python 3
python3 -m http.server 8000
# Python 2
python -m SimpleHTTPServer 8000
# Node.js (if you have http-server installed)
npx http-serverThen open http://localhost:8000 in your browser.
For permanent deployment on a Raspberry Pi, use the included systemd service:
./install.shSee DEPLOYMENT.md for detailed deployment instructions.
- Create a new JSON file in the
quizzes/directory (e.g.,science.json) - Add your questions following this format:
{
"title": "Science Quiz",
"description": "Test your scientific knowledge",
"questions": [
{
"question": "What is the chemical symbol for water?",
"options": ["H2O", "CO2", "O2", "N2"],
"correctIndex": 0
}
]
}- Update
quizzes/_manifest.jsonto include your new quiz:
{
"quizzes": [
{
"id": "science",
"title": "Science Quiz",
"description": "Test your scientific knowledge",
"file": "science.json"
}
]
}/
index.html # Main quiz interface
app.js # Quiz logic
styles.css # Styling
install.sh # Deployment script for Raspberry Pi
quiz-app.service # Systemd service file
DEPLOYMENT.md # Deployment documentation
quizzes/
_manifest.json # Lists all available quizzes
friends.json # Friends quiz (20 questions)
friends-hard.json # Friends Hard Mode (50 questions)
game-of-thrones.json # Game of Thrones quiz (25 questions)
title: Display name of the quizdescription: Short description shown on quiz selectionquestions: Array of question objectsquestion: The question textoptions: Array of possible answerscorrectIndex: Index (0-based) of the correct answer in the options array