Web application for creating and taking exams, with role-based access for professors and students.
| Layer | Technology |
|---|---|
| Backend | Django 4.2 + Django REST Framework |
| Database | PostgreSQL |
| Auth | Token authentication + JWT (SimpleJWT) |
| Frontend | React 18, React Router v6, Axios |
| Charts | Chart.js + react-chartjs-2 |
- Professors can create, edit, and delete exams; manage questions and answer options; assign exams to students; view per-exam statistics and detailed results
- Students can take assigned exams, see their score and a question-by-question breakdown after submission
- Bulk import — create an exam from a
.txtfile using a simple format (see below) - Randomizable question and option order; configurable questions per page
plataforma-tests-master/
├── backend/ Django project
│ ├── app_examenes/ Core app (models, views, serializers, urls)
│ │ └── migrations/
│ ├── backend/ Django config (settings, urls)
│ ├── ActualizarBD.sh Script to reset and rebuild the database
│ ├── requirements.txt
│ └── .env.example
└── frontend/ React app
├── src/
│ ├── components/ Header, UserArea, ExamenCard
│ ├── context/ AuthContext (global auth state via localStorage)
│ ├── pages/ All route pages
│ ├── services/ Axios API wrappers
│ └── config.js Centralized API base URL
├── package.json
└── .env.example
Usuario ──< Examen (creado_por)
Usuario >──< Examen (alumnos_asignados)
Examen ──< Pregunta
Pregunta ──< Opcion
Examen ──< Resultado
Usuario ──< Resultado
-
Create a virtual environment and install dependencies:
cd backend python -m venv venv source venv/bin/activate pip install -r requirements.txt
-
Create a PostgreSQL database and user, then copy
.env.exampleto.envand fill in your values:cp .env.example .env
-
Apply migrations and run the server:
python manage.py migrate python manage.py runserver
The API will be available at http://localhost:8000/gestion/.
-
Install dependencies:
cd frontend npm install -
Optionally copy
.env.exampleto.envif your backend runs on a different address:cp .env.example .env
-
Start the dev server:
npm start
The app will be available at http://localhost:3000.
To drop and recreate the database and regenerate all migrations:
cd backend
bash ActualizarBD.sh| Method | URL | Description |
|---|---|---|
| POST | /gestion/auth/register/ |
Register a new user |
| POST | /gestion/auth/login/ |
Login, returns token + role |
| GET/POST | /gestion/api/examenes/ |
List / create exams |
| GET | /gestion/api/examenes/?user_id={id} |
Exams created by a professor |
| GET | /gestion/api/examenes/examenes-asignados/?alumno_id={id} |
Exams assigned to a student |
| GET/PUT/DELETE | /gestion/api/examenes/{id}/ |
Retrieve / update / delete exam |
| GET | /gestion/api/examenes/{id}/preguntas/ |
Questions of an exam |
| GET/POST | /gestion/api/examenes/{id}/resultados/ |
Results for an exam (POST submits answers) |
| GET/POST/PUT/DELETE | /gestion/api/preguntas/ |
Question CRUD |
| POST | /gestion/api/uploadtxt/ |
Create exam from .txt file |
| GET | /gestion/api/profesores/{id}/alumnos/ |
Students assigned to a professor |
| POST | /gestion/api/profesores/{id}/alumnos/ |
Assign a student to a professor |
| DELETE | /gestion/api/profesores/{id}/alumnos/{alumno_id}/ |
Remove student from professor |
| PUT | /gestion/api/usuarios/{id}/password/ |
Change password |
Nombre del examen: Introducción a Python
Descripción: Preguntas básicas sobre Python
Pregunta: ¿Cuál es el tipo de dato para texto en Python?
a) int
b) str*
c) bool
d) float
Explicación: str es el tipo string en Python.
Pregunta: ¿Cuánto es 2 + 2?
a) 3
b) 5
c) 4*
Mark the correct option with * at the end. The Explicación: line is optional per question.
| Role | Can do |
|---|---|
profesor |
Create/manage exams, manage questions, assign students, view statistics |
alumno |
Take assigned exams, view own results |