> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opennote.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Practice API

> Create custom practice problem sets and grade student responses with AI assistance.

# 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

<Steps>
  <Step title="Create Problem Set">
    Describe what kind of problems you want and how many
  </Step>

  <Step title="Check Status">
    Monitor progress as problems are generated
  </Step>

  <Step title="Get Results">
    Receive completed problem set with solutions and grading rubrics
  </Step>

  <Step title="Grade FRQ Responses" icon="pen-nib">
    Submit student answers for automatic grading and feedback
  </Step>
</Steps>

## Quick Start Example

<CodeGroup>
  ```python Python theme={null}
  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)
  ```

  ```typescript TypeScript theme={null}
  import { OpennoteClient } from '@opennote-ed/sdk';

  const client = new OpennoteClient('your_editable_api_key');

  // Create a practice problem set
  const response = await client.practice.create({
      set_description: "Algebra word problems involving linear equations for 9th grade students",
      count: 5
  });

  if (response.success && response.set_id) {
      const setId = response.set_id;
      console.log(`Practice set started! ID: ${setId}`);
      
      // Check status until complete
      while (true) {
          const status = await client.practice.status(setId);
          
          if (status.status === "completed" && status.response) {
              console.log(`Generated ${status.response.problems?.length} problems!`);
              break;
          } else if (status.status === "failed") {
              console.log(`Error: ${status.message}`);
              break;
          }
          
          await new Promise(resolve => setTimeout(resolve, 10000));
      }
  }
  ```

  ```bash cURL theme={null}
  # Create practice set
  curl -X POST "https://api.opennote.com/v1/interactives/practice/create" \
    -H "Authorization: Bearer your_editable_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "set_description": "Algebra word problems involving linear equations for 9th grade students",
      "count": 5
    }'

  # Check status
  curl -X GET "https://api.opennote.com/v1/interactives/practice/status/{set_id}" \
    -H "Authorization: Bearer your_editable_api_key"
  ```
</CodeGroup>

## 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:

<CodeGroup>
  ```python Python theme={null}
  # 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}")
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.opennote.com/v1/interactives/practice/grade" \
    -H "Authorization: Bearer your_editable_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "problem": {
        "problem_type": "frq",
        "problem_statement": "Solve for x: 2x + 5 = 17",
        "user_answer": "2x = 12, so x = 6"
      }
    }'
  ```
</CodeGroup>

## Support

Need help with practice problems?

* **Technical Issues**: [devtools@opennote.me](mailto:devtools@opennote.me)
* **API Questions**: See our [API Reference](/api-reference/practice) for detailed documentation
* **Account Issues**: Visit your [dashboard](https://opennote.com/api/teams) for billing and usage

Ready to create your first practice problem set? Try the [API Playground](https://opennote.com/api/teams) or explore our [SDK documentation](../sdks).
