Add speaker standings and metrics by score criterion - #2901
Conversation
Adds "total for X" and "average for X" metrics for each score criterion, so speakers can be ranked by e.g. Style in a WSDC tournament. Criteria are per-tournament rows, so their annotator classes are built per tournament and keyed by criterion seq. Also adds a standings page per criterion, admin and public, the latter gated on a new criterion_tabs_released preference.
With criteria configured the speech score is derived from them and set_score() is a no-op, so simulated ballots produced all-zero scores.
|
Criteria only aggregate over the speeches they apply to ie One case your question turned up: the criterion tab was inheriting its eligibility filter from the substantive standings view, so it ranked on |
|
On the API, each criterion adds Per-round criteria scores aren't available anywhere at the moment. This PR doesn't touch either file, so it's not from here, but making the read path emit |
There was a problem hiding this comment.
So the new metrics do show in the preference fields; however, trying to save them results in a ValidationError like "criterion_avg_1 is not a valid choice".
| def get_position_filter(self, round): | ||
| """Mirrors ScoreCriterion.applies_to_position().""" | ||
| if self.criterion.speech_type == ScoreCriterion.SpeechType.REPLY: | ||
| return Q(speakerscore__position=round.tournament.reply_position) | ||
| if self.criterion.speech_type == ScoreCriterion.SpeechType.SUBSTANTIVE: | ||
| return Q(speakerscore__position__lte=round.tournament.last_substantive_position) | ||
| return Q() |
There was a problem hiding this comment.
As the metrics for reply are fixed and don't have a setting to customize, I don't think we need to worry about reply speeches actually.
Q(speakerscore__position__lte=round.tournament.last_substantive_position)should always be applied (or based on what page is being viewed, between reply or substantive standings, so that it works with SpeechType.ALL)
Fixes #2900