@@ -86,7 +86,7 @@ function main_page () {
8686 const current_term = getCurrentTerm ( ) ;
8787 const { courses, promises_grade_calc_list } = getCourses ( second_semester , sem1_col , sem2_col ) ;
8888
89- showCurrentGPA ( second_semester , courses ) ;
89+ showCurrentGPA ( second_semester , courses , promises_grade_calc_list ) ;
9090
9191 if ( second_semester ) {
9292 showFirstSemGPA ( ) ;
@@ -101,11 +101,6 @@ function main_page () {
101101 secondSemester : second_semester ,
102102 } ,
103103 } ) . $mount ( "#cumulative-gpa" ) ;
104-
105- Promise . all ( promises_grade_calc_list ) . then ( _ => {
106- $ ( "table[border='0'][cellpadding='3'][cellspacing='1'][width='100%']" ) . prepend ( `<tr><td align="center">Current Semester GPA (${ second_semester ? 'S2' : 'S1' } ): ${ calculate_gpa ( courses ) } </td></tr>` ) ;
107- saveGradesLocally ( student_name , courses ) ;
108- } ) ;
109104 addHypoGradeCalc ( courses ) ;
110105}
111106
@@ -218,8 +213,11 @@ function isSecondSemester (sem2_col) {
218213 * @param second_semester If the current semester is the second semester
219214 * @param courses an array of Courses that the student is taking
220215 */
221- function showCurrentGPA ( second_semester , courses ) {
222- $ ( "table[border='0'][cellpadding='3'][cellspacing='1'][width='100%']" ) . prepend ( `<tr><td align="center">Current Semester GPA (${ second_semester ? 'S2' : 'S1' } ): ${ calculate_gpa ( courses ) } </td></tr>` ) ;
216+ function showCurrentGPA ( second_semester , courses , promises_grade_calc_list ) {
217+ Promise . all ( promises_grade_calc_list ) . then ( _ => {
218+ $ ( "table[border='0'][cellpadding='3'][cellspacing='1'][width='100%']" ) . prepend ( `<tr><td align="center">Current Semester GPA (${ second_semester ? 'S2' : 'S1' } ): ${ calculate_gpa ( courses ) } </td></tr>` ) ;
219+ saveGradesLocally ( getStudentName ( ) , courses ) ;
220+ } ) ;
223221}
224222
225223/**
0 commit comments