Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/TheSerchCp/SEAM/llms.txt

Use this file to discover all available pages before exploring further.

The Grades (calificaciones) and Reports (reportes) modules provide the academic output layer of SEAM. Grades are scoped to a group and displayed in a per-student, per-subject table where instructors can update a numeric score inline and save it. Reports offer three pre-defined analytics views — performance, attendance, and failed students — rendered on demand. Both modules are currently driven by in-memory session state and stub repositories, and are architected to accept real API endpoints with minimal changes.

Grades (Calificaciones)

Repository functions

// calificaciones.repository.js
export const getAll = () => [];
export const update = (id, nota) => ({ id, nota });
update receives the grade record id and the new numeric nota value. Once connected to a backend, it should persist the change via a PUT or PATCH request.

Session state sample data

Until a backend is available, CalificacionesPage reads directly from session.calificaciones, filtered to the current group:
// session.state.js
calificaciones: [
    { id: 1, alumno_id: 3, grupo_id: 1, materia: "Matemática", nota: 8.5, semestre: 1 },
    { id: 2, alumno_id: 3, grupo_id: 1, materia: "Español",    nota: 7.9, semestre: 1 }
]
id
number
Primary key of the grade record.
alumno_id
number
Foreign key referencing the student user in session.users.
grupo_id
number
Foreign key referencing the group; used to scope the table to the current page.
materia
string
Subject name displayed in the Materia column.
nota
number
Numeric grade. The input field accepts values between 0 and 10 in 0.1 increments.
semestre
number
Academic semester the grade belongs to.

Group (Grupo) shape

The page also reads from session.grupos to display the group name in the page heading:
// session.state.js
grupos: [
    { id: 1, nombre: "6A", profesor_id: 2, alumnos: 30, promedio: 7.8, reprobados: 3 },
    { id: 2, nombre: "6B", profesor_id: 2, alumnos: 28, promedio: 8.1, reprobados: 2 }
]
id
number
Primary key of the group.
nombre
string
Display name shown in page headings and navigation (e.g. "6A").
profesor_id
number
Foreign key of the professor responsible for the group.
alumnos
number
Total number of enrolled students.
promedio
number
Current group average grade.
reprobados
number
Number of students currently below the passing threshold.

Saving a grade

// calificaciones.page.js
window.saveGrade = function(gradeId) {
    alert('Calificación guardada exitosamente');
};
The saveGrade(gradeId) global is bound to each row’s Guardar button. Replace the alert with a call to calificaciones.repository.update(gradeId, newNota) once the repository is wired to a real endpoint.

Reports (Reportes)

Repository function

// reportes.repository.js
export const getAll = () => [];

Report types

The page exposes three report triggers:
Button labelType string
Reporte Desempeñodesempenio
Reporte Asistenciaasistencia
Reporte Reprobadosreprobados
window.generateReport = function(type) {
    generateReport(type);
    location.hash = '/reportes';
    alert(`Reporte de ${type} generado exitosamente`);
};
Results are injected into the #reports-container element. Currently this shows a placeholder; wire the generateReport service to a real backend endpoint to populate it with live data.

Connecting to a real backend

Both repositories follow the same ApiClient pattern used by every other module:
// calificaciones.repository.js — after wiring
import { ApiClient } from '../core/ApiClient.js';

export const getAll = ()           => ApiClient.get('/calificaciones');
export const update = (id, nota)   => ApiClient.put(`/calificaciones/${id}`, { nota });
// reportes.repository.js — after wiring
import { ApiClient } from '../core/ApiClient.js';

export const getAll = () => ApiClient.get('/reportes');
When implementing update for grades, consider sending only the changed nota field in a PATCH request rather than a full PUT to minimise payload size and avoid accidentally overwriting server-computed fields like promedio or semestre.
Both calificaciones.repository and reportes.repository are stub implementations that return empty arrays. The page templates, group-scoped filtering, inline editing inputs, and report trigger buttons are fully built — only the repository functions need to point at a live API.

Build docs developers (and LLMs) love