HackFSU / hackfsu-2018

HackFSU Website & Api
https://hackfsu.com
5 stars 14 forks source link

Create route for POST/GET judging data #39

Closed andrewsosa closed 6 years ago

andrewsosa commented 7 years ago

/judge/hacks Outline of judging functionality:

Client devices send GET, api returns an array of three hack numbers to judge, e.g.

{
    "hacks": [22, 23, 24],
    "superlatives": ["Best Veteran Team", "Best Novice Team", "Funniest Hack",  "..."]
}

Also each GET sends a list of available nominations for the set of hacks.

Client devices then POST back an ordering of hacks, and nominations as an array

{
    "order": {
        "1": 23,
        "2": 24,
        "3": 22
    },
    "superlatives": {
        "22": ["Best Veteran Team"]
     }
}

Judging Rules

Hacks are awarded points for how they placed, 1 point for 1st place, 2 for 2nd, 3 for 3rd. The hack with the fewest points is highest placed.

Superlatives are awarded to the hack with the with the most nominations for a category. A hack can not win more than 1 superlative; a team with multiple most-nominations for a superlative wins the superlative which they received the greater number of nominations for. Any other superlatives which the hack has the most nominations for will run-off to the next most-nominated hack.

Resolving ties:

  1. top-three ranking score between hacks
  2. number of superlative nominations between hacks
  3. number of superlative nominations for a hack between superlatives

This needs to be decided. Perhaps 1) By designated tie-breaker, 2) designated tie-breaker, 3) by coin flip?

andrewsosa commented 6 years ago

I think we might also want to add a /judge/expo route to get information on when the different expos are. GET only, would be like:

{
    "current": 1,
    "expos": [
        {
             "id": 1,
             "start_time": 0000000000,
             "end_time": 0000000000
        },
        {
             "id": 2,
             "start_time": 0000000000,
             "end_time": 0000000000
        }
    ]
}

Ids will be some sort of number, probably 1, 2, 3... so we can call them "Expo 1". Start/end times will probably end up being a millisecond timestamp, but that might change.

If there is no active expo, current will have value 0.

andrewsosa commented 6 years ago

Related: https://github.com/HackFSU/hackfsu_com/issues/58

andrewsosa commented 6 years ago

The current implemention combined with #58 seems sufficient.

This is implemented, but currently bugged.

andrewsosa commented 6 years ago

Okay, judging should be ready (maybe nominations need more testing),

Routes are:

GET /api/judge/hacks POST /api/judge/hacks/upload

The GET route will send you back your hack assignment. The POST route will accept your upload and send back 200 if good, but will send 400 if you don't have any hacks assigned or upload the wrong hacks.

andrewsosa commented 6 years ago

Hopefully not bugged right now. Need some mobile testing to make sure it all works right.

andrewsosa commented 6 years ago

As this is completed and working on the API side, we're closing the issue.