Howdy, Stranger!

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

Supported by

still randomizing the position of images

Hello.

I have found different ways proposed in the forum but I still can't find the solution. The problem is probably quite simple, sorry.

In a test we are administering a series of musical excerpts grouped in four emotional categories. The subject is asked to choose the category/emotion selecting one of the four faces in a sketchpad (afraid, happy, neutral, sad):

set duration 0
set description "Displays stimuli"
draw image center=1 file="[face_nr]AF.tif" scale=0.5 show_if=always x=-384 y=0 z_index=0
draw image center=1 file="[face_nr]HA.tif" scale=0.5 show_if=always x=-128 y=0 z_index=0
draw image center=1 file="[face_nr]NE.tif" scale=0.5 show_if=always x=128 y=0 z_index=0
draw image center=1 file="[face_nr]SA.tif" scale=0.5 show_if=always x=384 y=0 z_index=0

Through the f1, f2, f3, f4 the subject can choose the related face/emotion.

Now I have the necessity

1) to present the [face_nr]EMOTION.tif in a random order from left to right and

2) to log the correct response.

But unfortunately I can't find a solution.

Could you suggest me a way to do that ?

Thank you very much for your attention

Comments

  • Hi,


    1) to present the [face_nr]EMOTION.tif in a random order from left to right and

    This you can achieve but not only code the emotion as a variable in your experiment, but also the position. In the easiest way, you can completetly counterbalance it in the loop table (see for example the beginner's tutorial where this is also done).If this is not feasible for whatever reason, you can randomly assign the positions in an inline_script (prepare phase) before the sketchpad. Something like this will do:

    import random
    position_x = [-300, -100, 100, 300 ]
    random.shuffle(position_x)
    var.x1, var.x2, var.x3, var.x3 = position_x
    

    Then you can also change the value in your screenshot to [x1], [x2], [x3], [x4] as x coordinate.

    2) to log the correct response.

    You must link the location of the emotion to the location of the correct response. For this you need to know where each emotion was placed. With the code above, I don't think you have control over the location. It might make more sense, to not shuffle the x positions, but shuffle the image identity. Same principle:

    import random
    face_id = ['[face_nr]NE.tif','[face_nr]AF.tif','[face_nr]HA.tif','[face_nr]SA.tif' ]
    random.shuffle(face_id)
    var.face1, var.face2, var.face3, var.face4 = face_id
    

    Now you only need to collect the response (1, 2, 3, or 4) and check which emotion was coded at that position (coded in var.faceX). If this label matches the predefined condition, you have a correct response and an incorrect response otherwise.

    Eduard

    Buy Me A Coffee

  • Dear Eduard,

    it was a bit harder than expected but we did it, thank you very much !

  • Good to hear!

    Buy Me A Coffee

Sign In or Register to comment.