Defaults: don't show object in results
info sets custom information to see about the object—e.g. test condition values associated with the object. You can set info to a struct with any fields containing any values you want. Field names go to headings in the results table and field values go under those headings. Note sometimes it's convenient to add a trial object and set info fields there—this groups those columns near the front of the results table, not specific to any other object in the trial. [In the visual method you can use # in a property/variable heading (heading row 2) as a shortcut for setting info fields.]
report is an array of strings that are names of properties for the object to show. These can include input properties which you can set when making the experiment. More commonly they include record properties which you can't set but PsychBench uses to record information during the experiment. Common record properties to report are response, responseLatency, and others for response handler elements. The documentation for each object type lists both its input and record properties.
See Getting started – Experiment results output for more information.
We define four trials, eaching showing two rectangle elements with the following properties set for results output (other properties not shown). We want to see some custom information we make under n_condition for the trial and direction for each rectangle. We also want to see the value of input property rotation (which we set) and record property duration (which PsychBench fills in during the experiment) for each rectangle.
In the coding method:
rotations = [30 -30];
directions = [<cdsm>"cw" "ccw"<cdsm>];
c = 0;
<cdkm>for<cdkm> d1 = 1:2
<cdkm>for<cdkm> d2 = 1:2
c = c+1;
rects = rectangleObject(2);
rects(1).rotation = rotations(d1);
rects(1).info.direction = directions(d1);
rects(2).rotation = rotations(d2);
rects(2).info.direction = directions(d2);
for n = 1:2
rects(n).report = [<cdsm>"rotation" "duration"<cdsm>];
end
...
trial = trialObject;
trial.info.n_condition = c;
...
addTrial(rects, trial);
<cdkm>end<cdkm>
<cdkm>end<cdkm>
In the visual method:
If we ran the four trials in random order, the first results variable output would look something like this. You can see the information requested, plus some information PsychBench adds automatically: