Add a question to a quiz
post
https://mudey.fr/api/v1/courses/{courseId}/lessons/{lessonId}/questionscourses:writeThe question is checked as in the editor; the quiz duration (30 s per question) is recalculated.
Authorization: Bearer mudey_sk_… header required. Create and use a key
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| courseId* | path | string | |
| lessonId* | path | string |
JSON body
Fields marked * are required.
| Field | Type | Description |
|---|---|---|
| kind | SINGLE | MULTIPLE | SINGLE: a single correct answer; MULTIPLE: all correct answers to tick. Default: inferred from the number of correct answers. |
| prompt* | string | Question text. |
| answers* | object[] | 2 to 15 answers, at least one correct (exactly one for SINGLE). |
| relatedLessonId | string | null | Video lesson of the same course to review, suggested to a student who gets it wrong. |
Responses
201Question added; updated list.401Missing, invalid, revoked or expired key.403Missing permission on the key, or the account is no longer an instructor.404Resource not found among your courses.422Invalid question (invalid_questions), related session not found (invalid_related_lesson) or lesson that is not a quiz (not_a_quiz).429Rate limit exceeded (300 calls per minute per key). See the Retry-After header.
Example
export MUDEY_API_KEY="mudey_sk_..."
export COURSE_ID="..." # replace me
export LESSON_ID="..." # replace me
curl -X POST "https://mudey.fr/api/v1/courses/$COURSE_ID/lessons/$LESSON_ID/questions" \
-H "Authorization: Bearer $MUDEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "SINGLE",
"prompt": "Combien de couleurs primaires en lumière ?",
"answers": [
{
"text": "Trois",
"explanation": "Rouge, vert et bleu.",
"correct": true
},
{
"text": "Quatre",
"explanation": "Non : quatre, c'\''est l'\''imprimerie (CMJN).",
"correct": false
}
],
"relatedLessonId": "…"
}'