Using conditional valid responses


Author
Message
Maurits
Maurits
Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)
Group: Forum Members
Posts: 9, Visits: 120
Hi, 

I'am trying to adjust the Effort Expenditure for Reward (EEfRT) task I found in the library (http://www.millisecond.com/download/library/EffortExpenditureforRewardTask/) 
This task consists of easy and hard trials (button presses with the index finger of the dominant hand VS button presses with the little finger of the non-dominant hand. In the inquistit version of this task, both hard en easy trials are performed by pressing the spacebar. Each button press raises a bar up a little. In the original version however, two different keys are used "s" and "l". If right handed, for easy trials, participants press the "l" with their right-hand index finger, and for difficult trials the press the "s" with their left-hand little finger, for left handed-participants this is reversed. I want to use this two different button version of the task.
I am experiences problems making the validresponse option conditional on the handedness of the participant. 

I first asked participants whether they are right- or left-handed:
<radiobuttons hand>
/ caption = "Are you left or right-handed?"
/ options = ("Left","Right")
/ optionvalues = ("1","2")
/ position = (50%, 50%)
/ required = true
</radiobuttons>

Then I want to change the following trial, where the spacebar is indicated as valid, into a conditional valid response:
<trial hard>
/ stimulusframes = [1 = buttonpress, outerbox, innerbox, filling]
/ validresponse = (57)
/ beginresponsetime = -1
/ ontrialend = [
if (trial.hard.response == 57)
{
values.countpresses += 1;
values.fillingheight += expressions.increasefillingheight;
};
if (values.countpresses >= parameters.hardpresses)
values.success = 1
else
values.success = 0;
values.remainingtaskduration -= trial.hard.latency;
if (values.remainingtaskduration < 0)
values.remainingtaskduration = 0;
]
/ branch = [
if (values.success == 0 && values.remainingtaskduration > 0) trial.hard
else if (values.success == 1) trial.success
else trial.failure
]
/ recorddata = false
/ timeout = values.remainingtaskduration
</trial>

I tried:
/ validresponse = (if (radiobuttons.hand.response==1)] 38 else 31)  but this is not allowed.
In addition, the following part:
"/ ontrialend = [
if (trial.hard.response == 57)" has to be made conditional as well. 

Do you have any suggestions how to proceed?

regards,

Maurits



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: 13K, Visits: 105K
For conditional / dynamically determined valid responses, you need to use the

/isvalidresponse attribute, not /validresponse

Similarly, for the case of correct response evaluation, the equivalent is

/iscorrectresponse, not /correctresponse

The easiest thing to do is something like:

<values>
/ responsekey = 57
</values>

<surveypage handedness>
/ ontrialend = [if (radiobuttons.hand.response == "1") values.responsekey = 38 else values.responsekey = 31; ]
/ questions = [1= hand]
</surveypage>

<radiobuttons hand>
/ caption = "Are you left or right-handed?"
/ options = ("Left","Right")
/ optionvalues = ("1","2")
/ position = (50%, 50%)
/ required = true
</radiobuttons>

with

<trial hard>
/ stimulusframes = [1 = buttonpress, outerbox, innerbox, filling]
/ isvalidresponse = [trial.hard.response == values.responsekey]
/ beginresponsetime = -1
/ ontrialend = [
if (trial.hard.response == values.responsekey)
{
values.countpresses += 1;
values.fillingheight += expressions.increasefillingheight;
};
...
</trial>

Edited 9 Years Ago by Dave
Maurits
Maurits
Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)Esteemed Member (1.6K reputation)
Group: Forum Members
Posts: 9, Visits: 120
Thank you very much, it works now!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search