Replace choice groups (beta)
curl --request PUT \
--url https://api.evalezy.com/v1/exams/{examId}/choice-groups \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"choice_groups": [
{
"label": "Section E internal choice",
"question_labels": [
"Q30",
"Q31",
"Q32"
],
"attempt": 2,
"policy": "best"
}
]
}
'import requests
url = "https://api.evalezy.com/v1/exams/{examId}/choice-groups"
payload = { "choice_groups": [
{
"label": "Section E internal choice",
"question_labels": ["Q30", "Q31", "Q32"],
"attempt": 2,
"policy": "best"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
choice_groups: [
{
label: 'Section E internal choice',
question_labels: ['Q30', 'Q31', 'Q32'],
attempt: 2,
policy: 'best'
}
]
})
};
fetch('https://api.evalezy.com/v1/exams/{examId}/choice-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"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"
}
}Choice groups
Replace choice groups (beta)
Beta, enabled on request. Choice groups are currently switched off, so this endpoint returns 422 feature_not_available; send papers without internal choice for now, or contact hello@evalezy.com if you need them.
When enabled, it replaces every choice group of the exam (“attempt any N of M”). Each group lists at least two question labels, attempt (at least 1 and less than the group size) and policy (first or best). The response carries choice_groups, total_marks and paper_max.
Scope: evaluation:write
PUT
/
exams
/
{examId}
/
choice-groups
Replace choice groups (beta)
curl --request PUT \
--url https://api.evalezy.com/v1/exams/{examId}/choice-groups \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"choice_groups": [
{
"label": "Section E internal choice",
"question_labels": [
"Q30",
"Q31",
"Q32"
],
"attempt": 2,
"policy": "best"
}
]
}
'import requests
url = "https://api.evalezy.com/v1/exams/{examId}/choice-groups"
payload = { "choice_groups": [
{
"label": "Section E internal choice",
"question_labels": ["Q30", "Q31", "Q32"],
"attempt": 2,
"policy": "best"
}
] }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
choice_groups: [
{
label: 'Section E internal choice',
question_labels: ['Q30', 'Q31', 'Q32'],
attempt: 2,
policy: 'best'
}
]
})
};
fetch('https://api.evalezy.com/v1/exams/{examId}/choice-groups', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{}{
"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).
Body
application/json
Show child attributes
Show child attributes
Response
OK