lukasg
|
|
Group: Forum Members
Posts: 35,
Visits: 103
|
Hi All, I am trying to combine a textbox response with a mouse-click response. For the former, participants should enter two earlier displayed digits (e.g., 7 and 9). For the latter, participants should press on one of several simultaneously presented shapes to indicate the colour of a target. A similar issue was raised in a previous forum post ( https://www.millisecond.com/forums/Topic14994.aspx) from 8 years ago. Hence, I was wondering whether there would be a more straightforward way of doing so. My current trial looks as follows: /stimulustimes = [0 = clearscreen; 1 = fixation; 150 = clearscreen; 151 = t, d1, d2 , dig1, dig2; 350 = clearscreen; 600 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] / correctresponse = (values.cresp) / inputdevice = mouse / validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8) </trial>
Now, I would like to add the textbox entry before the shape selection screen. Ideally, I would want to avoid switching to another trial. Is this possible? All the best, Lukas
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+xHi All, I am trying to combine a textbox response with a mouse-click response. For the former, participants should enter two earlier displayed digits (e.g., 7 and 9). For the latter, participants should press on one of several simultaneously presented shapes to indicate the colour of a target. A similar issue was raised in a previous forum post ( https://www.millisecond.com/forums/Topic14994.aspx) from 8 years ago. Hence, I was wondering whether there would be a more straightforward way of doing so. My current trial looks as follows: /stimulustimes = [0 = clearscreen; 1 = fixation; 150 = clearscreen; 151 = t, d1, d2 , dig1, dig2; 350 = clearscreen; 600 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] / correctresponse = (values.cresp) / inputdevice = mouse / validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8) </trial>
Now, I would like to add the textbox entry before the shape selection screen. Ideally, I would want to avoid switching to another trial. Is this possible? All the best, Lukas No, you'll need two trials. An <openended> for the textbox response, followed by the shape selection <trial>.
|
|
|
lukasg
|
|
Group: Forum Members
Posts: 35,
Visits: 103
|
+xNo, you'll need two trials. An <openended> for the textbox response, followed by the shape selection <trial>. Thanks for your response. When trying to set this up, two follow-up questions arose: a) Can the opendeded trial be followed by the 2nd response type automatically? The following code cannot be the way to do this: <block 250ms> / trials = [1 = trial200; 2 = res2; 3 = trial200; 4 = res2; ...] </block> b) The correct response for the textbox should be a combination of the two presented digits. For instance, when 1 and 9 were presented I want the correct response to be 19. With the following code I have only managed to get both answer options to be correct, or the added value to the the correct response: / mask = positiveinteger / correctresponse = (values.dig1,values.dig2)
// OR
/ correctreponse = (valuesdig1 + values.dig2)
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+xNo, you'll need two trials. An <openended> for the textbox response, followed by the shape selection <trial>. Thanks for your response. When trying to set this up, two follow-up questions arose: a) Can the opendeded trial be followed by the 2nd response type automatically? The following code cannot be the way to do this: <block 250ms> / trials = [1 = trial200; 2 = res2; 3 = trial200; 4 = res2; ...] </block> b) The correct response for the textbox should be a combination of the two presented digits. For instance, when 1 and 9 were presented I want the correct response to be 19. With the following code I have only managed to get both answer options to be correct, or the added value to the the correct response: / mask = positiveinteger / correctresponse = (values.dig1,values.dig2)
// OR
/ correctreponse = (valuesdig1 + values.dig2) Re. a): You can /branch from the <openended> to the follow-up <trial>. Re. b): You'll want to do / ontrialbegin = [values.correctanswer = concat(values.dig1, values.dig2);] with / correctresponse = (values.correctanswer)
|
|
|
lukasg
|
|
Group: Forum Members
Posts: 35,
Visits: 103
|
+xRe. a): You can /branch from the <openended> to the follow-up <trial>. Re. b): You'll want to do / ontrialbegin = [values.correctanswer = concat(values.dig1, values.dig2);] with / correctresponse = (values.correctanswer) Thanks again Dave!
|
|
|
lukasg
|
|
Group: Forum Members
Posts: 35,
Visits: 103
|
+xRe. a): You can /branch from the <openended> to the follow-up <trial>. Re. b): You'll want to do / ontrialbegin = [values.correctanswer = concat(values.dig1, values.dig2);] with / correctresponse = (values.correctanswer) I have done so but I run into several issues with the code. <openended trialPractice> / ontrialbegin = [ // combine digits values.correctdigit = concat(values.dig1, values.dig2); // select digit items values.dig1 = list.digits.nextvalue; values.dig2 = list.digits.nextvalue; // select target item values.t = list.t_items.nextvalue; // select distractor items values.d1 = list.d_items.nextvalue; values.d2 = list.d_items.nextvalue; // select target position values.t_x = list.t_x.nextvalue; // select distractor positions values.d1_x = list.d_x.nextvalue; values.d2_x = list.d_x.nextvalue; // select target color values.t_color = list.t_colors.nextvalue; // and corresponding response key // select distractor colors values.d1_color = list.d_colors.nextvalue; values.d2_color = list.d_colors.nextvalue; ]
/stimulustimes = [0 = clearscreen; 1 = fixation; 150 = clearscreen; 151 = t, d1, d2 , dig1, dig2; 350 = clearscreen; 600 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] / mask = positiveinteger / beginresponsetime = 600 / correctresponse = (values.correctdigit) // correctresponse = (values.cresp) / inputdevice = mouse // validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)
/ branch = [if(trial.trialPractice.correct == 1 || trial.trialPractice.correct == 0)trial.colorResponse]
/ ontrialend = [ // reset relevant lists for next trial list.d_items.reset(); list.d_x.reset(); list.d_colors.reset(); ]
</openended>
<trial colorResponse>
/ ontrialbegin = [ if(values.t_color == #1f77b4){ values.cresp = "1" } else if (values.t_color == #ff7f0e){ values.cresp = "2" } else if (values.t_color == #2ca02c){ values.cresp = "3" } else if (values.t_color == #d62728){ values.cresp = "4" } else if (values.t_color == #9467bd){ values.cresp = "5" } else if (values.t_color == #8c564b){ values.cresp = "6" } else if (values.t_color == #e377c2){ values.cresp = "7" } else if (values.t_color == #17becf){ values.cresp = "8" }; ]
/stimulustimes = [0 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] // validresponse = ("1", "2", "3", "4", "5", "6", "7", "8") / correctresponse = (values.cresp) / inputdevice = mouse / validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)
</trial>
<block practice> / trials = [1-5 = trialPractice]
/ correctmessage = true(correctmsg, 500) / errormessage = true(errormsg, 500) </block>
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+xRe. a): You can /branch from the <openended> to the follow-up <trial>. Re. b): You'll want to do / ontrialbegin = [values.correctanswer = concat(values.dig1, values.dig2);] with / correctresponse = (values.correctanswer) I have done so but I run into several issues with the code. <openended trialPractice> / ontrialbegin = [ // combine digits values.correctdigit = concat(values.dig1, values.dig2); // select digit items values.dig1 = list.digits.nextvalue; values.dig2 = list.digits.nextvalue; // select target item values.t = list.t_items.nextvalue; // select distractor items values.d1 = list.d_items.nextvalue; values.d2 = list.d_items.nextvalue; // select target position values.t_x = list.t_x.nextvalue; // select distractor positions values.d1_x = list.d_x.nextvalue; values.d2_x = list.d_x.nextvalue; // select target color values.t_color = list.t_colors.nextvalue; // and corresponding response key // select distractor colors values.d1_color = list.d_colors.nextvalue; values.d2_color = list.d_colors.nextvalue; ]
/stimulustimes = [0 = clearscreen; 1 = fixation; 150 = clearscreen; 151 = t, d1, d2 , dig1, dig2; 350 = clearscreen; 600 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] / mask = positiveinteger / beginresponsetime = 600 / correctresponse = (values.correctdigit) // correctresponse = (values.cresp) / inputdevice = mouse // validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)
/ branch = [if(trial.trialPractice.correct == 1 || trial.trialPractice.correct == 0)trial.colorResponse]
/ ontrialend = [ // reset relevant lists for next trial list.d_items.reset(); list.d_x.reset(); list.d_colors.reset(); ]
</openended>
<trial colorResponse>
/ ontrialbegin = [ if(values.t_color == #1f77b4){ values.cresp = "1" } else if (values.t_color == #ff7f0e){ values.cresp = "2" } else if (values.t_color == #2ca02c){ values.cresp = "3" } else if (values.t_color == #d62728){ values.cresp = "4" } else if (values.t_color == #9467bd){ values.cresp = "5" } else if (values.t_color == #8c564b){ values.cresp = "6" } else if (values.t_color == #e377c2){ values.cresp = "7" } else if (values.t_color == #17becf){ values.cresp = "8" }; ]
/stimulustimes = [0 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] // validresponse = ("1", "2", "3", "4", "5", "6", "7", "8") / correctresponse = (values.cresp) / inputdevice = mouse / validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)
</trial>
<block practice> / trials = [1-5 = trialPractice]
/ correctmessage = true(correctmsg, 500) / errormessage = true(errormsg, 500) </block> Order matters. You're "combining" digits BEFORE you have selected digits in the given round. You need to combine them AFTER.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+xRe. a): You can /branch from the <openended> to the follow-up <trial>. Re. b): You'll want to do / ontrialbegin = [values.correctanswer = concat(values.dig1, values.dig2);] with / correctresponse = (values.correctanswer) I have done so but I run into several issues with the code. <openended trialPractice> / ontrialbegin = [ // combine digits values.correctdigit = concat(values.dig1, values.dig2); // select digit items values.dig1 = list.digits.nextvalue; values.dig2 = list.digits.nextvalue; // select target item values.t = list.t_items.nextvalue; // select distractor items values.d1 = list.d_items.nextvalue; values.d2 = list.d_items.nextvalue; // select target position values.t_x = list.t_x.nextvalue; // select distractor positions values.d1_x = list.d_x.nextvalue; values.d2_x = list.d_x.nextvalue; // select target color values.t_color = list.t_colors.nextvalue; // and corresponding response key // select distractor colors values.d1_color = list.d_colors.nextvalue; values.d2_color = list.d_colors.nextvalue; ]
/stimulustimes = [0 = clearscreen; 1 = fixation; 150 = clearscreen; 151 = t, d1, d2 , dig1, dig2; 350 = clearscreen; 600 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] / mask = positiveinteger / beginresponsetime = 600 / correctresponse = (values.correctdigit) // correctresponse = (values.cresp) / inputdevice = mouse // validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)
/ branch = [if(trial.trialPractice.correct == 1 || trial.trialPractice.correct == 0)trial.colorResponse]
/ ontrialend = [ // reset relevant lists for next trial list.d_items.reset(); list.d_x.reset(); list.d_colors.reset(); ]
</openended>
<trial colorResponse>
/ ontrialbegin = [ if(values.t_color == #1f77b4){ values.cresp = "1" } else if (values.t_color == #ff7f0e){ values.cresp = "2" } else if (values.t_color == #2ca02c){ values.cresp = "3" } else if (values.t_color == #d62728){ values.cresp = "4" } else if (values.t_color == #9467bd){ values.cresp = "5" } else if (values.t_color == #8c564b){ values.cresp = "6" } else if (values.t_color == #e377c2){ values.cresp = "7" } else if (values.t_color == #17becf){ values.cresp = "8" }; ]
/stimulustimes = [0 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] // validresponse = ("1", "2", "3", "4", "5", "6", "7", "8") / correctresponse = (values.cresp) / inputdevice = mouse / validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)
</trial>
<block practice> / trials = [1-5 = trialPractice]
/ correctmessage = true(correctmsg, 500) / errormessage = true(errormsg, 500) </block> Order matters. You're "combining" digits BEFORE you have selected digits in the given round. You need to combine them AFTER. Here / branch = [if( trial.trialPractice.correct == 1 || trial.trialPractice.correct == 0)trial.colorResponse] it's not a <trial> element. It's an <openended>.
|
|
|
Dave
|
|
Group: Administrators
Posts: 13K,
Visits: 105K
|
+x+x+x+xRe. a): You can /branch from the <openended> to the follow-up <trial>. Re. b): You'll want to do / ontrialbegin = [values.correctanswer = concat(values.dig1, values.dig2);] with / correctresponse = (values.correctanswer) I have done so but I run into several issues with the code. <openended trialPractice> / ontrialbegin = [ // combine digits values.correctdigit = concat(values.dig1, values.dig2); // select digit items values.dig1 = list.digits.nextvalue; values.dig2 = list.digits.nextvalue; // select target item values.t = list.t_items.nextvalue; // select distractor items values.d1 = list.d_items.nextvalue; values.d2 = list.d_items.nextvalue; // select target position values.t_x = list.t_x.nextvalue; // select distractor positions values.d1_x = list.d_x.nextvalue; values.d2_x = list.d_x.nextvalue; // select target color values.t_color = list.t_colors.nextvalue; // and corresponding response key // select distractor colors values.d1_color = list.d_colors.nextvalue; values.d2_color = list.d_colors.nextvalue; ]
/stimulustimes = [0 = clearscreen; 1 = fixation; 150 = clearscreen; 151 = t, d1, d2 , dig1, dig2; 350 = clearscreen; 600 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] / mask = positiveinteger / beginresponsetime = 600 / correctresponse = (values.correctdigit) // correctresponse = (values.cresp) / inputdevice = mouse // validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)
/ branch = [if(trial.trialPractice.correct == 1 || trial.trialPractice.correct == 0)trial.colorResponse]
/ ontrialend = [ // reset relevant lists for next trial list.d_items.reset(); list.d_x.reset(); list.d_colors.reset(); ]
</openended>
<trial colorResponse>
/ ontrialbegin = [ if(values.t_color == #1f77b4){ values.cresp = "1" } else if (values.t_color == #ff7f0e){ values.cresp = "2" } else if (values.t_color == #2ca02c){ values.cresp = "3" } else if (values.t_color == #d62728){ values.cresp = "4" } else if (values.t_color == #9467bd){ values.cresp = "5" } else if (values.t_color == #8c564b){ values.cresp = "6" } else if (values.t_color == #e377c2){ values.cresp = "7" } else if (values.t_color == #17becf){ values.cresp = "8" }; ]
/stimulustimes = [0 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] // validresponse = ("1", "2", "3", "4", "5", "6", "7", "8") / correctresponse = (values.cresp) / inputdevice = mouse / validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)
</trial>
<block practice> / trials = [1-5 = trialPractice]
/ correctmessage = true(correctmsg, 500) / errormessage = true(errormsg, 500) </block> Order matters. You're "combining" digits BEFORE you have selected digits in the given round. You need to combine them AFTER. Here / branch = [if( trial.trialPractice.correct == 1 || trial.trialPractice.correct == 0)trial.colorResponse] it's not a <trial> element. It's an <openended>. Here, these no longer make sense. Those aren't your response options anymore. You're now using objects called "shape1" to "shape8" <trial colorResponse> / ontrialbegin = [ if(values.t_color == #1f77b4){ values.cresp = "1" } else if (values.t_color == #ff7f0e){ values.cresp = "2" } else if (values.t_color == #2ca02c){ values.cresp = "3" } else if (values.t_color == #d62728){ values.cresp = "4" } else if (values.t_color == #9467bd){ values.cresp = "5" } else if (values.t_color == #8c564b){ values.cresp = "6" } else if (values.t_color == #e377c2){ values.cresp = "7" } else if (values.t_color == #17becf){ values.cresp = "8" }; ] /stimulustimes = [0 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] // validresponse = ("1", "2", "3", "4", "5", "6", "7", "8") / correctresponse = (values.cresp) / inputdevice = mouse / validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)</trial>
|
|
|
lukasg
|
|
Group: Forum Members
Posts: 35,
Visits: 103
|
+xHere, these no longer make sense. Those aren't your response options anymore. You're now using objects called "shape1" to "shape8" <trial colorResponse> / ontrialbegin = [ if(values.t_color == #1f77b4){ values.cresp = "1" } else if (values.t_color == #ff7f0e){ values.cresp = "2" } else if (values.t_color == #2ca02c){ values.cresp = "3" } else if (values.t_color == #d62728){ values.cresp = "4" } else if (values.t_color == #9467bd){ values.cresp = "5" } else if (values.t_color == #8c564b){ values.cresp = "6" } else if (values.t_color == #e377c2){ values.cresp = "7" } else if (values.t_color == #17becf){ values.cresp = "8" }; ] /stimulustimes = [0 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] // validresponse = ("1", "2", "3", "4", "5", "6", "7", "8") / correctresponse = (values.cresp) / inputdevice = mouse / validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)</trial> Thanks, surprisingly the branch worked with trial.colorResponse also. I tidied up the code and it is working now: <openended trialPractice> / ontrialbegin = [ // select digit items values.dig1 = list.digits.nextvalue; values.dig2 = list.digits.nextvalue; // select target item values.t = list.t_items.nextvalue; // select distractor items values.d1 = list.d_items.nextvalue; values.d2 = list.d_items.nextvalue; // select target position values.t_x = list.t_x.nextvalue; // select distractor positions values.d1_x = list.d_x.nextvalue; values.d2_x = list.d_x.nextvalue; // select target color values.t_color = list.t_colors.nextvalue; // and corresponding response key // combine digits values.correctdigit = concat(values.dig1, values.dig2); //#1f77b4, #ff7f0e, #2ca02c, #d62728, #9467bd, #8c564b, #e377c2, #17becf //1 dark blue, 2 orange, 3 green, 4 red, 5 purple, 6 brown, 7 pink, 8 light blue
// select distractor colors values.d1_color = list.d_colors.nextvalue; values.d2_color = list.d_colors.nextvalue; ]
/stimulustimes = [0 = clearscreen; 1 = fixation; 150 = clearscreen; 151 = t, d1, d2 , dig1, dig2; 350 = clearscreen;] / mask = positiveinteger / beginresponsetime = 350 / correctresponse = (values.correctdigit)
/ branch = [if(openended.trialPractice.correct == 1 || openended.trialPractice.correct == 0)trial.colorResponse]
/ ontrialend = [ // reset relevant lists for next trial list.d_items.reset(); list.d_x.reset(); list.d_colors.reset(); ]
</openended>
<trial colorResponse>
/ ontrialbegin = [ if(values.t_color == #1f77b4){ values.cresp = "shape1" } else if (values.t_color == #ff7f0e){ values.cresp = "shape2" } else if (values.t_color == #2ca02c){ values.cresp = "shape3" } else if (values.t_color == #d62728){ values.cresp = "shape4" } else if (values.t_color == #9467bd){ values.cresp = "shape5" } else if (values.t_color == #8c564b){ values.cresp = "shape6" } else if (values.t_color == #e377c2){ values.cresp = "shape7" } else if (values.t_color == #17becf){ values.cresp = "shape8" }; ]
/stimulustimes = [0 = clearscreen; 650 = shape1, shape2, shape3, shape4, shape5, shape6, shape7, shape8] // validresponse = ("1", "2", "3", "4", "5", "6", "7", "8") / correctresponse = (values.cresp) / inputdevice = mouse / validresponse = (shape1,shape2,shape3,shape4,shape5,shape6,shape7,shape8)
</trial>
|
|
|