Skip to content

Commit

Permalink
Update Overall Attendance
Browse files Browse the repository at this point in the history
  • Loading branch information
ezhil56x committed Mar 31, 2024
1 parent 4fb8eb0 commit bf0b5a7
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1299,8 +1299,6 @@ private void downloadAttendance() {
JSONArray attendanceArray = response.getJSONArray("attendance");
List<Attendance> attendance = new ArrayList<>();

int overallAttendance = 0;

int attendedClasses = 0;
int totalClasses = 0;

Expand Down Expand Up @@ -1328,8 +1326,10 @@ private void downloadAttendance() {
attendance.add(attendanceItem);
}

int overallAttendance = 0;

if (totalClasses != 0) {
overallAttendance = (int) ((attendedClasses * 100) / totalClasses);
overallAttendance = (attendedClasses * 100) / totalClasses;
}

sharedPreferences.edit().putInt("overallAttendance", (int) overallAttendance).apply();
Expand Down

0 comments on commit bf0b5a7

Please sign in to comment.