DayInReview / day-in-review

Full Day In Review application
http://dayinreview.org
Apache License 2.0
2 stars 0 forks source link

Grades Calculations #53

Closed JimothyGreene closed 3 years ago

JimothyGreene commented 3 years ago

Problem

The Grades widget simply provided a place to store your assignments and their respective grades. There was no part of this widget that gave you up-to-date information regarding the total grade in a given course or your GPA on any level.

Solution

Add fields to all the models to keep track of a grade at each level.

The client interface sends requests to the server to update these values when anything relevant to that value changes. This was accomplished using useEffect React hooks. A simple boolean state was implemented to stop circular dependencies from causing infinite hook triggering.

Testing

This was tested by adding, editing, and removing assignments and seeing that all relevant values would change. These values were also stored in the database since they were present on page refresh as well.

Notes

Some of the math is UT specific. The number of hours of a course is deduced from the name of the course (first numerical character in the name). Also, the specific grade points associated with each letter grade is UT specific (although the UT standard is relatively common among most schools).

Closes #51