![]() So, we add a column to our spreadsheet to indicate what the correct answer is. In our experiment, the participant can press either the left or right arrow key. It is very easy to store accuracy from a keyboard in PsychoPy. When you are finished, come back to the main session and collect one run of your task so that we can talk through the data file. Make the size (letter height) of the numbers change trial.Īdd a column to the conditions spreadsheet to note if this trial is congruent (numerically larger number is also physically larger) or incongruent (numerically larger number is physically smaller).Īdd an instructions routine and a thanks routine to the experiment. By default “participant” and “session” are gathered - and these are used to set the filename of that participant. age) ¶Įvery experiment starts with a dialog box to gather some info about the participant/experiment. Let’s start by presenting a different pair of numbers on each trial and allowing the participant to press the left and right arrow keys to indicate a number. Then make sure to use that variable to set the parameter of a component on every repeat of your loop. Once we have inserted a loop we can add a spreadsheet of trials to the “conditions” field. Each header is a variable, each row corresponds to the value of that variable on each trial. ![]() If something changes trial-by-trial, we make a spreadsheet (this can be made in Excel). To present several trials, add a loop around the routine to repeat. Changing things trial-by-trial (the “conditions” file) ¶ an Inter-Trial-Interval presenting a fixation cross). Creating a routine ¶Ī Routine is the basic building block of PsychoPy experiments. To start making an experiment we add routines to our flow and add components to our routines. What makes a PsychoPy experiment? ¶Ī builder experiment has three main sections. In this demo we will work through making a Numerical Stroop task in PsychoPy. give them a separate rows in the conditions file.Building better experiments ¶ Using Builder ¶Īll the base knowledge we assume at the start of this workshop can be learned from this 15 minute video Two dot positions for each conditionįor the record, if the dot position is to be shown at each position for each image-combination, simply count each of these situations as conditions, i.e. Naturally, if the number of trials is uneven, one position will be occupied one more time than the other. ![]() Then under "begin routine" do something akin to what we did above: x = (dotPos.pop() - 0.5) * xdist # dotPos.pop() takes returns the last element while removing it from the list. Np.random.shuffle(dotPos) # randomize order Under "begin experiment", make a list with the exact length of the number of trials: dotPos = * int(round(numberOfTrials/2)) # create the correct number of left/right (coded as 0 and 1). ![]() ![]() If you want the dot to appear at each side exactly the same number of times, you can do the following in the code component: You probably want to set this to 0.5, i.e. For true randomness but only 50% probability in the limit of infinite trials, simply put this in a code component under "begin routine": x = (np.random.binomial(1, prob) - 0.5) * xdistĪnd change dot to the name of your dot stimulus, y is the vertical offset, x is the horizontal offset (here varying between trials), xdist is the distance between the dot positions, and prob is the chance of the dot appearing to the right. This is one of the cases that TrialHandler does not handle and I suspect you need to insert a code component to make this work. In your case, you want the dot position to be random, independently of image. This allows psychopy to load the images in the background so that they are ready for presentation. The timing issue can be solved by inserting an ISI period in the beginning of the trial, e.g. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |