In the Experiment this week ( Lindgaard et al., 2011 ), participants were presented with a screenshot of a website, then asked to rate this website, using a sliding scale from very unattractive to very attractive. So far we have only created Experiments where people respond through key presses. However Inquisit has a variety of other response formats.
This week you will program this basic Experiment using two other means of collecting responses; 1) using a slider similar to the described Experiment, and 2) using a likert scale, which Lindgaard et al. (2011) sugget as an alternative to their slider.
To do this you will learn about:
trial.Like every week we are going to start a new Inquisit file for this weeks exercises. Call this file surname_wpa6.iqx. This is the file you will send me at the end of the class. I strongly recommend that you copy the defaults element from last weeks script into the top of this file, so that you have an easy way to terminate the Experiment.
In Lindgaard et al. (2011) they use screenshots of different web pages as their stimuli, and asked participants to rate the visual appeal of each. In the dropbox folder you will find screenshots of 7 web pages that we will use as our stimuli. These are the 7 homepages of the different faculties of the University of Basel, and vary substantially in their visual appeal, which is perfect for this task. They can be found in the subfolder pres1.
In wpa3 we covered how to load image stimuli, using the item element, and how to specify how these stimuli should be displayed, using the picture element. If you are unsure how to do this I suggest looking back at your code or instructions for wpa3. To save you time, I’ve supplied the code for doing this in the file helpfulcode.iqx with the image files. It is also written below.
<item faculty>
/1 = "Business.png"
/2 = "Humanities.png"
/3 = "Law.png"
/4 = "Medicine.png"
/5 = "Psychology.png"
/6 = "Science.png"
/7 = "Theology.png"
</item>
<picture faculty>
/ items = faculty
/ select = noreplace
/ position = (50%, 50%)
/ size = (100%, 100%)
</picture>
In the first version of the task, we are going to colect responses using a Slider scale. Inquisit has an element that creates a response slider (called slider, shockingly) which participants can set using the mouse. However, this element cannot be called as part of a normal trial element. Instead it belongs to a different class of trial elements, called survey elements.
So to produce the task which we want we are going to create two separate types of trials in our Experiment. On the first of these, we will use a normal trial element to present the webpage. On the second we will use a surveypage element, to present our response slider.
First we are going to create the trial for presenting the webpage, which we will call web. This has several key features; 1) Before each trial there should be a pause of 100ms, 2) At the start of the trial one webpage should be displayed for 500ms, 3) At the end of this 500ms the trial should end (i.e. timeout), 4) During the trial participants shouldn’t be able to respond to the stimuli.
Points 1-3 you should be able to implement based on previous weeks. Point 4 is new. To work out how to implement this feature, think about what happens if you press a key that isn’t listed in the validresponse attribute in one of your other Experiments? How could this be used to prevent participants from responding during the trial?
<trial web>
/stimulustimes = [0=faculty]
/timeout=500
/pretrialpause=100
</trial>
As before the pause is implemented using the pretrialpause attribute, and the end of the trial after 500ms is achieved by setting the timeout to 500ms. In this trial we have not specified any valid response. This means that no responses can trigger the end of the trial, essentially enforcing the 500ms trial length.
Up to this point we have only used the basic trial element for presenting stimuli. However Inquisit has other type of elements that can be used to present stimuli and collect responses. For instance there are several elements that are used for displaying survey type questions to participants, i.e. presenting a question then collecting a response through a text entry box, radiobutton, dropdown menu, slider etc. Just like the elements related to presenting stimuli on a trial, these elements operate in a hierarchical fashion.
At the lowest level are survey item elements that define how responses are collected, and what questions are displayed. We will use the slider element, which belongs to this class. At the next is how these indivudal questions/items are to be displayed together on the page. This is defined by using a surveypage element. Finally, at the highest level, you can optionally define how multiple surveypages should be linked together, which we won’t do, using the survey element. survey and surveypage elements can be called at the block level, just like trials.
To create a slider, we need to create a survey item of type slider. As always first look up the help file for the slider element. This element specifies an (optional) question that participants are asked to answer, and presents a response slider on the screen that they can use to make their response. Most of the atttributes of slider define how either the slider should look, or how the question should look.
For our task we wish to present the question “How attractive was that web page?”, which can be done using the caption property. We then want to present a slider which has 100 possible slider positions, and has endpoint labels of “very unattractive” and “very attractive”. The range property defines the maximum and minimum values of the slider (whch aren’t dsipalyed), and the increment property defines the space between each tickmark on the slider. the labels property lets you put labels on the slider. Try to create the slider. Call it q1 for quesiton 1.
<slider q1>
/caption = "How attractive was that web page?"
/labels=("Very Unattractive", "Very Attractive")
/range = (0, 100)
/increment = 1
</slider>
You should now have a rather small slider displayed in a weird spot on the screen. Lets place it in the middle of the screen, and make it cover about 60% of the width of the screen. You can use the position and slidersize attributes to achieve this. They work similarly to the position and size attributes of the picture element, but with one annoying difference.
<slider q1>
/caption = "How attractive was that web page?"
/labels=("Very Unattractive", "Very Attractive")
/range = (0, 100)
/increment = 1
/slidersize= (60%, 10%)
/position = (20%, 50%)
</slider>
The slidersize property functions exactly how you expect. But if I set the position to (50%, 50%), as I would for a picture, it displays the slider on the right of the screen. This is because all survey elements are assumed (and forced) to be left aligned, so if I use (50%, 50%) the left edge of the slider is at the center of the screen, not the center of the slider. Therefore you need to adjust the position based on the size of the slider (e.g. setting the horizontal position to 20% means there should be 20% of the screen left on each side. Although this doesnt work perfectly.
Now we need to create a survey page to display our suvery item. Crete a surveypage element called slider. Have a look at the help file. The most important attribute for this element is the questions attribute. This works in a similar way to the stimulustimes attribute of a trial, or the trials attribute of a block, or the blocks attribute of expt. it lets us specify which suvery items, or questions, should be displayed on the page, and in what order. In our case we just want to display our slider questions q1.
There are other attributes we could also change, some that you might want to play around with are: finishlabel which determines what is shown on the button participants need to press when they finish the page; showquestionnumbers which shows the question number if set to true; showpagenumbers which similarly determines whether the surveypage number (in this case always 1), should be shown; captions which is similar to the captions command for ourslider` element, but places text at the start of the page before the individual question text.
<surveypage slider>
/caption = "How attractive was that web page?"
/ questions=[1=q1]
/ showbackbutton=false
/ finishlabel="Next"
/showpagenumbers=false
/showquestionnumbers=false
</surveypage>
Now we need to set it up so that following the presentation of our stimulus (i.e. trial web), the response slider is collected (i.e. surveypage slider). In previous weeks we have discussed how you can set the order of presentation of different trials. This is always done at the block level, using the trials attribute. Fortunately, the surveypage element can be called in trials, just like any other trial.
To start with create a block element that just runs a single “trial” of our task. In this case a singletrial, should be a sequential presentation of a trial web element and surveypage slider element. There are two ways to do this.
Less flexible way:
<block transfer>
/trials = [1=web; 2=slider]
</block>
This will present one random web page, followed by 1 slider page. The webpage is determined randomly as we have set select to noreplac ein the picture element.
Flexible way:
<block transfer>
/trials = [1-2=sequence(web, slider)]
</block>
This has the same effect as the previous code. By using sequence for our selection method here we insure that our code will first select a web trial, then a slider page. It wont just do this once, it will always do this, alternativing between web and slider elements.
Now alter your code so that instead all 7 trials are presented, in random order.
<block transfer>
/trials = [1-14=sequence(web, slider)]
</block>
All we need do is replace 2 with 14 (the number of total trials i.e. 7 web and 7 slider). As mentioned above using sequence insures that Inquisit alternates between web and slider elements, while setting select to noreplace at the picture level insures that all 7 web pages are shown before any are repeated. For the slider, it is the same for every trial, so we dont need to think about selection or matching.
The authors also discussed using a likert scale instead of a slider to collect responses. For the type of task we wish to create this is actually much easierto achieve in Inquisit. Inquisit has several specialised trial types, that work almost identically to the normal trial element, but have special features. For instance the likert element takes most of the same attributes as the trial element. But it also by default displays a likert scale on the screen, where participants can indicate their preferences using either the mouse, or by typing the matching number of the position on the scale they wish to enter.
We will use the likert trial, to program an alternative version of our study, where both the stimuli (web page) and response (likert scale) will be presented as a single element.
The first step is to create our likert element. As I said, this is a special type of trial element. So we can just copy our trial element from above, and change the tags (i.e. <trial> and </trial>) to likert instead. We will also rename it so that it is called both (as it displays both stimuli and response).
<likert both>
/stimulustimes = [0=faculty]
/timeout=500
/pretrialpause=100
</likert>
We also need to change our block element so that it calls both rather than web and slider. How many trials will we need for this version in the block?
7 as we know longer have seperate stimulus and response elements.
<block test>
/trials = [1-7=both]
</block>
Run your Experiment now. What happens?
It should work, but the trials timeout after 500 ms, and the likert scale is superimposed on the web page.
Rather than having our trial end after 500ms, we instead want the stimuli (i.e. web page) to dissapear, but the likert scale to stay on the screen until the participant chooses to response. You should know how to remove the trial end time. To remove the web page from the screeen, we discovered in week 4 that you need to obscure it with ablank stimuli. For a refrecher on this check out the How to erase stimuli page. I suggest using the shape element (a stimuli element like picture or text) which can create a shape (e.g. a square) of any colour and size. If you created white rectangle the size of the screen, this would effectively block out the web page. When would our newly created shape stimulus need to be presented (in stimulustimes)?
<shape blank>
/color=white
/size=(100%, 100%)
/position=(50%, 50%)
</shape>
<likert both>
/stimulustimes = [0=faculty; 500=blank]
/pretrialpause=100
</likert>
Our blank shape should appear after 500 ms.
No we should have a trial where a webpage is shown for 500ms, then a blank page is shown with the likert scale (very compressed with 5 points) in the center. Why is the likert scale not also superimposed on the web page anymore?
Remember that by default Inquisit only starts collecting responses after all stimuli have been shown. In this case the likert scale is how we are collecting responses, so it is only displayed once all stimuli have been shown - i.e. only after the blank stimuli has been shown.
Currently our sclae looks very ugly. We are going to change it so that it has 9 points, with labels only on the two endpoints (“very unattractive” and “very attractive”), and so that it is bit more spread out.
Adjusting the number of points is very easy. There is an attribute called numpoints which defines the number of points (it just accepts an integer as an inpoint).
<likert both>
/stimulustimes = [0=faculty; 500=blank]
/pretrialpause=100
/numpoints=9
</likert>
On Likert scales our labels are referred to as anchors. These labels can be set using the anchors attribute. Inputs to this attribute are the same format as the trials attribute of a block, in that it is a list of the labels for each anchor. if your scale has 9 points you can set up to 9 anchors, however you can also give labels to only a subset of anchors if you like. Try using different subsets to get a feel for how it works.
This version just has the endpoint anchors
<likert both>
/stimulustimes = [0=faculty; 500=blank]
/pretrialpause=100
/ anchors=[1="very unattractive";9="very attractive"]
/numpoints=9
</likert>
Finally we can set the width of the likert scale, by specifying how much space there should be between each point, using the anchorwidth attribute. This can accept values in pixels or percents like most size attributes. Play around with different values (I suggest using percents).
<likert both>
/stimulustimes = [0=faculty; 500=blank]
/pretrialpause=100
/ anchors=[1="very unattractive";9="very attractive"]
/ position=(50%, 50%)
/numpoints=9
/ anchorwidth=5%
</likert>
There are a variety of other attributes, such as a position attribute, tht only effects the position of the likert scale, not the stimuli, as those are defined at a lower level (i.e. in pictures).
<likert both>
/stimulustimes = [0=faculty; 500=blank]
/pretrialpause=100
/ anchors=[1="very unattractive";9="very attractive"]
/ position=(50%, 80%)
/numpoints=9
/ anchorwidth=5%
</likert>
You now have two working versions of your study. For further exercises I suggest adding an instruction/question text to your likert version of the experiment, similar to the text that appears on the slider version.
Apart from that, you can leave, or work on your presentation or on your final project (if you have done your presentation).
Alter your likert code so that the prompt “How attractive was that web page?” appears at the same time as your likert scale, at the top of the screen.
<text prompt>
/items=("How attractive was that web page?")
/position = (50%, 20%)
/hjustify = center
/fontstyle=("Arial", 7%)
</text>
<likert both>
/stimulustimes = [0=faculty; 500=blank; 500=prompt]
/pretrialpause=100
/ anchors=[1="very unattractive";9="very attractive"]
/ position=(50%, 80%)
/numpoints=9
/ anchorwidth=5%
</likert>