Update a question
curl --request PATCH \
--url https://api.evalezy.com/v1/exams/{examId}/questions/{questionId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"word_limit": 120
}
'import requests
url = "https://api.evalezy.com/v1/exams/{examId}/questions/{questionId}"
payload = { "word_limit": 120 }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({word_limit: 120})
};
fetch('https://api.evalezy.com/v1/exams/{examId}/questions/{questionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"label": "<string>",
"parent_label": "<string>",
"section": "<string>",
"type": "<string>",
"text": "<string>",
"max_marks": 123,
"negative_marks": 123,
"options": [
{
"label": "<string>",
"option_id": "<string>",
"text": "<string>"
}
],
"correct_options": [
"<string>"
],
"answer": {},
"model_answer": "<string>",
"rubric": {},
"word_limit": 123,
"expects_diagram": true,
"assess_language": true,
"tags": {},
"external_id": "<string>",
"rubric_version": 123,
"rubric_sync": "<string>",
"warnings": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is not valid.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f"
}
}{
"error": {
"code": "insufficient_scope",
"message": "This API key lacks the evaluation:write scope.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f",
"details": {
"required_scope": "evaluation:write"
}
}
}{
"error": {
"code": "not_found",
"message": "The resource was not found.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f"
}
}{
"error": {
"code": "conflict",
"message": "The request conflicts with the current state.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f"
}
}{
"error": {
"code": "validation_failed",
"message": "questions[0].max_marks is required.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f",
"details": {
"errors": [
{
"field": "questions[0].max_marks",
"code": "required",
"message": "max_marks is required."
}
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after 2 s.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f"
}
}Questions
Update a question
Edits one question. In a draft exam any field can change except type and section. Once the exam is open, only text, model_answer, rubric, tags, word_limit and expects_diagram can change.
Scope: evaluation:write
PATCH
/
exams
/
{examId}
/
questions
/
{questionId}
Update a question
curl --request PATCH \
--url https://api.evalezy.com/v1/exams/{examId}/questions/{questionId} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"word_limit": 120
}
'import requests
url = "https://api.evalezy.com/v1/exams/{examId}/questions/{questionId}"
payload = { "word_limit": 120 }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({word_limit: 120})
};
fetch('https://api.evalezy.com/v1/exams/{examId}/questions/{questionId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"label": "<string>",
"parent_label": "<string>",
"section": "<string>",
"type": "<string>",
"text": "<string>",
"max_marks": 123,
"negative_marks": 123,
"options": [
{
"label": "<string>",
"option_id": "<string>",
"text": "<string>"
}
],
"correct_options": [
"<string>"
],
"answer": {},
"model_answer": "<string>",
"rubric": {},
"word_limit": 123,
"expects_diagram": true,
"assess_language": true,
"tags": {},
"external_id": "<string>",
"rubric_version": 123,
"rubric_sync": "<string>",
"warnings": [
{
"code": "<string>",
"message": "<string>",
"field": "<string>"
}
]
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is not valid.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f"
}
}{
"error": {
"code": "insufficient_scope",
"message": "This API key lacks the evaluation:write scope.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f",
"details": {
"required_scope": "evaluation:write"
}
}
}{
"error": {
"code": "not_found",
"message": "The resource was not found.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f"
}
}{
"error": {
"code": "conflict",
"message": "The request conflicts with the current state.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f"
}
}{
"error": {
"code": "validation_failed",
"message": "questions[0].max_marks is required.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f",
"details": {
"errors": [
{
"field": "questions[0].max_marks",
"code": "required",
"message": "max_marks is required."
}
]
}
}
}{
"error": {
"code": "rate_limited",
"message": "Too many requests. Retry after 2 s.",
"request_id": "req_4f9c2a7e1b3d4c8a9e6f0b2d5a7c1e3f"
}
}Authorizations
Your institute's API key, vak_eval_ followed by 48 hex characters. An institute admin creates keys in the dashboard under Settings -> Integrations -> API keys.
Path Parameters
Exam id (UUID).
Question id (UUID).
Body
application/json
The body is of type object.
Response
OK
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes