repeat trial with certain response


Author
Message
Jerri
Jerri
Partner Member (548 reputation)Partner Member (548 reputation)Partner Member (548 reputation)Partner Member (548 reputation)Partner Member (548 reputation)Partner Member (548 reputation)Partner Member (548 reputation)Partner Member (548 reputation)Partner Member (548 reputation)
Group: Forum Members
Posts: 16, Visits: 1


Hello!


I would like my subjects to have the possibility to repeat a trial when hitting a certain key like "space".


The branch command that i have built in below does not work. Can anyone help?


Thanks a lot!


<trial a1>


/ trialcode = "a1" 


/ stimulustimes = [1=start; 801=blank; 1051=square1]


/ branch = [if (trial.a1.response = 57) trial.a1]


/ validresponse = (42,54,57)


/ correctresponse = (42)


</trial>



S F
S F
Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)Esteemed Member (2.3K reputation)
Group: Forum Members
Posts: 29, Visits: 175
Dave - 12/9/2009

The error message is informative. For starters set:

/ branch = [if (trial.a1.response == 57) trial.a1]

The '=' is an assignment operator, while '==' is a comparison operator.  That should fix the error message and make the branch functional. However, if any of the stims (i.e. start, blank, square1) has more than one item, the repeated trial will display a different item than its first instance (unless you've taken precautions against this).

~Dave


Hi Dave, thanks so much for this answer. I was wondering about the last thing you said- how would we take precautions against the stim loading different items? I'd like to repeat an item if subjects get it wrong, but after showing an error message.
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: 102K
S F - 6/19/2019
Dave - 12/9/2009

The error message is informative. For starters set:

/ branch = [if (trial.a1.response == 57) trial.a1]

The '=' is an assignment operator, while '==' is a comparison operator.  That should fix the error message and make the branch functional. However, if any of the stims (i.e. start, blank, square1) has more than one item, the repeated trial will display a different item than its first instance (unless you've taken precautions against this).

~Dave


Hi Dave, thanks so much for this answer. I was wondering about the last thing you said- how would we take precautions against the stim loading different items? I'd like to repeat an item if subjects get it wrong, but after showing an error message.

You'll have to do something like this:

<values>
/ exampleitem = 1
</values>

<block exampleblock>
/ trials = [1-4 = example]
</block>

<trial example>
/ ontrialbegin = [if (trial.example.trialcount < 1 || trial.example.correct) values.exampleitem = list.items.nextindex]
/ stimulusframes = [1=examplestimulus]
/ validresponse = ("E", "I")
/ correctresponse = ("E")
/ errormessage = true(errormsg, 1000)
/ branch = [if (trial.example.error) trial.example]
</trial>

<list items>
/ poolsize = 4
</list>

<text examplestimulus>
/ items = exampleitems
/ select = values.exampleitem
</text>

<item exampleitems>
/ 1 = "Example A"
/ 2 = "Example B"
/ 3 = "Example C"
/ 4 = "Example D"
</item>

<text errormsg>
/ items = ("X")
/ txcolor = red
/ position = (50%, 75%)
</text>

I.e. only select a new item number if the response given in the previous instance of the trial was correct.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search