psychopy.org | Reference | Downloads | Github

Input field options?

I would need to insert an input field in my online experiment. I have searched through the forum and people have come up with some sort of work around.

I was wondering if there is any implemented way to have a text input field within a routine of an online experiment or that is something that is not available just yet.

Thanks!

Yes, you can create your own text input using a text component. See the online demo we have available on Pavlovia:

https://pavlovia.org/run/dvbridges/textinput/html/

Thanks for this @dvbridges!!

I noticed two small issues.

  1. The period button will be printed as period and not as a actual period .
  2. How to prevent subjects to just press ‘return’ to end the routine. I want to make sure they are going to actually answer the question without leaving unanswered.

I guess that’s something that must be done in the definition of the textAdd variable…

Sure, its just a demo, it does not cover all keys, but shows you how you would deal with any key press you would like to handle. For the second question, you need to make sure that the text component contains text before allowing return to end a trial e.g., something like if (key == 'return' && text.text.length > 0).

1 Like

I have implemented a text input field in my online masked priming experiment as suggested above. The text input field is available during breaks for subjects to answer a given question; their answer is recorded in the output file in the column Answer. After giving the question, the subjects are supposed to continue on the original task (that is, a lexical decision task) by pressing either f or j (non-word and word, respectively).

It works fine, however I noticed that all keys are available right after the question and the text input field is given, even for actual trials (i.e., letter strings to make lexical decisions on). What happens is that subjects type in their answer, press ENTER to get back to the lexical decision task, and, if they accidentally hit one of the other keys than f/j, those keys will be recorded in the output file in the Answer column (even though there was no question asked).

I hope the description above is clear enough. I was wondering if there was a way to refrain the keys (other than f/j) from being active during the presentation of the actual task so as to avoid storing of unwanted responses in the output files.