Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

did dynamic statistics for teacher dashboard #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__pycache__/
uploads/
7 changes: 1 addition & 6 deletions dataset/teacherdb.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@ Not that good,-1.0,Very much better,1.0,Beliver,1.0,One of the best teachern,1.0
Not that good teaching,-1.0,Very nice nd clean teaching,1.0,Very poor,-1.0,Staisfying,1.0,Excellent,1.0,Do not counduct lectures at all,-1.0
Not on time for lectures,-1.0,Teaching is much better,1.0,No need to be improved,-1.0,Very Godd in teachings,1.0,Better one,1.0,cool,1.0
Not on time for lectures,-1.0,Cool,1.0,Teachings are awsome,1.0,Need the skills to be improved,-1.0,One of the best teacher,1.0,So rude with students and also teachings are not that better,-1.0
Not bad teacher,-1.0,Very Well,1.0,Good,1.0,not happy,-1.0,good,1.0,could be better,-1.0
d,1.0,d,1.0,d,1.0,d,1.0,d,1.0,d,1.0
d,1.0,d,1.0,d,1.0,d,1.0,d,1.0,d,1.0
d,1.0,d,1.0,d,1.0,d,1.0,d,1.0,d,1.0
a,1.0,d,1.0,a,1.0,d,1.0,a,1.0,d,1.0
fake,1.0,fake,1.0,fake,1.0,fake,1.0,fake,1.0,fake,1.0
Not bad teacher,-1.0,Very Well,1.0,Good,1.0,not happy,-1.0,good,1.0,could be better,-1.0
24 changes: 16 additions & 8 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,28 @@ def teacherdashboard(teachernumber):
tecp = int(round(tecp / ttf * 100))
tecn = int(round(tecn/ttf * 100))
tecneu = int(round(tecneu/ttf * 100))


data = [ttp, ttn, ttneu, tcp, tcn, tcneu, tep, ten, teneu, tlwp, tlwn, tlwneu, tlfp, tlfn, tlfneu, tecp, tecn, tecneu]
role = f'teacher{teachernumber}'

if teachernumber == 1:
return render_template('teacherdashboard.html', ttf=ttf, ttp=ttp, ttn=ttn, ttneu=ttneu)
ttp, ttn, ttneu = data[0:3]
return render_template('teacherdashboard.html', role=role, ttf=ttf, ttp=ttp, ttn=ttn, ttneu=ttneu)
elif teachernumber == 2:
return render_template('teacherdashboard.html', ttf=ttf, ttp=tcp, ttn=tcn, ttneu=tcneu)
ttp, ttn, ttneu = data[3:6]
return render_template('teacherdashboard.html', role=role, ttf=ttf, ttp=ttp, ttn=ttn, ttneu=ttneu)
elif teachernumber == 3:
return render_template('teacherdashboard.html', ttf=ttf, ttp=tep, ttn=ten, ttneu=teneu)
ttp, ttn, ttneu = data[6:9]
return render_template('teacherdashboard.html', role=role, ttf=ttf, ttp=ttp, ttn=ttn, ttneu=ttneu)
elif teachernumber == 4:
return render_template('teacherdashboard.html', ttf=ttf, ttp=tlwp, ttn=tlwn, ttneu=tlwneu)
ttp, ttn, ttneu = data[9:12]
return render_template('teacherdashboard.html', role=role, ttf=ttf, ttp=ttp, ttn=ttn, ttneu=ttneu)
elif teachernumber == 5:
return render_template('teacherdashboard.html', ttf=ttf, ttp=tlfp, ttn=tlfn, ttneu=tlfneu)
ttp, ttn, ttneu = data[12:15]
return render_template('teacherdashboard.html', role=role, ttf=ttf, ttp=ttp, ttn=ttn, ttneu=ttneu)
else:
return render_template('teacherdashboard.html', ttf=ttf, ttp=tecp, ttn=tecn, ttneu=tecneu)

ttp, ttn, ttneu = data[15:18]
return render_template('teacherdashboard.html', role=role, ttf=ttf, ttp=ttp, ttn=ttn, ttneu=ttneu)

@app.route('/login', methods=['GET'])
def login():
Expand Down
3 changes: 0 additions & 3 deletions teacherdashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,8 @@ def get_feedback_counts():
teacher5_positive_count,teacher5_negative_count,teacher5_neutral_count,
teacher6_positive_count,teacher6_negative_count,teacher6_neutral_count]


return no_of_feedbacks,\
int(round(total_positive_feedbacks / total_feedbacks * 100)),\
int(round(total_negative_feedbacks / total_feedbacks * 100)),\
int(round(total_neutral_feedbacks / total_feedbacks * 100)),\
li


4 changes: 2 additions & 2 deletions templates/teacherdashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
<div class="container">

<div class="section-title" data-aos="fade-up">
<h2>Dashboard</h2>
<h2>Dashboard For {{role}}</h2>
</div>

<div class="our-skill-area fix hidden-sm">
Expand Down Expand Up @@ -177,7 +177,7 @@ <h2>Dashboard</h2>
</div>
</div>
</div>
</div>
</div>
</div><!-- End of row for circular progressbar-->
<div class="row">
<div class="col-md-3 col-sm-3"><h3 style="color:aqua;text-align: center">Total</h3></div>
Expand Down
Binary file modified user_data.db
Binary file not shown.