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

# Evaluation

> Reference for Python SDK evaluator input and output fields across Text Complexity, Feedback, Academic Standards, Graphics, and Durable Skills.

Once you've configured your evaluator, you can start evaluating text inputs for grade level appropriateness:

```python example.py theme={null}
from learning_commons_evaluators import (
  GradeLevelAppropriatenessEvaluator,
  GradeLevelAppropriatenessInput,
)

evaluator = GradeLevelAppropriatenessEvaluator(google_api_key="your-google-key")

result = evaluator.evaluate_sync(
  GradeLevelAppropriatenessInput(text="The cat's out of the bag now.")
)
```

## Inputs

> [!WARNING]
>
> Inputs must be de-identified. Do not submit students' Personally
> Identifiable Information (PII) or any regulated or sensitive personal
> information.

Each evaluator requires different input fields when invoking `evaluate()`.

### [Text Complexity evaluators](https://docs.learningcommons.org/evaluators/text-complexity-evaluators/introduction.md)

> [tab] Grade Level Appropriateness
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `text` | `string` | Informational text to evaluate (10-10,000 characters) |

> [tab] Others
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `text` | `string` | Informational text to evaluate (10-10,000 characters) |
> | `grade_level` | `int` | Target student grade (3–12) |
>
> ```python theme={null}
> from learning_commons_evaluators import (
>   VocabularyComplexityEvaluator,
>   VocabularyComplexityInput,
> )
>
> evaluator = VocabularyComplexityEvaluator(
>   openai_api_key="your-openai-key",
>   google_api_key="your-google-key",
> )
>
> result = evaluator.evaluate_sync(
>   VocabularyComplexityInput(text="The cat's out of the bag now.", grade_level=5)
> )
> ```

### [Graphics evaluators](https://docs.learningcommons.org/evaluators/graphics-evaluators/introduction.md)

v1.1.0

> [tab] Graphics Accuracy
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `image_paths` | `list[str]` | Local path to the image to check, as a one-item list. PNG, JPEG, or WebP, 64 bytes to 5 MB, with width and height each 16–2,560 pixels |
> | `claim` | `str` | What the image should show: a statement about the image, or a question with its expected answer. 1–12,000 characters |
>
> ```python theme={null}
> from learning_commons_evaluators import (
>   GraphicsAccuracyEvaluator,
>   compose_graphics_accuracy_claim, # Produces the exact wording the evaluator was tested with
> )
>
> evaluator = GraphicsAccuracyEvaluator(google_api_key="your-google-key")
>
> result = evaluator.evaluate_sync(
>   image_paths=["figures/apples.png"],
>   claim=compose_graphics_accuracy_claim(
>     "How many apples do all the trees have together?", "9"
>   ),
> )
> ```

> [tab] Graphics Complexity
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `text` | `str` | Informational text that the graphics accompany. 1–10,000 characters |
> | `grade_level` | `int` | Target student grade, 3–12. Passed as an integer |
> | `image_paths` | `list[str]` | Local paths to the passage's graphics, one per graphic, in reading order. 1–5 images. PNG, JPEG, or WebP, 64 bytes to 2.5 MB, with width and height each 16–8,000 pixels |
> | `figure_labels` | `str \| None` | Optional. Comma-separated labels in the same order as `image_paths` (e.g., `"Figure 1, Figure 2"`). Defaults to `Image 1`, `Image 2`, and so on |
>
> ```python theme={null}
> from learning_commons_evaluators import GraphicsComplexityEvaluator
>
> evaluator = GraphicsComplexityEvaluator(google_api_key="your-google-key")
>
> result = evaluator.evaluate_sync(
>   text="Beekeepers in the United States report losing hives at rates they have not seen before.",
>   grade_level=5,
>   image_paths=["figures/hive-losses.png"],
>   figure_labels="Figure 1",
> )
> ```

### [Feedback evaluators](https://docs.learningcommons.org/evaluators/feedback-evaluators/introduction.md)

| Field | Type | Description |
| :- | :- | :- |
| `student_text` | `string` | Student's written response. 1–10,000 characters |
| `feedback_text` | `string` | Teacher or AI feedback to evaluate. 1–10,000 characters |

### [Academic Standards evaluators](https://docs.learningcommons.org/evaluators/academic-standards-evaluators/introduction.md)

The Academic Standards evaluators have 2 entry points, depending on how the standard is named:

* `evaluate()` - By the standard's CASE UUID
* `evaluate_by_code()` - By the standard's code

> [tab] evaluate()
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `question` | `string` | Math assessment question to evaluate. 1–10,000 characters |
> | `case_identifier_uuid` | `string` | CASE Network UUID of the math standard — the Knowledge Graph's `caseIdentifierUUID` |
>
> ```python theme={null}
> from learning_commons_evaluators import MathStandardsAlignmentEvaluator
>
> evaluator = MathStandardsAlignmentEvaluator(
>   anthropic_api_key="your-anthropic-key",
>   learning_commons_api_key="your-learning-commons-key",
> )
>
> result = evaluator.evaluate_sync(
>   question="What is 3/4 + 1/8?",
>   case_identifier_uuid="6ba25656-d7cc-11e8-824f-0242ac160002",
> )
> ```

> [tab] evaluate\_by\_code()
>
> | Field | Type | Description |
> | :- | :- | :- |
> | `question` | `string` | Math assessment question to evaluate. 1–10,000 characters |
> | `statement_code` | `string` | Math standard code, spelled as its jurisdiction spells it (e.g., `"3.MD.C.7.d"`, `"K.CC.A.1"`). 1–50 characters |
> | `jurisdiction` | [`Jurisdiction`](https://github.com/learning-commons-org/evaluators/blob/main/sdks/python/src/learning_commons_evaluators/schemas/kg_taxonomy.py) ↗ | Optional. Whose framework the code belongs to ([`JurisdictionENUM`](https://docs.learningcommons.org/knowledge-graph/schemas/enums-and-formats#jurisdictionenum)). Defaults to `Jurisdiction.MULTI_STATE`, which is CCSS (Common Core State Standards) |
> | `grade_level` | `string` | Optional, `"K"` through `"12"`. Only consulted when a code names more than one standard, which happens when a framework reuses codes across courses |
>
> ```python theme={null}
> import asyncio
>
> from learning_commons_evaluators import MathStandardsAlignmentEvaluator
>
> evaluator = MathStandardsAlignmentEvaluator(
>   anthropic_api_key="your-anthropic-key",
>   learning_commons_api_key="your-learning-commons-key",
> )
>
> result = asyncio.run(
>   evaluator.evaluate_by_code(
>     question="What is 3/4 + 1/8?",
>     statement_code="5.NF.A.1",
>   )
> )
> ```

### [Durable Skills evaluators](https://docs.learningcommons.org/evaluators/durable-skills-evaluators/introduction.md)

v1.2.0

| Field | Type | Description |
| :- | :- | :- |
| `assignment_text` | `str` | Writing assignment or prompt given to the student. 1–3,000 characters |
| `source_passages` | `list[SourcePassage]` | Source passages in the order the student received them. 1–5 passages. Fields for each passage are below |
| `essay_text` | `str` | Student's essay, verbatim. Spelling and grammar errors can stay in the text. 1–12,000 characters |

Each object in `source_passages`:

| Field | Type | Description |
| :- | :- | :- |
| `title` | `str \| None` | Optional. Passage title, 1–300 characters. Leave it out, or pass `None`, when the passage has no title |
| `author` | `str \| None` | Optional. Passage author, 1–200 characters. Leave it out, or pass `None`, when the passage has no author |
| `text` | `str` | Passage text. 1–9,000 characters |

```python theme={null}
from learning_commons_evaluators import CriticalThinkingEvaluator

evaluator = CriticalThinkingEvaluator(anthropic_api_key="your-anthropic-key")

result = evaluator.evaluate_sync(
  assignment_text="Should our school move the start time from 7:30 to 8:30 a.m.? Write a letter to the school board. Use the source.",
  source_passages=[
    {
      "title": "Teen Sleep and School Start Times",
      "author": "Dr. Ortiz",
      "text": "Melatonin arrives about two hours later at puberty, so most teenagers cannot fall asleep before about 11 p.m. In one survey, 7 in 10 high school students slept fewer than 8 hours on school nights.",
    },
  ],
  essay_text="Dear School Board, the school should start at 8:30. Dr. Ortiz explains that teenagers cannot fall asleep before about 11 p.m., so waking at 6 for a 7:30 start means about seven hours of sleep, which is not enough.",
)
```

## Output

All evaluators return the following fields:

| Field | Type | Description |
| :- | :- | :- |
| `evaluator` | `string` | Registry ID for the evaluator used |
| `result` | Unique to each evaluator See "Output" for each evaluator (e.g., for [Grade Level Appropriateness](https://docs.learningcommons.org/evaluators/text-complexity-evaluators/grade-level-appropriateness.md#output)) | Detailed internal analysis data specific to each evaluator |
| `metadata` | [`EvaluationMetadata`](https://github.com/learning-commons-org/evaluators/blob/main/sdks/python/src/learning_commons_evaluators/schemas/evaluator.py) ↗ | Includes model used to generate the evaluation, total evaluation processing time in milliseconds, input tokens, and output tokens |

## Related topics

> [card] [Quickstart](https://docs.learningcommons.org/evaluators/using-evaluators/python-sdk/quickstart.md)
>
> Install the SDK and run your first evaluator.

> [card] [Configuration](https://docs.learningcommons.org/evaluators/using-evaluators/python-sdk/configuration.md)
>
> Configure evaluators, including API keys and options.

> [card] [Error handling](https://docs.learningcommons.org/evaluators/using-evaluators/python-sdk/error-handling.md)
>
> Handle configuration, validation, and API errors.
