Closed jpschewe closed 3 months ago
If a score sheet goal can be used in multiple categories, I can have a category made up of goals referenced from score sheets. However when I want to populate the score sheet with the values from the database how do I map that back?
The easy solution is to just store the scores in the categories like I currently do and then throw an exception if the scores don't match up when creating the populated rubric sheet. Although that also comes up when populating the subjective judging application.
Another idea is to store scores separately in the database outside of categories and score sheets. Then put it all together in code as needed. However that will require rewriting the code that does normalization as well as the code that loads and saves scores.
In the end adding a virtual subjective category seems like it's going to solve the issue.
Instead of a table per virtual category, I could go with a table for all virtual categories with columns:
The the query for final scores is
SELECT team_number, sum(goal_score) as computed_total
FROM virtual_category
WHERE tournament_id = ?
AND virtual_category_name = ?
GROUP BY team_number
There are some cases coming up where we'll need this.
Tasks:
final_scores
table