Members
activeScreen
app :App
the app of this stage.
Type:
appPath
The file of this stage's app.
clientDuration :number
Seconds each player has for this stage, from when they start it (oTree's page
timeout); see getClientDuration(player) for a
duration per player. Their page counts down and submits; if it does not, the server
ends the stage for them, as for a group's timeout (see timeoutGrace). If <= 0, none.
Type:
- number
duration :number
timeout duration in seconds
if <= 0, then no timeout for this stage.
Type:
- number
endOnTimeout :boolean
When the stage times out (duration or clientDuration), end it (true); or only mark
the players timed out and keep it open until they submit (false: z-Tree's "leave
stage after timeout: no").
Type:
- boolean
html
htmlFile
id :String
The identifier of this stage.
Type:
- String
jt
The jtree of this stage's app.
name :Name
for display only, should be unique.
Type:
- Name
onPlaySendPlayer :boolean
when starting stage for a player, send 'player' object or not.
fields determined by player.outputFields.
Type:
- boolean
outputHide :Array
'outputHide' fields are not included in output.
Type:
- Array
outputHideAuto :Array.<String>
'outputHideAuto' fields are not included in output.
Type:
- Array.<String>
repetitions :number
For a stage with stages of its own (see newStage), the number of times its stages
are played each time its group reaches it, if numPeriods is not set.
Type:
- number
session :Session
The session of this stage's app.
Type:
stages :Array.<Stage>
The stages within this stage: its own (see newStage), or, for an app added as a stage
(see App#addApp), that app's.
Type:
- Array.<Stage>
timeoutGrace :number|null
When this stage times out and Stage#waitOnTimerEnd is true, each player's
page is asked to submit what it has. After this many seconds, the server ends the
stage for players whose page has not (as if they submitted nothing); null waits
for the pages however long they take.
Type:
- number | null
updateObject :string
how far up the tree should be sent on update. More data comes at cost of higher latency.
possible values: 'player', 'group'
Type:
- string
useAppActiveScreen :boolean
Type:
- boolean
useAppWaitingScreen :boolean
Type:
- boolean
useIdAsHTMLFileName :boolean
Type:
- boolean
waitForAllGroups :boolean
Wait for every player of the period, in every group, to be 'ready' before any group
starts this stage (z-Tree's "wait for all", oTree's wait_for_all_groups). Then
Stage.allGroupsStart(period) is called, once, before
the groups' groupStart.
Type:
- boolean
waitOnTimerEnd :boolean
Wait for all players to finish stage on their own (true), or end anyway (false).
Type:
- boolean
waitToEnd :boolean
Wait for all players in group to be 'finished' or 'done' before calling Stage.groupEnd(group) and Stage.playerStart(player) are called.
Type:
- boolean
waitToStart :boolean
Wait for all players in group to be 'ready' before calling Stage.groupStart(group) and Stage.playerStart(player) are called.
Type:
- boolean
wrapPlayingScreenInFormTag
Wrap stage playing screens in a
Methods
addApp(file, optionsopt, idopt) → {Stage}
Adds the app in file as a stage within this stage (see newStage, App#addApp).
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
file |
string | The app's file, or folder, relative to this stage's app's folder. |
|
options |
Object |
<optional> |
The app's option values. |
id |
string |
<optional> |
The id of the stage; by default, the app's. |
Returns:
The new stage.
- Type
- Stage
allGroupsStart(period)
Overwrite in app.jtt: for a stage that waits for all groups, called once per period
when every player has arrived, before each group's groupStart.
Parameters:
| Name | Type | Description |
|---|---|---|
period |
Period |
blockApp()
The app this stage's stages are in (see App#newBlock), made the first time it is asked for.
canPlayerParticipate(player) → {type}
Can the given player participate in this stage?
Parameters:
| Name | Type | Description |
|---|---|---|
player |
type | description |
Returns:
description
- Type
- type
groupEnd(group) → {type}
Overwrite in app.jtt.
Parameters:
| Name | Type | Description |
|---|---|---|
group |
type | description |
Returns:
description
- Type
- type
groupStart()
Called before the first player plays this stage.
Overwrite in app.jtt
indexInApp() → {type}
indexInApp - description
Returns:
description
- Type
- type
isContainer()
Whether this stage has stages of its own, or is an app (see newStage, App#addApp).
newStage(idopt) → {Stage}
Adds a stage within this stage. A stage with stages is an app within its app: each time
a group reaches it, its players play its stages, numPeriods times (repetitions, if
that is not set), in periods of their own, and then go on to the next stage of this
stage's app. By default they keep their groups; with groupSize, numGroups,
groupMatchingType or getGroupIdsForPeriod(period) set on this stage, they are
regrouped, as an app's players are. periodStart(period) and periodEnd(period), if set
on this stage, are called as an app's are. See App#newBlock.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
id |
string |
<optional> |
Returns:
The new stage.
- Type
- Stage
playerEnd(player)
End this stage for the given player.
Overwrite in app.jtt.
Parameters:
| Name | Type | Description |
|---|---|---|
player |
type | description |
playerStart()
Called when this player plays this stage.
Overwrite in app.jtt.
runFor(period) → {App}
The app this stage's stages run as in period (a period of this stage's app), for the
time period's groups reach this stage: made the first time it is asked for. For an app
added as a stage (see App#addApp), that app, loaded afresh.
Parameters:
| Name | Type | Description |
|---|---|---|
period |
Period |
Returns:
- Type
- App
runIn()
The app this stage's stages run as in period, if its groups have reached it; else null.
save() → {type}
CALLED FROM:
Returns:
description
- Type
- type
shell() → {type}
CALLED FROM:
Returns:
description
- Type
- type
shellWithParent() → {type}
shellWithParent - description
Returns:
description
- Type
- type