Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Collegiate results are calculated incorrectly #277

Open
djmolny opened this issue Jan 16, 2025 · 1 comment
Open

Collegiate results are calculated incorrectly #277

djmolny opened this issue Jan 16, 2025 · 1 comment
Assignees
Labels

Comments

@djmolny
Copy link
Collaborator

djmolny commented Jan 16, 2025

The current algorithm divides the total points awarded for the student's three best contests by the total possible points for those contests to produce %pp (percentage of possible points). If the flights span multiple categories (e.g., Primary & Sportsman), the category with the higher possible points will be over-weighted in the calculation.

The algorithm should instead calculate %pp for each contest, then average those.

@djmolny djmolny added the bug label Jan 16, 2025
@djmolny djmolny self-assigned this Jan 16, 2025
@djmolny djmolny closed this as completed Jan 16, 2025
djmolny added a commit that referenced this issue Jan 16, 2025
…` values for the rolled-up pilot `%pp` value.
djmolny added a commit that referenced this issue Jan 20, 2025
@djmolny djmolny reopened this Jan 22, 2025
@djmolny djmolny changed the title Collegiate Individual results are calculated incorrectly Collegiate results are calculated incorrectly Jan 22, 2025
@djmolny djmolny changed the title Collegiate results are calculated incorrectly Collegiate Individual results are calculated incorrectly Jan 22, 2025
@djmolny djmolny closed this as completed Jan 22, 2025
@djmolny djmolny reopened this Jan 22, 2025
@djmolny djmolny changed the title Collegiate Individual results are calculated incorrectly Collegiate results are calculated incorrectly Jan 22, 2025
@djmolny
Copy link
Collaborator Author

djmolny commented Jan 22, 2025

Sorry for the close-open-close-open nonsense... I thought there was one issue covering the changes needed for both Individual and Team results. But there wasn't, so I've edited the title of this one accordingly.

Without going over the differences in gory detail, the Team Award criteria have also changed since IACCDB was initially coded; see P&P 225.7.1.

djmolny added a commit that referenced this issue Jan 22, 2025
app/models/collegiate_individual_result.rb:
- Fixed the qualifying count: doesn't include Primary or 4 Minute Free flights

app/services/iac/collegiate_computer.rb:
- Swapped the recompute order: now it's individual first, then the teams, b/c the
  individual results are used when calculating the team results

app/services/iac/collegiate_individual_computer.rb:
- Removed the Category filter to get a result for all pilots, but only
  qualify those with >= 3 contests in Sportsman or higher.

app/services/iac/collegiate_team_computer.rb:
- Complete rewrite of the `#compute_result` method, including deletion of the
  private `#compute_best_result_p` and `#compute_best_result_pc` methods.
  - Fixed the indentation

app/views/collegiate_results/_collegiate_result.html.erb:
- Eliminated "points" and "possible" from the team row headers
- Lots of HTML reformatting for readability

app/views/leaders/collegiate.html.erb:
- Added "Notes" section, including a link to the P&P on www.iac.org
- Lots of HTML reformatting for readability
djmolny added a commit that referenced this issue Jan 23, 2025
  Deleted the obsolete/unused method `#update`, and added logic to save the top 3 pilots' PcResult
  objects for use in displaying "TC" (Team Contribution) in the `/leaders/collegiate` view.
djmolny added a commit that referenced this issue Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant