Assessment Tools
Build comprehensive assessment systems with quiz creation, automatic grading, and detailed feedback. Support multiple question types and adaptive difficulty.
Creating an Assessment
javascript
const assessment = await client.assessments.create({
title: "Chapter 5 — Forces and Motion",
type: "quiz",
subject: "physics",
grade: "11",
time_limit: "30min",
passing_score: 70,
shuffle_questions: true,
questions: [
{
type: "multiple_choice",
question: "What is Newton's Second Law of Motion?",
options: [
"An object at rest stays at rest",
"F = ma",
"Every action has an equal and opposite reaction",
"Energy cannot be created or destroyed"
],
correct_answer: 1,
points: 5,
explanation: "Newton's Second Law states that Force = mass × acceleration."
},
{
type: "short_answer",
question: "Calculate the force needed to accelerate a 10kg object at 5 m/s².",
correct_answer: "50 N",
points: 10,
rubric: "Award full marks for correct value and unit."
},
{
type: "true_false",
question: "Friction always opposes the direction of motion.",
correct_answer: true,
points: 3
}
]
});Endpoints
GET
/v1/assessmentsList assessments with filtering by subject, type, grade, or lesson.
Query Parameters
typestring - Assessment type (quiz,exam,assignment,practice)subjectstring - Filter by subjectlesson_idstring - Filter by associated lessonlimitinteger - Records per page (default: 20)
POST
/v1/assessmentsCreate a new assessment with questions, grading criteria, and configuration options.
Request Body
titlestring requiredtypestring required -quiz,exam,assignment,practicetime_limitstring - Time allowed (e.g.30min,2h)passing_scorenumber - Minimum passing percentageshuffle_questionsboolean - Randomize question orderquestionsobject[] required - Array of question objects
POST
/v1/assessments/:id/submitSubmit answers for grading. Returns scores, feedback, and correct answers.
response
{
"submission_id": "sub_def456",
"assessment_id": "asmt_abc123",
"student_id": "stu_001",
"score": 85,
"max_score": 100,
"passed": true,
"time_taken": "22:45",
"results": [
{
"question_index": 0,
"correct": true,
"points_awarded": 5,
"points_possible": 5
},
{
"question_index": 1,
"correct": true,
"points_awarded": 10,
"points_possible": 10,
"feedback": "Correct calculation with proper units."
},
{
"question_index": 2,
"correct": false,
"points_awarded": 0,
"points_possible": 3,
"explanation": "Friction always opposes the direction of motion."
}
]
}GET
/v1/assessments/:id/resultsRetrieve aggregated results for an assessment — class averages, score distribution, and question-level analytics.
Question Types
multiple_choice Single correct answer from a list of optionsmulti_select Multiple correct answers from a listtrue_false Boolean true/false questionsshort_answer Free-text response with keyword matchingessay Long-form response graded by rubric or AIfill_in_blank Complete sentences with missing wordsmatching Match items from two columns