📖
Empirica v1 Docs
  • Introduction
  • Getting Started
    • Setup
      • Windows WSL Instructions
    • Creating your experiment
    • Running your experiment
    • Updating your experiment
  • Guides
    • Tutorial: Your First Experiment
      • Part 1: Getting Started
      • Part 2: Configuring the Experiment
      • Part 3: Adding Social Information and New Factors
      • Part 4: Adding Chats
      • Part 5: Adding Bots
    • The Settings File
      • Specifying Login Details
      • Setting player ids via URL queries
      • Connecting Locally to MongoDB
    • The Admin Panel
    • Special Empirica Elements (and how to modify them)
    • Deploying Your Experiment
      • Database
      • Hosting
    • Managing the Data
    • Using Custom Collections
  • Conceptual Overview
    • Structure
    • Game Life Cycle
      • Customising when players submit stages
    • Concepts
    • Randomization & Batches
    • API
  • FAQ
    • I need help!
    • The Processes and Elements of an Empirica Experiment
    • Managing Players and Games
  • Community Demos
    • Guess The Correlation
    • Random Dot Motion
    • Room Assignment
  • Tips & Tricks
    • Helpful Linux Commands
    • Code Editors
  • Links
    • Empirica website
    • Twitter
    • GitHub
Powered by GitBook
On this page
  • When players submit (end) a stage
  • What players see when they have submitted a stage

Was this helpful?

  1. Conceptual Overview
  2. Game Life Cycle

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:

player.stage.submit()

This will change this property, that you can use to see if the stage has been submitted (it is a Boolean, true or false):

player.stage.submitted

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.submit().

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.submitted returns.

For example:

{
player.stage.submitted
    ? <div> Thank you for your answer. The next stage will start when all the other 
    players have submitted their answer. </div>
    : <div><Question player={player} /></div>
}
PreviousGame Life CycleNextConcepts

Last updated 3 years ago

Was this helpful?