Thanks for the feedback and tips on that. I may go back and try the sequential game approach because it does seem that it's much easier to implement. Nonetheless in the meantime this is a good learning opportunity for me about live methods (for the future) so if you could explain what's going on I appreciate it. My html/javascript code is below (note I know it's quite simple at the moment- my intention was to get it running then add the signals, options,etc. afterwards). It looks like there is a problem on the addEventListener. Â
{{ block content }}
  <p>Your randomly set player number for this round is. Please wait for your turn to
    make a guess about the state of the round (Up or Down).</p>
  <div id="is-live" style="...">
    <p>
      Before you guess if the state is Up or Down, you can now also view the color of the ball that was randomly
      drawn.
    </p>
    <p>
      Now that you can see what color of ball the computer drew it is time for you to guess the state of the world.
      You can use this draw to help you make your guess. You will be informed of whether your guess is correct
      and if your random partner guessed correctly at the end of the experiment when your payout is determined.
    </p>
    <button type="button" onclick="sendOffer()">Submit</button>
  </div>
  <div id="is-waiting">
    <progress></progress>
    <p> You are in the queue. Please wait for your turn while those before you make their guess.</p>
  </div>
<script>
  let state_of_world_guess = document.getElementById('state_of_world_guess')
  state_of_world_guess.addEventListener("keydown", function (event) {
    if (event.key === "Enter") {
      sendOffer();
    }
  });
  function sendOffer() {
    if (state_of_world_guess.reportValidity()) {
      liveSend({'state_of_world_guess': parseInt(state_of_world_guess.value)});
    }
  }
  function liveRecv(data) {
    console.log('liveRecv',data);
    if ('color_of_ball_signal' in data) {
      document.getElementById('is-waiting').style.display = 'none';
      document.getElementById('is-live').style.display = 'block';
      //let color_of_ball_signal = data.color_of_ball_signal;
    }
    if ('finished' in data) {
      document.getElementById('form').submit();
    }
    if ('reload' in data) {
      liveSend({});
    }
    if ('error' in data) {
      alert(data.error);
    }
    else {
      document.getElementById('is-waiting').style.display = 'block';
      document.getElementById('is-live').style.display = 'none';
    }
  }
</script>
{{ endblock }}