<> tags
) and JavaScript (with {}
)..jsx
file. Components can be imported into each other to build more complex components. Usually, the type of components used in Empirica are class-based.{ condition ? true : false }
or { condition && true}
where condition is a condition that is tested, true is what is rendered if this condition tests true, and false is what is rendered if this condition tests false.TaskResponse.jsx
. You can see that two render functions have been created: renderSubmitted()
and renderInput()
. In the render()
part of the component, you can see that there is an if conditional that determines whether the render function used will be renderSubmitted()
, which will prevent the renderSubmitted()
from being called (and thereby hiding the slider and method of response from the player):renderSubmitted()
does.client/main.js
you set which components form the Exit Steps with Empirica.exitSteps()
. You can use the player.exitStatus
to separate out whether they have finished the game or if they were sent to the exit steps because the game was cancelled/had an issue and send them to different Exit Steps.static stepName = "";
and players can only move from one Exit Step to the next if the component has an element (e.g., a button) that will call the onSubmit
prop. For example:server/bots.js
you can create bots for them to participate in your games.