Defaults: don't show object in results
report is an array of strings that are names of properties for the object to see. 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.
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:
