insertstimulustime not applying conditional statement


Author
Message
aliciay1
aliciay1
Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)
Group: Forum Members
Posts: 12, Visits: 64
Oh great that is really helpful and makes sense. Thanks very much.
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
aliciay1 - 6/23/2020
Oh I understand. Is it possible to trigger the presentation of a stimulus as a key or response is provided at all? 

Or alternatively, if you set the correct response only able to be validated after 2000ms, how would you ensure the stimulus onset following the period in which the response can be provided?

Thank you for your help!

> Is it possible to trigger the presentation of a stimulus as a key or response is provided at all?

Yes. As stated per /correctmessage, /errormessage or /responsemessage.

> Or alternatively, if you set the correct response only able to be validated after 2000ms, how would you ensure the stimulus onset following the period in which the response can be provided?

If only responses with latency > 2000 count as correct, then the correct message cannot possibly be displayed before that.

But again, the actual timing characteristics of your trial are unclear -- your question is in effect not answerable on the basis of the limited information provided.

aliciay1
aliciay1
Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)
Group: Forum Members
Posts: 12, Visits: 64
Oh I understand. Is it possible to trigger the presentation of a stimulus as a key or response is provided at all? 

Or alternatively, if you set the correct response only able to be validated after 2000ms, how would you ensure the stimulus onset following the period in which the response can be provided?

Thank you for your help!
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
aliciay1 - 6/23/2020
Oh great. So below ontrialbegin, inserting:

/errormessage=true(text.errorfeedback,2000)
/correctmessage = true(text.correctfeedback, 2000)

Would correctly display the text depending on whether the correct response was provided during the trial at 2000 ms?

No.

/errormessage=true(text.errorfeedback,2000)
/correctmessage = true(text.correctfeedback, 2000)

defines the *duration* of the feedback stimulus, not its onset. The latter you have to control via other means, How I cannot say since the code snippet you provided is too incomplete and doesn't actually make the relevant timings clear.

Finally, this

> " I am trying to get correctfeedback text to be displayed only when the correctresponse key is pressed after 2000 ms into the trial."

is somewhat confusing, If you want to define a correct response as one that occurs after 2000ms into the trial, why don't you specify that as the correct response directly?

I.e.

/iscorrectresponse = [trial.practice_go.response == values.correctresponsekey && trial.practice_go.latency > 2000]


aliciay1
aliciay1
Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)
Group: Forum Members
Posts: 12, Visits: 64
Oh great. So below ontrialbegin, inserting:

/errormessage=true(text.errorfeedback,2000)
/correctmessage = true(text.correctfeedback, 2000)

Would correctly display the text depending on whether the correct response was provided during the trial at 2000 ms?
Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 13K, Visits: 104K
aliciay1 - 6/23/2020
Hi forum,

I am struggling to get my inquisit code to correctly apply the if statement that suggests when another stimulus should be displayed on screen within a trial.

My current code reads as:
<trial practice_go>
/pretrialpause = values.iti
/ontrialbegin = [
    values.trialtype = "Go";
    values.digit = list.practice_digitsequence.nextvalue;
    values.fontsize = list.practice_fontsizes.nextvalue;
    if (mod(values.digit, 2) == 0) {
        values.even = true;
        values.correctresponsekey = values.responsekey2;
    }
    else {
        values.even = false;
        values.correctresponsekey = values.responsekey1;
    }
    trial.practice_go.insertstimulustime(text.mask, values.digitpresentationtime);
    trial.practice_go.insertstimulustime(shape.background, (values.digitpresentationtime + values.maskpresentationtime));
    if(trial.practice_go.response == values.correctresponsekey) {
    trial.practice_go.insertstimulustime(text.correctfeedback, 2000); } else
    trial.practice_go.insertstimulustime(text.errorfeedback, 2000)]
/ontrialend = [
    trial.practice_go.resetstimulusframes();
]

/stimulustimes = [0 = background, digit]
/responsetime = 0
/responseinterrupt = frames
/monkeyresponse = (24,18)
/iscorrectresponse = [trial.practice_go.response == values.correctresponsekey]
/trialduration = values.digitpresentationtime + values.maskpresentationtime

The bolded text is where I'm having the issue within this trial. I am trying to get correctfeedback text to be displayed only when the correctresponse key is pressed after 2000 ms into the trial. Where correctresponsekey is defined immediately above. However when I run the code, the text is not being appropriately presented depending on if the correctrepsonse is pressed or not. 

Is the if statement incorrectly defined? How can I fix this to ensure that correct feedback is displayed so when an ODD digit is presented and O key (scancode 24) is pressed correct feedback is presented and if and EVEN digit is displayed and the E key (scancode 18) is pressed correct feedback is also displayed. And if the correct corresponding key in NOT pressed the error feedback is displayed? 

Any suggestions would be greatly appreciated. Thanks very much. 

Alicia

You cannot insert a stimulus into an instance of trial /ontrialbegin based on something that only happens later during that instance of the trial.

You need to make use of the trial's /errormessage and /correctmessage attributes instead of trying to use insertstimulustime.

aliciay1
aliciay1
Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)Associate Member (152 reputation)
Group: Forum Members
Posts: 12, Visits: 64
Hi forum,

I am struggling to get my inquisit code to correctly apply the if statement that suggests when another stimulus should be displayed on screen within a trial.

My current code reads as:
<trial practice_go>
/pretrialpause = values.iti
/ontrialbegin = [
    values.trialtype = "Go";
    values.digit = list.practice_digitsequence.nextvalue;
    values.fontsize = list.practice_fontsizes.nextvalue;
    if (mod(values.digit, 2) == 0) {
        values.even = true;
        values.correctresponsekey = values.responsekey2;
    }
    else {
        values.even = false;
        values.correctresponsekey = values.responsekey1;
    }
    trial.practice_go.insertstimulustime(text.mask, values.digitpresentationtime);
    trial.practice_go.insertstimulustime(shape.background, (values.digitpresentationtime + values.maskpresentationtime));
    if(trial.practice_go.response == values.correctresponsekey) {
    trial.practice_go.insertstimulustime(text.correctfeedback, 2000); } else
    trial.practice_go.insertstimulustime(text.errorfeedback, 2000)]
/ontrialend = [
    trial.practice_go.resetstimulusframes();
]

/stimulustimes = [0 = background, digit]
/responsetime = 0
/responseinterrupt = frames
/monkeyresponse = (24,18)
/iscorrectresponse = [trial.practice_go.response == values.correctresponsekey]
/trialduration = values.digitpresentationtime + values.maskpresentationtime

The bolded text is where I'm having the issue within this trial. I am trying to get correctfeedback text to be displayed only when the correctresponse key is pressed after 2000 ms into the trial. Where correctresponsekey is defined immediately above. However when I run the code, the text is not being appropriately presented depending on if the correctrepsonse is pressed or not. 

Is the if statement incorrectly defined? How can I fix this to ensure that correct feedback is displayed so when an ODD digit is presented and O key (scancode 24) is pressed correct feedback is presented and if and EVEN digit is displayed and the E key (scancode 18) is pressed correct feedback is also displayed. And if the correct corresponding key in NOT pressed the error feedback is displayed? 

Any suggestions would be greatly appreciated. Thanks very much. 

Alicia
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search