uprm-inso4101-2024-2025-s1 / semester-project-regiupr

semester-project-regiupr created by GitHub Classroom
7 stars 1 forks source link

Create functions to get courses that the student is currently taking. #93

Closed nelson-escalona closed 1 week ago

nelson-escalona commented 3 weeks ago

Objective: Create the functions necessary to get the courses that the student is currently taking.

Description: This task involves creating the necessary functions to get the courses that the student is currently taking from the database. The GET function will get the courses that the student is currently taking based on the status of the course being "Currently taking", pulled from the student_courses table. These functions must return a list of 'course' objects given the students data.

Research must me conducted on the database design to check the necessary queries.

Requirements: For this task, the courses class must be completed.

Time Constraints: No time constraint yet. But will be updated.

Completion Criteria: We have fully functional functions that given student data, they return the classes that the student is currently taking.

Difficulty: 2

Priority: 4

Assignees: No assignees yet

NOTE: Task created to avoid further point decay. More information on the task coming later.

nelson-escalona commented 2 weeks ago

Added "The GET function will get the courses that the student is currently taking based on the status of the course being "Currently taking", pulled from the student_courses table." to the issue description in order to better define this issue

Jeanpaul-Ortiz commented 1 week ago

This function, fetch_enrolled_courses, retrieves all courses that a student is currently enrolled in from the database. It accepts two parameters: a database connection and a student's ID. The function first queries the student_courses table to find entries for the specified student where the course status is marked as 'CURRENTLY TAKING'. For each course entry, it fetches the associated course details from the courses table using the course code. If the course is found, it is added to the list of enrolled courses. Finally, the function returns this list of enrolled courses. This is the output from the tests:

Screenshot 2024-10-24 at 1 48 10 PM
nelson-escalona commented 1 week ago

LGTM👍🏼