jpschewe / fll-sw

FIRST Lego League scoring software
http://jpschewe.github.io/fll-sw/
GNU General Public License v2.0
10 stars 7 forks source link

Separate subjective score categories from rubric sheets - virtual category #1198

Closed jpschewe closed 1 month ago

jpschewe commented 3 months ago

There are some cases coming up where we'll need this.

Tasks:

jpschewe commented 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.

jpschewe commented 2 months ago

In the end adding a virtual subjective category seems like it's going to solve the issue.

jpschewe commented 2 months ago

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