(724) 732-4299

MON - FRI, 10AM - 8PM

huangs@allegheny.edu

REPLY IN 24 HOURS

About it

By Spencer Huang

Advisagator is a Flask based web application tool used by students and faculties to help them communicate with each other in a more efficient manner. Currently, students have to schedule a meeting with their advisors and physically submit a copy of their four year plan so the advisor could photoscan it for their records. That takes way too long and it is such a tedious process for both the student and the advisor. Another feature that the tool does is that it allows the advisor to take notes on what actually happened during the meeting. Right now, the students and the advisors meet and the advisor has to remember everything that they have said during the meeting and record/store it somewhere that they can access later. But, that makes the job extremely hard for the advisor. So, the tool lets the advisor and/or advisee edit what they remember for the meeting so they can accurately record down what they talked about for that meeting.

This is the sample output of the initial screen you would see when you run the program using the command pipenv run server :
As you can see from the image, it first prompts the user to log into their account to access their information.
The logging in and registering functionality is handled by the code shown below:
						
@app.route("/login/", methods=["POST"])
def login():
    """Log in the student or teacher"""
    # get form information
    form_data = flask.request.form

    # validation
    if form_data["username"] == "":
        flask.flash("The username field is required.")
        return flask.redirect("/")
    if form_data["password"] == "":
        flask.flash("The password field is required.")
        return flask.redirect("/")

    # get data from database
    data = db_connect.query_db(
        "SELECT password, isTeacher, person_id FROM people WHERE username=? LIMIT 1",
        [form_data["username"]],
    )
    # make sure username is right
    if data == []:
        flask.flash("Your username was incorrect.")
        return flask.redirect("/")

    # check the password
    user_pass = form_data["password"]
    if data[0][0] == user_pass:
        # correct password
        flask.session["isTeacher"] = data[0][1]
        flask.session["id"] = data[0][2]
        # if student, redirect to students page
        if flask.session["isTeacher"] == 0:
            return flask.redirect("/students/")
        # else they are a teacher, redirect to teachers page
        return flask.redirect("/teachers/")

    flask.flash("Your password was incorrect.")
    return flask.redirect("/")


@app.route("/register/", methods=["GET", "POST"])
def register():
    """Register the user"""
    # form data is GET, so render template
    if flask.request.method == "GET":
        return flask.render_template("register.html")

    # request method is POST, so do everything

    form_data = flask.request.form

    # form validation
    # pylint: disable=bad-continuation
    if (
        form_data["username"] == ""
        or form_data["password"] == ""
        or form_data["name"] == ""
        or form_data["email"] == ""
    ):
        return "All text fields are required"
    if "isTeacher" not in form_data:
        isTeacher = 0  # they are not a teacher
    else:
        isTeacher = 1  # they are a teacher

    password = form_data["password"]
    db_connect.insert_db(
        "INSERT INTO people (isTeacher, username, password, name, email)"
        "VALUES (?, ?, ?, ?, ?)",
        [
            isTeacher,
            form_data["username"],
            password,
            form_data["name"],
            form_data["email"],
        ],
    )
    flask.flash("The entry was created")
    return flask.redirect("/")
						
					


The feature above was mainly what I was able to help my team implement. Aside from implementations, I was mostly responsible for creating the basic structure of the repository. Because the project required us to have knowledge on frameworks I haven't had experience on, all I could do for my team was to try and read through the documentations for the frameworks and try to help out along the way. Due to the short amount of time that we were given to work on the project, I wasn't able to help out much for the implementation part of the project. However, because I did have experience on starting up a new repository from scratch, my main responsibility for my group was to initialize the repository with all the necessary requirements, like setting up the virtual environment, setting up Travis, and just the overall structure of the repository.

Overall, I think that the team had a tough time collectively working and combining their expertises. Because of the different schedules that each team member had, it was difficult to come together and work. That became a huge downfall for the team because that caused people to have less motivation to do anything and that lead to work not being done on time. That also made planning a lot harder because each week we just try to add on what we didn't do from last week to the current week. That kind of planning is horrible and caused a lot of frustration. That being said, it is a learning experience and that I've learned that staying ahead of the game makes thing a lot easier than being behind. Also, I learned that when team members are slacking, I should just pick it up rather than trying to rely on them. At the end of the day, it is hard to notice if they actually want to get the work done or if they are just stalling for someone to save them. So, I learned that taking things into my own hands is a lot more reliable and that I should learn more about a large variety of things to be able to do more aspects of projects myself.