Replies: 1 comment 1 reply
-
You will need to add data.Gender to the data file at some point, and this is not done in the part of your script that you shared. You can do this in a number of ways. Here are two suggestions...
Hope this helps, Cai |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
hi all, i am running an experiment about face impression formation, the face stimuli are categorized into different genders and races. they are randomly presented to each participant so he/she would make a response on each face stimulus. participants' race and gender are recorded before and i want to record whether the face is in "sameRace or diffRace" and "sameSex or "diffSex" as the participants', therefore, i try to write the following codes to record whether the gender and race of the face stimulus match the participant's gender and race, I tried both methods but the output does not work. would you please help me spot out the problem? thank you so much
var ExptFaceimg = {
type: 'image-keyboard-response',
stimulus: jsPsych.timelineVariable('target_faceimg'),
trial_duration: 600,
response_ends_trial: false,
data: {
trial_set: 'face',
face_ID: jsPsych.timelineVariable('face_id'),
face_Sex: jsPsych.timelineVariable('face_sex'),
face_ethnic: jsPsych.timelineVariable('ethnic'),
},
on_finish: function(data) {
if (data.face_Sex == data.Gender) {
data.GenderMatch = "sameSex";
} else {
data.GenderMatch = "diffSex";
}
if (jsPsych.pluginAPI.compareKeys(data.face_ethnic, data.ethnicity)) {
data.RaceMatch = "sameRace";
} else {
data.RaceMatch = "diffRace";
}
//data.face_Sex indicates the sex category of the face stimulus, data.Gender indicates the sex category of the participant
//data.face_ethnic indicates the race category of the face stimulus, data.ethnicity indicates the race category of the participant
},
}
Beta Was this translation helpful? Give feedback.
All reactions