Sie sind auf Seite 1von 21

Conducting Experiments Using Opus Professional

Arnoud Plantinga

October 11, 2012

Contents

Contents 1 Introduction 1.1 What is Opus Professional? . 1.2 The Purpose of This Manual 1.3 Overview . . . . . . . . . . . 1.4 Some Basic Settings . . . . . 2 My First Publication 2.1 Creating a Publication . 2.2 Adding Text . . . . . . 2.3 Adding Images . . . . . 2.4 Creating Buttons . . . . 2.5 Asking about Gender . 2.6 Asking for Age . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2 3 3 3 4 4 6 6 7 7 8 9 10 13 13 15 16 18 19 19 19 20 21

3 Likert Scales 3.1 Creating a Likert Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 Several Questions on One Page . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Using a Loop to Quickly Create Questions . . . . . . . . . . . . . . . . . . . 4 Creating Conditions 5 Master Pages 5.1 Using Master Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 Scripts in Master Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Authorware vs. Opus Pro Index

Chapter 1 Introduction

1.1

What is Opus Professional?

Basically, Opus Professional (from here on referred to as Opus) is a program to make other programs. It is a very versatile program; you could use it to make presentations, educational materials, games, or to conduct experiments (surprise!). You could also make all these things by using a programming language (i.e., by typing long lines of code), but Opus just makes it a bit easier. There are other programs that do the same thing. For example, you might be familiar with Authorware (if you are, check out Chapter 6 for the dierences and similarities). Qualtrics is another alternative, although a lot more limited in features. I believe that Opus has a nice balance between versatility and learning curve.

1.2

The Purpose of This Manual

You can nd lot (perhaps all) that you read in this manual also in the manual Opus provides (go to Help Contents & Index to see it). However, whereas Opus provides more of a reference manual, this manual will take you step by step through the process of creating your program. In addition, it is focused on creating experiments. Nevertheless, the manual Opus provides a very handy reference guide, so Id advise you to use it to nd info about particular subjects. Besides this manual and the Opus manual, another great way to learn how to use Opus is to look at things others have created. This can save you a lot of time trying to reinvent the wheel. A great resource is digitalgrapevine.info, a forum of Opus users where you can nd tutorials, downloads, and questions.

CHAPTER 1. INTRODUCTION

1.3

Overview

In the screenshot of Opus above, there are 4 important areas: 1. Page View: This is where you edit the content of your pages. Here you will add buttons, text, images, etc. 2. Organiser: This part shows the chapters and pages of your publication. 3. Tools toolbar: This toolbar shows the dierent tools you can use, for example, for creating text, buttons, images, etc. 4. Main toolbar: There are some familiar buttons here, such as for creating, opening, or saving a le. To the right of those are some important buttons to control your publication.

1.4

Some Basic Settings

Before we start using Opus were going to have a quick look at some basic settings. The following settings are the ones I use, you should of course choose the settings according to your personal taste. Go to T ools Options. There are a lot of dierent settings here, but Ill highlight the most important ones. If youre completely new to the program, Id advise you to change them to the recommended settings because this manual will assume that you have.

General
In the General part I have the Default Page Size set to 1024 768, because thats a resolution that most modern computer support. Opus will by default note scale your publication, but automatically draw a black border around it. This is nice, because it will keep the size of your text, buttons, and so on constant across computers.

1.4. SOME BASIC SETTINGS

Furthermore, in Object Properties Ive deselected both checkboxes to prevent Opus from automatically showing some screens.

Spelling
In the Spelling part Ive disabled Check spelling as you type, because most of the time Im not typing in English.

View
In V iew General, Ive enabled Single mouse click in Organizer window will open page view to save me some mouse clicks. I have disabled Use Notes View because I never use notes, so this will save me some valuable screen space.

Chapter 2 My First Publication

This chapter will show you how to: create a publication, add images, text, and buttons, and create questions about gender and age.

2.1

Creating a Publication

Lets create our rst Publication! Go to File N ew P ublication or click on this icon: . Now, you should see something like this:

2.2. ADDING TEXT

On the left side in the Organiser, you see a little book with the word Untitled1 next to it. This is your publication, which is now called Untitled1. You can change the title by clicking on Untitled1 twice. Inside your publication there is now one chapter called Chapter_1. You can divide your publication in as many chapters as you want, which is handy mostly to get a good overview of your publication. You create your program in Opus by editing pages, which are a bit like slides of a presentation. On the page, which is displayed in the Page View, you will place your text, buttons, and so on. You can get a better view of your page by clicking the arrow next to 100% and selecting Fit. Inside Pages you will create Objects. Objects can be pieces of text, buttons, images, shapes, etc.

2.2

Adding Text

Now we can add some text to our rst page by using the Create Text tool. Click on the icon and click somewhere on the page where you want to place your text. Now, you can enter any text you want. For example, enter Welcome to this experiment!. When youre entering text, a toolbar will appear with familiar tools to edit your text, such as font, size, boldface, etc. To see what the experiment will look like for your participants, you can preview your publication. You can preview starting with the current page by clicking this button or pressing F5, or you can preview starting at the rst page in your publication by clicking this button or pressing F4.

2.3

Adding Images

Similarly, we can add images by using the Create Image tool. Select the Create Image icon and click somewhere on the page, or drag to create an image of a certain size. To select an image on your computer that you want to use, double click on the new image object and click Browse. . . . For example, insert a nice logo to make the welcome page look a bit more ocial. There are several options for displaying the picture: 1. Fixed: The picture will retain its original size. 2. Tile: The picture will also retain its original size, and will be shown several times when the area is big enough. 3. Centred: The picture retains its size and is centred in the picture area. 4. Scale to t: The picture will be scaled to the picture area, while optionally keeping its original aspect ratio (using the Keep Aspect option). You can use the Transparent option to remove a single-color background from your picture. Finally, the Enable Bilinear Resample option smoothens the picture a bit.

CHAPTER 2. MY FIRST PUBLICATION When youve added an image to your publication and you hit the save button, Opus will ask you whether you want to "consolidate this publications resources". Its a good idea to press the Yes button, as this will save all the resources (images, movies, sounds) in your publication into a separate folder called < Y our P ublication sname > \Resources. When you copy your publication to another computer, make sure to copy this folder as well, so that you have all the images, movies, and sounds you need.1

2.4

Creating Buttons

To create a button, simply click the Create Button icon and click somewhere on your page. You can now label the button, for example, label it Continue. You might have to resize the button a bit in order for the text to t in. Its always a good idea to name your pages and objects. In the organiser pane on the left, you can change the names of your pages and objects by clicking twice on their names. For example, rename your rst page to Introduction. In order to make clicking this button advance to the next page, we need to add some actions to it. You can tell Opus what to do by binding a certain trigger (e.g., a left mouse click) to a certain action (e.g., go to the next page). We can add actions by Rightclick Edit Actions or by pressing Ctrl + E. When youre in the actions view, on the left you can see the trigger for the current object. For a button, the default trigger is Left Mouse Click. This means that if the participant clicks with his left mouse button on this particular button, the action will be executed. Although the Left Mouse Click trigger for buttons works ne most of the time, I advise you to use only the Left Mouse Down trigger. When using the rst, the action is not executed when the participant presses his mouse button when the cursor is above the button, but releases it somewhere else. However, the button does go down, so the participant doesnt realize that his response has not yet been registered. The Left Mouse Down trigger circumvents this problem by immediately executing the action when the participant presses his mouse button when the cursor is above the button. Change the trigger to Left Mouse Down by rst deleting the Left Mouse Click trigger, and then selecting T riggers Mouse Lef t Mouse Down. At the moment this trigger does not have any actions. We can add an action by clicking the Actions tab on the right, and double-clicking on one of the actions. We would like this button to continue to the next page, so we double-click Go to Page. Next, you can tell Opus to which page you want the button to go, but the default is textitForward (which means the page below this one in the organiser), so thats ne for now. At the moment there is only one page, so we have to add a new page by clicking the New Page button:
1 When

. Now you can try your publication again using the Preview Button

youre frequently working on dierent computers, its a lot easier to use a service like Dropbox to synchronize les across computers.

2.5. ASKING ABOUT GENDER

2.5

Asking about Gender

Lets ask our participant about his/her gender! Rename your second page to Gender, and add two buttons to your second page, and label one of them Male and the other Female. Now, in order to save the participants gender, we will save the participants choice in a variable. First, go to the actions view for the Male button. Now select the action P rogramming V ariables SetV ariable:

Now there should be an action added to the Left Mouse Down trigger and you should be at the Set Variable tab. You can now create a new variable by clicking the New. . . button. Type in a name for your new variable (e.g., sex), set the initial value to N umber 0.00, and click OK. Now youll see that the Variable box says sex. When previewing your publication, you can view the value of variables to see if they change properly. To do this, open the Script Console by clicking V iew Script Console. Click on the tab Variable Watch, and add a variable by right clicking in the Script Console and selecting Add Watch, and select the variable you want to monitor. When you preview your publication, youll see the value of the variable in the Script Console.

Below that box, you can tell Opus which value it should assign to the variable sex. In this case, we want Opus to set the variable sex to 1 when the participant clicks Male, so we click Number and enter 1 in the box on the right. You can leave the Overwrite current content box checked, as we want to replace the default value (0) by a new value (1). Now click OK and follow the same procedure for the Female button, but assign the value 2 instead of 1 to the variable sex. When you preview this page, you might notice that when you click one of the buttons, it does not stay down. To make the buttons stay down after youve clicked them, we have to convert them to radio buttons. For a group of radio buttons, only one of the buttons can be down at a time. This means that if the participant rst clicks the Male button and then the Female button, the Male button will go up again. If you want participants to be able to select several options, you can convert the buttons to checkboxes. To set the button type, go to the Properties of one of the buttons either by Rightclick P roperties or by pressing Ctrl + R. In the Tab Button you can choose for Push Button (the default), Checkbox, or Radio Button. Choose Radio Button and do not change the group. When you have several questions with radio buttons on one page, youll have to assign each set of radio buttons to a dierent group. In this case we have only one question with two radio buttons, so well assign them each to group 1. Now do the same for the other button and preview the page. Youll see that one and only one of the buttons will stay down!

10

CHAPTER 2. MY FIRST PUBLICATION

Displaying the Continue button


We should give the participants a way to continue to the next page. A simple way of doing that is by simply copying and pasting the Continue button we created earlier. Select the button in the organiser pane, or go back to the rst page and simply click on the button on the page view. Youll see that when you paste the button into your second page, itll be in exactly the same position as the button on the rst page. However, we want to prevent that participants continue to the next page without answering our question! We can do that by telling Opus to hide the button, until the participant has clicked on one of the buttons: 1. Go to the properties of your button object, and select the General tab. Click the checkbox Initially hidden. This will make sure that the button is initially not shown on the screen. 2. Close the button properties, and go to the Actions screen of the page. Now add the trigger Advanced V ariable Changed. This trigger executes an action whenever the value of a certain variable changes while the participant is on this screen. 3. Select the variable sex in the dropdown list. 4. Go to the Actions tab and add a Show action. Now you can choose which items you want the action to show. Click the checkbox next to your Continue button. Now preview your publication, and you should see that the Continue button is hidden, until you click one of the two buttons!

2.6

Asking for Age

Now that we know our participants gender, lets about their age. We can do that using an Input Box, with which you can ask participants to enter text, numbers, or a combination of both. Create a new page and name it Age. Select the Text Input Box tool and click or drag somewhere on the page. Now open the properties of the input box and go to the Text Input tab. There are a lot of options here; Ill highlight the most important ones for now.

2.6. ASKING FOR AGE

11

In the upper part you can select the variable to which the text the participant enters is saved. You can either select a preexisting variable from the dropdown list, or create a new one. Always make sure that the variables you use to store input information have an empty initial value, because otherwise the participant will see the initial value of the variable in the input box. You can do this by creating a new variable and selecting the Text option as the initial value. Click New, and create a new variable named age. Leave the initial value as Text and click OK. In the Limit Input part we can specify what type of characters participants can enter. Because we are interested in the participants age at this point, you can uncheck Allow special characters and symbols and Allow letters. You can also limit the length of the participants response to 2, so that they can only enter two characters at most. Finally, check the box Auto focus. This will make sure that when partcipants enter the page, they can immediately start typing in the input box, without having to click the box rst. There are two ways in which we can allow participants to go to the next page; we can show a Continue button or tell them to press enter. When we use the rst method, you should again only let the button appear when the participant has entered something in the Input box. Similarly to when we were asking about gender, you can add a Variable changed trigger, but now for the variable age. To make Enter go to the next page, well have to add a new trigger to the Input box. Add the trigger Advanced Key P ress. This trigger activates when either a random or a specic key is pressed. You can set the specic key by clicking on the white box next to Specic Key = and, in this case, pressing Enter. With the Use Modiers option you can create combination such as Control + T , but well leave that unchecked for now. Now we could simply add a Go to P age < Forward > action. However, we need to make sure that participants have actually entered there age. We can check whether theyve done so by using the If action. Just like in any programming language, the If action checks whether a particular condition is true, and executes the action when it is. Now add the P rogramming If action. Because we have to test the length of the variable age instead of just its value, well have to use an advanced condition. Select Use advanced condition in the dropdown box below Test. In the white box below it, enter the following text: length(age)>1 This code basically tells Opus to execute the action under the If statement only if the length of the variable age is greater than 1. Now add a Go to P age < Forward > action under the If action. Now you should see something like this:

12

CHAPTER 2. MY FIRST PUBLICATION

If you now preview this page, nothing should happen when you press enter after entering no or only one number, but you should go to the next page when youve entered two numbers.

Chapter 3 Likert Scales

Now that we know our participants gender and age, we can start asking some more interesting questions. This chapter will show you how to create Likert scales.

3.1

Creating a Likert Scale

Were going to ask participants how happy they feel at the moment, on a scale of 1 to 7. Create a new page and name it Happiness, for example. Now add a button of about 50 50 pixels, and label it 1 (you might have to increase the font size a bit). In the buttons properties, select Radio Button in the Button tab. Now open the buttons action view, and add the Left Mouse Down trigger. Add the action P rogramming V ariables Set V ariable. Create a new variable named question1 with an initial value of 0, and under Set this variable to the following, click on Number and enter the number 1 in the eld to the right. When the participant now clicks on this button, the variable question1 will be set to 1. The action view should now look like this:

13

14

CHAPTER 3. LIKERT SCALES

Now duplicate this button 6 times, either by using Right click Duplicate or pressing Ctrl + D. Drag the buttons and place them on a line next to each other. You can easily align objects by using the Alignment toolbar. Open it by clicking V iew T oolbars and clicking the checkbox next to Alignment. You can now space your 7 buttons evenly across the page by dragging one of them to the far right, then selecting all the buttons and clicking the Space Evenly Across icon . You can centre the buttons horizontally by using the Align Centres Horizontally tool . If you want to centre the group of buttons horizontally and vertically on the page, rst group the buttons by selecting them and selecting Right Click Group Group Objects or pressing Ctrl + G. Now click the Align Centres icon .

Use the alignment toolbar often to create more professional looking publications.

Now change the labels of the buttons to 2, 3, 4, etc., and add a few Text Objects to the page to display the question and two anchors. Youre page should now look like the picture on the right. Now we only have to change each buttons actions, so that when the participant clicks on button 2, the value of question1 will be set to 2. For each button, open the actions view and change the Set Variable so that question1 is set to the appropriate value. Now we have created 7 buttons, each of which sets question1 to a dierent value. Why didnt we give the variable a bit more logical name, like happiness, for example? Imagine that this question is part of a long list of questions about mood, and is followed by questions about anger, sadness, etc. Then we would have to copy this page and change the Set Variable action in every button to change the variable anger instead of happiness! To circumvent this problem, well use question1 as a temporary variable, and save the answer to the actual variable when participant clicks the Continue button. Copy the Continue button from a previous page and open its actions view. Add a Set Variable action (make sure it is executed before the Go to Page action!) and create a new variable happiness with an initial value of 0. Now choose to set this variable to a variable, and select question1 from the dropdown list. This means that, in this case, the variable happiness will take on whatever value question1 has at that moment. To reset the value of question1, add another Set Variable action and set the value of question1 to 0. This will make sure that the value of question1 is not automatically assigned to other variables in upcoming questions.

3.2. SEVERAL QUESTIONS ON ONE PAGE

15

Displaying the Continue button


To display the Continue button only when the participant has clicked on of the 7 Likert scale buttons, go to the actions view of the page, add an Advanced V ariable Changed trigger, and choose the variable question1. Add a Show action and select the Continue button. Now preview the page and try out all the buttons. The Continue button should only appear after youve clicked one of the buttons. You can use the Script Console (see the tip on page 9 for how to use the Script Console) to check whether the value of question1 changes appropriately when you click the buttons.

Creating More Questions


If you want to create more questions, such as a question about anger, simply copy this page. The only things you need to change are: the name of the page (e.g., Anger), the question text (e.g., How angry do you feel at the moment) the Set Variable action in the Continue button (e.g., anger=question1), and the anchors, when necessary.)

3.2

Several Questions on One Page

To create several Likert scale questions on one page, rst copy your page with one Likert scale and name it (e.g., Happiness_Anger). Now copy the 7 buttons, the question, and the anchor and move it to a convenient spot on the page. While keeping all of your newly created buttons selected, go to their properties and to the Button tab. Change the Group to 2. This will make sure that clicking a button from the second question will not inuence the buttons from the rst question. Now change all the Set Variable actions to adjust the value of question2 instead of question1. Change the question and the anchors Text Objects and add a Set Variable action to the Continue button, that sets anger to the value of question2. In order to make the display button appear only when the participant has answered both questions, we need to change the triggers and actions that weve attached to the page. Open the actions view for the page. There are dierent triggers we could use. For example, we could add a trigger V ariable Changed question2, checking whether the participant has answered the last question. However, we can also check whether the participant has answered all questions. Add a Left Mouse Click trigger, and then add an If action. Select Use advanced condition, and enter the following text in the white box: question1>0 & question2>0 This will check whether both question1 has a value bigger than 0 and question2 has a value bigger than 0. Then add a Show action to the If action, and set it to show your Continue button. If you now preview your publication, the Continue button should only

16

CHAPTER 3. LIKERT SCALES

show up when youve answered both questions, regardless of the order in which you answer the questions. If you want the participant to go to the next page only when theyve answered your questions correctly, simply change the condition of the If action. For example, if the right answers are 3 and 4, change the code to: question1==3 & question==4(you have to use a two = signs because you want to compare values, instead of assigning them.) If you want to create more than two Likert scales on page, simply repeat the same procedure using variables question3, question4, and so on.

3.3

Using a Loop to Quickly Create Questions

Using one of the pages with Likert scales we could create a scale by copying the pages, changing the question text in each of them, changing the Set Variable action in the Continue button. While this is ne for creating short scales, it could get tiring and chaotic when creating longer scales. In this part Ill show you how to loop through the same page several times, changing the question every time the participant visits the page again. First copy one of your pages with one Likert scale and name the new page to something like Likert Loop. Click twice on your question text to edit it, delete all the text, and then choose Right Click Insert V ariable. With this tool you can display the value of a certain variable inside a text. Create a new variable question with an initial empty value. Now well add a script which changes the question variable every time the participant visits the page. First well create some new variables. Go to P ublication P ublication P roperties V ariables. Here you can see an overview of all the variables in your publication. If you check the Hide system vars checkbox the variables that are included in every publication by default (such as todays date) will be hidden, and youll see all the variables youve created. Create the following variables by using the Add button: Variable question_num question_text mood Initial value Number (0) Array Array

To cycle through a list of questions well create an array. An array is basically a numbered list of data. Well use question_text to store the dierent questions were going to ask our participants, and well use mood to store the answers they give to the dierent questions. Opus has three dierent sorts of data that can be assigned to variables: numbers, strings and arrays. You can do all kinds of mathematical operations (e.g., addition, multiplication, etc.) on numbers but not on strings. You can use arrays by referring to a certain position, e.g. newarray[0] refers to the rst element of the array newarray, whereas newarray[1] refers to the second element, and so on.

3.3. USING A LOOP TO QUICKLY CREATE QUESTIONS

17

Add a Script to the page by clicking the Script Object icon . A script object that is attached to a page will immediately execute the code inside it once the page is loaded. Paste the following code inside the script object: question_text[0] = "How happy do you feel at the moment?" question_text[1] = "How angry do you feel at the moment?" question_text[2] = "How sad do you feel at the moment?" question=question_text[question_num] The rst three lines create 3 elements in the array question_text. The last line assigns the value of element with the number equal to question_num to the variable we use to display the question. Now open the Actions view for the Continue button. Were going to add a big chain of actions to the Left Mouse Down trigger. First add a script by clicking P rogramming Script and enter the following text: mood[question_num]=question1 This way, we save the answers participants give to another array, mood. Every time Opus runs through the loop, a new answer is added to the array at position question_num. Now add an P rogramming If action and set it to Use advanced condition. Enter the following text: question_num<question_text.length-1 To this If action well add the actions that should be executed when the participant has not yet seen all of the questions. The code checks whether the number of questions the participant has already seen is still smaller than the total number of questions. Now add the following actions to the If action: P rogramming V ariables Set V ariable: question1 = 0 P rogramming V ariables Add: Add 1 to question_num Actions Go to P age < Current P age (Reset) > When the participant has not seen all questions yet, question1 will be reset, question_num will be increased by 1, and the current page is reset. The last action makes sure that the variable question is set to a dierent element of question_text. Now add a P rogramming Else action to the If action. This action will be executed whenever the If action is not. In this case, it will be executed when the participant has seen all the questions from our list. Add the following actions to the Else action: P rogramming V ariables Set V ariable: question1 = 0 P rogramming V ariables Set V ariable: question_num = 0 Actions Go to P age < Forward > This will reset both question1 and question_num and continue to the next page.

Chapter 4 Creating Conditions

18

Chapter 5 Master Pages

5.1 5.2

Using Master Pages Scripts in Master Pages

19

Chapter 6 Authorware vs. Opus Pro

20

Index

Buttons, 8 Images, 7 Input Box, 10 Likert, 13 Loops, 15 Script Console, 9 Text, 7

21

Das könnte Ihnen auch gefallen