Adjust Approach-Avoidance Task (AAT)


Author
Message
lotte
lotte
Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)
Group: Forum Members
Posts: 10, Visits: 10
My question concerns the AAT I got from the millisecond database. 
I would like to adjust some features, but I cannot figure out how it would work. 
The original task consists of pushing&pulling trials with a zooming (decrease&increase) feature. Also, the participant is able to change its movement during the trial, and the trial finishes when the correct response to the stimulus is given. 
What I want:
Pushing&sideway movement trials, with a zooming (decrease) feature when pp pushes, however, the size of the pic should stay the same if a pp moves the joystick sideways.
Also, and thats the thing that doesnt work, pp should be able to change the movement until the correct response is given to the specific stimulus (happy= target 'H'versus angry=target 'A' face). 

I would love some help with my wishes...
Thank you so much in advance. 
And if you need more information, please let me know. 

This is part of the script I have (adjusted) until now:


<trial practicetrial_A>
/ontrialbegin = [values.targetformat = "A"]
/ ontrialbegin = [values.selectpracticepicture = 1]
/ ontrialbegin = [values.starttime = script.elapsedtime; values.endtime = 0]
/ ontrialbegin = [picture.practicetarget.height = values.startheight_A]
/ ontrialbegin = [values.completeRT = 0; values.changedirection = 0; values.finalresponse=""]
/ stimulusframes = [1 = practicetarget]
/ validresponse = (left, forward)
/ iscorrectresponse = [(trial.practicetrial_A.response == "forward")]
/ errormessage = true(error,0)
/ ontrialend = [values.joystick_y = joystick.y]
/ ontrialend = [values.joystick_x = joystick.x]
/ ontrialend = [values.joystick_change = abs(values.joystick_y)]
/ontrialend = [values.trialcode = "practicetrial_A"]
/ontrialend = [values.RT = trial.practicetrial_A.latency]
/ontrialend = [values.correct = trial.practicetrial_A.correct]
/ontrialend = [values.stimulus = picture.practicetarget.currentitem]
/ontrialend = [if (trial.practicetrial_A.response == "forward") values.initialresponse = "PUSH"
else values.initialresponse = "SIDE"]
/ branch = [if (trial.practicetrial_A.response == "forward") trial.practicedecrease else trial.practicesame]
/ recorddata = false
</trial>


<trial practicetrial_B>
/ontrialbegin = [values.targetformat = "H"]
/ontrialbegin = [values.starttime = script.elapsedtime; values.endtime = 0]
/ ontrialbegin = [values.repeat = 0]
/ ontrialbegin = [values.selectpracticepicture = 2]
/ ontrialbegin = [picture.practicetarget.height = values.startheight_B]
/ ontrialbegin = [values.completeRT = 0; values.changedirection = 0; values.finalresponse=""]
/ stimulusframes = [1 = practicetarget]
/ validresponse = (left, forward)
/ iscorrectresponse = [(trial.practicetrial_B.response == "left")]
/ errormessage = true(error,0)
/ontrialend = [values.joystick_y = joystick.y]
/ontrialend = [values.joystick_x = joystick.x]
/ontrialend = [values.joystick_change = abs(values.joystick_y)]
/ontrialend = [values.trialcode = "practicetrial_B"]
/ontrialend = [values.RT = trial.practicetrial_B.latency]
/ontrialend = [values.correct = trial.practicetrial_B.correct]
/ontrialend = [values.stimulus = picture.practicetarget.currentitem]
/ontrialend = [if (trial.practicetrial_B.response == "forward") values.initialresponse = "PUSH"
else values.initialresponse = "SIDE"]
/ branch = [if (trial.practicetrial_B.response == "forward") trial.practicedecrease else trial.practicesame]
/recorddata = false
</trial>



*********ZOOM FEATURE:

#angry trials=correct - forward push - picture decreases

<trial practicedecrease>
/ontrialbegin = [if (values.targetformat == "H") trial.practicedecrease.insertstimulustime(text.error, 0)]
/ontrialbegin = [picture.practicetarget.height = picture.practicetarget.height - values.joystick_change/expressions.ratio_joystickchangeperassignedpixel]
/stimulusframes = [1 = eraser, practicetarget]
/validresponse = (change)
/ontrialend = [values.joystick_change = abs(abs(values.joystick_y) - abs(joystick.y))]
/ontrialend = [trial.practicedecrease.resetstimulusframes()]
/branch = [if (script.subjectid == "monkey")
{values.endtime = script.elapsedtime; values.finalresponse = "PUSH"; trial.intertrialinterval}]
/branch = [if (joystick.y <= -1000)
{values.joystick_y = joystick.y; values.endtime = script.elapsedtime; values.finalresponse = "PUSH"; trial.enddecrease_practice}]
/branch = [if (joystick.y <= values.joystick_y)
{values.joystick_y = joystick.y; trial.practicedecrease}]
/branch = [if (joystick.y > values.joystick_y)
{values.joystick_y = joystick.y; values.changedirection += 1; trial.practicesame}]
/ recorddata = false
</trial>

**************

#happy trials=correct - left joystick movement - same picture size

<trial practicesame>
/ontrialbegin = [if (values.targetformat == "A") trial.practicesame.insertstimulustime(text.error, 0)]
/ontrialbegin = [picture.practicetarget.height = values.startheight_A]
/stimulusframes = [1 = practicetarget]
/validresponse = (change)
/ontrialend = [trial.practicesame.resetstimulusframes()]
/branch = [if (script.subjectid == "monkey")
{values.endtime = script.elapsedtime; values.finalresponse = "SIDE"; trial.intertrialinterval}]
/branch = [if (joystick.x <= -1000)
{values.joystick_x = joystick.x; values.endtime = script.elapsedtime; values.finalresponse = "SIDE"; trial.endsame_practice}]
/branch = [if (joystick.x <= values.joystick_x)
{values.joystick_x = joystick.x; trial.practicesame}]
/branch = [if (joystick.x > values.joystick_x)
{values.joystick_x = joystick.x; values.changedirection += 1; trial.practicedecrease}]
/recorddata = false
</trial>



********************************************************************************************************

Note: trials show the last size of the picture
<trial enddecrease_practice>
/ontrialbegin = [picture.practicetarget.height = picture.practicetarget.height - values.joystick_change/expressions.ratio_joystickchangeperassignedpixel]
/stimulusframes = [1 = eraser, practicetarget]
/timeout = 0
/branch = [trial.joystickrest]
/recorddata = false
</trial>

<trial endsame_practice>
/ontrialbegin = [picture.practicetarget.height = values.startheight_A]
/stimulusframes = [1 = practicetarget]
/timeout = 0
/branch = [trial.joystickrest]
/recorddata = false
</trial>


Tags
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
> Also, and thats the thing that doesnt work, pp should be able to change the movement until the correct response is given to
> the specific stimulus (happy= target 'H'versus angry=target 'A' face).

Can you be more specific about what exactly isn't working? Also, for your own debugging purposes, you should set /recorddata=true for all your <trial> elements so that you can examine the x, y, etc. values in detail in the data file.

lotte
lotte
Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)
Group: Forum Members
Posts: 10, Visits: 10
Hi Dave, thank you very much for the reply. 

If I make the correct response to the stimulus, everything works fine (push in response to angry face, picture decreases, trial ends / sideway movement in reponse to happy face, picture stays same size, trial ends).

If I start with a correct response, and I interrupt it/change it to incorrect reponse:
- it will give error feedback, which is perfect. 
- however, it will continue with error feedback when I change to making correct response again (not good)
- and, it doesnt end the trial when I make the correct response, it will only end the trial if I make the incorrect reponse (not good)

If I start with incorrect reponse:
- I get error feedback, which is perfect. 
- when I change to correct response, no error, and the trial will end, which is perfect
- however, if I make the incorrect response twice, I will not get error feedback the second time, and decreasing function doesnt work for happy faces anymore (not good). 

Thus, the practivedecrease trial and practicesame trial should be able to alternate, also after incorrect responses,but I think there might be something wrong with the branches. 
Do I need more branches maybe?

I hope this information makes the problem more clear (instead of unclear). 
Otherwise, just ask for more info again. 
Thanks

Lotte



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
The first thing you should do is enable data recording for those trials (as advised in my previous reply) and examine the data file closely. That will tell you which trials are being /branched to etc.

/branch attributes are executed in the order given -- which means if you never reach <trial enddecrease_practice> etc., that's because some other /branch (still) applies or none applies. You'll want to log / look at the x and y values, particularly joystick.x and joystick.y, whose return values trigger the "end" trials per some of your /branches

/branch = [if (joystick.y <= -1000)
{values.joystick_y = joystick.y; values.endtime = script.elapsedtime; values.finalresponse = "PUSH"; trial.enddecrease_practice}]

etc.

You may also be running into a practical problem (depends on your joystick hardware I suppose). You must consider both horizontal and vertical movements (x and y coordinates). The practical question is, though, is anyone really able to move the joystick, say, horizontally *while* keeping its vertical position perfectly constant.

You'll thus want to take a very close look at when / how you update values.joystick_y and values.joystick_x which also play and important part in your /branch attributes.

lotte
lotte
Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)Esteemed Member (1.7K reputation)
Group: Forum Members
Posts: 10, Visits: 10
Hi Dave, 

Thank you so much for your feedback!
After some trial and error, I think I've found the solution... (need to test it on a pc with data recording license tomorrow, dont have it on my home pc..)
I think the (practical) problem was, that after a trial change (between practicesame and practicedecrease), it could not go back to the same trial again. It first had to switch to the other one (change x or y position) before it was directed to the right trial again. 

I had to change the if smaller of equal to sign (within practicesame trial):
/branch = [if (joystick.x <= values.joystick_x) {values.joystick_x = joystick.x; trial.practicesame}]
into only if smaller sign
/branch = [if (joystick.x < values.joystick_x) {values.joystick_x = joystick.x; trial.practicesame}]

I also had to add a final branch in which I stated that if x (or y in other trial) stayed the same, it should switch to the other trial, instead of get stuck in the trial that wasnt relevant anymore..
/branch = [if (joystick.x == values.joystick_x) {values.joystick_x = joystick.x; values.joystick_y = joystick.y; trial.practicedecrease}]

Also, as you can see, I save the joystick.y in addition to the joystick.x values when he will change from one trial to the other trial.  I believe this is necessary in this next trial, but I will check this tomorrow in the data file. 

Again, thank you for the feedback, hopefully the data file looks as good as the experiment is working now
For now, it made my day 


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
Great! Glad to hear some of my pointers proved to be useful. Let me know if anything else comes up.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search