[solved] Help getting started on an experiment.
I hate doing this, because I know there's a good chance that these questions will have been answered piecemeal in the forums here, but I'm in a bit more of a hurry than I like to be thanks to some consistent difficulties with E-Prime (story of my life). I created the first block of a six-block study in E-Prime, and any attempt at replicating that block for the next five results in the program crashing. So I thought I might try OpenSesame again, as it's had some updates since the last time I tried. The problem is that I was intending to have this experiment listed on my University's signup page next week, so I'm somewhat rushed.
That said, the experiment itself is simple in design, but apparently a little more difficult to program. The basic layout is this: There are 6 blocks of trials. Each block consists of 6 trials, and each trial consists of the following sequence--
Study list of 8 images, presented one at a time, randomly
Brief Two-step arithmetic problem
Test array of 4 images, presented simultaneously, in random locations
----The test array may or may not contain one of the study list images
Confidence judgment on test array choice
Re-presentation of all four test items with a visual analog scale for participants to rate the likelihood each item was in the study list
I would like to be able to explicitly specify which items appear in each study list and test array, though I would like for their presentation orders to be random.
So it would randomly select a Block [1-6], then randomly select Trials [1-6] until it exhausted all six trials, then move on to another random block.
Unfortunately for me, I'm not very familiar with OpenSesame at all. I haven't even yet figured out how to get it to perform a single trial, let alone setting up the structure for all the randomizations. I think perhaps part of that problem is that I'm used to using E-Prime, and thus might be biased to trying to do things in that manner (I had little trouble building the structure there, but the constant crashing was frustrating beyond belief). If I've not been clear enough here, I'd be happy to try explaining this again. What I would really like is just a few pointers in the right direction, such as how to get OpenSesame to randomly draw images from specified lists of images, or how I might start building the randomization structure.
I'll keep digging around the website as well. Thanks in advance for any help. I would love it if I could get up and running with an experimental software other than E-Prime... if you can't tell, I'm at least a little bit disillusioned with it.
Edit: Apologies for the bad formatting, I'm not quite familiar with the best ways to structure posts on this forum.
I'm sorry to hear about your problems with E-Prime. However, I'm afraid that this post will not get you the answers that you need, because essentially you're asking someone to build the experiment for you. The 'few pointers' that you mention, are all addressed in the tutorial, so I would recommend walking through this first. Then, when you have constructed the experiment as far as possible, and run into specific issues, please post them, and you will receive extensive help. However, I'm afraid that right now I can do little more than refer you back to the tutorial to get a basic understanding of how OpenSesame works.
Thanks for the frankness. I suppose I didn't intend for someone to do it for me, but rather direct me to a portion of a tutorial that was most applicable to this. Perhaps I didn't have as much luck as I should have looking for information because I tried to find a specific spot in the tutorial rather than starting at the beginning. I'll try that approach instead, which will probably be more beneficial in the long run anyway. If it wasn't obvious, I was just frustrated and probably a little impatient yesterday.
I figured you were frustrated, and of course I can understand that (I don't wish E-Prime on anybody). Please don't hesitate to post further questions after you have done the tutorial. You will find the forum more welcoming than it might seem now!
I do have one quick question: Every now and then, text fields do not seem to accept keyboard input. For example, sometimes when I click on an object's name to rename it, it won't let me type anything. This can be circumvented by right clicking on the item in the overview area, so that's not too much a problem. However, I've also had it happen with the "Run if" box and the "background color/foreground color" boxes in the experiment overview. Is this a normal bug in the OS X version, and is there something I can do? Thus far, I've just been saving and restarting the program.
Okay, I've got a more specific question now. I've gotten to the point where I'm ready to build the test. I figured I would use a form, using image_button widgets for the four options. However, I'm not sure how I can get it to randomly place the four images into the widgets instead of always using the same ones.
What I intended to do was to have four variables, test1-test4, and create different rows of combinations in each until all combinations of the four images were exhausted. Then I would have the program just select one of those possible "trials" per test, and use that for the rest of the test procedure. But it seems that if I create multiple rows in the variable fields, it wants the program to run all possible cycles, rather just select one of them. Is there a more elegant/appropriate way to accomplish this? This is how I did it in e-prime, for reference.
Edit: Here is how I have it set up currently, although it has yet to let me accept changes. I think I may be missing some sort of "end line" symbol, but I used the examples at http://osdoc.cogsci.nl/forms/custom-forms/ as a model.
Edit2: It seems the error I keep getting is a bug in the OS X version. I just opened it up in a virtual machine with Windows 7, and it allowed me to save it. Moving forward again.
Do I understand correctly that you want to randomly select one row from a loop table? You can do this by setting
repeatto a value smaller than 1. Say that you have 10 cycles, and set repeat to 0.1, then only 1 cycle (=row) will be executed. If the order is random, this will be a randomly selected row, otherwise it will be the first.
Other than that, your approach sounds good. A slightly more flexible alternative (not necessarily better) is described here:
Does this answer your question?
Regarding the Mac OS issues. It's very well possible that these are specific bugs in the Mac OS packaging. I'll pass this on.
Could you tell me which specific version of OpenSesame for OS X you are using (0.26 or 0.27.1 / 32-bit or 64-bit)
Sebastiann, thanks! That's what I needed to know for that. I kept trying to change the cycles field instead of repeat. I'll also check out the link to see which would be easier for me to replicate down the line for the other trials.
Daniel, I just checked, and it's version 0.27.1. And for additional reference, I'm running OS X 10.8.3. When I copied text directly from the OS X version of OpenSesame to the Windows version (also 0.27.1), the issue cleared up.
Edit: Upon checking Activity Monitor, looks like it's the 64-bit version.
Hmm. So I tried your second method because I believe it will save me a lot of time down the road, but I've hit another unusual snag. When I exit the script editor for the test form, it erases all the changes I made, even if I click "accept" or "accept and close". Here's a short youtube video demonstrating, and the script I'm trying to use beneath it (not sure if it works, since it won't let me keep it).
Sebastiaan refered you to a post in which he and Jason used Python inline scripting instead of OpenSesame script to present the form widgets. If you try to paste Python code into the form_base script editor it's not recognised as 'correct' OpenSesame script and therefore not saved when you close the editor.
If you want to use the 'second method', you should replace your form_base item by an inline_script item and paste the above Python code there. For an example, see:
For more information on how to present form widgets via Python inline scripting, see:
Did you like my answer? Feel free to
Hah, what a simple mistake to make a big deal over. Thanks again.
Is the way in which I called variables correct in this case? For example, [test1].jpg refers to a variable in the parent loop of this object, where [test1] is "apple1", and so it should fill that with "apple1.jpg". When I ran this as it was, after correcting a spacing error with the equal signs (doh!), it said it couldn't find the image [test1].jpg. Or is there something else required to get the python script to read the loop variables?
I do apologize if this is all too basic stuff. I've definitely been trying to use the resources on the site as well as asking questions here.
To make in-the-GUI-defined variables available in an inline_script item, you use a different approach than the square-bracket method, namely the experiment function
For example, if you want to use your in-the-loop-defined variable 'test1', in an inline_script item you retrieve its value like so:
So, in your case, for example:
Does that make sense?
For more info, see:
Did you like my answer? Feel free to
That made perfect sense, thank you again. Everything seems to be working except one of my four images isn't displaying, which I think may be some error I haven't figured out with the form structure. The nice thing is, I think once I finish this, the only thing I'll have to do is duplicate it and change the variables.
I think I'm down to my final two questions, and I really appreciate all the help that got me here. If I can get these two things worked out, I'll be ready to start collecting data as soon as I have participants ready.
Edit: I think I've figured out the logging issue. I was just labeling everything as "response", when I should have been defining specific variables for each response I wanted. So I think this section is okay, and I removed all the logger placement questions.
Edit 2: I was half-correct. It seems to only be logging "yes" for any of the image_button widgets when clicked. I set what I thought to be recording values for the widgets, as seen in the code below. Is this not the correct way to define the value of an image_button? What I attempted to do was to have it record the value in the loop variable "test1" to the locations "test_response" when the button is clicked. I'm having the same issue with the standard button "none", which is the not present option in the test seen below.
Second, I can't seem to get one image_button to appear in my test forms during the experiment. Here is the form's script (it should be similar to the script I posted earlier):
And here is the result in the experiment Runtime:
I'll keep plugging away at these issues in the meantime. I'm really looking forward to having this completed.
Update, in case someone comes across this on a google search and wants to set up something similar: The error regarding my missing item was because I had the list as "cols = [1,2]" in the pre-shuffle definition, when I only had two columns. When I changed that to "cols = [0,1]", the missing image_button reappeared.
I've tried several things to fix my logging problem with the image_buttons, however, and have not reached a solution for that just yet.
Great to hear that you're almost there!
I just noticed you already solved this one yourself. Just for your interest, herewith a bit of explanation:
Your list of possible column positions was:
Because in Python we start counting at 0, this list assumes that the form_base consists of at least 3 columns. However, your form_base contains only two columns:
So, simply changing the 'cols' list into
indeed makes sure that all four images will be presented, at the desired locations.
Yes, that's right. However, you changed all output variables into 'test_response' now, but then you still have the problem that the first four 'test_response' values are lost/overwritten, and the output file only contains the 'test_response' value of the last button (which is in your case the 'None of these' button). Right?
So I think it's best if you save the values from the five different buttons with five different output variables, for example by calling those variables (i.e. column headers in your output file) 'test1_response', 'test2_response', etc. The variable 'test1_response' will have the value 'yes' if this button was clicked, and the value 'no' otherwise. Note that it's not necessary to use the set_var() function for this, you can just change the name of the variable like so:
If you would like to add a variable containing the name of the clicked image to your output file as well, you could do something like the following:
Does this help? Don't hesitate to post again if something is unclear or if you have any more questions!
Did you like my answer? Feel free to
Ah, thanks, that works great. I was hung up on getting any of the buttons to fill the same variable, so much that I didn't even think of having a variable for each of them. And since the logger saves them right next to the image name (e.g. what's filling variable "test1"), the simple "yes" or "no" actually works quite well.
I think with that, this is actually ready to get started. I really appreciate all the help here, and I'm definitely looking forward to showing our lab a fully-running experiment with something other than E-Prime. And, all things considered, learning OpenSesame and building to this point took me less time (5 days) than troubleshooting the E-prime program I knew how to use (9 days).
So thanks again, all. Now to get this thing out to the subject pool.
Good to hear!
Just as a final note: When using the above-suggested Python inline code, the variable 'clicked_img' contains the name of the clicked item.
Did you like my answer? Feel free to
Yes, that works as well, : )
I did have one unexpected question turn up regarding logging. I have it logging all the responses I would like, but reaction time is not logged on the test_slide in-line script, despite telling the logger to record "time_test_slide". All that shows up under "time_test_slide" is "NA". Is there an additional piece of script needed to record reaction times on in-line script items? Or do I need to set an explicit variable for time? This isn't vital, but it would be a nice piece of data to look at, given our hypotheses.
Edit: I'm making a habit of making posts about 5 minutes too soon. I solved the problem. I believe this can, yet again, and hopefully for good, be marked as Solved. : )
Marked as solved, then