Evaluation Function API (1.1.0)

Download OpenAPI specification:

The Evaluation Function API provides a comprehensive solution for educational assessment systems, using an RPC-like approach via HTTP with commands specified in request headers.

Overview

This API enables automated feedback and validation of student responses against educator-defined answers, with support for custom evaluation parameters and real-time preview functionality.

Core Features

Evaluation (eval command)

The primary endpoint for grading student responses. It compares a student's submission against the correct answer and returns:

  • Boolean correctness indicator (is_correct)
  • Optional feedback (string, array, or object format)
  • Support for custom evaluation parameters (e.g. tolerance levels)

Preview (preview command)

A lightweight validation endpoint that normalizes and validates student responses without performing full evaluation. Useful for:

  • Real-time input validation as students type
  • Formatting and normalization checks
  • Pre-submission validation Returns a normalized version of the student's response.

Health Check (healthcheck command)

Monitors the operational status of the evaluation function by running internal tests. Returns detailed diagnostics including:

  • Overall test status (tests_passed)
  • Lists of successful tests, failures, and errors
  • Useful for monitoring and debugging evaluation functions

evaluation

Evaluate and preview responses

Evaluate a student response

header Parameters
command
string
Default: eval
Value: "eval"
Request Body schema: application/json
required
response
required
any

Student response

answer
required
any

Educator answer

params
object (EvaluationParams)

Parameters for an evaluation or preview request.

Responses

Request samples

Content type
application/json
Example

Correct evaluation request

{
  • "response": "Hello, World!",
  • "answer": "Hello, World!"
}

Response samples

Content type
application/json
Example

Successful evaluation response

{
  • "command": "eval",
  • "result": {
    }
}

Validate and normalize student response

header Parameters
command
required
string
Default: preview
Value: "preview"
Request Body schema: application/json
required
response
required
any

Student response

params
object (EvaluationParams)

Parameters for an evaluation or preview request.

Responses

Request samples

Content type
application/json
Example
{
  • "response": "Hello, World!"
}

Response samples

Content type
application/json
Example

Successful preview response

{
  • "command": "preview",
  • "result": {
    }
}

health

Health check operations

Check the health status of the evaluation function

header Parameters
command
required
string
Default: healthcheck
Value: "healthcheck"
Request Body schema: application/json
optional
property name*
additional property
any

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
Example

Successful health check

{
  • "command": "healthcheck",
  • "result": {
    }
}