Need to add functionality for the game master to choose, at the end of a round, which 'option' (1/2/3 or 0/1/2 in code) was correct.
New Plan:
Add a form titled "Set Room Colors" in a card under the main round control table with a separate submit button.
Have a little help text like "Choose a color for each option for the live round. When you click 'Reveal Colors', the rooms will change to the colors associated with their current vote.
The form should have up to three radio button lists (or select lists) based on the current active/live round options, each one is "Option name" for the form label and then the options are 'off' (Default), 'white', 'red', 'green', 'blue'.
When someone clicks submit after choosing the colors, the submission would trigger some logic:
Cycle through all the rooms' latest votes. (maybe just brute force go from 1 to 100 and load the room's latest vote).
UPDATE the rooms table color entry for that room based on the color assigned to the value the room selected (e.g. if 'Cheese' was set to 'green', then turn that room 'green' in the rooms table.
It would be nice to store the color associations somewhere but for now let's not.
Original Plan:
Preserved for historical reasons — this structure would be too restrictive for how they want to sometimes reveal who chose what.
Add new INTEGER column to rounds table, named winning_value
For each row on the Round admin page/index, add a select option with all the available value_*s for the round.
Have the default be --- or 'choose' or something
Only display this select box for existing rounds (not the new one)
Add logic to saving code:
If the round didn't previously have a winning answer saved, check if it is the current round
If it is the current round, run through every room, checking it's latest answer for the round
If the room's answer does not match the correct answer, turn the light red in that room record in rooms
Need to add functionality for the game master to choose, at the end of a round, which 'option' (1/2/3 or 0/1/2 in code) was correct.
New Plan:
Add a form titled "Set Room Colors" in a card under the main round control table with a separate submit button.
Have a little help text like "Choose a color for each option for the live round. When you click 'Reveal Colors', the rooms will change to the colors associated with their current vote.
The form should have up to three radio button lists (or select lists) based on the current active/live round options, each one is "Option name" for the form label and then the options are 'off' (Default), 'white', 'red', 'green', 'blue'.
When someone clicks submit after choosing the colors, the submission would trigger some logic:
UPDATE
therooms
tablecolor
entry for that room based on the color assigned to the value the room selected (e.g. if 'Cheese' was set to 'green', then turn that room 'green' in the rooms table.It would be nice to store the color associations somewhere but for now let's not.
Original Plan:
Preserved for historical reasons — this structure would be too restrictive for how they want to sometimes reveal who chose what.
winning_value
value_*
s for the round.red
in that room record inrooms