Skip to main content

Practice Problems API

The Opennote Practice API lets you create practice problem sets for any subject and automatically grade student responses. Generate multiple choice, free response, select all, or mixed problem types with detailed feedback and scoring.

How It Works

1

Create Problem Set

Describe what kind of problems you want and how many
2

Check Status

Monitor progress as problems are generated
3

Get Results

Receive completed problem set with solutions and grading rubrics

Grade FRQ Responses

Submit student answers for automatic grading and feedback

Quick Start Example

from opennote import OpennoteClient
import time

client = OpennoteClient(api_key="your_editable_api_key")

# Create a practice problem set
response = client.practice.create(
    set_description="Algebra word problems involving linear equations for 9th grade students",
    count=5
)

if response.success:
    set_id = response.set_id
    print(f"Practice set started! ID: {set_id}")
    
    # Check status until complete
    while True:
        status = client.practice.status(set_id)
        
        if status.status == "completed":
            print(f"Generated {len(status.response.problems)} problems!")
            break
        elif status.status == "failed":
            print(f"Error: {status.message}")
            break
        
        time.sleep(10)

Configuration Options

Based on the API specification, here are the available parameters:

set_description (required)

Description of what kind of practice problems you want. Be specific about the subject, grade level, and topics. Examples:
  • "Algebra word problems involving linear equations for 9th grade students"
  • "Basic calculus derivatives for AP students"
  • "Chemistry stoichiometry problems with molar ratios"

count (optional)

Number of problems to generate (1-15). Default: 5

set_name (optional)

Custom name for the problem set. If not provided, one will be generated automatically.

search_for_problems (optional)

Whether to search the web for additional context to help create better problems. Default: false

webhook_url (optional)

URL to receive notifications when problem generation is complete.

Automatic Grading

You can also grade student responses to free-response questions:
# Grade a student's answer
problem = {
    "problem_type": "frq",
    "problem_statement": "Solve for x: 2x + 5 = 17",
    "user_answer": "2x = 12, so x = 6"
}

grade = client.practice.grade(problem=problem)
print(f"Score: {grade.score}/{grade.max_score}")
print(f"Explanation: {grade.explanation}")

Support

Need help with practice problems? Ready to create your first practice problem set? Try the API Playground or explore our SDK documentation.
I