wiki:ClientHistory

ClientHistory

ClientHistory is the multistage framework's way to allow details of the previous matches of an experiment to be shown to the subjects. The number of columns is flexible and set by the programmer. The data can be updated at any time.

There are several options about the history panel which can be changed at runtime in the metadata:

match.N.defaultView=fullThe history panel will contain one line for every round, and will display in one pane.
match.N.defaultView=tabbedThe history panel will display all rounds for each match in its own tab, and the subject can switch between them.
match.N.viewSwitchable=trueA button will be present on the history panel allowing the subjects to switch between tabbed and full views
match.N.viewSwitchable=falseThe view switching button will not be enabled

Adding Data

Data is added to the history panel in one of two ways:

On the server side, data is added by calling addColumnData(int partnerNum, String column, String data) from the extending server controller. If the column string is an existing column, the data will be placed in that column for the current match and round. If the column does not already exist, the column will be created. The clients will see the updates the next time askPlayer(...) or askAllPlayers(...) is called.

On the client side, data can be added by calling updateHistory(String columnName, String value) from the extending client interface. If the column string is an existing column, the data will be placed in that column for the current match and round. If the column does not exist, the column will be created. The client will see the updated data when the history panel repaints.

Note: Some columns of the history panel, by nature of the chronological progression of the game, cannot be filled in initially. In order to make the headings for these initially-empty columns display from the beginning of the match, one can initially add empty strings as the data in the history panel, and replace these with the actual data as the game proceeds.

Disabling Previous Match Histories

The module has an option to disable the history from matches before the current match. When defaultView=tabbed, calling disablePreviousMatches() on the instantiated instance will cause the tabs of all previous matches to be disabled.

Note that this method needs to be called every match in order for all but the current to be disabled, and that it does nothing when defaultView=full.

Last modified 4 years ago Last modified on Oct 18, 2013 4:14:47 PM