repeat trial after error


Author
Message
laurenemberson
laurenemberson
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: 12, Visits: 24
Thanks so much Dave this helped a lot!!! 
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: 104K
laurenemberson - Thursday, December 29, 2016
Hi-- This seems like a simple one but I can't find an existing forum thread on this issue.  I want to repeat a trial after an error.   Here is the relevant part of my code. Any help is much appreciated!  ~Lauren

<item familiarizationPics>
/1 = "images/ATflwr1.jpg"
/2 = "images/ATfish1.jpg"
/3 = "images/ATbird4.jpg"
/4 = "images/ATdogg2.jpg"
/5 = "images/ATflwr1.jpg"
...
</item>
<picture familiarization>
/ items = familiarizationPics
/ select = sequence
/ size = (400, 400)
/ erase = false
</picture>

<trial famTrial>
/ stimulustimes = [0=familiarization; 300=blank]
/ validresponse = (noresponse,"1","2")
/ iscorrectresponse = [trial.famTrial.response == list.famAnswers.nextvalue]
/ beginresponsetime = 0
/ trialduration = 1000
/ responseinterrupt = trial
/ errormessage = (wrong,500)
</trial>

<block famBlock>
/ preinstructions = (intro,famInstruct)
/ trials = [1 = famInstructionsWithPic; 2-449 = famTrial]
/ errormessage = false
/ blockfeedback = (correct)
/ ontrialend = [if (block.famBlock.errorstreak == 11 ) script.abort();]
</block>


Strictly speaking, there is no way to repeat a *trial*. Instead you need to frame the problem in terms of item selection, i.e. in any given trial, only select a new item if  the previous trial was answered correctly. Example:

<values>
/ itemnumber = 1
</values>

<block myblock>
/ trials = [1-5 = mytrial]
</block>

<trial mytrial>
/ ontrialbegin = [if (trial.mytrial.correct) values.itemnumber += 1]
/ stimulusframes = [1=mytext]
/ validresponse = ("1","2")
/ correctresponse = ("1")
/ branch = [if (trial.mytrial.error) trial.mytrial]
</trial>

<text mytext>
/ items = myitems
/ select = values.itemnumber
</text>

<item myitems>
/ 1 = "A"
/ 2 = "B"
/ 1 = "C"
/ 2 = "D"
/ 1 = "E"
</item>

Hope this helps.

laurenemberson
laurenemberson
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: 12, Visits: 24
Hi-- This seems like a simple one but I can't find an existing forum thread on this issue.  I want to repeat a trial after an error.   Here is the relevant part of my code. Any help is much appreciated!  ~Lauren

<item familiarizationPics>
/1 = "images/ATflwr1.jpg"
/2 = "images/ATfish1.jpg"
/3 = "images/ATbird4.jpg"
/4 = "images/ATdogg2.jpg"
/5 = "images/ATflwr1.jpg"
...
</item>
<picture familiarization>
/ items = familiarizationPics
/ select = sequence
/ size = (400, 400)
/ erase = false
</picture>

<trial famTrial>
/ stimulustimes = [0=familiarization; 300=blank]
/ validresponse = (noresponse,"1","2")
/ iscorrectresponse = [trial.famTrial.response == list.famAnswers.nextvalue]
/ beginresponsetime = 0
/ trialduration = 1000
/ responseinterrupt = trial
/ errormessage = (wrong,500)
</trial>

<block famBlock>
/ preinstructions = (intro,famInstruct)
/ trials = [1 = famInstructionsWithPic; 2-449 = famTrial]
/ errormessage = false
/ blockfeedback = (correct)
/ ontrialend = [if (block.famBlock.errorstreak == 11 ) script.abort();]
</block>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search