How redx0476/test_assignment works
Result Analyzer accepts MSM test-result submissions, stores them, and turns the accumulated results into daily statistics and scheduled monthly averages. Users can view daily and monthly reports. The README documents the endpoint, schedule, and calculation rules; sampled source confirms the monthly calculation and reporting-controller reads, but the API controller, EOD implementation, and recurring-task configuration are not in the supplied tree, so their internal wiring is shown only where documented.
Main entry points: calculate_daily_statistics.rb Daily aggregation · monthly_averages_job.rb Monthly job · calculate_averages.rb Monthly averaging · daily_result_statistic.rb Daily statistics
Components 16
Result ingestion
- Ingestion API
app/controllers - Store result
app/services/ingestion/create_test_result.rb
Scheduled calculations
- EOD job
app/jobs/eod_statistics_job.rb - Daily aggregation
app/services/eod/calculate_daily_statistics.rb - Monthly job
app/jobs/monthly_averages_job.rb - Trigger-date guard
app/services/monthly/trigger_date.rb - Monthly averaging
app/services/monthly/calculate_averages.rb
Persistence
- Test results
app/models - Daily statistics
app/models/daily_result_statistic.rb - Monthly averages
app/models/monthly_result_average.rb
Reports
- Dashboard
app/controllers/dashboard_controller.rb - Daily report
app/controllers/daily_statistics_controller.rb - Monthly report
app/controllers/monthly_averages_controller.rb
Other components
- MSM service
- Recurring scheduler
- Report user
Connections 17
- MSM service → Ingestion API: submits JSON
- Ingestion API → Store result: delegates validation
- Store result → Test results: persists result
- Recurring scheduler → EOD job: dispatches daily
- EOD job → Daily aggregation: runs aggregation
- Daily aggregation → Test results: reads results
- Daily aggregation → Daily statistics: writes statistics
- Recurring scheduler → Monthly job: dispatches daily
- Monthly job → Trigger-date guard: checks date
- Monthly job → Monthly averaging: runs when due
- Monthly averaging → Daily statistics: reads history
- Monthly averaging → Monthly averages: upserts averages
- Report user → Dashboard: requests page
- Report user → Daily report: requests report
- Report user → Monthly report: requests report
- Daily report → Daily statistics: reads statistics
- Monthly report → Monthly averages: reads averages