Class: Period

Period(app)

Period object - test link Session Session.clients.

Constructor

new Period(app)

Parameters:
Name Type Description
app App

The app that this period belongs to.

Source:

Members

allGroupsStarted :Array.<number>

The stages (by index) that wait for all groups and have started (see Group#startStage).

Type:
  • Array.<number>
Source:

app :App

Type:
Source:

groups :Array

List of groups for this period.

Type:
  • Array
Default Value:
  • []
Source:

id :String

Unique identifier for this participant.

Type:
  • String
Source:

outputHide :Array.<String>

'outputHide' fields are not included in output

Type:
  • Array.<String>
Source:

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

Source:

groupEnded()

Called when a group of this period has ended the period's last stage: once all have,
calls the app's periodEnd hook.

Source:

participantBegin(participant) → {type}

participantBegin - description

Called from:

  • participantBeginPeriod
Parameters:
Name Type Description
participant type

description

Source:
Returns:

description

Type
type

participantEnd(participant) → {type}

participantEnd - description

Called from:

Parameters:
Name Type Description
participant type

description

Source:
Returns:

description

Type
type

save()

save - description

Source:

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>>
Source:

(static) load(json, session) → {type}

Parameters:
Name Type Description
json type

description

session type

description

Source:
Returns:

description

Type
type