Dynamic Forums (1, 2, 4, 6)
Get Forum 1 Responses
Verify Forum 4 Participation
curl https://proyecto-ingenieria-software-6ccv.onrender.com/respuestas_foro1
GET /respuestas_foro
Retrieve all responses for a specific forum with user information.
Implementation : main.py:232-256
Forum identifier: 1, 2, 4, or 6
Response Schema
Array of forum response objects Response to question 6 (if applicable)
Response to question 7 (forums 4, 6)
Response to question 8 (forum 6 only)
Submission timestamp (auto-generated)
Student first name (from usuarios JOIN)
Student last name (from usuarios JOIN)
User Join Behavior
The endpoint attempts to JOIN with the usuarios table:
SELECT r. * , u . nombre , u . apellidos
FROM {foro_nombre} r
LEFT JOIN usuarios u ON r . email = u . email
ORDER BY r . fecha DESC
If the JOIN fails (e.g., usuarios table doesn’t exist), the endpoint falls back to returning only forum response data without nombre and apellidos fields.
Example Response
[
{
"email" : "[email protected] " ,
"r1" : "The derivative represents the rate of change" ,
"r2" : "f'(x) = 2x" ,
"r3" : "Local maximum at x = 3" ,
"r4" : "Concave up on (0, infinity)" ,
"r5" : "Area equals 12 square units" ,
"r6" : "Fundamental theorem connects derivatives and integrals" ,
"fecha" : "2026-03-05T14:32:18" ,
"nombre" : "Maria" ,
"apellidos" : "Garcia"
},
{
"email" : "[email protected] " ,
"r1" : "Instantaneous rate of change at a point" ,
"r2" : "2x" ,
"r3" : "x=3" ,
"r4" : "Positive second derivative" ,
"r5" : "12" ,
"r6" : "Connection between differentiation and integration" ,
"fecha" : "2026-03-05T13:15:42" ,
"nombre" : "Juan" ,
"apellidos" : "Martinez"
}
]
GET /verificar_foro/
Check if a student has already participated in a forum.
Implementation : main.py:258-271
Forum identifier: 1, 2, 4, or 6
Student email address to check
Response
true if student has submitted a response, false otherwise
Example Response :
Forum 3 - Table Responses
Get Forum 3 Responses
Verify Forum 3 Participation
curl https://proyecto-ingenieria-software-6ccv.onrender.com/respuestas_en_foro_3
GET /respuestas_en_foro_3
Retrieve all Forum 3 responses with table data.
Implementation : main.py:307-316
Response Schema
Array of Forum 3 response objects Table cells for question 6 (21 fields: 7 rows × 3 columns)
Student first name (from JOIN)
Student last name (from JOIN)
Example Response
[
{
"email" : "[email protected] " ,
"r1" : "Answer 1" ,
"r2" : "Answer 2" ,
"r3" : "Answer 3" ,
"r4" : "Answer 4" ,
"r5" : "Answer 5" ,
"t6_r1_c1" : "f(x)" ,
"t6_r1_c2" : "x^2" ,
"t6_r1_c3" : "2x" ,
"t6_r2_c1" : "g(x)" ,
"t6_r2_c2" : "sin(x)" ,
"t6_r2_c3" : "cos(x)" ,
"t6_r3_c1" : "h(x)" ,
"t6_r3_c2" : "e^x" ,
"t6_r3_c3" : "e^x" ,
"r7" : "Answer 7" ,
"r8" : "Answer 8" ,
"fecha" : "2026-03-05T14:20:33" ,
"nombre" : "Carlos" ,
"apellidos" : "Rodriguez"
}
]
GET /verificar_en_foro_3/
Check if a student has participated in Forum 3.
Implementation : main.py:318-329
Response
Forum 5 - Image Responses
Get Forum 5 Responses
Verify Forum 5 Participation
curl https://proyecto-ingenieria-software-6ccv.onrender.com/respuestas_en_foro_5
GET /respuestas_en_foro_5
Retrieve all Forum 5 responses with base64-encoded images.
Implementation : main.py:592-644
Response Schema
Array of Forum 5 response objects Data URL for question 3 image (base64-encoded)
Format: data:image/jpeg;base64,{encoded_data}
Data URL for table image 1 (base64-encoded)
Data URL for table image 2 (base64-encoded)
Data URL for table image 3 (base64-encoded)
Student first name (from JOIN)
Student last name (from JOIN)
Image Encoding Process
The endpoint converts binary image data (BYTEA) to base64-encoded data URLs (main.py:607-637):
Fetch binary data from PostgreSQL (memoryview or bytes)
Convert to bytes if needed: bytes(valor)
Encode to base64 : base64.b64encode(valor).decode('utf-8')
Create data URL : data:image/jpeg;base64,{encoded}
Remove binary field and add _url field
If image encoding fails, all image URLs are set to null. The endpoint handles errors gracefully to prevent response failures.
Example Response
[
{
"id" : 42 ,
"email" : "[email protected] " ,
"r2" : "The limit approaches infinity" ,
"r4" : "Continuous on all real numbers" ,
"r5" : "Differentiable except at x=0" ,
"r6" : "Graph shows vertical asymptote" ,
"imagen_pregunta_3_url" : "data:image/jpeg;base64,/9j/4AAQSkZJRg..." ,
"imagen_1_url" : "data:image/jpeg;base64,iVBORw0KGgoAAAANSUhE..." ,
"imagen_2_url" : "data:image/jpeg;base64,R0lGODlhAQABAIAA..." ,
"imagen_3_url" : null ,
"nombre" : "Ana" ,
"apellidos" : "Lopez"
}
]
Using Image URLs
The data URLs can be used directly in HTML img tags:
< img src = "data:image/jpeg;base64,/9j/4AAQSkZJRg..." alt = "Student sketch" />
GET /verificar_en_foro_5/
Check if a student has participated in Forum 5.
Implementation : main.py:578-589
Response
Error Handling
HTTP Status Codes
Forum ID not found in configuration (dynamic forums)
Database connection or query error
Graceful Degradation
All endpoints implement fallback behavior:
JOIN failures : Return data without user names
Image encoding errors : Set image URLs to null
Database errors : Return empty arrays or {"participo": false}
Sorting
All response endpoints sort by submission timestamp in descending order:
ORDER BY r . fecha DESC -- Most recent first
Next Steps
Submit Responses Learn how to submit forum responses
Forums Overview View forum configuration and routing