Add User Course Selection and Display Functionality to Learning Management App #69
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request enhances the Learning Management App by introducing functionalities for users to select their preferred courses and view them on a dedicated page. It includes server-side and client-side code modifications to support these features.
Changes Include:
Server-side Enhancements:
Added routes to handle course selection and retrieval of selected courses for logged-in users.
Updated server.js to include:
POST /select-courses: Allows users to select and save their preferred courses.
GET /get-selected-courses: Retrieves the list of courses selected by the logged-in user.
Necessary database queries and error handling.
Client-side Updates:
Modified index.html, dashboard.html, and selected_courses.html to support new functionalities.
Added JavaScript code in script.js for handling course selection, fetching, and displaying selected courses.
Updated forms and buttons to trigger new routes and display the corresponding data.
Database Adjustments:
Added user_courses table to store the relationship between users and their selected courses.
Ensured referential integrity with foreign keys linking user_courses to users and courses tables.
Validation and Error Handling:
Included input validation for course selection.
Improved error messages and handling for smoother user experience.
Testing and Verification:
Tested user registration, login, and logout functionalities to ensure no regressions.
Verified that users can successfully select courses and view them on the 'Selected Courses' page.
Ensured the database operations (insertions and queries) function correctly without errors.
Screenshots (if applicable):
Include screenshots of the 'Selected Courses' page displaying selected courses.
Show the forms for selecting courses and the resulting updates in the UI.
Additional Notes:
Ensure that the database schema changes are applied before deploying this update.
Review and test thoroughly to confirm all edge cases are handled properly.
This enhancement aims to improve user engagement and personalization within the Learning Management App by allowing users to manage their course preferences effectively.