Skip to content

rhoda-lee/Student-Feedback-Management-System

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

23 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Final Project - Backend Development

๐ŸŽ“ Student Feedback Management System

License: MIT Python Flask MySQL

A web-based platform for collecting and managing student feedback, enabling institutions to make data-driven decisions and improve educational outcomes.

Header Image

Author


๐Ÿ“‹ Table of Contents


Project Description

The Student Feedback Management System simplifies the process of collecting and managing student feedback. Designed for educational institutions, the system includes role-based access for students and admins. Students submit feedback on curriculum and campus facilities, while admins analyze this feedback via dashboards to make informed decisions.


Features

  • Role-Based Access:
    • Students: Submit feedback.
    • Admins: View and analyze aggregated feedback.
  • Dynamic Feedback Questions:
    • Text-based or multiple-choice questions.
  • Real-Time Dashboards for administrators.
  • Secure Authentication using Flask-Login.

Setup and Installation

Prerequisites

  • Python 3.8+
  • MySQL
  • Virtual Environment

Installation Steps

  1. Clone the repository:
   git clone https://github.com/rhoda-lee/Student-Feedback-Management-System.git
  1. Move into cloned directory
   cd Student-Feedback-Management-System
  1. Create a virtual environment and activate it:
    sudo apt install python3-venv
    python3 -m venv ~/myenv
    source ~/myenv/bin/activate
  1. Install dependencies:
    pip install mysql-connector-python sqlalchemy flask flask-login 
  1. Set up the database:
    # Configure the database connection in config/config.py
  1. Initialize the database:
    python3 models.py
  1. Run the Flask application:
    export FLASK_APP=app
    export FLASK_DEBUG=1
    flask run
  1. Open your browser and navigate to:
    http://127.0.0.1:5000

API Endpoints

Users API

Endpoint Method Description Example Request Example Response
/register POST Register a new user { "username": "johndoe", "email": "john@example.com", "password": "password123" } { "message": "Registration successful!" }
/login POST Log in a user { "email": "john@example.com", "password": "password123" } { "message": "Welcome back, johndoe!", "redirect": "stu_dash.html" }
/logout POST Log out the current user - { "message": "You have been logged out." }
/users GET List all users - { "Users": [{"id": 1, "username": "johndoe", "email": "john@example.com", "role": "user"}] }
/users/<int:user_id> GET Get a specific user - { "id": 1, "username": "johndoe", "email": "john@example.com", "role": "user" }
/users/update/<int:user_id> PUT Update a user { "username": "john_updated", "email": "john_updated@example.com", "password": "newpassword123", "role": "user" } { "message": "User updated successfully." }
/users/delete/<int:user_id> DELETE Delete a user - { "message": "User deleted successfully." }

Questions API

Endpoint Method Description Example Request Example Response
/questions POST Add a new question { "question_text": "What is your favorite color?", "question_type": "select", "options": ["Red", "Blue", "Green"] } { "Message": "Question created successfully!", "Question": { "question_id": 1, "question_text": "What is your favorite color?", "question_type": "select" } }
/questions GET List all questions - { "Questions": [{"question_id": 1, "question_text": "What is your favorite color?", "question_type": "select", "options": ["Red", "Blue", "Green"]}] }
/questions/<int:question_id> GET Get a specific question - { "question_id": 1, "question_text": "What is your favorite color?", "question_type": "select", "options": ["Red", "Blue", "Green"] }
/questions/update/<int:question_id> PUT Update a question { "question_text": "What is your favorite fruit?", "question_type": "select", "options": ["Apple", "Banana", "Cherry"] } { "Message": "Question updated successfully." }
/questions/delete/<int:question_id> DELETE Delete a question - { "Message": "Question deleted successfully." }

Feedback API

Endpoint Method Description Example Request Example Response
/feedback POST Create new feedback { "user_id": 1, "question_id": 2, "response": "I enjoy coding." } { "Message": "Feedback created successfully!", "Feedback": { "feedback_id": 1, "user_id": 1, "question_id": 2, "response": "I enjoy coding." } }
/feedback GET List all feedback - { "Feedbacks": [{"feedback_id": 1, "user_id": 1, "question_id": 2, "response": "I enjoy coding."}] }
/feedback/<int:feedback_id> GET Get specific feedback - { "feedback_id": 1, "user_id": 1, "question_id": 2, "response": "I enjoy coding." }
/feedback/update/<int:feedback_id> PUT Update feedback { "response": "I love coding challenges." } { "Message": "Feedback updated successfully." }
/feedback/delete/<int:feedback_id> DELETE Delete feedback - { "Message": "Feedback deleted successfully." }

Example Usage

Testing API Endpoints with Postman

To test the backend API endpoints using Postman, follow these steps:

Users API

  1. Register a User
  • Endpoint: POST /register
  • Request Body:
{
  "username": "johndoe",
  "email": "johndoe@example.com",
  "password": "password123"
}
  • Expected Response:
{
  "message": "Registration successful!"
}
  1. Login a User
  • Endpoint: POST /login
  • Request Body:
{
  "email": "johndoe@example.com",
  "password": "password123"
}
  • Expected Response:
{
  "message": "Welcome back, johndoe!",
  "redirect": "stu_dash.html"
}
  1. List All Users
  • Endpoint: GET /users
  • Expected Response:
{
  "Users": [
    {
      "id": 1,
      "username": "johndoe",
      "email": "johndoe@example.com",
      "role": "user"
    }
  ]
}
  1. Get a Specific User
  • Endpoint: GET /users/int:user_id
  • Example URL: /users/1
  • Expected Response:
{
  "id": 1,
  "username": "johndoe",
  "email": "johndoe@example.com",
  "role": "user"
}
  1. Update a User
  • Endpoint: PUT /users/update/int:user_id
  • Example URL: /users/update/1
  • Request Body:
{
  "username": "john_updated",
  "email": "john_updated@example.com",
  "password": "newpassword123",
  "role": "admin"
}
  • Expected Response:
{
  "message": "User updated successfully."
}
  1. Delete a User
  • Endpoint: DELETE /users/delete/int:user_id
  • Example URL: /users/delete/1
  • Expected Response:
{
  "message": "User deleted successfully."
}

Questions API

  1. Add a New Question
  • Endpoint: POST /questions
  • Request Body (Text Question):
{
  "question_text": "What are your hobbies?",
  "question_type": "text"
}
  • Request Body (Select Question):
{
  "question_text": "What is your favorite color?",
  "question_type": "select",
  "options": ["Red", "Blue", "Green"]
}
  • Expected Response:
{
  "Message": "Question created successfully!",
  "Question": {
    "question_id": 1,
    "question_text": "What is your favorite color?",
    "question_type": "select",
    "options": ["Red", "Blue", "Green"]
  }
}
  1. List All Questions
  • Endpoint: GET /questions
  • Expected Response:
{
  "Questions": [
    {
      "question_id": 1,
      "question_text": "What is your favorite color?",
      "question_type": "select",
      "options": ["Red", "Blue", "Green"]
    }
  ]
}
  1. Get a Specific Question
  • Endpoint: GET /questions/int:question_id
  • Example URL: /questions/1
  • Expected Response:
{
  "question_id": 1,
  "question_text": "What is your favorite color?",
  "question_type": "select",
  "options": ["Red", "Blue", "Green"]
}
  1. Update a Question
  • Endpoint: PUT /questions/update/int:question_id
  • Example URL: /questions/update/1
  • Request Body:
{
  "question_text": "What is your favorite fruit?",
  "question_type": "select",
  "options": ["Apple", "Banana", "Cherry"]
}
  • Expected Response:
{
  "Message": "Question updated successfully."
}
  1. Delete a Question
  • Endpoint: DELETE /questions/delete/int:question_id
  • Example URL: /questions/delete/1
  • Expected Response:
{
  "Message": "Question deleted successfully."
}

Feedback API

  1. Create Feedback
  • Endpoint: POST /feedback
  • Request Body:
{
  "user_id": 1,
  "question_id": 1,
  "response": "I love learning new things."
}
  • Expected Response:
{
  "Message": "Feedback created successfully!",
  "Feedback": {
    "feedback_id": 1,
    "user_id": 1,
    "question_id": 1,
    "response": "I love learning new things."
  }
}
  1. List All Feedback
  • Endpoint: GET /feedback
  • Expected Response:
{
  "Feedbacks": [
    {
      "feedback_id": 1,
      "user_id": 1,
      "question_id": 1,
      "response": "I love learning new things."
    }
  ]
}
  1. Get Specific Feedback
  • Endpoint: GET /feedback/int:feedback_id
  • Example URL: /feedback/1
  • Expected Response:
{
  "feedback_id": 1,
  "user_id": 1,
  "question_id": 1,
  "response": "I love learning new things."
}
  1. Update Feedback
  • Endpoint: PUT /feedback/update/int:feedback_id
  • Example URL: /feedback/update/1
  • Request Body:
{
  "response": "I enjoy learning Python."
}
  • Expected Response:
{
  "Message": "Feedback updated successfully."
}
  1. Delete Feedback
  • Endpoint: DELETE /feedback/delete/int:feedback_id
  • Example URL: /feedback/delete/1
  • Expected Response:
{
  "Message": "Feedback deleted successfully."
}

How to Use

  • Open Postman.
  • Create a new request and set the appropriate method (e.g., POST, GET, PUT, or DELETE).
  • Enter the endpoint URL (e.g., http://127.0.0.1:5000/register).
  • For endpoints that require data (e.g., POST):
    • Go to the Body tab -Select raw
    • Choose JSON format
    • Input the JSON data
  • Click Send and verify that the response matches the expected output.

About Me

Hi ๐Ÿ‘‹, I'm Rhoda Lee, a passionate software developer and data science enthusiast. I love creating solutions that solve real-world problems and enjoy contributing to open-source projects.

What I Do:

  • Web Development:

    • Full-stack expertise with Python, Flask, and React
  • Data Science and Analytics:

    • Working on projects that analyze and visualize data insights
  • Tech Advocacy:

    • Committed to sharing knowledge and empowering others through workshops and online content

Key Projects

ATM Simulation:

  • Simulated the processes of an Automated Teller Machine

CPU Scheduling Algorithm:

  • Implemented some key algorithms used by the CPU to schedule tasks in an Operating System

License

This project is licensed under the MIT License. See the LICENSE file for details.

Feel free to fork, contribute or reach out to collaborate! ๐Ÿ˜Š

About

This repository houses the code to my final project of the Tech4Girls Bootcamp by the HACSA Foundation. It features a full stack Student Feedback Management web application that has real-time analysis of data

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages