Assignments Assess
Assess student assignment submissions
Course Teacher Assignments Assess
Assess student assignment submissions by accepting or rejecting them. Teachers can batch multiple decisions in a single transaction.
API Endpoint
POST /v2/tx/course/teacher/assignments/assessCost Summary
| Cost Type | Amount | Notes |
|---|---|---|
| Transaction Fee | ~0.27 ADA | Network fee |
| MinUTxO Refund | ~-0.07 ADA | Datum shrinks on accept |
| Protocol Fee | 0 ADA | No service fee |
| Total Wallet Delta | ~0.21 ADA | Teacher may get small refund |
The wallet delta is lower than the tx fee because the datum shrinks when an assignment is accepted (pending → completed), releasing some locked ADA.
Request Body
{
"alias": "james",
"course_id": "23a6bbce3a8deca8985764e847594f6956c9dc643e3f6c8efdba04e4",
"assignment_decisions": [
{
"outcome": "accept",
"alias": "student_001"
}
]
}| Field | Type | Required | Description |
|---|---|---|---|
alias | string | Yes | Teacher's access token alias |
course_id | string | Yes | Course NFT policy ID (56 char hex) |
assignment_decisions | object[] | Yes | List of assessment decisions |
assignment_decisions[].outcome | string | Yes | "accept" or "refuse" |
assignment_decisions[].alias | string | Yes | Student's alias |
Transaction Pattern
Spend and Recreate - No minting. Consumes student's course state UTxO and recreates with updated datum.
┌─────────────────────────────────────────────────────────────────┐
│ ASSIGNMENTS ASSESS TRANSACTION │
├─────────────────────────────────────────────────────────────────┤
│ │
│ INPUTS OUTPUTS │
│ ────── ─────── │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Course State │───────────▶│ Course State │ │
│ │ (student's │ SPEND │ (UPDATED: │ │
│ │ pending) │ │ completed) │ │
│ └─────────────────┘ └─────────────────┘ │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Wallet │───────────▶│ User Wallet │ │
│ │ (u-token + ADA) │ │ (u-token + │ │
│ └─────────────────┘ │ change) │ │
│ └─────────────────┘ │
│ NO MINTING │
│ │
│ REFERENCE INPUTS │
│ ──────────────── │
│ • global-state-v2 script ref │
│ • LocalStateToken (course validator) │
│ • Governance UTxO (teacher verification) │
│ │
└─────────────────────────────────────────────────────────────────┘Inputs
| Input | Type | Validator | Description |
|---|---|---|---|
| Course State | Script | course-state-validator | Student's pending assignment |
| Access Token | Wallet | - | Teacher's u-token |
| Wallet UTxOs | Wallet | - | ADA for fees |
Outputs
| Output | Validator | Value | Description |
|---|---|---|---|
| Course State | course-state-validator | ~1.38 ADA + token | Updated: completed |
| User Wallet | wallet | u-token + change | Access token returned |
Datum Changes
The course state datum changes when an assignment is accepted:
Before (Constructor 1 - active commitment):
Constructor 1:
├── slt_hash: "{module_token_name}"
├── assignment_info: "{evidence_hash}"
└── completed_modules: []After (Constructor 0 - no active commitment):
Constructor 0:
└── completed_modules: ["{slt_hash}"]The slt_hash moves from the commitment fields to the completed_modules list.
Redeemers
| Script | Constructor | Fields | Description |
|---|---|---|---|
| course-state-validator (spend) | 2 | teacher_alias | Assess action |
{
"constructor": 2,
"fields": [
{ "bytes": "<teacher_alias>" }
]
}Reference Inputs
| UTxO | Description |
|---|---|
| Script Ref | global-state-v2 script reference |
| LocalStateToken | Course's LocalStateToken (validator script_ref) |
| Governance | Course governance UTxO (verifies teacher authorization) |
Batching
Multiple assignment decisions can be batched in a single transaction:
{
"assignment_decisions": [
{ "outcome": "accept", "alias": "student_001" },
{ "outcome": "accept", "alias": "student_002" },
{ "outcome": "refuse", "alias": "student_003" }
]
}Key Notes
- Teacher spends the student's course state UTxO
- Authorization via teacher alias in redeemer + governance reference input
- Datum shrinks on accept (drops assignment_info), reducing minUTxO
- Completed SLT hashes accumulate in a list for credential claims
- No protocol fee for assessments
See Also
- Assignment Commit - Student enrollment
- Assignment Update - Student updates submission
- Credential Claim - Claim credential