Questionnaire Overview
The questionnaire (preguntas.html) consists of 10 questions that gather essential fitness data.
The questionnaire is shown immediately after registration or can be accessed later from the profile page to update fitness preferences.
Question Flow
The questionnaire uses a single-page application approach with smooth transitions between questions.Question 1: Gender
Users select their biological gender for accurate calorie and exercise recommendations.frontend/pages/preguntas.html
Question 2: Age
Age validation ensures users are at least 14 years old.Question 3: Height
Height is collected in centimeters (100-250 cm range).Question 4: Weight
Current weight in kilograms (30-300 kg range).Question 5: Fitness Level
Users select their current experience level with exercise.Principiante
Little to no exercise experience
Intermedio
Regular exercise, 3-6 months experience
Avanzado
Consistent training, 1+ years experience
Question 6: Main Goal
Users select their primary fitness objective.Question 7: Medical Conditions
Users disclose any injuries or medical conditions that may affect exercise.This information is critical for generating safe, appropriate workout recommendations.
Question 8: Training Location
Users choose where they prefer to train.Question 9: Training Days
Users specify how many days per week they can commit to training.Question 10: Session Duration
Final question about preferred workout duration.Data Structure
The questionnaire data is stored in a JavaScript object:Submitting Questionnaire Data
When the user completes all questions, the data is sent to the backend.Backend Processing
The backend validates and stores the questionnaire data in the user’s fitness profile.BMI Calculation
The backend automatically calculates BMI when height and weight are provided:User Model Virtual
UI Transitions
The questionnaire uses smooth CSS animations for transitions:Error Handling
Comprehensive error handling ensures a smooth user experience:Input Validation
Client-side validation prevents invalid data submission:API Endpoints
| Endpoint | Method | Description | Auth Required |
|---|---|---|---|
/api/questionnaire | POST | Submit fitness questionnaire | Yes |
/api/questionnaire/:userId | GET | Get user fitness profile | Yes |
/api/questionnaire/:userId | PUT | Update fitness questionnaire | Yes |