UC-10 Admin runs reports and exports prize lists
| Primary actor | SHS Staff (Admin) |
| Supporting actors | Reporting Consumer (SHS leadership, CSU stakeholders) |
| Priority | Must |
| Satisfies | FR-F1, FR-F2, FR-F3, FR-F4, FR-F5, FR-F6, FR-F7, FR-F8, FR-F9, NFR-1 |
| Precondition | The admin is signed in; a published challenge exists for the campus. |
| Trigger | The admin opens Reports. |
Main success scenario
- The admin sees the participation funnel per week, attendance by capture method, engagement, and learning-outcome aggregates, each re-derived from the rows written a moment ago and refreshed on a timer.
- Aggregates that could identify a student are suppressed below the small-cell threshold.
- The admin exports the grand-prize roster (every required task complete) or the per-week drawing list (one row per student per week checked in, required flag ignored) as CSV.
- The admin downloads all aggregate reports as one ZIP with a manifest.
Extensions
- 1a. No published challenge. 404 with
NO_ACTIVE_CHALLENGE; never 403, so a challenge id from another campus cannot be probed. - 3a. Nobody eligible yet. An empty but valid CSV with a header row.
- Per-student exports (prize rosters, engagement detail) write an
ExportAuditrow naming who exported and how many rows were disclosed. - Attendance provenance. The manual bucket distinguishes audited staff overrides from legacy self-reported rows.
- Rehearsal students are excluded from every report and export through one shared helper.
Acceptance criteria (Gherkin)
| Feature file | Test module |
|---|---|
participation_report.feature |
test_participation_report_bdd.py |
attendance_report.feature |
test_attendance_report_bdd.py |
engagement_report.feature |
test_engagement_report_bdd.py |
learning_outcome_report.feature |
test_learning_outcome_report_bdd.py |
reporting_privacy.feature |
test_reporting_privacy_bdd.py |
prize_export.feature |
test_prize_export_bdd.py |
weekly_prize_export.feature |
test_weekly_prize_export_bdd.py |
prize_export_audit.feature |
test_prize_export_audit_bdd.py |
engagement_detail_export.feature |
test_engagement_detail_export_bdd.py |
per_event_export.feature |
test_per_event_export_bdd.py |
aggregate_report_csv_export.feature |
test_aggregate_report_csv_export_bdd.py |
aggregate_report_bundle.feature and frontend/aggregate_report_bundle.feature |
test_aggregate_report_bundle_bdd.py |
manual_checkin_provenance.feature |
test_manual_checkin_provenance_bdd.py |
reporting_dashboard_auto_refresh.feature and frontend/reporting_dashboard_auto_refresh.feature |
test_reporting_dashboard_auto_refresh_bdd.py |
reports_stat_tile_grid.feature and frontend/reports_stat_tile_grid.feature |
test_reports_stat_tile_grid_bdd.py |
Plain pytest: test_participation_report.py, test_attendance_report.py, test_engagement_report.py, test_learning_outcome_report.py, test_reporting_privacy.py, test_prize_export.py, test_weekly_prize_export.py, test_report_csv.py, test_report_bundle.py. Frontend: Reports*.test.tsx.
Views
- Process: UC-10 Reports and exports
- Logical:
services/reportsandExportAuditin system components and the domain model
Code: backend/app/services/reports.py, report_privacy.py, report_csv.py, report_bundle.py, backend/app/routers/reports.py, frontend/src/components/admin/Reports/.