Skip to content

Stuff to change every year

mgale456 edited this page Apr 23, 2020 · 4 revisions

Change team data:

make a new TeamData.csv with at least these columns (can be done with a join, or manually):

  1. Name - team name
  2. School - team's school
  3. Abbr - team name abbreviation
  4. Email - captain's email
  5. Captain Name - captain's name

This gives us the necessary data to create the teams and a user for each team. Passwords for the users are randomly generated and can be emailed to the team captains upon initialization of the database. Passwords are not saved, and cannot be accessed to send out again, but password reset functionality is available through email.

Change Scoring Types in the Database

Can be done two ways:

  1. Manually add them through the Django admin site url: /admin/. This is easiest, but the data will disappear if you remove the docker volume. This is not good if you are making any changes or doing any development, since you may have to remigrate the db.
  2. Update the migration file: team_management/migrations/team_management/0002.....py This is the best option, since the data is stored in a persistent file.
Anything that is scored must be in here, regardless of whether or not it belongs on the judging screen.

Change Judging Page Layout

edit team_management/templates/team_management/GameX.html and team_management/views.py.

views.py sends context which is a dictionary of Python objects with string keys, to the Django template renderer to insert custom data from the db into the html. We are using input_style in the ScoringType db model to separate our scoring types into button clusters on the judging page. Then you can copy/paste different sections of GameX.html to organize your clusters. You should be able to just change which list the for loops loop over to get the other cluster.

Currently there are two input types we have. Standard buttons, which are buttons. They can have upper limits, or unlimited presses, and each action is separately recorded in the db, and can be deleted easily by the judge. The other input type is a text/button input. It is stored in the db as a single row with a count. The multiplier applies at the time the count is last updated, which is incorrect for many things, but correct for 2020's scoring balls, since they are counted at the end of the match.

Setting input_type to anything not filtered into one of these clusters will not display it on the judging page. This is essential for things scored by external scripts like the Wizard towers from 2020.

Also remove any superfluous html from the page, like the Potion Recipes from 2020.

Implement non-linear scoring

This is triggered by having value = 0 for the ScoringType

edit team_management/models.py under GameParticipant edit switcher and add def <name of scoringType>. I recommend following the format of brewPotion from 2020. For each time they score, it calculates what it is worth with a simple formula, and then multiplies it by the multiplier. You can get more complicated with if statements or anything you want.