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:
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.
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.
Rspec Tests:
Added Rspec test cases to validate the functionality of all the newly created endpoints in StudentDashboardController.
Additional Changes:
Migrations:
Updated the evaluations table to allow NULL values for ratings to facilitate the new logic in the Evaluation model.
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:
Student Dashboard Controller:
index
Endpoint:@upcoming_evaluations
, listing all upcoming evaluations associated with the projects of the current student.@avg_ratings
, a map containing the average values of all rating categories for the student.teams
Endpoint:@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:@student_evaluations
, which consists of all projects linked to the student, completed evaluations, and pending evaluations where theevaluator_id
is the current student.feedback
Endpoint:@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.Changes to the
Evaluation
Model:date_completed
based on the presence of ratings. If any rating fields are missing, the status is set topending
, and thedate_completed
is set tonil
. If all ratings are present, the status is updated tocompleted
, anddate_completed
is set to the current date.Rspec Tests:
StudentDashboardController
.Additional Changes:
evaluations
table to allowNULL
values for ratings to facilitate the new logic in theEvaluation
model.