Generate Quiz
Supports both text input and file upload (TXT, DOC, DOCX). Authentication is optional - authenticated users can save quizzes to their history.
POST /api/quiz/generate
Request Parameters
Name/topic of the quiz source (e.g., “Biology Chapter 3”). Defaults to “Untitled Quiz” if not provided.
Text content to generate quiz from. If not provided, quiz will be generated based on the topic name.
Optional file upload (TXT, DOC, DOCX). Maximum 10MB. File content takes precedence over text content.
Response
Unique identifier for the saved quiz (only present for authenticated users)
Name of the quiz source
Array of generated quiz questions
Error Responses
Submit Quiz
Submit quiz answers for AI-powered grading and detailed feedback.POST /api/quiz/submit
Request Parameters
ID of the quiz being submitted (required for saving results to history)
Array of quiz questions (must match the generated quiz structure)
Array of user’s answers corresponding to each question. Length must match questions array.
Response
Number of correct answers
Total number of questions in the quiz
Score as a percentage (0-100)
Detailed results for each question
Error Responses
Get Quiz History
Retrieve all quiz attempts and results for the authenticated user.GET /api/quiz/history
Response
Returns an array of quiz result objects:Unique identifier for the quiz result
ID of the associated quiz
Number of correct answers
Total number of questions
Score as a percentage
ISO 8601 timestamp of submission
Associated quiz information
Get Quiz by ID
Retrieve a specific quiz by its ID.GET /api/quiz/:id
Path Parameters
The unique identifier of the quiz
Response
Quiz ID
ID of the user who created the quiz
Name of the quiz source
Array of quiz questions (same structure as generate endpoint)
ISO 8601 timestamp of quiz creation
Username of the quiz creator
Error Responses
Share Quiz
Generate a shareable link for a quiz. Others can take the quiz using this link.POST /api/quiz/:quizId/share
Path Parameters
The unique identifier of the quiz to share
Response
Unique token for the shared quiz
Complete shareable URL
Get Shared Quiz
Retrieve a quiz using its share token (public endpoint).GET /api/quiz/shared/:shareToken
Path Parameters
The share token for the quiz
Response
Quiz ID
Name of the quiz source
Array of quiz questions
Username of the quiz creator
ISO 8601 timestamp
Submit Shared Quiz
Submit answers for a shared quiz attempt.POST /api/quiz/shared/:shareToken/submit
Path Parameters
The share token for the quiz
Request Parameters
Array of quiz questions
Array of user’s answers
Name of the person taking the quiz (max 100 characters)
Whether this is a guest attempt (default: false)
Response
Same structure as the regular submit quiz endpoint (score, results, etc.)Get Quiz Attempts
View all attempts and statistics for a shared quiz (quiz creator only).GET /api/quiz/:quizId/attempts
Response
Basic quiz information
Overall statistics for all attempts
Array of individual quiz attempts