Multiple response modes within trial


Author
Message
lukasg
lukasg
Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)
Group: Forum Members
Posts: 35, Visits: 103
Dave - 1/26/2022
lukasg - 1/26/2022
Dave - 1/26/2022

In Inquisit parlance, a "value" is what you know as a variable* in other programming languages. A variable keeps the value you assign to until you change it. You assign values to your variables at the start of each instance of <openended trial250>. <trial colorResponse> changes nothing in these variables, so when that trial writes a line to the data file, the values as set in the preceding openended are captured.

*<variables> used to be a diferent syntax construct from early on in Inquisit's history, so the proper moniker was already taken; unfortunate in hindsight.

However, what about variables such as latency. This is overwritten upon the start of the second trial. How would I go about importing the latency of the 1st trial, without specifying a new column for each type of 1st trial (because the first trial will vary on presentation times). I would want to avoid the following:


<data>
/ columns = (build, computer.platform, computer.timerresolution, expressions.canvasRatio, date, time, subject, blockcode, blocknum, trialcode, trialnum,blockcode

values.t, values.t_x, values.t_color, openended.trial250.response, openended.trial250.cresp, values.colorResponse, values.colorCorrect, openended.trial250.latency, openended.trial200.latency, ..


All you need is a variable (value) and then have all openended elements store their latency in that variable. Log that variable.

Great, this is what I ended up doing. Thanks.
lukasg
lukasg
Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)
Group: Forum Members
Posts: 35, Visits: 103
lukasg - 1/26/2022

However, what about variables such as latency. This is overwritten upon the start of the second trial. How would I go about importing the latency of the 1st trial, without specifying a new column for each type of 1st trial (because the first trial will vary on presentation times). I would want to avoid the following:


<data>
/ columns = (build, computer.platform, computer.timerresolution, expressions.canvasRatio, date, time, subject, blockcode, blocknum, trialcode, trialnum,blockcode

values.t, values.t_x, values.t_color, openended.trial250.response, openended.trial250.cresp, values.colorResponse, values.colorCorrect, openended.trial250.latency, openended.trial200.latency, ..


I am sure there are better ways to do this. For now, I figured updating some value (e.g., value.latency) on the end of each 1st trial type will get the job done. For instance:


/ ontrialend = [    
    values.latency = openended.trial250.latency;
    ]

/ ontrialend = [    
    values.latency = openended.trial200.latency;
    ]
    


And so on...
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
lukasg - 1/26/2022
Dave - 1/26/2022

In Inquisit parlance, a "value" is what you know as a variable* in other programming languages. A variable keeps the value you assign to until you change it. You assign values to your variables at the start of each instance of <openended trial250>. <trial colorResponse> changes nothing in these variables, so when that trial writes a line to the data file, the values as set in the preceding openended are captured.

*<variables> used to be a diferent syntax construct from early on in Inquisit's history, so the proper moniker was already taken; unfortunate in hindsight.

However, what about variables such as latency. This is overwritten upon the start of the second trial. How would I go about importing the latency of the 1st trial, without specifying a new column for each type of 1st trial (because the first trial will vary on presentation times). I would want to avoid the following:


<data>
/ columns = (build, computer.platform, computer.timerresolution, expressions.canvasRatio, date, time, subject, blockcode, blocknum, trialcode, trialnum,blockcode

values.t, values.t_x, values.t_color, openended.trial250.response, openended.trial250.cresp, values.colorResponse, values.colorCorrect, openended.trial250.latency, openended.trial200.latency, ..


All you need is a variable (value) and then have all openended elements store their latency in that variable. Log that variable.
lukasg
lukasg
Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)
Group: Forum Members
Posts: 35, Visits: 103
Dave - 1/26/2022

In Inquisit parlance, a "value" is what you know as a variable* in other programming languages. A variable keeps the value you assign to until you change it. You assign values to your variables at the start of each instance of <openended trial250>. <trial colorResponse> changes nothing in these variables, so when that trial writes a line to the data file, the values as set in the preceding openended are captured.

*<variables> used to be a diferent syntax construct from early on in Inquisit's history, so the proper moniker was already taken; unfortunate in hindsight.

However, what about variables such as latency. This is overwritten upon the start of the second trial. How would I go about importing the latency of the 1st trial, without specifying a new column for each type of 1st trial (because the first trial will vary on presentation times). I would want to avoid the following:


<data>
/ columns = (build, computer.platform, computer.timerresolution, expressions.canvasRatio, date, time, subject, blockcode, blocknum, trialcode, trialnum,blockcode

values.t, values.t_x, values.t_color, openended.trial250.response, openended.trial250.cresp, values.colorResponse, values.colorCorrect, openended.trial250.latency, openended.trial200.latency, ..


Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
lukasg - 1/26/2022
Dave - 1/26/2022

> Unfortunately, most values of the 250ms trial are relevant whereas I am only interested in the response during the 2nd trial.

They'll still be logged, so I don't know why you think this would be a problem.

I was under the impression that, similar to what I did before, I would need to save all information in separate 'values'. I suppose the values are logged and overwritten once the next 250ms trial begins? Switching the order solved the issue 

In Inquisit parlance, a "value" is what you know as a variable* in other programming languages. A variable keeps the value you assign to until you change it. You assign values to your variables at the start of each instance of <openended trial250>. <trial colorResponse> changes nothing in these variables, so when that trial writes a line to the data file, the values as set in the preceding openended are captured.

*<variables> used to be a diferent syntax construct from early on in Inquisit's history, so the proper moniker was already taken; unfortunate in hindsight.

lukasg
lukasg
Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)
Group: Forum Members
Posts: 35, Visits: 103
Dave - 1/26/2022

> Unfortunately, most values of the 250ms trial are relevant whereas I am only interested in the response during the 2nd trial.

They'll still be logged, so I don't know why you think this would be a problem.

I was under the impression that, similar to what I did before, I would need to save all information in separate 'values'. I suppose the values are logged and overwritten once the next 250ms trial begins? Switching the order solved the issue 
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
lukasg - 1/26/2022
Dave - 1/26/2022

You're doing things the wrong way around. The openended *precedes* the color response trial. The openended can't look into the future and log information it cannot possibly know yet.

Meaning rather than saving values of the 2nd trial, I need to save those of the 1st (250 ms) trial? Unfortunately, most values of the 250ms trial are relevant whereas I am only interested in the response during the 2nd trial.

> Unfortunately, most values of the 250ms trial are relevant whereas I am only interested in the response during the 2nd trial.

They'll still be logged, so I don't know why you think this would be a problem.

lukasg
lukasg
Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)
Group: Forum Members
Posts: 35, Visits: 103
Dave - 1/26/2022

You're doing things the wrong way around. The openended *precedes* the color response trial. The openended can't look into the future and log information it cannot possibly know yet.

Meaning rather than saving values of the 2nd trial, I need to save those of the 1st (250 ms) trial? Unfortunately, most values of the 250ms trial are relevant whereas I am only interested in the response during the 2nd trial.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 105K
lukasg - 1/26/2022
Dave - 1/26/2022

Sure, store the response from the openended (textbox) in a value, set the openended's /recorddata attribute to false, log the value to the raw data file.

As always, much appreciated Dave. I do encounter an issue with the data though, and the data seem not to save to the corresponding trial. In the attached screenshot, no response is saved for the first trial which makes be think there is an offset ()?

<openended trial250>
/ 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);

// 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; 401 = clearscreen]
    
/ mask = positiveinteger
/ beginresponsetime = 600
/ correctresponse = (values.correctdigit)

/ branch = [if(openended.trialPractice.correct == 1 || openended.trialPractice.correct == 0)trial.colorResponse]

/ ontrialend = [
    // save data
    list.targetColor.appenditem(values.cresp);


// reset relevant lists for next trial
list.d_items.reset();
list.d_x.reset();
list.d_colors.reset();
]

</openended>





<trial colorResponse>

/ recorddata = false

/ 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; 1 = 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)


/ ontrialend = [
    values.colorResponse = trial.colorResponse.response;
    values.colorCorrect = trial.colorResponse.correct;
]

/ posttrialpause = 1000

</trial>




<data>

/ columns = (build, computer.platform, computer.timerresolution, expressions.canvasRatio, date, time, subject, group, blockcode, blocknum, trialcode, trialnum,
script.sessionid, script.currentblock, script.currenttrialnumber,

values.t, values.t_x, values.t_color, values.colorResponse, values.cresp, values.colorCorrect, correct, latency, values.d1_color, values.d2_color, values.dig1, values.dig2, values.cresp, response

...


Where does my saving the trial information go wrong?

You're doing things the wrong way around. The openended *precedes* the color response trial. The openended can't look into the future and log information it cannot possibly know yet.
lukasg
lukasg
Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)Partner Member (633 reputation)
Group: Forum Members
Posts: 35, Visits: 103
Dave - 1/26/2022

Sure, store the response from the openended (textbox) in a value, set the openended's /recorddata attribute to false, log the value to the raw data file.

As always, much appreciated Dave. I do encounter an issue with the data though, and the data seem not to save to the corresponding trial. In the attached screenshot, no response is saved for the first trial which makes be think there is an offset ()?

<openended trial250>
/ 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);

// 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; 401 = clearscreen]
    
/ mask = positiveinteger
/ beginresponsetime = 600
/ correctresponse = (values.correctdigit)

/ branch = [if(openended.trialPractice.correct == 1 || openended.trialPractice.correct == 0)trial.colorResponse]

/ ontrialend = [
    // save data
    list.targetColor.appenditem(values.cresp);


// reset relevant lists for next trial
list.d_items.reset();
list.d_x.reset();
list.d_colors.reset();
]

</openended>





<trial colorResponse>

/ recorddata = false

/ 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; 1 = 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)


/ ontrialend = [
    values.colorResponse = trial.colorResponse.response;
    values.colorCorrect = trial.colorResponse.correct;
]

/ posttrialpause = 1000

</trial>




<data>

/ columns = (build, computer.platform, computer.timerresolution, expressions.canvasRatio, date, time, subject, group, blockcode, blocknum, trialcode, trialnum,
script.sessionid, script.currentblock, script.currenttrialnumber,

values.t, values.t_x, values.t_color, values.colorResponse, values.cresp, values.colorCorrect, correct, latency, values.d1_color, values.d2_color, values.dig1, values.dig2, values.cresp, response

...


Where does my saving the trial information go wrong?
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search