Displaying from Datasource

Since we have just deleted our IMAGE_RESOURCE from our DISPLAY_SCREEN, the trials will now not contain any pictures. We therefore need to add the IMAGE_RESOURCE back in. But this time we don’t just want one particular picture to be shown; we want all of them shown, one at a time, to give a series of different trials.

Before we get to that, note how under the Properties panel of the SEQUENCE, it now has an Iteration Count of 4, as below:


This is because there are 4 lines (trials) in our datasource. This means that we will now see what is in the SEQUENCE four times, as it will run through everything in the SEQUENCE four times. The below sequence of events will be repeated once for each row in our datasource:




We want a different picture to be displayed for each of the four times DISPLAY_SCREEN will be run. To set this up, go to the DISPLAY_SCREEN action in your SEQUENCE and insert a new IMAGE_RESOURCE, as you did before. Select any of the four images and insert one of them, as below.

Next, select the IMAGE_RESOURCE you have just added. On the left side of the screen, you’ll see that, like everything else, the IMAGE_RESOURCE also has special properties associated with it in the Properties pane. In order to present a different image each trial, we just need to point the Source File Name to our datasource, rather than the name that it has to begin with. When you click on the Value for Source File Name, you’ll see a button with three dots appear. Click that button. It will open up a new window that will enable you to point the image name to anything you want. In this case, you want to point it to the image_name column in your datasource, as below. To do this, click on the datasource node and then double-click on the image_name column to set it as the new attribute.