Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Prerating stimuli

Hey everybody,

currently I'm trying to set up an experiment in which affective stimuli are presented to participants. Before those stimuli are shown, I want the subjects to prerate the stimuli on a scale from 1 to 10. After they've done this, I want to select the four best and the four worst rated stimuli for each participant to use these preselected stimuli in the actual study.

Unfortunately, I have no idea how to get the collected data from the preselection task (which should be stored by a logger), choose the four best and worst stimuli and present only these ones to the subject.
Maybe someone can help me with this problem?

Thanks a lot!
Lea

Comments

  • Hello Lea,

    OK I join a script doing that as an example when rating how you like letters (well just an example!!).

    The strategy is as follow:

    • first at the very beginning of the script you see an inline where I define two lists
    list_rating = list()
    list_item = list()
    

    these lists are used to stock the items that will be rating, and their rating

    • then after each rating it appends the rating and the item to these lists in the same position
    # stock items
    list_item.append(var.Letter)
    # stock ratings
    list_rating.append(var.response_rating + 1) # doesnt change anything but since values start at 0 for the scale
    
    • then when all items have been rated and before the start of the experimental procedure there is an inline called sort_valid_items that is going to first sort the item of list_item according to their rating of list_rating. Then it selects only the first 4 ones and the last 4 ones. Then it create a list of these 8 items called item_to_present

    • then the strategy is to use the runif strategy of open sesame. The items in the loop loop_test, you will notice, are exactly the same as the one in loop_eval_item. However you can indicate to run only some of them, that is, the items in the list item_to_present. In order to do this in the sequence sequence_loop_test you just enter that:

    Well now I guess you can adapt this strategy for your experiment I guess the choice you will have to make is what to do if for instance there are more than 4 items with rating equal to 1 or to the max.

    Best,

    Sylvain

  • Hey Sylvain,

    thanks a lot for your response! I think this is working for me. :) But still one problem remains: How can I show pictures on the canvas below the question and above the scale? The pictures are in the pool and should be presented randomly.

    Best,
    Lea

  • And I want to force them to choose a number. Right now it looks as if it's possible to just click through. Sorry if these are very dull things to ask for..

  • Hey Lea,

    For showing the pictures I advice you to check this page http://osdoc.cogsci.nl/3.2/manual/forms/widgets/ . Everything is explained about the widgets, but you could do it this way:

    from libopensesame import widgets
    
    form_rating = widgets.form(exp,
        cols=3, rows=4, spacing=10, margins=(100, 100, 100, 100), theme=u'gray'
    )
    
    label = widgets.label(form_rating, text='how do you like this image? ')
    image = ImageWidget(path=pool[var.Images], adjust=True, frame=False)
    
    rating_scale = widgets.rating_scale(form_rating, nodes=['1','2', '3', '4', '5', '6', '7', '8', '9', '10'], var='response_rating')
    button_next = Button(text='Next', frame=True, center=True)
    
    form_rating.set_widget(label, (1,0))
    form_rating.set_widget(image, (1,1))
    
    form_rating.set_widget(rating_scale, (1,2))
    
    form_rating.set_widget(button_next, (1,3))
    

    And for avoiding participants to click next without any rating in the run phase you can do that:

    while var.response_rating == None:
        form_rating._exec()
    

    I modified the script with some images you can find everything in the zip there.

    Best,

    Sylvain

  • Hey Sylvain,

    thanks again!
    The images are now presented on the canvas, that's great! :)

    Now I have another problem (never ending story, I'm sorry!):
    Changing "Run if" to "=var.Image in var.item_to_present" makes the experminet jump directly to the end_of_experiment-sketchpad. It would be awesome if I could kind of create a second data pool with just those images that have been rated as worst or best by each participant but i guess that is not possible, right?

    I also have to conditions, so I thought I needed to change the "Run-if" to condition 1 or 2, respectively.

    Can I change the following code somehow so that it only presents the best or worst prerated images randomly on the left or right side of the canvas?

    image_display = items['US_open'].canvas
    image_display.image(pool[var.US])
    var.image_presented_list.append(var.US)

    This is how it works on OpenSesame, but again this draws images from the pool, not the prerated ones:
    draw image center=1 file="US_[US].JPG" scale=0.3 show_if=always x="[target_position]" y=0 z_index=0

    Best,
    Lea

  • Hey Lea,

    When you are saying:

    Changing "Run if" to "=var.Image in var.item_to_present" makes the experminet jump directly to the end_of_experiment-sketchpad.

    You are talking about the script of the your own experiment right? What I just mean is that on the script I joined in the previous message it is working, and what you are saying would suggest the var.item_to_present is empty. But I cannot be sure if I dont see your script could you maybe post it here and I will have a look?

    It would be awesome if I could kind of create a second data pool with just those images that have been rated as worst or best by each participant but i guess that is not possible, right?

    I am not sure that is possible, however you could populate a loop (the experimental one) with the prerated item, by using the datamatrix functions with only the images you want. Check the end of this page http://osdoc.cogsci.nl/3.1/manual/structure/loop/
    But it would seem to me kinda complicated while I think Run if should work, but I cannot know where in your script without seeing it.

    Can I change the following code somehow so that it only presents the best or worst prerated images randomly on the left or right side of the canvas?

    I think this video of Sebastiaan could help you for that:
    https://youtube.com/watch?v=K2dcG_7Hs3Y&feature=youtu.be

    But first I would try to fix this Run if issue, then take a look at the position of presentation.

    Sorry if I cannot do more but it is difficult without seeing your script please post it if you can.

    Best,

    Sylvain

  • Hey Sylvain,

    I don't really use a code to implement the experiment but tried to do it just with the OpenSesame userface.

    Verything works fine, except for the preselected US that aren't displayed on the screen. I changed the Run if-statement to "=var.Image in var.item_to_present" in "sequence_open", but that didn't help (and as you can see, I define the condition there, so I use this Run-if-statement otherwise). Changing it in the "trial_sequence_open"-part didn't work either. Python always seems to crash.
    Can I somehow use the sketchpad-script to call the variable "item_to_present"?

    Best,
    Lea

  • Little update:
    Python doesn't crash anymore, but just jumps to the end of the experiment. I'm really sorry if this is some easy stuff, but I'm kind of lost.

    Could something like this work, too?

    Best,
    Lea

  • Hello Lea,

    Could you just create a zip file with your experiment (images+opensesame code) if it is not too heavy it could be easier to check.

    Best,

    Sylvain

  • edited May 16

    Hey Sylvain,

    the problem is already solved (with the aid of a datamatrix). Thank yo alot for your great input!

    Best,
    Lea

Sign In or Register to comment.