Skip to main content

Overview

The Evaluations API allows you to create and manage different types of assessments for students. Evaluations can be assigned to sections and optionally linked to topics. Each evaluation has configurable start/end dates, duration, scoring, and attempt limits.

Evaluation Types

  • tarea - Homework assignment
  • practica - Practice exercise
  • diagnostico - Diagnostic assessment
  • formativa - Formative assessment
  • sumativa - Summative assessment

List All Evaluations

GET /api/evaluations

Retrieve a list of all evaluations.

Response

success
boolean
Indicates if the request was successful
message
string
Response message: “Evaluaciones listadas con éxito”
data
array
Array of evaluation objects

Example Request

curl -X GET https://api.example.com/api/evaluations \
  -H "Accept: application/json"

Example Response

{
  "success": true,
  "message": "Evaluaciones listadas con éxito",
  "data": [
    {
      "id": 1,
      "docente_id": 5,
      "section_id": 12,
      "topic_id": 3,
      "titulo": "Examen Final de Álgebra",
      "descripcion": "Evaluación sumativa que cubre todos los temas del semestre",
      "tipo": "sumativa",
      "fecha_inicio": "2026-03-15 08:00:00",
      "fecha_fin": "2026-03-15 10:00:00",
      "duracion_min": 120,
      "puntaje_max": 20.00,
      "puntaje_aprobacion": 11.00,
      "intentos_max": 1,
      "orden_aleatorio": 1,
      "created_at": "2026-03-05T10:30:00.000000Z",
      "updated_at": "2026-03-05T10:30:00.000000Z"
    }
  ]
}

Create Evaluation

POST /api/evaluations

Create a new evaluation.

Request Body

Response

success
boolean
Indicates if the request was successful
message
string
Response message: “Evaluación creada con éxito”
data
object
The newly created evaluation object

Example Request

curl -X POST https://api.example.com/api/evaluations \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "docente_id": 5,
    "section_id": 12,
    "topic_id": 3,
    "titulo": "Práctica de Ecuaciones Lineales",
    "descripcion": "Ejercicios prácticos sobre sistemas de ecuaciones",
    "tipo": "practica",
    "fecha_inicio": "2026-03-20 14:00:00",
    "fecha_fin": "2026-03-22 23:59:59",
    "duracion_min": 60,
    "puntaje_max": 20.00,
    "puntaje_aprobacion": 11.00,
    "intentos_max": 2,
    "orden_aleatorio": 0
  }'

Example Response

{
  "success": true,
  "message": "Evaluación creada con éxito",
  "data": {
    "id": 2,
    "docente_id": 5,
    "section_id": 12,
    "topic_id": 3,
    "titulo": "Práctica de Ecuaciones Lineales",
    "descripcion": "Ejercicios prácticos sobre sistemas de ecuaciones",
    "tipo": "practica",
    "fecha_inicio": "2026-03-20 14:00:00",
    "fecha_fin": "2026-03-22 23:59:59",
    "duracion_min": 60,
    "puntaje_max": 20.00,
    "puntaje_aprobacion": 11.00,
    "intentos_max": 2,
    "orden_aleatorio": 0,
    "created_at": "2026-03-05T14:25:00.000000Z",
    "updated_at": "2026-03-05T14:25:00.000000Z"
  }
}

Get Evaluation

GET /api/evaluations/:id

Retrieve a specific evaluation by ID.

Path Parameters

Response

success
boolean
Indicates if the request was successful
message
string
Response message: “Evaluación obtenida con éxito”
data
object
The evaluation object (see structure in List All Evaluations)

Example Request

curl -X GET https://api.example.com/api/evaluations/1 \
  -H "Accept: application/json"

Example Response

{
  "success": true,
  "message": "Evaluación obtenida con éxito",
  "data": {
    "id": 1,
    "docente_id": 5,
    "section_id": 12,
    "topic_id": 3,
    "titulo": "Examen Final de Álgebra",
    "descripcion": "Evaluación sumativa que cubre todos los temas del semestre",
    "tipo": "sumativa",
    "fecha_inicio": "2026-03-15 08:00:00",
    "fecha_fin": "2026-03-15 10:00:00",
    "duracion_min": 120,
    "puntaje_max": 20.00,
    "puntaje_aprobacion": 11.00,
    "intentos_max": 1,
    "orden_aleatorio": 1,
    "created_at": "2026-03-05T10:30:00.000000Z",
    "updated_at": "2026-03-05T10:30:00.000000Z"
  }
}

Update Evaluation

PUT /api/evaluations/:id

Update an existing evaluation.

Path Parameters

Request Body

All fields from the Create Evaluation endpoint can be updated. Include only the fields you want to change.

Response

success
boolean
Indicates if the request was successful
message
string
Response message: “Evaluación actualizada con éxito”
data
object
The updated evaluation object

Example Request

curl -X PUT https://api.example.com/api/evaluations/2 \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "intentos_max": 3,
    "fecha_fin": "2026-03-25 23:59:59"
  }'

Example Response

{
  "success": true,
  "message": "Evaluación actualizada con éxito",
  "data": {
    "id": 2,
    "docente_id": 5,
    "section_id": 12,
    "topic_id": 3,
    "titulo": "Práctica de Ecuaciones Lineales",
    "descripcion": "Ejercicios prácticos sobre sistemas de ecuaciones",
    "tipo": "practica",
    "fecha_inicio": "2026-03-20 14:00:00",
    "fecha_fin": "2026-03-25 23:59:59",
    "duracion_min": 60,
    "puntaje_max": 20.00,
    "puntaje_aprobacion": 11.00,
    "intentos_max": 3,
    "orden_aleatorio": 0,
    "created_at": "2026-03-05T14:25:00.000000Z",
    "updated_at": "2026-03-05T15:10:00.000000Z"
  }
}

Delete Evaluation

DELETE /api/evaluations/:id

Delete an evaluation. This will also cascade delete all associated evaluation questions.

Path Parameters

Response

success
boolean
Indicates if the request was successful
message
string
Response message: “Evaluación eliminada con éxito”
data
null
Returns null on successful deletion

Example Request

curl -X DELETE https://api.example.com/api/evaluations/2 \
  -H "Accept: application/json"

Example Response

{
  "success": true,
  "message": "Evaluación eliminada con éxito",
  "data": null
}

Database Relationships

Foreign Keys

  • docente_id: References users.id (cascade delete)
  • section_id: References sections.id (cascade delete)
  • topic_id: References topics.id (set null on delete)
  • See Evaluation Questions to assign questions to evaluations
  • Questions are linked through the eval_preguntas pivot table

Build docs developers (and LLMs) love