Search…
Customising when players submit stages

When players submit (end) a stage

Instead of having players wait until the end of the stage, you can have them submit their answer. This will set the Stage as submitted for them. If all the other players have also submitted the Stage, then the players move on to the next Stage or Round.
To set the stage to submitted you need to run this method from the player prop:
1
player.stage.set("submit", true);
Copied!
This will change this property, that you can use to see if the stage has been submitted (it is a Boolean, true or false):
1
player.stage.get("submit");
Copied!
For example, you could create a button, that has a handle method for onClick that will do the necessary with the player's answer and call player.stage.set("submit", true).

What players see when they have submitted a stage

Once a player submits for the stage, you might want to show something different on the screen. For example, instead of showing the stage's question/task (and avoiding players submitting multiple responses), you could show a message thanking the player for submitting the stage and telling them that they will have to wait for all players to submit the stage before they can move on to the next one.
You can do this by setting a conditional that renders different elements depending on what player.stage.get("submit") returns.
For example:
1
{
2
player.stage.get("submit")
3
? <div> Thank you for your answer. The next stage will start when all the other
4
players have submitted their answer. </div>
5
: <div><Question player={player} /></div>
6
}
Copied!