Skip to content

Commit

Permalink
Merge pull request #16 from BhuvanSA/main
Browse files Browse the repository at this point in the history
Add UML Diagram
  • Loading branch information
nishith-p-shetty authored Mar 2, 2024
2 parents c55f1dc + d6f4330 commit 188d6fd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 17 deletions.
6 changes: 0 additions & 6 deletions .gitignore

This file was deleted.

8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# flask-feedback-form

This project is a website that allows users to submit feedback on a form. The website is built using HTML, CSS, and JavaScript for the front-end, and Flask and SQLite3 for the backend.
This project is a website that allows users to submit feedback on a form. The website is built using HTML, CSS, and JavaScript for the front-end, and Flask and Postgresql for the backend.

[Checkout the website](https://bhuvansa.pythonanywhere.com).
[Checkout the website](https://flaskfeedbackform.bhuvansa.com).

DBML DIAGRAM
![](https://kroki.io/dbml/svg/eNqNkE2OwjAMRvc9RZawGfG7YcEhEDuEKpd-LRZJxLhpR2g0dyeNJm2EALFJYr_E9sueCg0l6Bg_EPWbqSHIuVQNhEmrw1XYkNzUBbdjesWSgepITmeSyXI2HVju2JN-aRyZa_aXZfvQyoFMaNMf3rQI2Lam8FOxdaj9fmgtf7c4jtUqoCzodGlCyRh9Mrm_8l82mWXMVAxdznMhx7ZWjSGtPYxg8QosX4HVE0AdhGpEIiCdSAzfulivp73xDtVmFP5KTbaDV5p-fBEtt8E3hncIU7Tx)

## Features

Expand Down Expand Up @@ -32,3 +35,4 @@ This project is a website that allows users to submit feedback on a form. The we
This project was created by [Nishith P Shetty](https://github.com/nishith-p-shetty) and [Bhuvan S A](https://github.com/BhuvanSA)

## License
GNU License
8 changes: 0 additions & 8 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
DB_NAME = os.environ.get('FEEDBACK_FORM_DB_NAME')
DB_USER = os.environ.get('FEEDBACK_FORM_DB_USER')
DB_PASSWORD = os.environ.get('FEEDBACK_FORM_DB_PASSWORD')
print(ADMIN_USERNAME, ADMIN_PASSWORD, SECRET_KEY,
DB_HOST, DB_NAME, DB_USER, DB_PASSWORD)

NO_OF_TEAMS = 3

Expand Down Expand Up @@ -90,7 +88,6 @@ def submit():
reviewer_row = cursor.fetchone()
reviewer_id = reviewer_row[0] if reviewer_row is not None else None

print(form_data, reviewer_id)
feedbacks = []
for team_id in range(1, NO_OF_TEAMS+1):
field1_rating = int(form_data.get(
Expand All @@ -103,14 +100,9 @@ def submit():
f'team_id{team_id}_field4_rating', 1))
feedback = form_data.get(f'team_id{ team_id }_feedback')

print("-------")
print(reviewer_id, team_id, field1_rating, field2_rating,
field3_rating, field4_rating, feedback)

feedbacks.append((reviewer_id, team_id, field1_rating, field2_rating, field3_rating,
field4_rating, field1_rating, field2_rating, field3_rating, field4_rating, feedback))

print(feedbacks)
cursor.executemany('''INSERT INTO feedbacks
(reviewer_id, team_id, field1_rating, field2_rating, field3_rating, field4_rating, average_rating, feedback)
VALUES (%s, %s, %s, %s, %s, %s, (SELECT AVG(s) FROM UNNEST(ARRAY[%s, %s, %s, %s]) s), %s)''',
Expand Down
2 changes: 1 addition & 1 deletion public/templates/success.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<body>
<div class="form">
<h1> Thankyou for your feedback! {{ reviewer_name }} </h1>
<h1> Thankyou for your feedback! {{ name }} </h1>
</div>
</body>

Expand Down
Binary file removed tmp/feedback.db
Binary file not shown.

0 comments on commit 188d6fd

Please sign in to comment.