[Script Info] Title: [Events] Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text Dialogue: 0,0:00:01.13,0:00:02.90,Default,,0000,0000,0000,,Hi. My name's John Pierce. Dialogue: 0,0:00:02.90,0:00:04.35,Default,,0000,0000,0000,,I'm a lecturer at the University of Nottingham. Dialogue: 0,0:00:04.35,0:00:07.43,Default,,0000,0000,0000,,I'm the inventor of PsychoPy. Dialogue: 0,0:00:07.43,0:00:08.65,Default,,0000,0000,0000,,In this demo, I'll show you how to Dialogue: 0,0:00:08.65,0:00:09.98,Default,,0000,0000,0000,,create a simple experiment in PsychoPy. Dialogue: 0,0:00:09.98,0:00:11.83,Default,,0000,0000,0000,,We're going to use the Stroop effect. Dialogue: 0,0:00:11.83,0:00:14.58,Default,,0000,0000,0000,,When you first start up PsychoPy, Dialogue: 0,0:00:14.58,0:00:17.29,Default,,0000,0000,0000,,you'll find two windows come open: Dialogue: 0,0:00:17.29,0:00:19.91,Default,,0000,0000,0000,,One is the builder view, which allows you to Dialogue: 0,0:00:19.91,0:00:22.28,Default,,0000,0000,0000,,construct your experiments graphically. Dialogue: 0,0:00:22.28,0:00:25.25,Default,,0000,0000,0000,,And the other is the coder view, which allows you to Dialogue: 0,0:00:25.25,0:00:27.60,Default,,0000,0000,0000,,create your experiments using Python scripts Dialogue: 0,0:00:27.60,0:00:29.80,Default,,0000,0000,0000,,if you prefer to write code directly. Dialogue: 0,0:00:29.80,0:00:32.86,Default,,0000,0000,0000,,Today we're going to be using the builder view. Dialogue: 0,0:00:32.86,0:00:37.05,Default,,0000,0000,0000,,The builder view has three panels. Dialogue: 0,0:00:37.05,0:00:41.44,Default,,0000,0000,0000,,It's got components. It's got one or more routines. Dialogue: 0,0:00:41.44,0:00:43.42,Default,,0000,0000,0000,,Here we've got a single routine called the "trial". Dialogue: 0,0:00:43.42,0:00:45.81,Default,,0000,0000,0000,,And it's got a flow which allows you to Dialogue: 0,0:00:45.81,0:00:51.98,Default,,0000,0000,0000,,combine multiple routines together. Dialogue: 0,0:00:51.98,0:00:53.78,Default,,0000,0000,0000,,In the case of the Stroop task, we'll need a Dialogue: 0,0:00:53.78,0:00:56.30,Default,,0000,0000,0000,,a text object as part of our trial Dialogue: 0,0:00:56.30,0:00:58.28,Default,,0000,0000,0000,,because we need to present a word to the subjects. Dialogue: 0,0:00:58.28,0:01:00.52,Default,,0000,0000,0000,,So, let's create a text object. Dialogue: 0,0:01:00.52,0:01:03.87,Default,,0000,0000,0000,,We'll call it "target". We'll have it start at Dialogue: 0,0:01:03.87,0:01:06.11,Default,,0000,0000,0000,,maybe naught point five seconds, Dialogue: 0,0:01:06.11,0:01:09.13,Default,,0000,0000,0000,,and it will last for five seconds. Dialogue: 0,0:01:09.13,0:01:11.63,Default,,0000,0000,0000,,Notice that each of these parameters, Dialogue: 0,0:01:11.63,0:01:14.04,Default,,0000,0000,0000,,as I hover my mouse over them, it gives me a tip to Dialogue: 0,0:01:14.04,0:01:18.44,Default,,0000,0000,0000,,inform me about what I would be expected to include. Dialogue: 0,0:01:18.44,0:01:21.37,Default,,0000,0000,0000,,There's also a help button. If I click on that, Dialogue: 0,0:01:21.37,0:01:24.38,Default,,0000,0000,0000,,I'll go to the PsychoPy web site where it will tell me Dialogue: 0,0:01:24.38,0:01:27.18,Default,,0000,0000,0000,,more detailed information about how to use Dialogue: 0,0:01:27.18,0:01:29.76,Default,,0000,0000,0000,,this particular component. Dialogue: 0,0:01:29.76,0:01:33.18,Default,,0000,0000,0000,,For now, we're not going to set color and the text Dialogue: 0,0:01:33.18,0:01:36.76,Default,,0000,0000,0000,,of this text object. We'll come back to that Dialogue: 0,0:01:36.76,0:01:39.29,Default,,0000,0000,0000,,later on. Dialogue: 0,0:01:39.29,0:01:42.70,Default,,0000,0000,0000,,Having hit "OK", we can see the text object Dialogue: 0,0:01:42.70,0:01:45.56,Default,,0000,0000,0000,,appearing in our routine and if we want to edit Dialogue: 0,0:01:45.56,0:01:48.18,Default,,0000,0000,0000,,that, we can click on the icon again and we Dialogue: 0,0:01:48.18,0:01:50.98,Default,,0000,0000,0000,,can get back and change our stimulus. Dialogue: 0,0:01:50.98,0:01:53.86,Default,,0000,0000,0000,,Maybe we want it to be for four seconds, instead of for five. Dialogue: 0,0:01:53.86,0:01:56.73,Default,,0000,0000,0000,,So it's now changed that representation. Dialogue: 0,0:01:56.73,0:02:01.22,Default,,0000,0000,0000,,We also, for the Stroop task, need for the Dialogue: 0,0:02:01.22,0:02:04.33,Default,,0000,0000,0000,,subjects to respond. So let's add a keyboard Dialogue: 0,0:02:04.33,0:02:09.95,Default,,0000,0000,0000,,to this routine. We'll call it "response". Dialogue: 0,0:02:09.95,0:02:13.46,Default,,0000,0000,0000,,We'll also start that at naught point five seconds. Dialogue: 0,0:02:13.46,0:02:14.62,Default,,0000,0000,0000,,We don't want subjects to respond before Dialogue: 0,0:02:14.62,0:02:17.18,Default,,0000,0000,0000,,the target was presented. Dialogue: 0,0:02:17.18,0:02:21.16,Default,,0000,0000,0000,,I'm going to set this to have an infinite duration. Dialogue: 0,0:02:21.16,0:02:24.34,Default,,0000,0000,0000,,If we set that to be blank, then the keyboard Dialogue: 0,0:02:24.34,0:02:26.52,Default,,0000,0000,0000,,will be available forever. Dialogue: 0,0:02:26.52,0:02:30.44,Default,,0000,0000,0000,,We're going to leave the allowed keys for now. Dialogue: 0,0:02:30.44,0:02:32.39,Default,,0000,0000,0000,,I'll come back and change those later on, Dialogue: 0,0:02:32.39,0:02:34.18,Default,,0000,0000,0000,,once we've set up our trials. Dialogue: 0,0:02:34.18,0:02:41.27,Default,,0000,0000,0000,,OK, now we that the response is going to Dialogue: 0,0:02:41.27,0:02:43.10,Default,,0000,0000,0000,,last forever. Dialogue: 0,0:02:43.10,0:02:47.39,Default,,0000,0000,0000,,So, that's roughly what one trial is going to look like Dialogue: 0,0:02:47.39,0:02:50.18,Default,,0000,0000,0000,,in the Stroop task. But we need to run more Dialogue: 0,0:02:50.18,0:02:52.22,Default,,0000,0000,0000,,than one trial and right now we've got that Dialogue: 0,0:02:52.22,0:02:54.45,Default,,0000,0000,0000,,routine appearing just once on our flow. Dialogue: 0,0:02:54.45,0:02:57.76,Default,,0000,0000,0000,,Let's insert a loop around the trial, Dialogue: 0,0:02:57.76,0:03:00.41,Default,,0000,0000,0000,,so that we can repeat it. Dialogue: 0,0:03:00.41,0:03:02.57,Default,,0000,0000,0000,,If I click on "Insert loop" just once, Dialogue: 0,0:03:02.57,0:03:05.30,Default,,0000,0000,0000,,and select, again with a single click, Dialogue: 0,0:03:05.30,0:03:08.60,Default,,0000,0000,0000,,where we want our loop to start and stop. Dialogue: 0,0:03:08.60,0:03:12.64,Default,,0000,0000,0000,,It brings up a dialog box, asking me Dialogue: 0,0:03:12.64,0:03:14.56,Default,,0000,0000,0000,,what do I want to call this loop. Dialogue: 0,0:03:14.56,0:03:16.41,Default,,0000,0000,0000,,We'll call it "trials". That's fine. Dialogue: 0,0:03:16.41,0:03:21.45,Default,,0000,0000,0000,,Should it be random or sequential in choosing the next condition? Dialogue: 0,0:03:21.45,0:03:22.96,Default,,0000,0000,0000,,Random is fine. Dialogue: 0,0:03:22.96,0:03:25.69,Default,,0000,0000,0000,,We'll have five repeats, and we need to Dialogue: 0,0:03:25.69,0:03:27.57,Default,,0000,0000,0000,,go and specify our conditions file. Dialogue: 0,0:03:27.57,0:03:30.13,Default,,0000,0000,0000,,Now, you'll notice here it's asking for a trial Dialogue: 0,0:03:30.13,0:03:33.96,Default,,0000,0000,0000,,a file that's CSV or XLSX. We need to go off Dialogue: 0,0:03:33.96,0:03:36.48,Default,,0000,0000,0000,,to Excel in order to create our file. Dialogue: 0,0:03:36.48,0:03:40.42,Default,,0000,0000,0000,,And click "OK". You'll see it insert the Dialogue: 0,0:03:40.42,0:03:42.51,Default,,0000,0000,0000,,loop around the trial. Dialogue: 0,0:03:42.51,0:03:45.48,Default,,0000,0000,0000,,Let's go and save that experiment now, Dialogue: 0,0:03:45.48,0:03:47.94,Default,,0000,0000,0000,,so that we don't lose it. Dialogue: 0,0:03:47.94,0:03:53.58,Default,,0000,0000,0000,,Save. I'm going to create a new folder on Dialogue: 0,0:03:53.58,0:04:00.62,Default,,0000,0000,0000,,my desktop called "Stroop" and maybe I'll Dialogue: 0,0:04:00.62,0:04:05.14,Default,,0000,0000,0000,,call the file "Stroop Experiment". Dialogue: 0,0:04:05.14,0:04:09.03,Default,,0000,0000,0000,,Okay. Dialogue: 0,0:04:09.03,0:04:14.46,Default,,0000,0000,0000,,The easiest way to define the conditions for Dialogue: 0,0:04:14.46,0:04:18.91,Default,,0000,0000,0000,,your experiment is to use a spreadsheet package Dialogue: 0,0:04:18.91,0:04:20.36,Default,,0000,0000,0000,,like Excel. Dialogue: 0,0:04:20.36,0:04:22.46,Default,,0000,0000,0000,,We can create a number of parameters for Dialogue: 0,0:04:22.46,0:04:25.40,Default,,0000,0000,0000,,our experiment, such as the word that we're Dialogue: 0,0:04:25.40,0:04:27.80,Default,,0000,0000,0000,,going to present, or the color that it will Dialogue: 0,0:04:27.80,0:04:30.86,Default,,0000,0000,0000,,be presented in, and we can create a number Dialogue: 0,0:04:30.86,0:04:34.06,Default,,0000,0000,0000,,of different conditions. We specify one on each row. Dialogue: 0,0:04:34.06,0:04:38.33,Default,,0000,0000,0000,,So, for the Stroop task, we might use the word "red" Dialogue: 0,0:04:38.33,0:04:43.79,Default,,0000,0000,0000,,written in red. We might have the word "red" written Dialogue: 0,0:04:43.79,0:04:48.14,Default,,0000,0000,0000,,in green. We might have the word "green" Dialogue: 0,0:04:48.14,0:04:51.28,Default,,0000,0000,0000,,written in green, etc. Dialogue: 0,0:04:51.28,0:05:04.37,Default,,0000,0000,0000,,"Green" in blue. "Blue" blue. "Blue" and red. Dialogue: 0,0:05:04.37,0:05:08.02,Default,,0000,0000,0000,,I'm going to keep track of whether or not Dialogue: 0,0:05:08.02,0:05:10.10,Default,,0000,0000,0000,,those are congruent. We don't really need to do this. Dialogue: 0,0:05:10.10,0:05:12.67,Default,,0000,0000,0000,,We could always work it out later, but it's Dialogue: 0,0:05:12.67,0:05:15.55,Default,,0000,0000,0000,,kind of convenient to have that stored as well. Dialogue: 0,0:05:15.55,0:05:17.63,Default,,0000,0000,0000,,So, congruent and I'm going to say "1"; Dialogue: 0,0:05:17.63,0:05:20.63,Default,,0000,0000,0000,,that means "true"; and "0" for "false". Dialogue: 0,0:05:20.63,0:05:25.36,Default,,0000,0000,0000,,That's just going to help us later on. Dialogue: 0,0:05:25.36,0:05:28.07,Default,,0000,0000,0000,,Now we also need to specify what's the Dialogue: 0,0:05:28.07,0:05:30.58,Default,,0000,0000,0000,,correct answer, cause PsychoPy will want to know Dialogue: 0,0:05:30.58,0:05:33.66,Default,,0000,0000,0000,,whether or not the subject got it right or wrong. Dialogue: 0,0:05:33.66,0:05:39.72,Default,,0000,0000,0000,,I'm going to call that "corrAns". Dialogue: 0,0:05:39.72,0:05:43.77,Default,,0000,0000,0000,,These parameters can't use any punctuation Dialogue: 0,0:05:43.77,0:05:47.54,Default,,0000,0000,0000,,or spaces in their names. So, I'm going to Dialogue: 0,0:05:47.54,0:05:50.58,Default,,0000,0000,0000,,take away the space and give it a capital letter Dialogue: 0,0:05:50.58,0:05:53.96,Default,,0000,0000,0000,,for, uh, to specify the correct answer. Dialogue: 0,0:05:53.96,0:05:57.34,Default,,0000,0000,0000,,In this case, we're going to use the left, Dialogue: 0,0:05:57.34,0:06:02.10,Default,,0000,0000,0000,,down, and right cursor keys from the keyboard. Dialogue: 0,0:06:02.10,0:06:05.71,Default,,0000,0000,0000,,So, I'm going to specify that red -- and remember Dialogue: 0,0:06:05.71,0:06:08.30,Default,,0000,0000,0000,,in the Stroop task that the subjects are asked Dialogue: 0,0:06:08.30,0:06:10.78,Default,,0000,0000,0000,,to report the color of the text rather than Dialogue: 0,0:06:10.78,0:06:14.09,Default,,0000,0000,0000,,the word itself. So, when the color is red, I'm Dialogue: 0,0:06:14.09,0:06:15.90,Default,,0000,0000,0000,,going to ask the subjects to press "left". Dialogue: 0,0:06:15.90,0:06:19.15,Default,,0000,0000,0000,,That's the left cursor key. Dialogue: 0,0:06:19.15,0:06:20.93,Default,,0000,0000,0000,,When it's green they should press "down". Dialogue: 0,0:06:20.93,0:06:23.43,Default,,0000,0000,0000,,"Down" again. Dialogue: 0,0:06:23.43,0:06:26.35,Default,,0000,0000,0000,,When the color's blue they should press "right". Dialogue: 0,0:06:26.35,0:06:28.29,Default,,0000,0000,0000,,"Right". Dialogue: 0,0:06:28.29,0:06:31.96,Default,,0000,0000,0000,,And now I've got red again, so they should Dialogue: 0,0:06:31.96,0:06:32.97,Default,,0000,0000,0000,,press "left". Dialogue: 0,0:06:32.97,0:06:35.81,Default,,0000,0000,0000,,Okay, that defines six different conditions Dialogue: 0,0:06:35.81,0:06:38.62,Default,,0000,0000,0000,,for our experiment with four different parameters. Dialogue: 0,0:06:38.62,0:06:41.48,Default,,0000,0000,0000,,Okay, let's save that file. Dialogue: 0,0:06:41.48,0:06:47.12,Default,,0000,0000,0000,,I'm going to put it in the same folder as my Dialogue: 0,0:06:47.12,0:06:49.47,Default,,0000,0000,0000,,experiment, although you don't have to. Dialogue: 0,0:06:49.47,0:06:52.79,Default,,0000,0000,0000,,And I'm going to call it "conditions.xlsx". Dialogue: 0,0:06:52.79,0:06:54.44,Default,,0000,0000,0000,,It's very important that you save it Dialogue: 0,0:06:54.44,0:06:58.25,Default,,0000,0000,0000,,in the XLSX format. PsychoPy can't use the old Dialogue: 0,0:06:58.25,0:07:02.47,Default,,0000,0000,0000,,XLS style spreadsheets. Dialogue: 0,0:07:02.47,0:07:07.70,Default,,0000,0000,0000,,Click "Save" and we're done. Dialogue: 0,0:07:07.70,0:07:11.76,Default,,0000,0000,0000,,So now we need to show PsychoPy where that file Dialogue: 0,0:07:11.76,0:07:14.36,Default,,0000,0000,0000,,is, and how to use it during the trials. Dialogue: 0,0:07:14.36,0:07:18.56,Default,,0000,0000,0000,,The way to do that is with the loop dialog. Dialogue: 0,0:07:18.56,0:07:21.83,Default,,0000,0000,0000,,So, if I just click on that loop again, Dialogue: 0,0:07:21.83,0:07:24.56,Default,,0000,0000,0000,,we'll get the properties back for the loop Dialogue: 0,0:07:24.56,0:07:27.31,Default,,0000,0000,0000,,and there's a conditions file. If we browse, Dialogue: 0,0:07:27.31,0:07:31.31,Default,,0000,0000,0000,,we can select our file that we've just created, Dialogue: 0,0:07:31.31,0:07:37.47,Default,,0000,0000,0000,,open that, and it's told me that there are Dialogue: 0,0:07:37.47,0:07:40.06,Default,,0000,0000,0000,,six conditions with four different parameters. Dialogue: 0,0:07:40.06,0:07:41.62,Default,,0000,0000,0000,,The parameters are color, word, congruent Dialogue: 0,0:07:41.62,0:07:43.45,Default,,0000,0000,0000,,and correct answer. Dialogue: 0,0:07:43.45,0:07:47.66,Default,,0000,0000,0000,,Ok? If the file had been invalid in some way, Dialogue: 0,0:07:47.66,0:07:49.66,Default,,0000,0000,0000,,maybe we had a space in one of our column Dialogue: 0,0:07:49.66,0:07:52.21,Default,,0000,0000,0000,,headings, then we would get a warning here to Dialogue: 0,0:07:52.21,0:07:54.22,Default,,0000,0000,0000,,say that we couldn't use that file or it Dialogue: 0,0:07:54.22,0:07:56.61,Default,,0000,0000,0000,,wouldn't show us the parameters were there. Dialogue: 0,0:07:56.61,0:07:59.88,Default,,0000,0000,0000,,Now we can select "OK". It's showing that we've Dialogue: 0,0:07:59.88,0:08:05.29,Default,,0000,0000,0000,,got five times six random trials. Dialogue: 0,0:08:05.29,0:08:09.79,Default,,0000,0000,0000,,So, five different repeats of six different conditions. Dialogue: 0,0:08:09.79,0:08:14.64,Default,,0000,0000,0000,,Okay, so the conditions file is now being set Dialogue: 0,0:08:14.64,0:08:17.05,Default,,0000,0000,0000,,here on each repeat through the loop, we use Dialogue: 0,0:08:17.05,0:08:18.38,Default,,0000,0000,0000,,a different row. Dialogue: 0,0:08:18.38,0:08:21.32,Default,,0000,0000,0000,,We still need to tell the stimulus about the Dialogue: 0,0:08:21.32,0:08:24.04,Default,,0000,0000,0000,,parameters that it needs to use. Dialogue: 0,0:08:24.04,0:08:26.31,Default,,0000,0000,0000,,We want the color of our stimulus to be set Dialogue: 0,0:08:26.31,0:08:31.24,Default,,0000,0000,0000,,by that color parameter. Now, I've typed in Dialogue: 0,0:08:31.24,0:08:35.34,Default,,0000,0000,0000,,"$colour" here, spelt with a "u" because that's Dialogue: 0,0:08:35.34,0:08:38.03,Default,,0000,0000,0000,,how we spelt it in the Excel file. Dialogue: 0,0:08:38.03,0:08:42.93,Default,,0000,0000,0000,,And that "$" is to tell PsychoPy "This isn't a Dialogue: 0,0:08:42.93,0:08:45.84,Default,,0000,0000,0000,,literal value. It's a variable." Dialogue: 0,0:08:45.84,0:08:47.77,Default,,0000,0000,0000,,Okay? So, it's going to go off and find a Dialogue: 0,0:08:47.77,0:08:50.17,Default,,0000,0000,0000,,variable called "colour" and see what the current Dialogue: 0,0:08:50.17,0:08:52.20,Default,,0000,0000,0000,,value of that variable is. Dialogue: 0,0:08:52.20,0:08:54.16,Default,,0000,0000,0000,,It's going to be red or green or blue. Dialogue: 0,0:08:54.16,0:08:58.68,Default,,0000,0000,0000,,I'm also going to set that to change on every repeat Dialogue: 0,0:08:58.68,0:09:01.49,Default,,0000,0000,0000,,rather than being constant. Dialogue: 0,0:09:01.49,0:09:03.44,Default,,0000,0000,0000,,Okay? We don't want the stimulus just to be Dialogue: 0,0:09:03.44,0:09:07.22,Default,,0000,0000,0000,,fixed to one particular color for the entire experiment. Dialogue: 0,0:09:07.22,0:09:11.24,Default,,0000,0000,0000,,Similarly, the text of this text stimulus should be Dialogue: 0,0:09:11.24,0:09:15.92,Default,,0000,0000,0000,,the word that we've specified in the Excel file Dialogue: 0,0:09:15.92,0:09:19.46,Default,,0000,0000,0000,,and it shouldn't be "word" it should be the variable Dialogue: 0,0:09:19.46,0:09:22.39,Default,,0000,0000,0000,,"word" in order to go and fetch that variable Dialogue: 0,0:09:22.39,0:09:24.51,Default,,0000,0000,0000,,which is going to be red or green or blue. Dialogue: 0,0:09:24.51,0:09:29.03,Default,,0000,0000,0000,,And, again, we want that to change on every repeat Dialogue: 0,0:09:29.03,0:09:31.09,Default,,0000,0000,0000,,of this routine. Dialogue: 0,0:09:31.09,0:09:40.66,Default,,0000,0000,0000,,Okay. We also need to set the response to be Dialogue: 0,0:09:40.66,0:09:44.97,Default,,0000,0000,0000,,based on the conditions. So I need to change Dialogue: 0,0:09:44.97,0:09:47.39,Default,,0000,0000,0000,,the keys that are going to be allowed for Dialogue: 0,0:09:47.39,0:09:49.46,Default,,0000,0000,0000,,the subject to respond with. We don't want them Dialogue: 0,0:09:49.46,0:09:52.13,Default,,0000,0000,0000,,to use the "yes" or the "no". We want them to use Dialogue: 0,0:09:52.13,0:09:57.23,Default,,0000,0000,0000,,"left", "right" and "down". So, notice that any keys Dialogue: 0,0:09:57.23,0:10:00.58,Default,,0000,0000,0000,,I want to put here I separate by commas and Dialogue: 0,0:10:00.58,0:10:05.03,Default,,0000,0000,0000,,I have to put inverted commas around the names Dialogue: 0,0:10:05.03,0:10:07.49,Default,,0000,0000,0000,,of each of the keys. Dialogue: 0,0:10:07.49,0:10:11.78,Default,,0000,0000,0000,,If I leave that blank -- the entire box -- then all keys Dialogue: 0,0:10:11.78,0:10:14.81,Default,,0000,0000,0000,,will be available. Okay? So that allows the subject Dialogue: 0,0:10:14.81,0:10:19.72,Default,,0000,0000,0000,,to press any key. I've also got "forceEndRoutine" Dialogue: 0,0:10:19.72,0:10:22.76,Default,,0000,0000,0000,,checked here. We left the response to be Dialogue: 0,0:10:22.76,0:10:26.22,Default,,0000,0000,0000,,infinite but as soon as they press any key, Dialogue: 0,0:10:26.22,0:10:28.20,Default,,0000,0000,0000,,it will force the end of that trial. Dialogue: 0,0:10:28.20,0:10:30.27,Default,,0000,0000,0000,,So that's a useful thing for us to do. Dialogue: 0,0:10:30.27,0:10:32.81,Default,,0000,0000,0000,,We're also going to want to store correct. Dialogue: 0,0:10:32.81,0:10:36.51,Default,,0000,0000,0000,,So, if I check that box, we have to tell PsychoPy Dialogue: 0,0:10:36.51,0:10:39.03,Default,,0000,0000,0000,,what is the correct answer on this trial, Dialogue: 0,0:10:39.03,0:10:43.86,Default,,0000,0000,0000,,and if you remember, that was stored as "corrAns". Dialogue: 0,0:10:43.86,0:10:48.50,Default,,0000,0000,0000,,Again, we need to use "$corrAns" to specify Dialogue: 0,0:10:48.50,0:10:52.55,Default,,0000,0000,0000,,the fact that this is a variable name not, Dialogue: 0,0:10:52.55,0:10:54.92,Default,,0000,0000,0000,,it shouldn't be looking for a key called "corrAns" Dialogue: 0,0:10:54.92,0:10:56.54,Default,,0000,0000,0000,,cause it will never find one. It's got to use Dialogue: 0,0:10:56.54,0:11:00.100,Default,,0000,0000,0000,,the variable "corrAns". And that's us done. Okay. Dialogue: 0,0:11:00.100,0:11:06.87,Default,,0000,0000,0000,,Save. Okay, we're pretty much there. Dialogue: 0,0:11:06.87,0:11:09.62,Default,,0000,0000,0000,,That should be a working experiment, but we do also Dialogue: 0,0:11:09.62,0:11:12.09,Default,,0000,0000,0000,,want to provide the subject with some instructions. Dialogue: 0,0:11:12.09,0:11:15.38,Default,,0000,0000,0000,,I'm going to insert another routine into the flow. Dialogue: 0,0:11:15.38,0:11:20.54,Default,,0000,0000,0000,,When I click that button it shows me either "new" Dialogue: 0,0:11:20.54,0:11:24.30,Default,,0000,0000,0000,,or "trial". Let's select "new" and I'll call it Dialogue: 0,0:11:24.30,0:11:31.25,Default,,0000,0000,0000,,"instructions"... if I can spell it. "Instructions". Dialogue: 0,0:11:31.25,0:11:35.55,Default,,0000,0000,0000,,It asks where I want to insert the instructions. Dialogue: 0,0:11:35.55,0:11:38.14,Default,,0000,0000,0000,,We don't want it to be here because that would Dialogue: 0,0:11:38.14,0:11:40.02,Default,,0000,0000,0000,,repeat the instructions on every trial. Dialogue: 0,0:11:40.02,0:11:43.98,Default,,0000,0000,0000,,Let's put it before the loop. And now we can click Dialogue: 0,0:11:43.98,0:11:48.58,Default,,0000,0000,0000,,on the instructions routine and we can edit that. Dialogue: 0,0:11:48.58,0:11:52.34,Default,,0000,0000,0000,,So, we're going to want another text object. Dialogue: 0,0:11:52.34,0:12:02.25,Default,,0000,0000,0000,,We're going to call that, say, "instrText", Dialogue: 0,0:12:02.25,0:12:05.83,Default,,0000,0000,0000,,start at time zero. Duration, we'll make it infinite. Dialogue: 0,0:12:05.83,0:12:11.74,Default,,0000,0000,0000,,Color white, that's fine. And we'll give it the text Dialogue: 0,0:12:11.74,0:12:27.51,Default,,0000,0000,0000,,"Remember choose the color of the letters, Dialogue: 0,0:12:27.51,0:12:33.70,Default,,0000,0000,0000,,ignoring the word: Dialogue: 0,0:12:33.70,0:12:46.96,Default,,0000,0000,0000,,left = red, down = green, right = blue. Dialogue: 0,0:12:46.96,0:12:49.04,Default,,0000,0000,0000,,Okay. Dialogue: 0,0:12:49.04,0:12:54.68,Default,,0000,0000,0000,,Now because we've made that text last forever, Dialogue: 0,0:12:54.68,0:12:56.46,Default,,0000,0000,0000,,we gave it an infinite duration, we need to make Dialogue: 0,0:12:56.46,0:12:59.02,Default,,0000,0000,0000,,sure that the subject can get rid of them. Dialogue: 0,0:12:59.02,0:13:05.41,Default,,0000,0000,0000,,So, we'll click on a keyboard, we'll allow any key, Dialogue: 0,0:13:05.41,0:13:10.15,Default,,0000,0000,0000,,we'll force the end of the routine, and we won't Dialogue: 0,0:13:10.15,0:13:12.89,Default,,0000,0000,0000,,bother storing anything. Dialogue: 0,0:13:12.89,0:13:15.80,Default,,0000,0000,0000,,We make that last forever. Dialogue: 0,0:13:15.80,0:13:18.19,Default,,0000,0000,0000,,Okay. Dialogue: 0,0:13:18.19,0:13:23.54,Default,,0000,0000,0000,,If you do get that wrong, you should always be able Dialogue: 0,0:13:23.54,0:13:25.86,Default,,0000,0000,0000,,to hit "escape" and you will still be able to quit Dialogue: 0,0:13:25.86,0:13:27.44,Default,,0000,0000,0000,,the experiment without having to Dialogue: 0,0:13:27.44,0:13:28.74,Default,,0000,0000,0000,,restart your computer. Dialogue: 0,0:13:28.74,0:13:31.08,Default,,0000,0000,0000,,Okay, I'm going to save that again. Dialogue: 0,0:13:31.08,0:13:32.59,Default,,0000,0000,0000,,I think we're done. Dialogue: 0,0:13:32.59,0:13:37.07,Default,,0000,0000,0000,,Okay, let's just have a quick look at the Dialogue: 0,0:13:37.07,0:13:39.36,Default,,0000,0000,0000,,Experiment Settings dialog box. Dialogue: 0,0:13:39.36,0:13:42.30,Default,,0000,0000,0000,,In this dialog, you can control things like whether Dialogue: 0,0:13:42.30,0:13:45.12,Default,,0000,0000,0000,,or not the mouse is visible during the experiment, Dialogue: 0,0:13:45.12,0:13:48.13,Default,,0000,0000,0000,,the color of the background of the screen, Dialogue: 0,0:13:48.13,0:13:51.42,Default,,0000,0000,0000,,whether or not it's in a window or in full screen, Dialogue: 0,0:13:51.42,0:13:54.46,Default,,0000,0000,0000,,is it "screen 1" or "screen 2" if you've got Dialogue: 0,0:13:54.46,0:13:57.03,Default,,0000,0000,0000,,multiple monitors, and what sort of data files Dialogue: 0,0:13:57.03,0:13:59.56,Default,,0000,0000,0000,,you want to save out. So, lots of useful things there Dialogue: 0,0:13:59.56,0:14:01.87,Default,,0000,0000,0000,,to control your experiment. Dialogue: 0,0:14:01.87,0:14:05.36,Default,,0000,0000,0000,,Now, at this point we could construct a script. Dialogue: 0,0:14:05.36,0:14:08.77,Default,,0000,0000,0000,,That'll allow you to go off and maybe learn a little Dialogue: 0,0:14:08.77,0:14:15.10,Default,,0000,0000,0000,,bit about how Python works. It's about 220 lines Dialogue: 0,0:14:15.10,0:14:18.28,Default,,0000,0000,0000,,long, this particular experiment. So, not too Dialogue: 0,0:14:18.28,0:14:21.78,Default,,0000,0000,0000,,complicated a script. But we don't need to. Dialogue: 0,0:14:21.78,0:14:24.83,Default,,0000,0000,0000,,We could actually go off and run our experiment Dialogue: 0,0:14:24.83,0:14:26.93,Default,,0000,0000,0000,,by hitting the green man. Dialogue: 0,0:14:26.93,0:14:31.15,Default,,0000,0000,0000,,Often takes a few seconds, especially the first time Dialogue: 0,0:14:31.15,0:14:34.74,Default,,0000,0000,0000,,you run. So, be patient with that one. Dialogue: 0,0:14:34.74,0:14:36.78,Default,,0000,0000,0000,,There we go. We've got a dialog box come up Dialogue: 0,0:14:36.78,0:14:39.60,Default,,0000,0000,0000,,asking for the participant and the session number. Dialogue: 0,0:14:39.60,0:14:42.10,Default,,0000,0000,0000,,That was also being controlled in the Experiment Dialogue: 0,0:14:42.10,0:14:43.71,Default,,0000,0000,0000,,Settings dialog. Dialogue: 0,0:14:43.71,0:14:45.36,Default,,0000,0000,0000,,I'm not actually going to run the experiment. Dialogue: 0,0:14:45.36,0:14:47.96,Default,,0000,0000,0000,,I'll leave that to you. Dialogue: 0,0:14:47.96,0:14:49.80,Default,,0000,0000,0000,,Okay. Have you found that useful? Dialogue: 0,0:14:49.80,0:14:51.82,Default,,0000,0000,0000,,Check out the Demos menu for more ideas Dialogue: 0,0:14:51.82,0:14:54.00,Default,,0000,0000,0000,,and I hope you enjoy using PsychoPy!