Overview
ClassQuiz provides a comprehensive quiz editor that allows you to create engaging quizzes with multiple question types, custom styling, and rich media support. The editor supports both creating new quizzes and editing existing ones.Creating a New Quiz
Getting Started
To create a new quiz:- Navigate to the dashboard
- Click the “Create Quiz” button
- You’ll be redirected to the quiz editor at
/create
Quizzes created from the
/create page are automatically assigned a unique UUID when saved.Editor Workflow
The quiz creation process follows this workflow:Initialize Editor Session
When you start creating a quiz, the system generates an edit session token (via
/api/v1/editor/start) that’s valid for 1 hour. This token manages your editing session and temporary image uploads.Build Your Quiz
Add questions, configure settings, upload images, and customize the appearance of your quiz in the editor interface.
Quiz Metadata
Every quiz has the following metadata stored in theQuiz model (classquiz/db/models.py:183):
Quiz Settings
Visibility Settings
Visibility Settings
Public vs Private Quizzes
- Private (default): Only you can see and use the quiz
- Public: Quiz appears in the community marketplace and search results
Visual Customization
Visual Customization
Appearance Options
- Cover Image: Upload or link to a cover image
- Background Color: Set a custom hex color (e.g.,
#FF5733) - Background Image: Add a background image URL
Editing Existing Quizzes
Edit Mode
To edit an existing quiz:- Go to your dashboard
- Find the quiz you want to edit
- Click the edit button
- You’ll be redirected to
/edit?quiz_id={quiz_id}
/api/v1/quiz/get/{quiz_id} (classquiz/routers/quiz.py:32).
Edit Session Management
When editing a quiz, the system:Validates Ownership
Ensures you own the quiz before allowing edits (classquiz/routers/editor.py:64)
Tracks Changes
Updates the
updated_at timestamp when you save changesManages Media
Handles deletion of old images when replaced with new ones
Re-indexes Content
Updates search index if the quiz is public
Update Process
When you save edits (classquiz/routers/editor.py:127):Content Sanitization
All user-provided content is sanitized to prevent XSS attacks (classquiz/routers/editor.py:88):- Quiz titles and descriptions are cleaned using
bleach.clean()with allowed HTML tags - Background colors are stripped of all HTML
- Question text and answers are sanitized with allowed tags
- Empty answers are converted to
None
ALLOWED_TAGS_FOR_QUIZ configuration.
Image Management
Uploading Images
Images can be added to:- Quiz cover image
- Quiz background
- Individual questions
- Question answers (for voting type questions)
Image Validation
All image URLs are validated usingcheck_image_string() helper function:
.gif, .jpg, .jpeg, .png, .svg, .webp, .jfif
Storage Integration
Images are tracked in theStorageItem model with metadata:
- File size and MIME type
- Upload timestamp
- MD5 hash for deduplication
- Relationships to quizzes using the image
- Alt text and filename for accessibility
Import Features
Kahoot Import
ClassQuiz supports importing quizzes from Kahoot:imported_from_kahoot: True and store the original kahoot_id.
Excel Import
You can also import quizzes from Excel files:Best Practices
Save Frequently
The editor auto-saves to localStorage, but manually save to persist to the server
Optimize Images
Use compressed images to stay within storage limits and improve loading times
Test Before Publishing
Create as private first, test with live games, then make public
Use Descriptive Titles
Clear titles help users find your quiz in search and improve discoverability
API Reference
Get Quiz
Start Editor Session
edit(boolean): Whether editing existing quizquiz_id(UUID, optional): ID of quiz to edit
Finish/Save Quiz
edit_id(string): Session token from start endpointquiz_input(QuizInput): Complete quiz data