gabrielshufelt / Real-Ratings-SOEN-341_Project_F24

0 stars 1 forks source link

Student Dashboard (Backend) #82

Closed Luqman1008 closed 2 days ago

Luqman1008 commented 3 days ago

Description:

This PR introduces the backend implementation for the Student Dashboard, including a new StudentDashboardController with endpoints to manage and retrieve essential student-related data.

Key Features Implemented:

  1. Student Dashboard Controller:

    • index Endpoint:

      • Returns @upcoming_evaluations, listing all upcoming evaluations associated with the projects of the current student.
      • Returns @avg_ratings, a map containing the average values of all rating categories for the student.
    • teams Endpoint:

      • Retrieves @student_teams, which includes a JSON response of all projects linked to the student and all associated teams within those projects. If the student belongs to a team.
    • evaluations Endpoint:

      • Provides @student_evaluations, which consists of all projects linked to the student, completed evaluations, and pending evaluations where the evaluator_id is the current student.
    • feedback Endpoint:

      • Returns @avg_ratings (average rating scores for the current student) and @received_evaluations, a list of all evaluations where the student is the evaluatee and the status is marked as completed.
  2. Changes to the Evaluation Model:

    • Automatic Status and Date Management:
      • Added logic to handle status and date_completed based on the presence of ratings. If any rating fields are missing, the status is set to pending, and the date_completed is set to nil. If all ratings are present, the status is updated to completed, and date_completed is set to the current date.
  3. Rspec Tests:

    • Added Rspec test cases to validate the functionality of all the newly created endpoints in StudentDashboardController.

Additional Changes: