How to use the survey form component?

OS Win10
PsychoPy version 3.10
Standard Standalone? (y/n) y
What are you trying to achieve?:

Hey there,
I want to use the survey form component of the builder. Thus, I used this description here:
http://www.psychopy.org/builder/components/form.html

What did you try to make it work?:

I have created a csv file with the corresponding columns descripted at the page above which looks as follows

questionText questionWidth type responseWidth options layout
Are you lucky? 1 rating 1 1,2,3,4,5 horiz
Are you sad? 1 rating 1 1,2,3,4,5 horiz
Are you alone? 1 rating 1 1,2,3,4,5 horiz
Are you happy? 1 rating 1 1,2,3,4,5 horiz

What I am wondering about is that in the component itself I am supposed to use ‘height’. But I am using ‘pix’ globally in my survey. This might be a mistake here?

I have attached my csv and psyexp file here:

survey.psyexp (5.3 KB)
surveyitem.csv (232 Bytes)

Looking forward to your suggestions, have great day! :slight_smile:

Hi @Fabian, great to see you testing out the new Form component. Yes, for now the Form object can only be formatted correctly in height units. That also means that you need to set your global screen units to height. If you do this, you can still size and position your other components using pixels, if you set the units of each component to ‘pix’.

Perhaps we can have this as an issue on GitHub, so that Form does not depend on the experiment settings screen units.

1 Like

Hey there,
I have some problems with using the form component in Psychopy3. I used the description from here: [http://www.psychopy.org/builder/components/form.html ].

Here is the created csv file which we’ve attached to our form component:

questionText questionWidth type responseWidth options layout
Have you read and understood the participant information sheet? 0.05 radio 0.05 yes,no horiz
Have you had the opportunity to ask questions and discuss the study? 0.05 radio 0.05 yes,no horiz
Have all the questions been answered satisfactorily? 0.05 radio 0.05 yes,no horiz
Have you received enough information about the study? 0.05 radio 0.05 yes,no horiz
Do you understand that you are free to withdraw from the study at any time without having to give a reason? 0.05 radio 0.05 yes,no horiz

The problems that we have:

  1. The questions did not show on the screen
  2. The answer options (YES/NO) exceeds the screen even after adjusting the responseWidth & questionWidth to 0.05
  3. How do we proceed to the next routine after answering all the questions?
    – We’ve tried adding keyboard component but it did not work.

Hope to get some suggestions soon. Thank you & have a nice day! :slight_smile:

![Untitled2|690x388]

Hi @Afrina_Athirah, with the Form component, the question and response width are proportions of 1, so you would have questionWidth as .7 and responseWidth as .3 to have questions covering 70% of the screen and responses covering 30% of the screen. Give that a go and let me know.

Hi there. I have changed the response width and question width like you suggested, the questions were displayed quite okay but the response component (yes, no) only the ‘yes’ came out but not the ‘no’. So we changed the response width to 0.1. However, to continue to the next routine, we have to add keyboard response which is the ‘spacebar’. We have to press the spacebar 5 times similar to the number of questions in the form. Is there any way that we could press the space bar one time only?

Ok, have you got the Form in a loop?

Also, if you look at the Builder demo called “BigFiveInventory”, there is a code component in there which shows you how to create a button to end the routine. Also, there is a conditional statement in the code that that only activates the button when all items are given responses.

Hi there,
I have a question about the form component too.
I would like to create a conditioning in which if the participant answered X (i.e, ‘No’) on the Y (i.e, third) question of the form, the experiment will skip the next routine.

How can I access these parameters from the data?

Hello David,
I used the Form component in my experment, I have looked at the Builder demo “BigFiveInventory” to find the code to make the button activate when all items are given responses. However, I didn’t find it.
Is it in the path onlinematerials>rating>IPIP-Johnson2014 ?
Could you please share me that demo?
Thanks in advance.

Hi @Westwood, you should find the BFI demo in the demos menu in Builder, where the button code is in one of the Builder code components. Alternatively, in the standalone PsychoPy package, you should find it in psychopy/Lib/site-packages/psychopy/demos/builder/BigFiveInventory/

Thanks for your reply, I find it!