The Analytics module transforms your raw academic record into actionable performance insights. Using theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Andr21Da16/UNITRU-ACADEMIC/llms.txt
Use this file to discover all available pages before exploring further.
academic_analytics.py domain service, Unitru Academic computes pass rates, weighted averages, and retry counts for every period you have been enrolled — completely on the fly from the already-extracted record data, with no additional server-side storage. Results are displayed as bar charts (powered by Recharts 3) alongside a full period-by-period breakdown table and highlighted callouts for your best and worst performing periods.
Data Model
AcademicAnalytics
PeriodStat
TypeScript Counterparts
Field Reference
| Field | Description |
|---|---|
period_stats | One PeriodStat entry per academic period, sorted chronologically |
total_courses | Total graded, non-disabled courses across all periods |
total_passed | Courses with final_grade >= 14 |
total_failed | total_courses − total_passed |
overall_pass_rate | (total_passed / total_courses) × 100, rounded to 2 decimal places |
retried_course_names | Sorted list of course names enrolled more than once (any attempt > 1) |
best_period | Period with the highest weighted_average |
worst_period | Period with the lowest weighted_average (among periods with graded courses) |
Computation Logic
Analytics are computed by thecompute(record: AcademicRecord) function in academic_analytics.py. Only courses with a non-null final_grade and is_disabled = False enter any calculation:
ROUND_HALF_UP applied at 2 decimal places:
best_period and worst_period are determined by max / min on weighted_average across all PeriodStat entries. If only one period exists, both fields point to the same period.
Charts
The frontend (analytics_view.tsx) renders two bar charts using Recharts 3:
- Weighted Average per Period
- Passed vs. Failed per Period
A
BarChart with Promedio on the Y-axis (domain 0–20) and period labels on the X-axis. Bars are filled in #FFD200 (UNT yellow). A tooltip shows the exact average on hover.ResponsiveContainer at 100% width and are hidden when there are no period stats to display.
Global Summary Cards
Four summary cards appear above the charts:| Card | Value shown |
|---|---|
| Total cursos | total_courses |
| Aprobados | total_passed (green) |
| Reprobados | total_failed (red) |
| Tasa global | overall_pass_rate formatted to 1 decimal place (e.g., 87.5%) |
Retried Courses
Theretried_course_names list surfaces every course name that appears with attempt > 1 in the academic record. These are displayed as red-tinted chips:
Retried courses are identified by the
attempt field on each CourseHistory entry — specifically any entry where attempt > 1. The unique course names are de-duplicated and sorted alphabetically before being included in retried_course_names. A course appearing in three periods with attempt values of 1, 2, and 3 contributes only one entry to this list.Best & Worst Period Highlights
Two highlight cards appear at the bottom of the analytics view when at least one period has graded data:🏆 Best Period
The period with the highest
weighted_average across all graded periods. Rendered with a green border and background.📉 Worst Period
The period with the lowest
weighted_average. Only shown when it differs from the best period. Rendered with a red-tinted border and background.