Millisecond Forums

does not record for a trial when no response was made with /stop criteria

https://forums.millisecond.com/Topic30613.aspx

By nidhi_desai - 1/26/2021

Inquisit does not record <data> for a trial in which no response was made. This happens when my trial has multiple responses and includes /responsemessage and /stop criteria. If I change the /stop criteria to /trialduration, I can get the <data> to record all the trials but this trial only shows the /responsemessage for the first response and not the subsequent responses. How do I record a row in <data> for a trial which allows multiple responses and has the /stop criteria, but a participant chooses not to respond in that trial?
By Dave - 1/26/2021

nidhi_desai - 1/26/2021
Inquisit does not record <data> for a trial in which no response was made. This happens when my trial has multiple responses and includes /responsemessage and /stop criteria. If I change the /stop criteria to /trialduration, I can get the <data> to record all the trials but this trial only shows the /responsemessage for the first response and not the subsequent responses. How do I record a row in <data> for a trial which allows multiple responses and has the /stop criteria, but a participant chooses not to respond in that trial?

You can do


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

<values>
/ n_responses = 0
/ rt = 0
/ prev_rt = 0
/ diff_rt = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.n_responses = 0;
    values.rt = 0;
    values.prev_rt = 0;
    values.diff_rt = 0;
]
/ ontrialend = [
    if (trial.mytrial.response == 0);
    values.n_responses = 0;
]
/ stop = [
  trial.mytrial.latency >=10000;
]
/ trialduration = 10000
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ isvalidresponse = [
    if (trial.mytrial.responsetext == "E" || trial.mytrial.responsetext == "I"){
        values.n_responses += 1;
        values.rt = trial.mytrial.latency;
        values.diff_rt = values.rt - values.prev_rt;
        values.prev_rt = values.rt;
        true;
    }
]
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 90%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 90%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response latency values.diff_rt values.n_responses)
</data>


for example


By nidhi_desai - 1/26/2021

Dave - 1/27/2021
nidhi_desai - 1/26/2021
Inquisit does not record <data> for a trial in which no response was made. This happens when my trial has multiple responses and includes /responsemessage and /stop criteria. If I change the /stop criteria to /trialduration, I can get the <data> to record all the trials but this trial only shows the /responsemessage for the first response and not the subsequent responses. How do I record a row in <data> for a trial which allows multiple responses and has the /stop criteria, but a participant chooses not to respond in that trial?

You can do


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

<values>
/ n_responses = 0
/ rt = 0
/ prev_rt = 0
/ diff_rt = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.n_responses = 0;
    values.rt = 0;
    values.prev_rt = 0;
    values.diff_rt = 0;
]
/ ontrialend = [
    if (trial.mytrial.response == 0);
    values.n_responses = 0;
]
/ stop = [
  trial.mytrial.latency >=10000;
]
/ trialduration = 10000
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ isvalidresponse = [
    if (trial.mytrial.responsetext == "E" || trial.mytrial.responsetext == "I"){
        values.n_responses += 1;
        values.rt = trial.mytrial.latency;
        values.diff_rt = values.rt - values.prev_rt;
        values.prev_rt = values.rt;
        true;
    }
]
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 90%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 90%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response latency values.diff_rt values.n_responses)
</data>


for example



So is it not recording a row in <data> because non of the values changed in a trial where no response was made compared to the previosu one?
By Dave - 1/26/2021

nidhi_desai - 1/27/2021
Dave - 1/27/2021
nidhi_desai - 1/26/2021
Inquisit does not record <data> for a trial in which no response was made. This happens when my trial has multiple responses and includes /responsemessage and /stop criteria. If I change the /stop criteria to /trialduration, I can get the <data> to record all the trials but this trial only shows the /responsemessage for the first response and not the subsequent responses. How do I record a row in <data> for a trial which allows multiple responses and has the /stop criteria, but a participant chooses not to respond in that trial?

You can do


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

<values>
/ n_responses = 0
/ rt = 0
/ prev_rt = 0
/ diff_rt = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.n_responses = 0;
    values.rt = 0;
    values.prev_rt = 0;
    values.diff_rt = 0;
]
/ ontrialend = [
    if (trial.mytrial.response == 0);
    values.n_responses = 0;
]
/ stop = [
  trial.mytrial.latency >=10000;
]
/ trialduration = 10000
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ isvalidresponse = [
    if (trial.mytrial.responsetext == "E" || trial.mytrial.responsetext == "I"){
        values.n_responses += 1;
        values.rt = trial.mytrial.latency;
        values.diff_rt = values.rt - values.prev_rt;
        values.prev_rt = values.rt;
        true;
    }
]
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 90%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 90%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response latency values.diff_rt values.n_responses)
</data>


for example



So is it not recording a row in <data> because non of the values changed in a trial where no response was made compared to the previosu one?

It's not recording data in the other case because there is no data to record and the trial does not "know" that it has an implicit timeout due to the stop criterion. The solution is to make the timeout explicit and adjust the stop criterion accordingly (if a trial times out and no response is received, the trial's timeout value is treated as the trial's latency).
By nidhi_desai - 1/26/2021

Dave - 1/27/2021
nidhi_desai - 1/26/2021
Inquisit does not record <data> for a trial in which no response was made. This happens when my trial has multiple responses and includes /responsemessage and /stop criteria. If I change the /stop criteria to /trialduration, I can get the <data> to record all the trials but this trial only shows the /responsemessage for the first response and not the subsequent responses. How do I record a row in <data> for a trial which allows multiple responses and has the /stop criteria, but a participant chooses not to respond in that trial?

You can do


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

<values>
/ n_responses = 0
/ rt = 0
/ prev_rt = 0
/ diff_rt = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.n_responses = 0;
    values.rt = 0;
    values.prev_rt = 0;
    values.diff_rt = 0;
]
/ ontrialend = [
    if (trial.mytrial.response == 0);
    values.n_responses = 0;
]
/ stop = [
  trial.mytrial.latency >=10000;
]
/ trialduration = 10000
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ isvalidresponse = [
    if (trial.mytrial.responsetext == "E" || trial.mytrial.responsetext == "I"){
        values.n_responses += 1;
        values.rt = trial.mytrial.latency;
        values.diff_rt = values.rt - values.prev_rt;
        values.prev_rt = values.rt;
        true;
    }
]
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 90%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 90%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response latency values.diff_rt values.n_responses)
</data>


for example



I tried having a
/ontrialend = [
if (trial.mytrial.response == 0);
values.n_responses = 0;
]

in the trial and values.n_responses in <data>, but it did not add a row in the output for when the trial had no responses.
By Dave - 1/26/2021

nidhi_desai - 1/27/2021
Dave - 1/27/2021
nidhi_desai - 1/26/2021
Inquisit does not record <data> for a trial in which no response was made. This happens when my trial has multiple responses and includes /responsemessage and /stop criteria. If I change the /stop criteria to /trialduration, I can get the <data> to record all the trials but this trial only shows the /responsemessage for the first response and not the subsequent responses. How do I record a row in <data> for a trial which allows multiple responses and has the /stop criteria, but a participant chooses not to respond in that trial?

You can do


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

<values>
/ n_responses = 0
/ rt = 0
/ prev_rt = 0
/ diff_rt = 0
</values>

<trial mytrial>
/ ontrialbegin = [
    values.n_responses = 0;
    values.rt = 0;
    values.prev_rt = 0;
    values.diff_rt = 0;
]
/ ontrialend = [
    if (trial.mytrial.response == 0);
    values.n_responses = 0;
]
/ stop = [
  trial.mytrial.latency >=10000;
]
/ trialduration = 10000
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ isvalidresponse = [
    if (trial.mytrial.responsetext == "E" || trial.mytrial.responsetext == "I"){
        values.n_responses += 1;
        values.rt = trial.mytrial.latency;
        values.diff_rt = values.rt - values.prev_rt;
        values.prev_rt = values.rt;
        true;
    }
]
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 90%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 90%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response latency values.diff_rt values.n_responses)
</data>


for example



I tried having a
/ontrialend = [
if (trial.mytrial.response == 0);
values.n_responses = 0;
]

in the trial and values.n_responses in <data>, but it did not add a row in the output for when the trial had no responses.

What code are you running? What I gave you above, i.e.


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

<values>
/ n_responses = 0
/ rt = 0
/ prev_rt = 0
/ diff_rt = 0
</values>

<trial mytrial>
/ ontrialbegin = [
  values.n_responses = 0;
  values.rt = 0;
  values.prev_rt = 0;
  values.diff_rt = 0;
]
/ ontrialend = [
  if (trial.mytrial.response == 0);
  values.n_responses = 0;
]
/ stop = [
trial.mytrial.latency >=10000;
]
/ trialduration = 10000
/ stimulustimes = [0=clearscreen,mytext]
/ validresponse = ("E", "I")
/ isvalidresponse = [
  if (trial.mytrial.responsetext == "E" || trial.mytrial.responsetext == "I"){
   values.n_responses += 1;
   values.rt = trial.mytrial.latency;
   values.diff_rt = values.rt - values.prev_rt;
   values.prev_rt = values.rt;
   true;
  }
]
/ responsemessage = ("E", Epress, 100)
/ responsemessage = ("I", Ipress, 100)
</trial>

<text mytext>
/ items = ("Press the E and I keys. You have 10 seconds.")
/ erase = false
</text>

<text Epress>
/ items = ("Pressed E")
/ position = (50%, 90%)
</text>

<text Ipress>
/ items = ("Pressed I")
/ position = (50%, 90%)
</text>

<data>
/ columns = (date time subject group session blocknum blockcode trialnum trialcode response latency values.diff_rt values.n_responses)
</data>

should produce a data file just fine in case of no response: