Repository navigation
Add a batch-wise total-credits-earned Database report - #2008
Merged
vikrantwiz02 merged 1 commit intoOct 7, 2026
Merged
vikrantwiz02 merged 1 commit into
vikrantwiz02 merged 1 commit into
Conversation
Splits each student's earned credits into regular, backlog/improvement and swayam, deduped to the best attempt per course code so the three columns always sum to the degree-credit total (the same rule calculate_cpi_for_student uses for the transcript's TU figure). Runs the per-student query across a thread pool rather than in series -- the underlying helper calls calculate_cpi_for_student once per semester for its CPI-progression display, and each of those calls re-queries grades and replacements from scratch, so a 600+ student batch was taking minutes one student at a time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /aims/api/database/credits-earned/, filter: batch) returning each student's earned credits split into Regular, Backlog/Improvement and Swayam, plus the total.calculate_cpi_for_studentuses for the transcript's TU figure), so the three columns always sum to the total._build_grade_validation_semesters) re-queries grades/replacements once per semester for its CPI-progression display, so a 600+ student batch was taking 2-3 minutes one student at a time; this brings it down to well under a minute without changing any of the underlying (already-correct) logic.Test plan
python -m ast