Constructor
new Period(app)
Parameters:
| Name | Type | Description |
|---|---|---|
app |
App | The app that this period belongs to. |
Members
allGroupsStarted :Array.<number>
The stages (by index) that wait for all groups and have started (see Group#startStage).
Type:
- Array.<number>
app :App
Type:
groups :Array
List of groups for this period.
Type:
- Array
id :String
Unique identifier for this participant.
Type:
- String
outputHide :Array.<String>
'outputHide' fields are not included in output
Type:
- Array.<String>
Methods
arrivalGroupId()
With app.groupByArrival: puts participant, arriving in this period, into the group
still filling up (or a new one), and returns that group's id. A group is complete,
and can start, with app.groupSize players (see Stage#canGroupStartDefault).
groupEnded()
Called when a group of this period has ended the period's last stage: once all have,
calls the app's periodEnd hook.
participantBegin(participant) → {type}
participantBegin - description
Called from:
- participantBeginPeriod
Parameters:
| Name | Type | Description |
|---|---|---|
participant |
type | description |
Returns:
description
- Type
- type
participantEnd(participant) → {type}
Parameters:
| Name | Type | Description |
|---|---|---|
participant |
type | description |
Returns:
description
- Type
- type
save()
save - description
setGroups(matrix)
Regroups this period's players: matrix lists each group's participant ids, e.g.
[['P1', 'P4'], ['P2', 'P3']], every player once. Only before any group has started a
stage, i.e. in app.periodStart (oTree's set_group_matrix, z-Tree's group matching).
Parameters:
| Name | Type | Description |
|---|---|---|
matrix |
Array.<Array.<string>> |
(static) load(json, session) → {type}
Parameters:
| Name | Type | Description |
|---|---|---|
json |
type | description |
session |
type | description |
Returns:
description
- Type
- type