PennController for IBEX › Forums › Support › How do I log whether the person pressed the right key or not?
- This topic has 4 replies, 2 voices, and was last updated 3 years, 4 months ago by
uppsalas.
-
AuthorPosts
-
April 5, 2021 at 10:45 pm #6836
uppsalas
ParticipantHello, I want to log in my results sheet if the person pressed the right key or not. From what I can see in the results, this is not being logged so how can I change that?
This is the code of the trial part:
Template( "StroopTable.csv" , row => newTrial ("experimental-trial" , defaultText.center() // Horizontally center all Text elements automatically , newText("word", row.Word) // Show the text from the 'Word' column .color(row.Color) // Color the text as specified in the 'FontColor' column .css("font-size", "24pt") // Increase the font size .log() // Reports when the Text is displayed in the results file .print() , newVar("RTword") .global() .set(v=>Date.now()) , newKey("keypress", "rav") .log() // Reports when the key is pressed in the results file .wait() , getVar("RTword") .set(v=>Date.now()-v) , // Wait 1s before moving to the next trial newTimer(500).start().wait().log() ) .log( "word" , row.Word ) // Append the value of 'Word' at the end of the results lines .log( "color" , row.Color ) // Append the value of 'FontColor' at the end of the results lines .log( "correct" , row.Key ) // Append the value of 'CorrectKey' at the end of the results lines .log( "RTword" , getVar("RTword") ) ) SendResults("send")
This is what I see in results of only one item. I also wonder why it appears six times:
1617676900,f980c64f763d5ccdd4e0c41a484e74dc,PennController,60,0,experimental-trial,NULL,PennController,61,_Trial_,Start,1617676806885,MOMENTO, red, r,4610,NULL 1617676900,f980c64f763d5ccdd4e0c41a484e74dc,PennController,60,0,experimental-trial,NULL,Text,word,Print,NA,1617676806887,MOMENTO, red, r,4610,NULL 1617676900,f980c64f763d5ccdd4e0c41a484e74dc,PennController,60,0,experimental-trial,NULL,Key,keypress,PressedKey,R,1617676811495,MOMENTO, red, r,4610,Wait success 1617676900,f980c64f763d5ccdd4e0c41a484e74dc,PennController,60,0,experimental-trial,NULL,Timer,Timer,Start,Start,1617676811498,MOMENTO, red, r,4610,NULL 1617676900,f980c64f763d5ccdd4e0c41a484e74dc,PennController,60,0,experimental-trial,NULL,Timer,Timer,End,End,1617676812001,MOMENTO, red, r,4610,NULL 1617676900,f980c64f763d5ccdd4e0c41a484e74dc,PennController,60,0,experimental-trial,NULL,PennController,61,_Trial_,End,1617676812003,MOMENTO, red, r,4610,NULL
Thank you in advance.
April 6, 2021 at 11:00 am #6839Jeremy
KeymasterHi,
PennController adds one line to the results file per event that is logged. The start and end of a trial are logged by default, and you additionally log your Text, Key and Timer elements: you get one line for when the Text element was printed, one line for when a key was pressed, and two lines corresponding to the start and end of the Timer element. The third line is the one for the Key element, and you can see that the key that was pressed is
R
, which matches the correct column, which reportsr
(it’s not a perfect match because you added a space character beforer
in your table, and you use lower-case when the pressed character is reported in upper case)Jeremy
April 6, 2021 at 6:53 pm #6843uppsalas
ParticipantThank you for answering. The issue is that in all instances it says success when I tried it myself and I pressed the wrong one to see it in the resutls. Why does this happen?
April 6, 2021 at 6:59 pm #6844Jeremy
KeymasterIt says “Wait success,” which means that the keypress successfully validated a
wait
commandJeremy
April 6, 2021 at 7:48 pm #6845uppsalas
ParticipantOh, okay, thank you.
-
AuthorPosts
- You must be logged in to reply to this topic.