Create a Course Quiz Question
This endpoint creates a question for a specific quiz (a lesson of type quiz) with id {lesson_id}
for the course
identified by {course_id}
and under the section identified by {section_id}
.
info
This operation requires the course creator or manager role.
HTTP Request
POST /api/v2/course/{course_id}/section/{section_id}/lesson/{lesson_id}/
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
course_id | path | string | true | A unique integer value identifying the course of the lesson |
section_id | path | string | true | A unique integer value identifying the section of the lesson |
lesson_id | path | string | true | A unique integer value identifying the lesson (quiz) |
body | body | Course Quiz Question | true | The request body (course quiz question) |
Example Body Parameters
- JSON
{
"type": "string",
"text": "string",
"answers": []
}
Example Request
- JavaScript
- Bash
const inputBody = '{
"type": "string",
"text": "string",
"answers": []
}';
const headers = {
'Content-Type':'application/x-www-form-urlencoded',
'Accept':'application/json',
'Authorization': 'Bearer {access_token}'
};
fetch('/api/v2/course/{course_id}/section/{section_id}/lesson/{lesson_id}/',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
# You can also use wget
curl -X POST /api/v2/course/{course_id}/section/{section_id}/lesson/{lesson_id}/ \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Accept: application/json'
-H 'Authorization: Bearer {access_token}'
--DATA '{body}'
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Response status code | Course Quiz Question |