What is the best way everyone has found to record demographic data? I only need age and gender to be recorded before my experiment.
thanks!
What is the best way everyone has found to record demographic data? I only need age and gender to be recorded before my experiment.
thanks!
Hello,
I would say the easier way to do it is simply adding Experiment Info
, especially because you only have 2 generic questions.
https://www.psychopy.org/builder/settings.html
filename = thisDir + os.sep + uâdata/%s%s_%sâ % (expInfo[âparticipantâ], expName, expInfo[âdateâ])
KeyError: âparticipantâ
################ Experi
this is the error code received after entering in age and gender
Normally, when nothing is changed, PsychoPy asks for a Participant ID in this Experiment Info Dialogue. It then uses this ID in the file names for data output.
When removing the participant entry from the Experiment Info Dialogue, PsychoPy does not generate the ID anymore. So you have to change the way PsychoPy generates file names for data output: You have to tell PsychoPy that it should not use the participant ID for file names.
Go to experiment Settings â Data and change the Data Filename entry to
u'data/%s_%s' % (expName, expInfo['date'])
Alternativley, add the Participant ID back to the Experiment Info Dialogue by readding a field labeld participant
with f"{randint(0, 999999):06.0f}"
as the default option:
Is there an option before selecting the gender (male or female) to have a grey-shaded option where it says âPlease selectâ instead of the currently displayed pre-selected option âmaleâ as that could have some participants falsely give wrong data, meaning that it would not allow proceeding with the experiment until the participant has selected their option (gender)?
Also, is there an option to make the field required in order for the participant to proceed with the experiment? I have seen a forum thread saying that putting the "" after the variable would resolve it (for example gender), but that does not seem to be legitimate (does not work).
You could put something like
['Please select','Woman','Man','Non-binary','Other','Prefer not to say']
If gender* doesnât work (it should work online but not locally) you could add a routine in the experiment to check that expInfo[âgenderâ} != âPlease selectâ
Thank you for your response! Also did help me, though I would like to elaborate on an issue I keep having:
I obviously understand how to put the âPlease selectâ option within the settings, but not sure where I would place the expInfo[âgenderâ} != âPlease selectâ option, like in which coding (i.e., Before Experiment/Before Routine)? Would there need to be any other coding before this code? Because I have tried placing it in a code and it sent me this error message: /* Syntax Error: Fix Python code */
Thanks