|
Post by Florian on Apr 3, 2020 15:01:05 GMT
Hi there, I am using the "readkeys" function for recall in a memory experiment in which participants are asked to enter a series of digits (using the keyboard), and I basically have two questions: (1) Is there a way to restrict the number and the type keys which are accepted for input (i.e., I would like to accept only the digits 1-9 but not letters or other characters, and participants should enter exactly eight characters)? (2) The function only seems to provide information on whether the entire response was correct or not (in STATUS). What I would like to have is information for each individual key: whether it matched the correct key at this position or not. Is there some workaround for this? Or is there different function that should be used for this purpose? Thanks for any hints! Best, Florian
|
|
|
Post by PsyToolkit on Apr 3, 2020 15:40:28 GMT
Hi Florian,
There is currently no way to restrict letters, no. For that you would need to write a bit more code, just have multiple "readkey" commands one after another. Readkeys is really for people who want a quick way to get some multiple-letter/number input.
What you get in your data file is the typed in word, so you can analyze this offline. But you cannot check this inline. Again, for such a thing it might be better to have multiple readkey commands.
Gijsbert Stoet
|
|
|
Post by Florian on Apr 3, 2020 15:55:41 GMT
Thanks a lot for the quick reply! Then I'll try to write some more code with multiple readkey commands.
|
|
|
Post by PsyToolkit on Apr 10, 2020 21:03:56 GMT
The readkeys code has just been improved so that the "locale" is taken into account as well.
|
|