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.
Issue number #185
This pull request introduces a Profile Badges and Achievements system to enhance student engagement and motivation on the Research-Nexas platform. The feature allows students to earn badges for significant accomplishments, such as submitting research papers, achieving high evaluation scores, and actively participating in peer reviews and collaborations.
Key Features
Badge Creation: Admins can create badges with specific criteria.
Awarding Badges: Badges can be awarded to students based on their achievements.
Viewing Badges: Students can view all badges available and those they have earned.
Database Integration: New tables for badges and student-badge relationships have been added to the MySQL database.
Instructions for Implementation-
Database Setup: Execute the provided SQL statements to create the badges and student_badges tables in your MySQL database.
Ensure that your database connection in config/db.js is properly configured to communicate with your MySQL server.
Connect Routes: Import the badges route in your main application file (e.g., app.js)
const badgesRouter =require('./routes/badges');
app.use('/api/badges', badgesRouter);
Testing the API: Use Postman or a similar tool to test the following endpoints:
POST /api/badges/create: Create a new badge.
GET /api/badges: Retrieve all badges.
POST /api/badges/award: Award a badge to a student.
GET /api/badges/:studentId: Retrieve badges for a specific student.
I know you’re already familiar with these instructions, but I’m including them here to ensure a smooth running of the feature. Please review the code changes thoroughly and let me know if you have any questions or need further modifications. Thankyou.
✅ Checklist
Before submitting the PR, please make sure you have completed the following:
🏷️ Types of Changes
What type of changes does your code introduce? (Check all that apply)