Generate worksheet questions
Send the reviewed question plan for a worksheet, and start generating its questions and answers.
POST
/
worksheet
/
v1
/
generate-worksheet
/
{work_sheet_id}
Generate worksheet questions
curl --request POST \
--url https://api.crazygoldfish.com/worksheet/v1/generate-worksheet/{work_sheet_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question_type_summary": [
{
"question_type": "mcq_single_answer",
"count": 3
},
{
"question_type": "short_answer",
"count": 2
}
],
"bloom_summary": [
{
"bloom": "remember",
"question_count": 2
},
{
"bloom": "understand",
"question_count": 2
},
{
"bloom": "apply",
"question_count": 1
}
],
"difficulty_summary": [
{
"difficulty": "easy",
"question_count": 2
},
{
"difficulty": "medium",
"question_count": 2
},
{
"difficulty": "hard",
"question_count": 1
}
],
"question_summary": [
{
"question_type": "mcq_single_answer",
"learning_objectives": "Recall the properties of magnetic field lines",
"bloom": "remember",
"difficulty": "easy",
"question_count": 2
},
{
"question_type": "mcq_single_answer",
"learning_objectives": "Apply the right-hand thumb rule to find the field direction",
"bloom": "apply",
"difficulty": "medium",
"question_count": 1
},
{
"question_type": "short_answer",
"learning_objectives": "Explain why magnetic field lines never cross",
"bloom": "understand",
"difficulty": "medium",
"question_count": 1
},
{
"question_type": "short_answer",
"learning_objectives": "Explain how a solenoid can be used to make an electromagnet",
"bloom": "understand",
"difficulty": "hard",
"question_count": 1
}
]
}
'import requests
url = "https://api.crazygoldfish.com/worksheet/v1/generate-worksheet/{work_sheet_id}"
payload = {
"question_type_summary": [
{
"question_type": "mcq_single_answer",
"count": 3
},
{
"question_type": "short_answer",
"count": 2
}
],
"bloom_summary": [
{
"bloom": "remember",
"question_count": 2
},
{
"bloom": "understand",
"question_count": 2
},
{
"bloom": "apply",
"question_count": 1
}
],
"difficulty_summary": [
{
"difficulty": "easy",
"question_count": 2
},
{
"difficulty": "medium",
"question_count": 2
},
{
"difficulty": "hard",
"question_count": 1
}
],
"question_summary": [
{
"question_type": "mcq_single_answer",
"learning_objectives": "Recall the properties of magnetic field lines",
"bloom": "remember",
"difficulty": "easy",
"question_count": 2
},
{
"question_type": "mcq_single_answer",
"learning_objectives": "Apply the right-hand thumb rule to find the field direction",
"bloom": "apply",
"difficulty": "medium",
"question_count": 1
},
{
"question_type": "short_answer",
"learning_objectives": "Explain why magnetic field lines never cross",
"bloom": "understand",
"difficulty": "medium",
"question_count": 1
},
{
"question_type": "short_answer",
"learning_objectives": "Explain how a solenoid can be used to make an electromagnet",
"bloom": "understand",
"difficulty": "hard",
"question_count": 1
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question_type_summary: [
{question_type: 'mcq_single_answer', count: 3},
{question_type: 'short_answer', count: 2}
],
bloom_summary: [
{bloom: 'remember', question_count: 2},
{bloom: 'understand', question_count: 2},
{bloom: 'apply', question_count: 1}
],
difficulty_summary: [
{difficulty: 'easy', question_count: 2},
{difficulty: 'medium', question_count: 2},
{difficulty: 'hard', question_count: 1}
],
question_summary: [
{
question_type: 'mcq_single_answer',
learning_objectives: 'Recall the properties of magnetic field lines',
bloom: 'remember',
difficulty: 'easy',
question_count: 2
},
{
question_type: 'mcq_single_answer',
learning_objectives: 'Apply the right-hand thumb rule to find the field direction',
bloom: 'apply',
difficulty: 'medium',
question_count: 1
},
{
question_type: 'short_answer',
learning_objectives: 'Explain why magnetic field lines never cross',
bloom: 'understand',
difficulty: 'medium',
question_count: 1
},
{
question_type: 'short_answer',
learning_objectives: 'Explain how a solenoid can be used to make an electromagnet',
bloom: 'understand',
difficulty: 'hard',
question_count: 1
}
]
})
};
fetch('https://api.crazygoldfish.com/worksheet/v1/generate-worksheet/{work_sheet_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"detail": [
{
"id": "152764ca-1685-427c-aba7-4b92dcc0d60f",
"msg": "Worksheet generation initiated successfully."
}
]
}Step 3 of 4 in Generate a worksheet. This call starts an async job.
Rules
- Call this after Get worksheet question configuration returns
status: "Completed". - Send the
question_configurationobject as the request body. Don’t wrap it in another key. - If you edit the plan, the counts in each of the four lists must still add up to
number_of_questions. Otherwise you get422 Total mismatch. - This step runs once per worksheet. A second call returns
400unless the first one failed.
Next step
Get generated worksheet questions
Poll until
status is Completed, or wait for the worksheet_generation webhook.Authorizations
Access token from Get an access token.
Path Parameters
The worksheet id returned by Start a worksheet.
Example:
"152764ca-1685-427c-aba7-4b92dcc0d60f"
Body
application/json
The question plan. The counts in each of the four lists must add up to the worksheet's number_of_questions.
Was this page helpful?
⌘I
Generate worksheet questions
curl --request POST \
--url https://api.crazygoldfish.com/worksheet/v1/generate-worksheet/{work_sheet_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"question_type_summary": [
{
"question_type": "mcq_single_answer",
"count": 3
},
{
"question_type": "short_answer",
"count": 2
}
],
"bloom_summary": [
{
"bloom": "remember",
"question_count": 2
},
{
"bloom": "understand",
"question_count": 2
},
{
"bloom": "apply",
"question_count": 1
}
],
"difficulty_summary": [
{
"difficulty": "easy",
"question_count": 2
},
{
"difficulty": "medium",
"question_count": 2
},
{
"difficulty": "hard",
"question_count": 1
}
],
"question_summary": [
{
"question_type": "mcq_single_answer",
"learning_objectives": "Recall the properties of magnetic field lines",
"bloom": "remember",
"difficulty": "easy",
"question_count": 2
},
{
"question_type": "mcq_single_answer",
"learning_objectives": "Apply the right-hand thumb rule to find the field direction",
"bloom": "apply",
"difficulty": "medium",
"question_count": 1
},
{
"question_type": "short_answer",
"learning_objectives": "Explain why magnetic field lines never cross",
"bloom": "understand",
"difficulty": "medium",
"question_count": 1
},
{
"question_type": "short_answer",
"learning_objectives": "Explain how a solenoid can be used to make an electromagnet",
"bloom": "understand",
"difficulty": "hard",
"question_count": 1
}
]
}
'import requests
url = "https://api.crazygoldfish.com/worksheet/v1/generate-worksheet/{work_sheet_id}"
payload = {
"question_type_summary": [
{
"question_type": "mcq_single_answer",
"count": 3
},
{
"question_type": "short_answer",
"count": 2
}
],
"bloom_summary": [
{
"bloom": "remember",
"question_count": 2
},
{
"bloom": "understand",
"question_count": 2
},
{
"bloom": "apply",
"question_count": 1
}
],
"difficulty_summary": [
{
"difficulty": "easy",
"question_count": 2
},
{
"difficulty": "medium",
"question_count": 2
},
{
"difficulty": "hard",
"question_count": 1
}
],
"question_summary": [
{
"question_type": "mcq_single_answer",
"learning_objectives": "Recall the properties of magnetic field lines",
"bloom": "remember",
"difficulty": "easy",
"question_count": 2
},
{
"question_type": "mcq_single_answer",
"learning_objectives": "Apply the right-hand thumb rule to find the field direction",
"bloom": "apply",
"difficulty": "medium",
"question_count": 1
},
{
"question_type": "short_answer",
"learning_objectives": "Explain why magnetic field lines never cross",
"bloom": "understand",
"difficulty": "medium",
"question_count": 1
},
{
"question_type": "short_answer",
"learning_objectives": "Explain how a solenoid can be used to make an electromagnet",
"bloom": "understand",
"difficulty": "hard",
"question_count": 1
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
question_type_summary: [
{question_type: 'mcq_single_answer', count: 3},
{question_type: 'short_answer', count: 2}
],
bloom_summary: [
{bloom: 'remember', question_count: 2},
{bloom: 'understand', question_count: 2},
{bloom: 'apply', question_count: 1}
],
difficulty_summary: [
{difficulty: 'easy', question_count: 2},
{difficulty: 'medium', question_count: 2},
{difficulty: 'hard', question_count: 1}
],
question_summary: [
{
question_type: 'mcq_single_answer',
learning_objectives: 'Recall the properties of magnetic field lines',
bloom: 'remember',
difficulty: 'easy',
question_count: 2
},
{
question_type: 'mcq_single_answer',
learning_objectives: 'Apply the right-hand thumb rule to find the field direction',
bloom: 'apply',
difficulty: 'medium',
question_count: 1
},
{
question_type: 'short_answer',
learning_objectives: 'Explain why magnetic field lines never cross',
bloom: 'understand',
difficulty: 'medium',
question_count: 1
},
{
question_type: 'short_answer',
learning_objectives: 'Explain how a solenoid can be used to make an electromagnet',
bloom: 'understand',
difficulty: 'hard',
question_count: 1
}
]
})
};
fetch('https://api.crazygoldfish.com/worksheet/v1/generate-worksheet/{work_sheet_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"detail": [
{
"id": "152764ca-1685-427c-aba7-4b92dcc0d60f",
"msg": "Worksheet generation initiated successfully."
}
]
}