← All tool references

Education · execute

Test Grade Calculator

Convert correct and total answer counts into a percentage, incorrect count, and default letter grade.

Open public tool

Overview

Category
Education
API mode
execute
Processing
client-side
Privacy
no-data-stored

Public descriptor

The descriptor is available without an API key and supplies this tool’s metadata, schemas, modes, and examples.

GET /api/v1/tools/test-grade-calculator

View this descriptor as JSON

Execute availability

This tool has an execute route defined by its descriptor. Server-side execution is currently unavailable, so requests return api_not_launched.

POST /api/v1/tools/test-grade-calculator/execute

Authentication is not issued during the preview. A bearer API key is planned for execution after launch.

Input schema

object object; additional properties are not accepted.

correct · integer · required
Correct-answer count.
total · integer · required
Total scored questions.
{
    "type": "object",
    "properties": {
        "correct": {
            "type": "integer",
            "minimum": 0,
            "description": "Correct-answer count."
        },
        "total": {
            "type": "integer",
            "minimum": 1,
            "description": "Total scored questions."
        }
    },
    "required": [
        "correct",
        "total"
    ],
    "additionalProperties": false
}

Output schema

On a successful execution, schema values appear in data.result.values.

percentage · number
Percentage score.
letter_grade · string
Default A–F grade.
correct · number
Correct count.
incorrect · number
Incorrect count.
total · number
Total count.
{
    "type": "object",
    "properties": {
        "percentage": {
            "type": "number",
            "description": "Percentage score."
        },
        "letter_grade": {
            "type": "string",
            "description": "Default A–F grade."
        },
        "correct": {
            "type": "number",
            "description": "Correct count."
        },
        "incorrect": {
            "type": "number",
            "description": "Incorrect count."
        },
        "total": {
            "type": "number",
            "description": "Total count."
        }
    },
    "additionalProperties": false
}

42 correct out of 50

The request body follows the published input schema. The response below shows the success-envelope shape returned after execution is available.

curl -X POST "https://utilitypages.org/api/v1/tools/test-grade-calculator/execute" \
  -H "Content-Type: application/json" \
  -d '{
    "correct": 42,
    "total": 50
}'
{
    "ok": true,
    "data": {
        "slug": "test-grade-calculator",
        "result": {
            "values": {
                "percentage": 84,
                "letter_grade": "B",
                "correct": 42,
                "incorrect": 8,
                "total": 50
            },
            "display": {
                "display": "84"
            },
            "warnings": [],
            "assumptions": [],
            "steps": []
        }
    },
    "meta": [],
    "request_id": "req_example_123"
}

Errors

api_not_launched · 503
Returned by the current launch gate for every execute request.
invalid_json · 400
Returned when an enabled execute request does not contain valid JSON.
validation_failed · 422
Returned when a request does not satisfy the input schema.
browser_interaction_required · 422
Returned for browser capability tools instead of inventing a server-side result.
tool_not_found · 404
Returned when a requested descriptor slug does not exist.
execution_failed · 503
Returned when an enabled server-side execution cannot complete.