calculate_attendance
Calculates per-course VTOP attendance, safe skip buffer, and classes to attend, then projects future sessions to check if planned bunks keep you above target by a deadline.
Instructions
Attendance / bunk calculator. Per course: current %, whether you're safe (strictly above 74.0% by default — 74.0 is debarred; override via targetPercent), how many more classes you can skip ('bunkBuffer'), and how many to attend to recover ('classesToRecover'). For the key real use case — 'I'm at the line; if I skip today can I still make 75% by the time attendance closes?' — pass untilDate (the attendance-closing date; ASK THE USER for it) or toTermEnd: true to project to the last instructional day of the term automatically, plus bunkDates (the days you'd skip, e.g. today's date). Using the timetable + academic calendar (holidays, working Saturdays / day-orders) it returns per course: upcomingSessions until the deadline, ifAttendAllPercent/ifSkipAllPercent, maxSkippableInRange, mustAttendInRange, canBeSafeByDeadline, and — when bunkDates is given — plannedBunk (your final % and whether you're still safe if you skip exactly those days and attend everything else). Also returns a perDay breakdown of which classes fall on each upcoming day. If the response contains NOT_AUTHENTICATED, call get_captcha then login then retry. login auto-uses VTOP_USERNAME/VTOP_PASSWORD env vars if set; if it reports credentials missing, ask the user for them. Requires login.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bunkDates | No | Dates (ISO YYYY-MM-DD) you plan to SKIP — e.g. today. Requires untilDate. For each course the tool reports whether you'd still be safe by the closing date if you skip exactly these days and attend everything else (`plannedBunk`). | |
| toTermEnd | No | Project to the last instructional day of the semester (from the academic calendar) instead of passing untilDate yourself. Answers 'how many of my remaining classes must I attend to hold the target?' — holidays and working Saturdays are excluded automatically. | |
| untilDate | No | Attendance-closing date as ISO YYYY-MM-DD (e.g. a CAT-2 cutoff). When set, the tool projects every class from today to this date using the timetable grid + academic calendar (working days, holidays, working Saturdays / day-orders). Ask the user for this date if they want a deadline-aware answer. | |
| courseCode | No | Limit to one course code (e.g. 'BCSE302L'), matched case-insensitively. Omit for all courses. | |
| semesterId | No | Semester ID (e.g. 'CH20252605'). If omitted, uses the current semester. | |
| targetPercent | No | Attendance % to target. Default 74 — VIT requires 75% but 74.x rounds up to 75. | |
| includeUntilDate | No | Whether classes ON the closing date are counted. Default true. |