Skip to content

Commit

Permalink
Something done
Browse files Browse the repository at this point in the history
  • Loading branch information
justafolk committed Apr 29, 2023
1 parent 904ba06 commit af779a6
Show file tree
Hide file tree
Showing 170 changed files with 50,256 additions and 175 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Grade-Point-Average-Analyzer
# Grade-Point-Average-Analyzer

-
Binary file modified __pycache__/app.cpython-39.pyc
Binary file not shown.
90 changes: 84 additions & 6 deletions app.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,93 @@
from flask import Flask, render_template, request, url_for
from flask import Flask, render_template, request, url_for, redirect
from flaskext.mysql import MySQL

app = Flask("GPA Calculator")
app.config['MYSQL_DATABASE_USER'] = 'root'
app.config['MYSQL_DATABASE_PASSWORD'] = 'justafolk'
app.config['MYSQL_DATABASE_DB'] = 'gpa'

mysql = MySQL()
mysql.init_app(app)
conn = mysql.connect()
class Course:
def __init__(self, name, credits, faculty = "NONE", course_type="BSC"):
self.name = name
self.credits = credits
self.faculty = faculty
self.course_type = course_type

app = Flask(__name__)

@app.route('/')
def mainapp():
return render_template('index.html')
return render_template('index.html', title="Home")

@app.route('/semester/view', methods=['GET'])
def viewsemester():
return render_template('index.html', title="Home")

@app.route('/onboarding')
@app.route('/semester/create')
def onboarding():
return render_template('onboarding.html')
return render_template('semesterform.html', title="Onboarding")

@app.route('/login')
def login():
return render_template('login.html', title="Login")

@app.route('/signup')
def signup():
return render_template('signup.html', title="Signup")

@app.route('/registeruser', methods=['POST'])
def registeruser():
username = request.form['username']
clgname = request.form['clgname']
misno = request.form['misno']
userbranch= request.form['userbranch']
useremail = request.form['useremail']
upass = request.form['pass']
sql = "INSERT INTO users (name, department, MIS, email, password, login_method) VALUES ('{}', '{}', '{}', '{}', '{}', '{}')".format(username, userbranch, misno, useremail, upass, "email")


cursor = conn.cursor()
cursor.execute(sql)
conn.commit()
cursor.close()

return redirect('/')



@app.route('/course/create', methods=['GET', 'POST'])
def createcourse():
return render_template('create_course.html', title="Create Course")

@app.route('/api/v1/createcourse', methods=['POST'])
def createcourseapi():
name = request.form['name']
credits = request.form['credits']
faculty = request.form['faculty']
course_type = request.form['course_type']
new_course = course(name, credits, faculty, course_type)
return redirect('/course/list')

@app.route('/course/list', methods=['GET'])
def course_list():
if(request.method == 'GET'):
print("GET")
coursename = request.args.get('name')

cursor =conn.cursor()
cursor.execute("SELECT * from courses")
data = cursor.fetchone()
print((data.__dict__), "chaltay")
course = [Course("BSCS", 3), Course("BSCss", 2), Course("sslSCS", 1)]

return render_template('course_list.html', title="Course List", courses=course, coursename=coursename )


@app.route('/home')
def home():
return render_template('home.html')

if __name__ == '__main__':
app.run(host="0.0.0.0", port=8080, debug=True)
app.run( debug=True)
96 changes: 96 additions & 0 deletions gpa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
class Course:
def __init__(self, name, credits, faculty, marks_distribution=0, seniors_advice = 0, friends_advice = 0, experience = 0, num_units = 0):
self.name = name
self.credits = credits
self.faculty = faculty
self.marks_distribution = marks_distribution
self.seniors_advice = seniors_advice
self.friends_advice = friends_advice
self.experience = experience
self.num_units = num_units


class Semester:
def __init__(self, name, duration, total_credits):
self.name = name
self.duration = duration
self.total_credits = total_credits
self.courses = dict()

def addcourse(self, course, credits):
self.courses[course.name] = credits

def removecourse(self, course):
self.courses.pop(course.name)



class User:
def __init__(self, name, current_year, department, MIS, birthday=None, login_method=None):
self.name = name
self.current_year = current_year
self.department = department
self.MIS = MIS
self.birthday = birthday
self.login_method = login_method
self.semesters = set()

def addsemester(self, semester):

self.semesters.insert(semester)

def rmsemester(self, semester):
self.semesters.pop(semester)



class Analyzer:
def __init__(self, generosity):
self.generosity = generosity

def average_grades(self):
# calculates the average grades based on the advices and experience
grades = self.generosity
return grades

def assign_grades(self, totalmarks):
# assigns grades based on the calculated average grades

# generosity ranges from 1 to 10, 1 being not generous and 10 being generous
# totalmarks ranges from 0 to 100
# create a if / switch case logic to assign grades based on the generosity
marks = [90, 80, 70, 60, 50, 40, 30, 20, 10, 0]

if self.generosity == 1:
if totalmarks > 60:
return 'AA'
elif totalmarks > 50:
return 'AB'
elif totalmarks > 40:


pass
elif self.generosity == 2:


pass

def plot_grades(self):
# plots the grades of each subject
pass

def plot_growth(self):
# plots the growth throughout semesters
pass

def plot_credit_distribution(self):
# plots a pie chart for credit distribution
pass

def plot_goal_met(self):
# plots a graph showing if goals are met
pass

def assign_goals(self):
# auto assigns goals for each subject with respect to given gpa goals
pass
54 changes: 54 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,57 @@
- pie chart for credit distribution [ top of semester ]
- Graph showing if goals are met
- Auto assign goals for each subject with respect to given gpa goals [if time persists]







- Courses
- Add course
- see all
- rm course
- find course

- Semester
- Add new sem
- see all
- rm sem
- find sem
- see statisics



































Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit af779a6

Please sign in to comment.