|
Post by jochen on Apr 17, 2020 11:42:21 GMT
In an experiment i want to use several sequential responses using readkeys. I can assign the numerical responses to separate variables for later saving. However, PsyToolkit can only work with whole numbers as values for variables, so the approach below results in NaN for the RESPONSE1 and RESPONSE2 variables. How do I save the WORD for several responses? Ideally I'd like to have just a single line per trial in the data file, so I'd rather not call save on each response collection. Since save WORD works if called directly from readkeys, it must be able to deal with string variables. Is there any way to store a string in a variable for later use (maybe by computing a numerical representation of it)?
part collectResponse1 readkeys @18 &MaxResponseTime set &STATUS1 expression STATUS set &RESPONSE1 expression WORD set &RT1 expression RT
part collectResponse2 readkeys @18 &MaxResponseTime set &STATUS2 expression STATUS set &RESPONSE2 expression WORD set &RT2 expression RT
task rsvp ### some code deleted here set $T2PRESENT @20 save $T2PRESENT &RESPONSE1 &STATUS1 &RT1 &RESPONSE2 &STATUS2 &RT2
|
|
|
Post by PsyToolkit on Apr 17, 2020 12:39:08 GMT
No, currently, only whole numbers can be saved in variables.
I can see why it would be handy to have text variables, and at some point in the future this might be implemented.
|
|
|
Post by jochen on Apr 17, 2020 12:46:23 GMT
Thanks, yes, that would be handy. At the moment I will work around by storing one line per WORD and merging it with the remaining trial table and results in postprocessing then.
|
|