Defaults: don't show object in results
Just about everything in results comes from objects in the experiment. For any object you to specify what to see using these two properties. If you leave both at default, the object doesn’t show in results.
report is an array of strings that are names of properties to see. These can include input properties which you can set when building the experiment. More commonly they are record properties which PsychBench uses to record information during the experiment. Common record properties to report are response, responseLatency, and other related information for response handler elements.
info attaches custom information to see for the object, most commonly test condition values associated with it. 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. (Tip: if you have values for a trial that are not specific to one element object, you can make a trial object and set info there as well.)
In this experiment each trial shows a picture randomly rotated between −30 … +30 deg. The subject responds by left/right arrow key press with whether the picture is rotated counterclockwise (negative angle) or clockwise (positive angle). Response is scored correct/incorrect. In results for the picture we ask to see the random value in input property rotation, and a rotation direction name (<cds>"ccw"<cds>, <cds>"cw"<cds>) and numeric code (−1 = left, +1 = right) based on it. For the response handler we ask to see record properties response, responseScore, responseLatency. Note you can use showKey at the MATLAB command line to get key names.
newExperiment
<cdkm>for<cdkm> r = 1:50
pic = pictureObject;
pic.fileName = <cdsm>"dog.jpg"<cdsm>;
pic.rotation = randomNum(-30, 30);
pic.start.t = 0;
pic.end.duration = 0.5;
pic.report = <cdsm>"rotation"<cdsm>;
<cdkm>if<cdkm> pic.rotation < 0
pic.info.direction = <cdsm>"ccw"<cdsm>;
pic.info.d = -1;
<cdkm>else<cdkm>
pic.info.direction = <cdsm>"cw"<cdsm>;
pic.info.d = +1;
<cdkm>end<cdkm>
recorder = keyPressObject;
recorder.listenKeyNames = [<cdsm>"left" "right"<cdsm>];
recorder.translateResponse = [
1 -1
2 +1
];
recorder.scoreResponse = true;
recorder.correctResponse = pic.info.d;
recorder.start.endOf = <cdsm>"pic"<cdsm>;
<cdcm>% keyPress ends on its own when it records a response<cdcm>
recorder.report = [<cdsm>"response" "responseScore" "responseLatency"<cdsm>];
addTrial(pic, recorder);
<cdkm>end<cdkm>
[results, resultsMatrix] = runExperiment;
The results table would look like this (first seven trials only). PsychBench automatically adds some information including results file name, date/time, screen measurements for visual angle degree units, and trial numbers and start times. The rest come from report and info.
See the results tutorial in <PsychBench folder>/docs/tutorials.
PsychBench © 2017–2023 Giles Holland
Website © 2023 Giles Holland
End user license agreement