Practical 7: AJAX
Practical 7: AJAX
git clone https://github.com/tsotnekekelia/wad20-lab-7.git
Send course data using POST method to https://wad20-lab7.free.beeceptor.com/users/1/courses
Request body example:
{
"title": "title",
"semester": 2,
"grade": 75
}
GPA on "Profile" container needs to be updated as well (depending on the grade you enter)
After saving form needs to be reset (all the entered information cleared out) and form needs to be hidden
Formula to calculate GPA:
if grade > 90 point = 4
if grade > 80 point = 3
if grade > 70 point = 2
if grade > 60 point = 1
if grade > 50 point = 0.5
if grade <= 50 point = 0
GPA = sum of all points / (number of courses)