This endpoint allows you to create multiple batches of quiz questions for a specific module in a single request. Each batch can contain its own set of questions and difficulty level, along with global quiz settings.
POST https://app.realxeducation.io/api/quiz/create-batches
Use this endpoint to:
- Create multiple quiz batches at once
- Associate all batches with a single module
- Define quiz settings (time limits, shuffling, max students, etc.)
- Track batch creation via returned batch IDs
export interface CreateQuizBatchesInput {
moduleId: string;
bookerId: string;
bookerName: string;
bookerEmail?: string;
deliverer: string;
moduleName: string;
batches: {
batchNumber: number;
questions: QuizQuestion[];
difficulty?: string;
}[];
settings?: {
allowRetakes?: boolean;
passingScore?: number;
timeLimit?: number;
shuffleQuestions?: boolean;
shuffleOptions?: boolean;
maxStudents?: number; // default: 10
};
}moduleIdmust be"10"bookerIdmust be"1"batchNumbermust be unique per batch- Each batch must include at least one question
Each question inside a batch must follow this structure:
QuizQuestion {
id: string;
question_text: string;
options: {
id: string;
label: string;
text: string;
}[];
correct_options: string[];
explanation?: string;
difficulty?: "easy" | "medium" | "hard";
source_fact_id?: string;
}{
"moduleId": "10",
"bookerId": "1",
"bookerName": "Izaak",
"deliverer": "1exisLyxm7JNVbAga7JLzA4WdGdWRVbWtgA6FmimsShdiDB",
"moduleName": "Privacy, Surveillance & Digital Control",
"settings": {
"shuffleQuestions": true,
"shuffleOptions": true,
"timeLimit": 300, // 5min should be in seconds
"maxStudents": 10
},
"batches": [
{
"batchNumber": 1,
"difficulty": "easy",
"questions": [
{
"id": "a1c2b3f0-1f6c-4f39-9e94-2a5c7b8d9e01",
"question_text": "What is the main concern discussed regarding the future of privacy in a digitally controlled world?",
"options": [
{ "id": "o1", "label": "A", "text": "Lack of internet access" },
{ "id": "o2", "label": "B", "text": "Increasing government and corporate surveillance" },
{ "id": "o3", "label": "C", "text": "Slow financial transactions" },
{ "id": "o4", "label": "D", "text": "Outdated banking systems" }
],
"correct_options": ["o2"],
"explanation": "The content emphasizes growing government and corporate surveillance as the main privacy concern.",
"difficulty": "easy",
"source_fact_id": "slide-1-introduction"
}
]
}
]
}{
"success": true,
"message": "Quiz batches created successfully",
"data": {
"moduleId": "10",
"bookerId": "1",
"totalBatches": 5,
"totalQuestions": 25,
"batchIds": [
"1770036724594-ui8cdhwxy",
"1770036724594-h6gg07r0g",
"1770036724594-jfoyzsch5",
"1770036724594-8eyute43b",
"1770036724594-k4ub65qsq"
],
"metadata": {
"allowRetakes": true,
"timeLimit": "7",
"maxStudents": 10
}
}
}| Field | Description |
|---|---|
totalBatches |
Number of batches created |
totalQuestions |
Total questions across all batches |
batchIds |
Unique IDs for each created batch |
metadata |
Applied quiz settings |
- Missing
moduleIdorbookerId - Invalid question structure
- Empty
batchesarray - Duplicate
batchNumbervalues
- Keep batch sizes consistent (e.g. 5 questions per batch)
- Use mixed difficulty levels across batches
- Enable
shuffleQuestionsandshuffleOptionsfor fairness - Use
source_fact_idfor traceability to learning material
If you want, I can also:
- Add error response examples
- Convert this into Swagger / OpenAPI
- Create a Postman collection
- Validate your payload automatically before sending
Just say the word.