Example prompt
ZapQuiz: Interactive Quiz Application
Part 1
Project Overview
ZapQuiz is a Kahoot-like interactive quiz application that allows teachers to create quizzes and participants to join via QR codes, answering questions in real-time with a points-based scoring system.
Technology Stack
- Backend: PHP
- Frontend: HTML, CSS, JavaScript (responsive design)
- Database: MySQL/MariaDB
- CSS Framework: Tailwind CSS
- Real-time Updates: SSE (Server-Snet events)
- Installation: Must support subdirectory installation (e.g., https://www.server.com/zapquiz)
Development Phases
The project will be developed in three distinct phases:
- Teacher Authentication & Quiz Management (current focus)
- Quiz Session Initialization & Participant Onboarding
- Quiz Execution, Scoring & Results Display
Phase 1: Teacher Authentication & Quiz Management System
Requirements
User Authentication
- Create a secure login system for teachers with:
- Username/email and password authentication
- Password encryption using bcrypt
- Session management
- Basic "remember me" functionality
- Password reset capability (optional)
Database Schema (Initial)
-
Teachers Table:
- id (PRIMARY KEY)
- username
- password (bcrypt hashed)
- created_at
- updated_at
-
Quizzes Table:
- id (PRIMARY KEY)
- teacher_id (FOREIGN KEY)
- title
- description
- unique_identifier (for QR code generation)
- status (draft, active, completed)
- created_at
- updated_at
-
Questions Table:
- id (PRIMARY KEY)
- quiz_id (FOREIGN KEY)
- question_text (HTML-formatted)
- image_path (optional)
- display_order
- time_limit (default: 30 seconds)
- created_at
- updated_at
-
Answers Table:
- id (PRIMARY KEY)
- question_id (FOREIGN KEY)
- answer_text
- is_correct (boolean)
- answer_option (A, B, C, or D)
- created_at
- updated_at
Teacher Dashboard Functionality
-
Authentication Pages:
- Login page
- For now we don't need an registration page yet.
Create one login with user teacher, password teacher123 - No password recovery yet.
-
Quiz Management:
- List all quizzes with search/filter options
- Create new quiz (with auto-generated unique identifier)
- Edit existing quiz details
- Delete quiz (with confirmation)
- Duplicate quiz with the option to assign it to a different teacher.
-
Question Management:
- List all questions for a quiz
- Add new questions with:
- Question text (HTML editor)
- Image upload capability
- Four answer options (A, B, C, D)
- Correct answer designation
- Question reordering capability
- Edit existing questions
- Delete questions (with confirmation)
Technical Implementation Details
-
Directory Structure:
zapquiz/ ├── assets/ │ ├── css/ │ ├── js/ │ ├── images/ │ └── uploads/ ├── config/ │ └── database.php ├── includes/ │ ├── auth.php │ ├── functions.php │ └── header.php ├── models/ │ ├── Teacher.php │ ├── Quiz.php │ └── Question.php ├── views/ │ ├── auth/ │ ├── dashboard/ │ └── quiz/ ├── index.php └── .htaccess (for subdirectory configuration)
-
URL Structure:
/zapquiz/
- Landing page/zapquiz/login
- Teacher login/zapquiz/dashboard
- Teacher dashboard/zapquiz/quiz/create
- Create new quiz/zapquiz/quiz/{id}/edit
- Edit quiz/zapquiz/quiz/{id}/questions
- Manage questions/zapquiz/quiz/{id}/start
- Initialize quiz (Phase 2)
-
Security Considerations:
- Input validation and sanitization
- CSRF protection for forms
- Session security
- Proper handling of file uploads
- Database query parameterization
UI/UX Requirements
-
Teacher Dashboard:
- Clean, professional interface using Tailwind CSS
- Responsive design for both desktop and tablet use
- Intuitive navigation between quizzes and questions
- Visual indication of quiz status (draft, active, completed)
-
Quiz & Question Editor:
- User-friendly HTML editor for question text
- Simple image upload with preview
- Clear visual distinction between correct and incorrect answers
- Drag-and-drop functionality for question reordering (optional)
Deliverables for Phase 1
- Functional teacher authentication system
- Complete quiz CRUD operations
- Question and answer management system
- Responsive UI built with Tailwind CSS
- Database with appropriate schema and relationships
- Installation instructions for subdirectory setup
Next Steps After Phase 1
Upon completion of Phase 1, development will proceed to Phase 2, focusing on quiz initialization, QR code generation, and participant onboarding.
--
ZapQuiz - Quiz Initialization & Participant Onboarding Prompt
Flow Overview
For the second phase of the ZapQuiz application, we need to implement the quiz initialization flow and participant onboarding process. This system bridges the teacher dashboard to the actual quiz experience.
Requirements
Teacher Dashboard to Quiz Launch
- Implement a "Start Quiz" button on the teacher dashboard for each available quiz
- When clicked, this should navigate to a splash page designed for classroom display
Quiz Splash Page (Teacher View)
Design a splash screen that includes:
-
A prominent, large QR code that students can scan with their phones
- The QR code should contain a unique URL for joining the specific quiz session
- The URL should be in the format:
https://[domain]/zapquiz/join/[unique-code]
-
A text version of the join link displayed beneath the QR code
- Make this text clearly visible for situations where QR scanning isn't possible
- Consider making this text easily selectable for sharing via other means
-
A real-time participant list
- As students join, their names should appear in this list
- Use Server-Sent Events or WebSockets to update the list without page refresh
- Include a counter showing the total number of participants
-
A prominent "Begin Quiz" button
- This should be enabled only when at least one participant has joined
- Include a confirmation dialog to prevent accidental starts
Participant Join Flow (Student View)
When a student scans the QR code or enters the join link:
-
Create a mobile-friendly landing page with:
- Quiz title
- Teacher's name
- A form to enter the student's name
- Clear instructions
-
After name submission:
- Validate the name (no empty submissions, reasonable length)
- Store the participant in the database with a unique session ID
- Redirect to a waiting screen
-
Design a waiting screen that:
- Confirms successful registration
- Displays a friendly "Waiting for quiz to begin..." message
- Includes a visual indicator that the connection is active
- Uses Server-Sent Events or WebSockets to listen for quiz start signal
Database Requirements
-
Add a
sessions
table to track active quiz sessions:- session_id (PRIMARY KEY)
- quiz_id (FOREIGN KEY)
- status (waiting, active, completed)
- started_at
- ended_at
-
Add a
participants
table:- id (PRIMARY KEY)
- session_id (FOREIGN KEY)
- name
- joined_at
- current_score (default 0)
- last_active
Real-Time Communication Requirements
-
Implement Server-Sent Events or WebSockets to:
- Update the teacher's view with participant names as they join
- Notify participants when the quiz begins
- Maintain connection status
-
Create appropriate event handlers for:
- Participant join events
- Quiz state changes
- Connection status updates
Security Considerations
-
Implement basic validation to prevent:
- Empty or excessively long participant names
- SQL injection or XSS attacks
- Multiple participants with identical names
-
Handle session management securely:
- Store participant session information securely
- Prevent unauthorized quiz access
Technical Implementation Notes
-
For QR code generation:
- Use a reliable PHP QR code library
- Generate codes at an appropriate size for classroom display
- Ensure proper contrast for easy scanning
-
For the real-time participant list:
- Implement clean animations for new participants
- Limit the list height with scrolling for large classes
- Consider showing a count of total participants
-
For the subdirectory installation:
- Ensure all URLs correctly account for the
/zapquiz
prefix - Update URL generation in QR codes accordingly
- Ensure all URLs correctly account for the
Deliverables
The completed implementation should include:
- Teacher dashboard with Start Quiz functionality
- Quiz splash page with QR code, join link, and participant list
- Participant join flow with name entry and waiting screen
- Real-time communication system for participant updates
- Database schema updates for sessions and participants
- Complete integration with existing teacher authentication system
Next Steps
After this phase is complete, the third phase will implement the actual quiz gameplay, including question display, answer submission, scoring, and results visualization.