In this section, we’ll collect and examine actual experimental results.
Collecting information from elements
When you run an experiment, by default PennController logs only when each trial starts and ends. You must call the
log command on each element that you’re interested in in order to collect information about it.
- Call the
logcommand on the
"side-by-side"Canvas to log when it’s printed to the screen.
- Call the
logcommand on the
"keypress"Key to log information about the participant’s keypress.
@// Type code below this line. @ @// Remove command prefix @PennController.ResetPrefix(null) @ @// Instructions @// code omitted in interest of space @ @// Experimental trial @newTrial("experimental-trial", @ newAudio("fish-audio", "2fishRoundTank.mp3") @ .play() @ , @ newText("fish-sentence", "The fish swim in a tank which is perfectly round.") @ .center() @ .unfold(2676) @ , @ newImage("fish-plural", "2fishRoundTank.png") @ .size(200, 200) @ , @ newImage("fish-singular", "1fishSquareTank.png") @ .size(200, 200) @ , @ newCanvas("side-by-side", 450,200) @ .add( 0, 0, getImage("fish-plural")) @ .add(250, 0, getImage("fish-singular")) @ .center() @ .print() + .log() @ , @ newKey("keypress", "FJ") + .log() @ .wait() @ , @ getAudio("fish-audio") @ .wait("first") @)
Running the experiment
We’re finally ready to run the experiment and collect some data!
- Click … to the right of Results to open a modal window.
- Make sure the dropdown list says UNpublished, check the box to the left of “Delete anyway” and click Delete all results to start with a clean slate.
- Click Open in new tab and take a full run of the experiment.
- Click Results to open the results file.
Examining experimental results
The results file should look like this:
# Published experiment # # Results on... # USER... # Design number... # # Columns below this comment are as follows: # 1. Time results were received. # 2. MD5 hash of participant's IP address. # 3. Controller name. # 4. Item number. # 5. Element number. # 6. Type. # 7. Group. # 8. PennElementType. # 9. PennElementName. # 10. Parameter. # 11. Value. # 12. EventTime. # 13. Comments. 1603390913,SOME_MD5_HASH,PennController,0,0,instructions,NULL,PennController,0,_Trial_,Start,1603390891064,NULL 1603390913,SOME_MD5_HASH,PennController,0,0,instructions,NULL,PennController,0,_Trial_,End,1603390892111,NULL 1603390913,SOME_MD5_HASH,PennController,1,0,experimental-trial,NULL,PennController,1,_Trial_,Start,1603390892115,NULL 1603390913,SOME_MD5_HASH,PennController,1,0,experimental-trial,NULL,Canvas,side-by-side,Print,NA,1603390892122,NULL 1603390913,SOME_MD5_HASH,PennController,1,0,experimental-trial,NULL,Key,keypress,PressedKey,F,1603390893835,Wait success 1603390913,SOME_MD5_HASH,PennController,1,0,experimental-trial,NULL,PennController,1,_Trial_,End,1603390894815,NULL
We’re interested in the five rows at the bottom, which tell us that:
"instructions"trial started at the timestamp
"instructions"trial ended at the timestamp
"experimental-trial"trial started at the timetamp
Canvaswas printed at the timestamp
Keyhad a value of
Fat the timestamp
"experimental-trial"trial ended at the timestamp
The timestamps are Unix timestamps in milliseconds, the number of milliseconds since 00:00:00 UTC on January 1, 1970.
Calculating response times
In general, we aren’t interested in the value of a single timestamp, but rather in the difference between timestamps. This difference can help us determine response times or event durations.
For example, we can subtract the Canvas timestamp from the Key timestamp to determine how long it took for the participant to press a valid key. In this experiment, the participant took 1713ms to press the
F key (
This experiment only has a single trial and run, so it’s hard to analyse the results. In the Advanced Tutorial, we’ll add more trials and runs, and perform more interesting analyses.
Collecting actual data
Once you have examined and successfully analyzed the data from your test runs, you will no longer edit your project. At this point (and not sooner) you are ready to publish your experiment:
- Add the
DebugOffcommand to turn off the debugger, since we’re now done writing the experiment script.
- Click the Unpublished toggle in the Actions panel to change the experiment from unpublished to published.
- Click Share and copy the link in the Data-collection link field.
- Paste the experiment link into a new tab to take one final test-run to make sure publishing your experiment did not introduce new issues (it should not)
- Click Results to open the data-collection results file and analyze it one more time
@// Type code below this line. @ @// Remove command prefix @PennController.ResetPrefix(null) @ +// Turn off debugger +DebugOff() @ @// code omitted in interest of space