lir1995
|
|
Group: Forum Members
Posts: 47,
Visits: 214
|
+x+x+x+x Come to think of it, we can actually make the trial timing more consistent with what it was before by changing the ptp trial to <trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial> That way, all stimuli should remain on-screen for approximately 3 seconds, followed by a 1 second blank period. Posting a correction to previous code here; it didn't catch one edge case, where there was already an "overflow" of assignments to one character, while no assignments had yet been made to the other. <text noun> / items = noun /select = noreplacenorepeat / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text>
<item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item>
<item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item>
<item Jordan> /1 = "Jordan" </item>
<item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item>
<item Cameron> /1 = "Cameron" </item>
<picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture>
<picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture>
<text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape>
<item oval> /1 = "oval.png" /2 = "oval_filled.png" </item>
<picture oval1> / items = oval / size = (15%, 15%) / position = (10,10) / select = list.left_set.items.1 / erase = false </picture>
<picture oval2> / items = oval / size = (15%, 15%) / position = (20,10) / select = list.left_set.items.2 / erase = false </picture>
<picture oval3> / items = oval / size = (15%, 15%) / position = (70,10) / select = list.right_set.items.1 / erase = false </picture>
<picture oval4> / items = oval / size = (15%, 15%) / position = (80,10) / select = list.right_set.items.2 / erase = false </picture>
<values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 </values>
<list left_set> / items = (1,1) </list>
<list right_set> / items = (1,1) </list>
<trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 2) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 2) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 2) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 2) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4] / validresponse = ("m", "z") / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial>
<trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial>
<block pair1> / trials = [1-4 = pair1] </block> The relevant change is minor and highlighted in bold below: <trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 2) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 2) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 2) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 2) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4] / validresponse = ("m", "z") / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> Thank you so much for following up on this! Thank you so much again for all of your help! I have been adapting the code and have been testing and working through it. I just noticed that when I add multiple blocks of pairs, the filled ovals don't seem to reset from the block before. I thought the line in trial.ptp.resetstimulusframes would take care of that, but perhaps there is something I'm missing. Is there a way to reset it such that when it starts a new block, all of the circles start out empty? Thanks! Here is the code above and I added a second pair in (I also added more ovals): <text noun> / items = noun /select = noreplacenorepeat / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text> <item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item> <item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item> <item Jordan> /1 = "Jordan" </item> <item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item> <item Cameron> /1 = "Cameron" </item> <picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture> <picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture> <text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <item pair2_item1> /1 = "FinalVersionToca44_neutral.jpg" </item> <item Reed> /1 = "Reed" </item> <item pair2_item2> /1 = "FinalVersionToca21_neutral.jpg" </item> <item Jesse> /1 = "Jesse" </item> <picture pair2_item1> / items = pair2_item1 / select = noreplacenorepeat / size = (35%, 35%) / position = (30,40) / erase = false </picture> <picture pair2_item2> / items = pair2_item2 / size = (35%, 35%) / position = (70,40) / select = picture.pair2_item1.currentindex / erase = false </picture> <text Reed> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Reed_feedback> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <text Jesse> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Jesse_feedback> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape> <item oval> /1 = "oval.png" /2 = "oval_filled.png" </item> <item oval2> /1 = "oval.png" /2 = "oval_filled2.png" </item> <picture oval1> / items = oval / size = (10%, 10%) / position = (17,10) / select = list.left_set.items.1 / erase = false </picture> <picture oval2> / items = oval / size = (10%, 10%) / position = (24,10) / select = list.left_set.items.2 / erase = false </picture> <picture oval3> / items = oval / size = (10%, 10%) / position = (31,10) / select = list.left_set.items.3 / erase = false </picture> <picture oval4> / items = oval / size = (10%, 10%) / position = (38,10) / select = list.left_set.items.4 / erase = false </picture> <picture oval5> / items = oval / size = (10%, 10%) / position = (45,10) / select = list.left_set.items.5 / erase = false </picture> <picture oval6> / items = oval / size = (10%, 10%) / position = (55,10) / select = list.right_set.items.5 / erase = false </picture> <picture oval7> / items = oval / size = (10%, 10%) / position = (62,10) / select = list.right_set.items.4 / erase = false </picture> <picture oval8> / items = oval / size = (10%, 10%) / position = (69,10) / select = list.right_set.items.3 / erase = false </picture> <picture oval9> / items = oval / size = (10%, 10%) / position = (76,10) / select = list.right_set.items.2 / erase = false </picture> <picture oval10> / items = oval / size = (10%, 10%) / position = (83,10) / select = list.right_set.items.1 / erase = false </picture> <values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 </values> <list left_set> / items = (1,1,1,1,1) </list> <list right_set> / items = (1,1,1,1,1) </list> <trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 5) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 5) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 5) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 5) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Jordan_feedback, 0) / responsemessage = ("m", Cameron_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> <trial pair2> / ontrialend = [ if (trial.pair2.responsetext == "m" && values.right_responses < 5) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair2.responsetext == "m" && values.right_responses >= 5) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair2.responsetext == "z" && values.left_responses < 5) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair2.responsetext == "z" && values.left_responses >= 5) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair2_item1, pair2_item2, Reed, Jesse, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Reed_feedback, 0) / responsemessage = ("m", Jesse_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> <trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ] / stimulustimes = [0 = oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial> <block pair1> / trials = [1-3 = pair1] </block> <block pair2> / trials = [1-3 = pair2] </block> <expt > / blocks = [1 = pair1; 2 = pair2] </expt>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+x+x Come to think of it, we can actually make the trial timing more consistent with what it was before by changing the ptp trial to <trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial> That way, all stimuli should remain on-screen for approximately 3 seconds, followed by a 1 second blank period. Posting a correction to previous code here; it didn't catch one edge case, where there was already an "overflow" of assignments to one character, while no assignments had yet been made to the other. <text noun> / items = noun /select = noreplacenorepeat / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text>
<item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item>
<item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item>
<item Jordan> /1 = "Jordan" </item>
<item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item>
<item Cameron> /1 = "Cameron" </item>
<picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture>
<picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture>
<text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape>
<item oval> /1 = "oval.png" /2 = "oval_filled.png" </item>
<picture oval1> / items = oval / size = (15%, 15%) / position = (10,10) / select = list.left_set.items.1 / erase = false </picture>
<picture oval2> / items = oval / size = (15%, 15%) / position = (20,10) / select = list.left_set.items.2 / erase = false </picture>
<picture oval3> / items = oval / size = (15%, 15%) / position = (70,10) / select = list.right_set.items.1 / erase = false </picture>
<picture oval4> / items = oval / size = (15%, 15%) / position = (80,10) / select = list.right_set.items.2 / erase = false </picture>
<values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 </values>
<list left_set> / items = (1,1) </list>
<list right_set> / items = (1,1) </list>
<trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 2) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 2) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 2) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 2) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4] / validresponse = ("m", "z") / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial>
<trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial>
<block pair1> / trials = [1-4 = pair1] </block> The relevant change is minor and highlighted in bold below: <trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 2) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 2) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 2) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 2) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4] / validresponse = ("m", "z") / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> Thank you so much for following up on this! Thank you so much again for all of your help! I have been adapting the code and have been testing and working through it. I just noticed that when I add multiple blocks of pairs, the filled ovals don't seem to reset from the block before. I thought the line in trial.ptp.resetstimulusframes would take care of that, but perhaps there is something I'm missing. Is there a way to reset it such that when it starts a new block, all of the circles start out empty? Thanks! Here is the code above and I added a second pair in (I also added more ovals): <text noun> / items = noun /select = noreplacenorepeat / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text> <item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item> <item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item> <item Jordan> /1 = "Jordan" </item> <item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item> <item Cameron> /1 = "Cameron" </item> <picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture> <picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture> <text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <item pair2_item1> /1 = "FinalVersionToca44_neutral.jpg" </item> <item Reed> /1 = "Reed" </item> <item pair2_item2> /1 = "FinalVersionToca21_neutral.jpg" </item> <item Jesse> /1 = "Jesse" </item> <picture pair2_item1> / items = pair2_item1 / select = noreplacenorepeat / size = (35%, 35%) / position = (30,40) / erase = false </picture> <picture pair2_item2> / items = pair2_item2 / size = (35%, 35%) / position = (70,40) / select = picture.pair2_item1.currentindex / erase = false </picture> <text Reed> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Reed_feedback> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <text Jesse> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Jesse_feedback> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape> <item oval> /1 = "oval.png" /2 = "oval_filled.png" </item> <item oval2> /1 = "oval.png" /2 = "oval_filled2.png" </item> <picture oval1> / items = oval / size = (10%, 10%) / position = (17,10) / select = list.left_set.items.1 / erase = false </picture> <picture oval2> / items = oval / size = (10%, 10%) / position = (24,10) / select = list.left_set.items.2 / erase = false </picture> <picture oval3> / items = oval / size = (10%, 10%) / position = (31,10) / select = list.left_set.items.3 / erase = false </picture> <picture oval4> / items = oval / size = (10%, 10%) / position = (38,10) / select = list.left_set.items.4 / erase = false </picture> <picture oval5> / items = oval / size = (10%, 10%) / position = (45,10) / select = list.left_set.items.5 / erase = false </picture> <picture oval6> / items = oval / size = (10%, 10%) / position = (55,10) / select = list.right_set.items.5 / erase = false </picture> <picture oval7> / items = oval / size = (10%, 10%) / position = (62,10) / select = list.right_set.items.4 / erase = false </picture> <picture oval8> / items = oval / size = (10%, 10%) / position = (69,10) / select = list.right_set.items.3 / erase = false </picture> <picture oval9> / items = oval / size = (10%, 10%) / position = (76,10) / select = list.right_set.items.2 / erase = false </picture> <picture oval10> / items = oval / size = (10%, 10%) / position = (83,10) / select = list.right_set.items.1 / erase = false </picture> <values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 </values> <list left_set> / items = (1,1,1,1,1) </list> <list right_set> / items = (1,1,1,1,1) </list> <trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 5) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 5) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 5) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 5) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Jordan_feedback, 0) / responsemessage = ("m", Cameron_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> <trial pair2> / ontrialend = [ if (trial.pair2.responsetext == "m" && values.right_responses < 5) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair2.responsetext == "m" && values.right_responses >= 5) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair2.responsetext == "z" && values.left_responses < 5) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair2.responsetext == "z" && values.left_responses >= 5) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair2_item1, pair2_item2, Reed, Jesse, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Reed_feedback, 0) / responsemessage = ("m", Jesse_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> <trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ] / stimulustimes = [0 = oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial> <block pair1> / trials = [1-3 = pair1] </block> <block pair2> / trials = [1-3 = pair2] </block> <expt > / blocks = [1 = pair1; 2 = pair2] </expt> You need to reset the lists and values that are used to keep track of the state of the ovals.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+x+x+x Come to think of it, we can actually make the trial timing more consistent with what it was before by changing the ptp trial to <trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial> That way, all stimuli should remain on-screen for approximately 3 seconds, followed by a 1 second blank period. Posting a correction to previous code here; it didn't catch one edge case, where there was already an "overflow" of assignments to one character, while no assignments had yet been made to the other. <text noun> / items = noun /select = noreplacenorepeat / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text>
<item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item>
<item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item>
<item Jordan> /1 = "Jordan" </item>
<item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item>
<item Cameron> /1 = "Cameron" </item>
<picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture>
<picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture>
<text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape>
<item oval> /1 = "oval.png" /2 = "oval_filled.png" </item>
<picture oval1> / items = oval / size = (15%, 15%) / position = (10,10) / select = list.left_set.items.1 / erase = false </picture>
<picture oval2> / items = oval / size = (15%, 15%) / position = (20,10) / select = list.left_set.items.2 / erase = false </picture>
<picture oval3> / items = oval / size = (15%, 15%) / position = (70,10) / select = list.right_set.items.1 / erase = false </picture>
<picture oval4> / items = oval / size = (15%, 15%) / position = (80,10) / select = list.right_set.items.2 / erase = false </picture>
<values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 </values>
<list left_set> / items = (1,1) </list>
<list right_set> / items = (1,1) </list>
<trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 2) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 2) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 2) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 2) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4] / validresponse = ("m", "z") / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial>
<trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial>
<block pair1> / trials = [1-4 = pair1] </block> The relevant change is minor and highlighted in bold below: <trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 2) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 2) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 2) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 2) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4] / validresponse = ("m", "z") / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> Thank you so much for following up on this! Thank you so much again for all of your help! I have been adapting the code and have been testing and working through it. I just noticed that when I add multiple blocks of pairs, the filled ovals don't seem to reset from the block before. I thought the line in trial.ptp.resetstimulusframes would take care of that, but perhaps there is something I'm missing. Is there a way to reset it such that when it starts a new block, all of the circles start out empty? Thanks! Here is the code above and I added a second pair in (I also added more ovals): <text noun> / items = noun /select = noreplacenorepeat / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text> <item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item> <item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item> <item Jordan> /1 = "Jordan" </item> <item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item> <item Cameron> /1 = "Cameron" </item> <picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture> <picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture> <text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <item pair2_item1> /1 = "FinalVersionToca44_neutral.jpg" </item> <item Reed> /1 = "Reed" </item> <item pair2_item2> /1 = "FinalVersionToca21_neutral.jpg" </item> <item Jesse> /1 = "Jesse" </item> <picture pair2_item1> / items = pair2_item1 / select = noreplacenorepeat / size = (35%, 35%) / position = (30,40) / erase = false </picture> <picture pair2_item2> / items = pair2_item2 / size = (35%, 35%) / position = (70,40) / select = picture.pair2_item1.currentindex / erase = false </picture> <text Reed> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Reed_feedback> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <text Jesse> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Jesse_feedback> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape> <item oval> /1 = "oval.png" /2 = "oval_filled.png" </item> <item oval2> /1 = "oval.png" /2 = "oval_filled2.png" </item> <picture oval1> / items = oval / size = (10%, 10%) / position = (17,10) / select = list.left_set.items.1 / erase = false </picture> <picture oval2> / items = oval / size = (10%, 10%) / position = (24,10) / select = list.left_set.items.2 / erase = false </picture> <picture oval3> / items = oval / size = (10%, 10%) / position = (31,10) / select = list.left_set.items.3 / erase = false </picture> <picture oval4> / items = oval / size = (10%, 10%) / position = (38,10) / select = list.left_set.items.4 / erase = false </picture> <picture oval5> / items = oval / size = (10%, 10%) / position = (45,10) / select = list.left_set.items.5 / erase = false </picture> <picture oval6> / items = oval / size = (10%, 10%) / position = (55,10) / select = list.right_set.items.5 / erase = false </picture> <picture oval7> / items = oval / size = (10%, 10%) / position = (62,10) / select = list.right_set.items.4 / erase = false </picture> <picture oval8> / items = oval / size = (10%, 10%) / position = (69,10) / select = list.right_set.items.3 / erase = false </picture> <picture oval9> / items = oval / size = (10%, 10%) / position = (76,10) / select = list.right_set.items.2 / erase = false </picture> <picture oval10> / items = oval / size = (10%, 10%) / position = (83,10) / select = list.right_set.items.1 / erase = false </picture> <values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 </values> <list left_set> / items = (1,1,1,1,1) </list> <list right_set> / items = (1,1,1,1,1) </list> <trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 5) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 5) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 5) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 5) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Jordan_feedback, 0) / responsemessage = ("m", Cameron_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> <trial pair2> / ontrialend = [ if (trial.pair2.responsetext == "m" && values.right_responses < 5) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair2.responsetext == "m" && values.right_responses >= 5) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair2.responsetext == "z" && values.left_responses < 5) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair2.responsetext == "z" && values.left_responses >= 5) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair2_item1, pair2_item2, Reed, Jesse, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Reed_feedback, 0) / responsemessage = ("m", Jesse_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> <trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ] / stimulustimes = [0 = oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial> <block pair1> / trials = [1-3 = pair1] </block> <block pair2> / trials = [1-3 = pair2] </block> <expt > / blocks = [1 = pair1; 2 = pair2] </expt> You need to reset the lists and values that are used to keep track of the state of the ovals. <text noun> / items = noun /select = noreplace / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text>
<item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item>
<item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item>
<item Jordan> /1 = "Jordan" </item>
<item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item>
<item Cameron> /1 = "Cameron" </item>
<picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture>
<picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture>
<text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<item pair2_item1> /1 = "FinalVersionToca44_neutral.jpg" </item>
<item Reed> /1 = "Reed" </item>
<item pair2_item2> /1 = "FinalVersionToca21_neutral.jpg" </item>
<item Jesse> /1 = "Jesse" </item>
<picture pair2_item1> / items = pair2_item1 / select = noreplacenorepeat / size = (35%, 35%) / position = (30,40) / erase = false </picture>
<picture pair2_item2> / items = pair2_item2 / size = (35%, 35%) / position = (70,40) / select = picture.pair2_item1.currentindex / erase = false </picture>
<text Reed> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Reed_feedback> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<text Jesse> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Jesse_feedback> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape>
<item oval> /1 = "oval.png" /2 = "oval_filled.png" </item>
<item oval2> /1 = "oval.png" /2 = "oval_filled2.png" </item>
<picture oval1> / items = oval / size = (10%, 10%) / position = (17,10) / select = list.left_set.items.1 / erase = false </picture>
<picture oval2> / items = oval / size = (10%, 10%) / position = (24,10) / select = list.left_set.items.2 / erase = false </picture>
<picture oval3> / items = oval / size = (10%, 10%) / position = (31,10) / select = list.left_set.items.3 / erase = false </picture>
<picture oval4> / items = oval / size = (10%, 10%) / position = (38,10) / select = list.left_set.items.4 / erase = false </picture>
<picture oval5> / items = oval / size = (10%, 10%) / position = (45,10) / select = list.left_set.items.5 / erase = false </picture>
<picture oval6> / items = oval / size = (10%, 10%) / position = (55,10) / select = list.right_set.items.5 / erase = false </picture>
<picture oval7> / items = oval / size = (10%, 10%) / position = (62,10) / select = list.right_set.items.4 / erase = false </picture>
<picture oval8> / items = oval / size = (10%, 10%) / position = (69,10) / select = list.right_set.items.3 / erase = false </picture>
<picture oval9> / items = oval / size = (10%, 10%) / position = (76,10) / select = list.right_set.items.2 / erase = false </picture>
<picture oval10> / items = oval / size = (10%, 10%) / position = (83,10) / select = list.right_set.items.1 / erase = false </picture>
<values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 / last_latency = 0 </values>
<list left_set> / items = (1,1,1,1,1) </list>
<list right_set> / items = (1,1,1,1,1) </list>
<trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && (values.left_overflow + values.right_responses < 5)) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && (values.left_overflow + values.right_responses >= 5)) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && (values.right_overflow + values.left_responses < 5)) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && (values.right_overflow + values.left_responses >= 5)) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; values.last_latency = trial.pair1.latency; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Jordan_feedback, 0) / responsemessage = ("m", Cameron_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial>
<trial pair2> / ontrialend = [ if (trial.pair2.responsetext == "m" && (values.left_overflow + values.right_responses < 5)) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair2.responsetext == "m" && (values.left_overflow + values.right_responses >= 5)) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair2.responsetext == "z" && (values.right_overflow + values.left_responses < 5)) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair2.responsetext == "z" && (values.right_overflow + values.left_responses >= 5)) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; values.last_latency = trial.pair2.latency; ] / stimulustimes = [0 = pair2_item1, pair2_item2, Reed, Jesse, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Reed_feedback, 0) / responsemessage = ("m", Jesse_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial>
<trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-values.last_latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = (0) / recorddata = false / trialduration = 4000-values.last_latency </trial>
<block pair1> / onblockbegin = [ list.left_set.reset(); list.right_set.reset(); values.left_responses = 0; values.right_responses = 0; values.left_overflow = 0; values.right_overflow = 0; values.last_latency = 0; ] / trials = [1-10 = pair1] </block>
<block pair2> / onblockbegin = [ list.left_set.reset(); list.right_set.reset(); values.left_responses = 0; values.right_responses = 0; values.left_overflow = 0; values.right_overflow = 0; values.last_latency = 0; ] / trials = [1-10 = pair2] </block>
<expt> / blocks = [1 = pair1; 2 = pair2] </expt>
|
|
|
lir1995
|
|
Group: Forum Members
Posts: 47,
Visits: 214
|
+x+x+x+x+x+x+x Come to think of it, we can actually make the trial timing more consistent with what it was before by changing the ptp trial to <trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial> That way, all stimuli should remain on-screen for approximately 3 seconds, followed by a 1 second blank period. Posting a correction to previous code here; it didn't catch one edge case, where there was already an "overflow" of assignments to one character, while no assignments had yet been made to the other. <text noun> / items = noun /select = noreplacenorepeat / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text>
<item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item>
<item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item>
<item Jordan> /1 = "Jordan" </item>
<item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item>
<item Cameron> /1 = "Cameron" </item>
<picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture>
<picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture>
<text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape>
<item oval> /1 = "oval.png" /2 = "oval_filled.png" </item>
<picture oval1> / items = oval / size = (15%, 15%) / position = (10,10) / select = list.left_set.items.1 / erase = false </picture>
<picture oval2> / items = oval / size = (15%, 15%) / position = (20,10) / select = list.left_set.items.2 / erase = false </picture>
<picture oval3> / items = oval / size = (15%, 15%) / position = (70,10) / select = list.right_set.items.1 / erase = false </picture>
<picture oval4> / items = oval / size = (15%, 15%) / position = (80,10) / select = list.right_set.items.2 / erase = false </picture>
<values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 </values>
<list left_set> / items = (1,1) </list>
<list right_set> / items = (1,1) </list>
<trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 2) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 2) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 2) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 2) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4] / validresponse = ("m", "z") / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial>
<trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial>
<block pair1> / trials = [1-4 = pair1] </block> The relevant change is minor and highlighted in bold below: <trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 2) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 2) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 2) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 2) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4] / validresponse = ("m", "z") / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> Thank you so much for following up on this! Thank you so much again for all of your help! I have been adapting the code and have been testing and working through it. I just noticed that when I add multiple blocks of pairs, the filled ovals don't seem to reset from the block before. I thought the line in trial.ptp.resetstimulusframes would take care of that, but perhaps there is something I'm missing. Is there a way to reset it such that when it starts a new block, all of the circles start out empty? Thanks! Here is the code above and I added a second pair in (I also added more ovals): <text noun> / items = noun /select = noreplacenorepeat / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text> <item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item> <item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item> <item Jordan> /1 = "Jordan" </item> <item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item> <item Cameron> /1 = "Cameron" </item> <picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture> <picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture> <text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <item pair2_item1> /1 = "FinalVersionToca44_neutral.jpg" </item> <item Reed> /1 = "Reed" </item> <item pair2_item2> /1 = "FinalVersionToca21_neutral.jpg" </item> <item Jesse> /1 = "Jesse" </item> <picture pair2_item1> / items = pair2_item1 / select = noreplacenorepeat / size = (35%, 35%) / position = (30,40) / erase = false </picture> <picture pair2_item2> / items = pair2_item2 / size = (35%, 35%) / position = (70,40) / select = picture.pair2_item1.currentindex / erase = false </picture> <text Reed> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Reed_feedback> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <text Jesse> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text> <text Jesse_feedback> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text> <shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape> <item oval> /1 = "oval.png" /2 = "oval_filled.png" </item> <item oval2> /1 = "oval.png" /2 = "oval_filled2.png" </item> <picture oval1> / items = oval / size = (10%, 10%) / position = (17,10) / select = list.left_set.items.1 / erase = false </picture> <picture oval2> / items = oval / size = (10%, 10%) / position = (24,10) / select = list.left_set.items.2 / erase = false </picture> <picture oval3> / items = oval / size = (10%, 10%) / position = (31,10) / select = list.left_set.items.3 / erase = false </picture> <picture oval4> / items = oval / size = (10%, 10%) / position = (38,10) / select = list.left_set.items.4 / erase = false </picture> <picture oval5> / items = oval / size = (10%, 10%) / position = (45,10) / select = list.left_set.items.5 / erase = false </picture> <picture oval6> / items = oval / size = (10%, 10%) / position = (55,10) / select = list.right_set.items.5 / erase = false </picture> <picture oval7> / items = oval / size = (10%, 10%) / position = (62,10) / select = list.right_set.items.4 / erase = false </picture> <picture oval8> / items = oval / size = (10%, 10%) / position = (69,10) / select = list.right_set.items.3 / erase = false </picture> <picture oval9> / items = oval / size = (10%, 10%) / position = (76,10) / select = list.right_set.items.2 / erase = false </picture> <picture oval10> / items = oval / size = (10%, 10%) / position = (83,10) / select = list.right_set.items.1 / erase = false </picture> <values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 </values> <list left_set> / items = (1,1,1,1,1) </list> <list right_set> / items = (1,1,1,1,1) </list> <trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && values.right_responses < 5) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && values.right_responses >= 5) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && values.left_responses < 5) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && values.left_responses >= 5) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Jordan_feedback, 0) / responsemessage = ("m", Cameron_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> <trial pair2> / ontrialend = [ if (trial.pair2.responsetext == "m" && values.right_responses < 5) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair2.responsetext == "m" && values.right_responses >= 5) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair2.responsetext == "z" && values.left_responses < 5) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair2.responsetext == "z" && values.left_responses >= 5) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; ] / stimulustimes = [0 = pair2_item1, pair2_item2, Reed, Jesse, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Reed_feedback, 0) / responsemessage = ("m", Jesse_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial> <trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-trial.pair1.latency); ] / stimulustimes = [0 = oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = (0) / recorddata = false / trialduration = 4000-trial.pair1.latency </trial> <block pair1> / trials = [1-3 = pair1] </block> <block pair2> / trials = [1-3 = pair2] </block> <expt > / blocks = [1 = pair1; 2 = pair2] </expt> You need to reset the lists and values that are used to keep track of the state of the ovals. <text noun> / items = noun /select = noreplace / position = (50,75) / fontstyle = ("Arial", 40pt) / erase = false </text>
<item noun> / 1 = "ACORN" / 2 = "APPLE" / 3 = "APRON" / 4 = "ATLAS" / 5 = "BACON" / 6 = "BANDAGE" / 7 = "BANJO" / 8 = "BARLEY" / 9 = "BASEBALL" / 10 = "BISCUIT" </item>
<item pair1_item1> /1 = "FinalVersionToca31_neutral.jpg" </item>
<item Jordan> /1 = "Jordan" </item>
<item pair1_item2> /1 = "FinalVersionToca42_neutral.jpg" </item>
<item Cameron> /1 = "Cameron" </item>
<picture pair1_item1> / items = pair1_item1 / select = noreplacenorepeat / size = (40%, 40%) / position = (30,50) / erase = false </picture>
<picture pair1_item2> / items = pair1_item2 / size = (40%, 40%) / position = (70,50) / select = picture.pair1_item1.currentindex / erase = false </picture>
<text Jordan> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Jordan_feedback> / items = Jordan /select = noreplacenorepeat / position = (30,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<text Cameron> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Cameron_feedback> / items = Cameron /select = noreplacenorepeat / position = (70,23) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<item pair2_item1> /1 = "FinalVersionToca44_neutral.jpg" </item>
<item Reed> /1 = "Reed" </item>
<item pair2_item2> /1 = "FinalVersionToca21_neutral.jpg" </item>
<item Jesse> /1 = "Jesse" </item>
<picture pair2_item1> / items = pair2_item1 / select = noreplacenorepeat / size = (35%, 35%) / position = (30,40) / erase = false </picture>
<picture pair2_item2> / items = pair2_item2 / size = (35%, 35%) / position = (70,40) / select = picture.pair2_item1.currentindex / erase = false </picture>
<text Reed> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Reed_feedback> / items = Reed /select = noreplacenorepeat / position = (30,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<text Jesse> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = black </text>
<text Jesse_feedback> / items = Jesse /select = noreplacenorepeat / position = (70,18) / fontstyle = ("Arial", 35pt) / erase = false / color = chartreuse </text>
<shape blank> / color = white / shape = rectangle / size = (100%, 100%) / erase = false </shape>
<item oval> /1 = "oval.png" /2 = "oval_filled.png" </item>
<item oval2> /1 = "oval.png" /2 = "oval_filled2.png" </item>
<picture oval1> / items = oval / size = (10%, 10%) / position = (17,10) / select = list.left_set.items.1 / erase = false </picture>
<picture oval2> / items = oval / size = (10%, 10%) / position = (24,10) / select = list.left_set.items.2 / erase = false </picture>
<picture oval3> / items = oval / size = (10%, 10%) / position = (31,10) / select = list.left_set.items.3 / erase = false </picture>
<picture oval4> / items = oval / size = (10%, 10%) / position = (38,10) / select = list.left_set.items.4 / erase = false </picture>
<picture oval5> / items = oval / size = (10%, 10%) / position = (45,10) / select = list.left_set.items.5 / erase = false </picture>
<picture oval6> / items = oval / size = (10%, 10%) / position = (55,10) / select = list.right_set.items.5 / erase = false </picture>
<picture oval7> / items = oval / size = (10%, 10%) / position = (62,10) / select = list.right_set.items.4 / erase = false </picture>
<picture oval8> / items = oval / size = (10%, 10%) / position = (69,10) / select = list.right_set.items.3 / erase = false </picture>
<picture oval9> / items = oval / size = (10%, 10%) / position = (76,10) / select = list.right_set.items.2 / erase = false </picture>
<picture oval10> / items = oval / size = (10%, 10%) / position = (83,10) / select = list.right_set.items.1 / erase = false </picture>
<values> / left_responses = 0 / right_responses = 0 / left_overflow = 0 / right_overflow = 0 / last_latency = 0 </values>
<list left_set> / items = (1,1,1,1,1) </list>
<list right_set> / items = (1,1,1,1,1) </list>
<trial pair1> / ontrialend = [ if (trial.pair1.responsetext == "m" && (values.left_overflow + values.right_responses < 5)) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair1.responsetext == "m" && (values.left_overflow + values.right_responses >= 5)) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair1.responsetext == "z" && (values.right_overflow + values.left_responses < 5)) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair1.responsetext == "z" && (values.right_overflow + values.left_responses >= 5)) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; values.last_latency = trial.pair1.latency; ] / stimulustimes = [0 = pair1_item1, pair1_item2, Jordan, Cameron, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Jordan_feedback, 0) / responsemessage = ("m", Cameron_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial>
<trial pair2> / ontrialend = [ if (trial.pair2.responsetext == "m" && (values.left_overflow + values.right_responses < 5)) { values.right_responses += 1; list.right_set.setitem(2, values.left_overflow + values.right_responses); } else if (trial.pair2.responsetext == "m" && (values.left_overflow + values.right_responses >= 5)) { values.right_responses += 1; values.right_overflow += 1; list.left_set.setitem(2, values.left_responses + values.right_overflow); } else if (trial.pair2.responsetext == "z" && (values.right_overflow + values.left_responses < 5)) { values.left_responses += 1; list.left_set.setitem(2, values.right_overflow + values.left_responses); } else if (trial.pair2.responsetext == "z" && (values.right_overflow + values.left_responses >= 5)) { values.left_responses += 1; values.left_overflow += 1; list.right_set.setitem(2, values.right_responses + values.left_overflow); }; values.last_latency = trial.pair2.latency; ] / stimulustimes = [0 = pair2_item1, pair2_item2, Reed, Jesse, noun, oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = ("m", "z") / responsemessage = ("z", Reed_feedback, 0) / responsemessage = ("m", Jesse_feedback, 0) / timeout = 3000 / beginresponsetime = 0 / branch = [ trial.ptp; ] </trial>
<trial ptp> / ontrialbegin = [ trial.ptp.resetstimulusframes(); trial.ptp.insertstimulustime(shape.blank, 3000-values.last_latency); ]
/ stimulustimes = [0 = oval1, oval2, oval3, oval4, oval5, oval6, oval7, oval8, oval9, oval10] / validresponse = (0) / recorddata = false / trialduration = 4000-values.last_latency </trial>
<block pair1> / onblockbegin = [ list.left_set.reset(); list.right_set.reset(); values.left_responses = 0; values.right_responses = 0; values.left_overflow = 0; values.right_overflow = 0; values.last_latency = 0; ] / trials = [1-10 = pair1] </block>
<block pair2> / onblockbegin = [ list.left_set.reset(); list.right_set.reset(); values.left_responses = 0; values.right_responses = 0; values.left_overflow = 0; values.right_overflow = 0; values.last_latency = 0; ] / trials = [1-10 = pair2] </block>
<expt> / blocks = [1 = pair1; 2 = pair2] </expt>
Ah, thanks!!
|
|
|