Skip to content

Add a batch-wise total-credits-earned Database report - #2008

Merged
vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:feature/credits-earned-report
Oct 7, 2026
Merged

vikrantwiz02 merged 1 commit into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:feature/credits-earned-report

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

Summary

  • New Database report (GET /aims/api/database/credits-earned/, filter: batch) returning each student's earned credits split into Regular, Backlog/Improvement and Swayam, plus the total.
  • Classification is a clean partition of the best-graded attempt per course code (same dedup rule calculate_cpi_for_student uses for the transcript's TU figure), so the three columns always sum to the total.
  • Runs the per-student computation across a bounded thread pool (16 workers) instead of in series — the shared helper it depends on (_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

  • Verified against a real batch (619 students) via Django shell: status 200, totals match the live Transcript page exactly for a spot-checked student (114 credits)
  • Confirmed output unchanged before/after parallelizing
  • Syntax-checked with python -m ast

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.
@vikrantwiz02
vikrantwiz02 merged commit 57a7f47 into FusionIIIT:prod/acad-react Oct 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant