Skip to content

feat: add feedback feature for students and teachers#455

Open
weiwei-gitch wants to merge 1 commit into
Eswaramuthu:mainfrom
weiwei-gitch:feat/feedback-feature
Open

feat: add feedback feature for students and teachers#455
weiwei-gitch wants to merge 1 commit into
Eswaramuthu:mainfrom
weiwei-gitch:feat/feedback-feature

Conversation

@weiwei-gitch
Copy link
Copy Markdown

Which issue does this PR close?

Rationale for this change

The platform had no way for students or teachers to share thoughts, report issues, or suggest improvements from within the platform. This PR adds a dedicated Feedback feature to make the platform more community-driven.

What changes are included in this PR?

  • Added feedback table to the database via init_db() in app.py
  • Added /feedback route (GET/POST) for submitting feedback
  • Added /admin/feedback route for admins to view all submissions
  • Created templates/feedback.html — feedback form with role selector, name, email, feedback type, message textarea, and star rating (1–5)
  • Created templates/admin_feedback.html — admin table view of all feedback
  • Added Feedback link to the navbar in base.html

Are these changes tested?

  • Yes, tested locally by submitting feedback and verifying it renders correctly on the feedback page.

Are there any user-facing changes?

  • Yes, a new Feedback page is accessible via the navbar for both students and teachers. No breaking changes.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 23, 2026

@weiwei-gitch is attempting to deploy a commit to the 007's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

Comment thread app.py
Comment on lines +1658 to +1659
if session.get("admin_logged_in") != True:
return redirect(url_for("admin_login"))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL AUTH admin_feedback uses nonexistent session key, always redirects admins away

app.py's admin login (line 870) sets session["logged_in"] and session["admin_id"], never session["admin_logged_in"]. The admin_feedback route checks session.get("admin_logged_in") != True — a key that is never set — so every admin request is redirected to admin_login, making the page permanently inaccessible.

Suggested change
if session.get("admin_logged_in") != True:
return redirect(url_for("admin_login"))
if not session.get("logged_in") or not session.get("admin_id"):
return redirect(url_for("admin_login"))
Prompt to fix with AI

Copy this prompt into your AI coding assistant to fix this issue.

Replace the auth check in admin_feedback() at line 1658 from `session.get("admin_logged_in") != True` to `not session.get("logged_in") or not session.get("admin_id")`, matching the pattern used by all other admin-protected routes in the file (see lines 286, 342).

@@ -0,0 +1,50 @@
{% extends "base.html" %}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR CORRECTNESS admin_feedback.html extends public base.html instead of admin layout

All other admin pages (admin_dashboard.html, admin_users.html, etc.) use a self-contained HTML structure with an admin sidebar/nav, not base.html. admin_feedback.html extends base.html, rendering it with the public marketing nav (Student/Teacher login, FAQ, Feedback links) rather than the admin UI chrome.

Prompt to fix with AI

Copy this prompt into your AI coding assistant to fix this issue.

Change admin_feedback.html to extend the same base admin template used by other admin pages (admin_dashboard.html, admin_users.html). Wrap its content in the same sidebar/layout structure those templates use, rather than extending the public base.html.

@entelligence-ai-pr-reviews
Copy link
Copy Markdown
Contributor


Confidence Score: 2/5 - Changes Needed

Not safe to merge — this PR introduces a feedback feature for students and teachers but contains a critical authentication bug in admin_feedback that checks for a nonexistent session key (the admin login path sets session['logged_in'] and session['admin_id'], but admin_feedback checks something else), meaning all admin users are incorrectly redirected away from the feedback admin page entirely. Additionally, admin_feedback.html extends the public base.html instead of the admin layout template used by every other admin page (e.g., admin_dashboard.html, admin_users.html), which likely exposes admin UI through the wrong nav context and potentially bypasses admin-specific chrome or security boundaries. While the feature concept is sound and the student/teacher-facing portions may work correctly, the admin side is functionally broken on both the routing and template layers.

Key Findings:

  • In app.py, the admin_feedback route checks a session key that is never set during admin login — admin login sets session['logged_in'] and session['admin_id'] — causing a permanent redirect for all legitimate admins, making the admin feedback view completely inaccessible.
  • In templates/admin_feedback.html, the template extends the public-facing base.html instead of the self-contained admin layout used by all other admin pages, breaking visual consistency and potentially leaking admin pages into the wrong navigation context.
  • The combination of a broken auth guard and wrong base template for the admin feedback view means the admin-facing portion of this feature ships in a non-functional and architecturally inconsistent state, requiring code changes before merge.
Files requiring special attention
  • app.py
  • templates/admin_feedback.html

@weiwei-gitch
Copy link
Copy Markdown
Author

I will immediately start work on this , i am sorry for this incomplete issue
Please give me some time to resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] Add a Feedback feature to the Achievement Management System

1 participant