Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[solved] Disable 'enter' and log subject's demographic details

edited January 2014 in OpenSesame

Hi,

I am wondering if there is a way to disable 'enter' in form input element. I want participants to write as many words as they want separated by commas. When they are finished they should move to the 'next' tab. Right now, if participants want to move to 'next' tab, they press enter and cursor appears which enable them to move to 'next' tab. But if they mistakenly press 'enter' instead of comma (which many of them do), there is no way that they can resume writing the words. Here is my form input script

[pastebin:1pTzR7r5]

Additionally, I am looking for a way to log participant's demographic details (like age, gender etc) at the start of the experiment and make it a part of log file (just as it is done in PsychoPy and EPrime). Is it possible?

Thanks in advance,
Asma

Comments

  • edited 6:29PM

    Hi Asma,

    Your script is a bit odd. Firstly, the question label spans two rows and therefore overlaps with the text_input on the second row. Also, what I assume should be a button is a text_input with the text 'Next' in it. Probably, you want to have a script like the following, am I right?

    set rows "1;5;1"
    set description "A simple text input form"
    set cols "2;1;2"
    set form_question "Write all the words that you remember. Use commas between words. When you are done press 'Enter' and click on 'Next' button."
    set form_title "Title"
    set form_var "BaselineResponse"
    widget 0 0 3 1 label center="no" text="[form_question]"
    widget 0 1 3 1 text_input focus="yes" return_accepts="no" var="[form_var]"
    widget 2 2 1 1 button text="Next"
    

    But if they mistakenly press 'enter' instead of comma (which many of them do), there is no way that they can resume writing the words.

    I think that this is related to the fact that the label overlapped the text_input in your script. This prevented you from clicking on the text_input to resume typing. Does the script I posted above fix your problem?

    Additionally, I am looking for a way to log participant's demographic details (like age, gender etc) at the start of the experiment and make it a part of log file (just as it is done in PsychoPy and EPrime). Is it possible?

    Yes, if you use forms to collect information at the beginning of the experiment, the info should be automatically written to the log file. Make sure to choose unique response variables, otherwise the info will be overwritten!

    Cheers!
    Sebastiaan

  • edited 6:29PM

    Thanks Sebastiaan!
    It was indeed a problem with row span. It works perfect now.

Sign In or Register to comment.