Millisecond Forums

Framing a target with a square, repeating trials when the participant is wrong

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

By DannyPilgrim - 5/26/2020

Hello everyone!

I am programming an experiment where two images are shown: A number (either left or right) and a letter (either left or right)
The participants have to press a left or right key for the position of the number.
I have built every possible combination as an object/ trial in Inquisit. (Number from 1-9; letter from a-i)

An example (letter g; number 7):
<trial g_7>
/ontrialbegin = [
    values.congruency = 1;
]
/ posttrialpause = 750
/ correctresponse = ("k") / beginresponsetime = 1000
/ validresponse = ("d", "k")
/ stimulustimes = [0=Fixationcross; 1500=clearscreen; 2500=clearscreen; 1000=clearscreen; 1000=g_links, 7_rechts]
/ timeout = 6500
/ontrialend = [
    list.responses.insertitem(trial.g_7.correct, 1);
    list.responses_congruent.insertitem(trial.g_7.correct, 1);
    
    if (trial.g_7.correct) {        
        list.latencies.insertitem(trial.g_7.latency, 1);
        list.latencies_congruent.insertitem(trial.g_7.latency, 1);

My question is:
- Is it possible to edit a square around the target of the first random trial of the list?
- How can I define that everytime when the participant pushed the wrong key, the target of the next trial is again framed with a square?
- How can I show a defined trial again, when the participant pushed the wrong button?

I can give you more Information if necessary :)
Tank you very much!
Danny
By Dave - 5/26/2020

DannyPilgrim - 5/26/2020
Hello everyone!

I am programming an experiment where two images are shown: A number (either left or right) and a letter (either left or right)
The participants have to press a left or right key for the position of the number.
I have built every possible combination as an object/ trial in Inquisit. (Number from 1-9; letter from a-i)

An example (letter g; number 7):
<trial g_7>
/ontrialbegin = [
    values.congruency = 1;
]
/ posttrialpause = 750
/ correctresponse = ("k") / beginresponsetime = 1000
/ validresponse = ("d", "k")
/ stimulustimes = [0=Fixationcross; 1500=clearscreen; 2500=clearscreen; 1000=clearscreen; 1000=g_links, 7_rechts]
/ timeout = 6500
/ontrialend = [
    list.responses.insertitem(trial.g_7.correct, 1);
    list.responses_congruent.insertitem(trial.g_7.correct, 1);
    
    if (trial.g_7.correct) {        
        list.latencies.insertitem(trial.g_7.latency, 1);
        list.latencies_congruent.insertitem(trial.g_7.latency, 1);

My question is:
- Is it possible to edit a square around the target of the first random trial of the list?
- How can I define that everytime when the participant pushed the wrong key, the target of the next trial is again framed with a square?
- How can I show a defined trial again, when the participant pushed the wrong button?

I can give you more Information if necessary :)
Tank you very much!
Danny

- Is it possible to edit a square around the target of the first random trial of the list?

Yes. Use conditional logic and the insertstimulustime() function /ontrialbegin to insert the square into the stimulus presentation sequence if the given trial is the 1st.

-  How can I define that everytime when the participant pushed the wrong key, the target of the next trial is again framed with a square?

Same as above.

- How can I show a defined trial again, when the participant pushed the wrong button?

/branch to the same trial in case of an error.
By DannyPilgrim - 5/28/2020

Dave - 5/26/2020
DannyPilgrim - 5/26/2020
Hello everyone!

I am programming an experiment where two images are shown: A number (either left or right) and a letter (either left or right)
The participants have to press a left or right key for the position of the number.
I have built every possible combination as an object/ trial in Inquisit. (Number from 1-9; letter from a-i)

An example (letter g; number 7):
<trial g_7>
/ontrialbegin = [
    values.congruency = 1;
]
/ posttrialpause = 750
/ correctresponse = ("k") / beginresponsetime = 1000
/ validresponse = ("d", "k")
/ stimulustimes = [0=Fixationcross; 1500=clearscreen; 2500=clearscreen; 1000=clearscreen; 1000=g_links, 7_rechts]
/ timeout = 6500
/ontrialend = [
    list.responses.insertitem(trial.g_7.correct, 1);
    list.responses_congruent.insertitem(trial.g_7.correct, 1);
    
    if (trial.g_7.correct) {        
        list.latencies.insertitem(trial.g_7.latency, 1);
        list.latencies_congruent.insertitem(trial.g_7.latency, 1);

My question is:
- Is it possible to edit a square around the target of the first random trial of the list?
- How can I define that everytime when the participant pushed the wrong key, the target of the next trial is again framed with a square?
- How can I show a defined trial again, when the participant pushed the wrong button?

I can give you more Information if necessary :)
Tank you very much!
Danny

- Is it possible to edit a square around the target of the first random trial of the list?

Yes. Use conditional logic and the insertstimulustime() function /ontrialbegin to insert the square into the stimulus presentation sequence if the given trial is the 1st.

-  How can I define that everytime when the participant pushed the wrong key, the target of the next trial is again framed with a square?

Same as above.

- How can I show a defined trial again, when the participant pushed the wrong button?

/branch to the same trial in case of an error.

Hello Dave,

thank you for your quick response.
Could you tell me more specific how these conditional lines look like?
Because I do not know how to define this and I could not find anything useful.

Thank you very much!

Greetings,
Danin
By Dave - 5/28/2020

DannyPilgrim - 5/28/2020
Dave - 5/26/2020
DannyPilgrim - 5/26/2020
Hello everyone!

I am programming an experiment where two images are shown: A number (either left or right) and a letter (either left or right)
The participants have to press a left or right key for the position of the number.
I have built every possible combination as an object/ trial in Inquisit. (Number from 1-9; letter from a-i)

An example (letter g; number 7):
<trial g_7>
/ontrialbegin = [
    values.congruency = 1;
]
/ posttrialpause = 750
/ correctresponse = ("k") / beginresponsetime = 1000
/ validresponse = ("d", "k")
/ stimulustimes = [0=Fixationcross; 1500=clearscreen; 2500=clearscreen; 1000=clearscreen; 1000=g_links, 7_rechts]
/ timeout = 6500
/ontrialend = [
    list.responses.insertitem(trial.g_7.correct, 1);
    list.responses_congruent.insertitem(trial.g_7.correct, 1);
    
    if (trial.g_7.correct) {        
        list.latencies.insertitem(trial.g_7.latency, 1);
        list.latencies_congruent.insertitem(trial.g_7.latency, 1);

My question is:
- Is it possible to edit a square around the target of the first random trial of the list?
- How can I define that everytime when the participant pushed the wrong key, the target of the next trial is again framed with a square?
- How can I show a defined trial again, when the participant pushed the wrong button?

I can give you more Information if necessary :)
Tank you very much!
Danny

- Is it possible to edit a square around the target of the first random trial of the list?

Yes. Use conditional logic and the insertstimulustime() function /ontrialbegin to insert the square into the stimulus presentation sequence if the given trial is the 1st.

-  How can I define that everytime when the participant pushed the wrong key, the target of the next trial is again framed with a square?

Same as above.

- How can I show a defined trial again, when the participant pushed the wrong button?

/branch to the same trial in case of an error.

Hello Dave,

thank you for your quick response.
Could you tell me more specific how these conditional lines look like?
Because I do not know how to define this and I could not find anything useful.

Thank you very much!

Greetings,
Danin

If you search the forum for those terms, you can find plenty of examples. I cannot give you any concrete example code because (1) the snippet of your code you provided is too incomplete to be a useful basis, and (2) your overall description of what you want is too vague / leaves too many blank spots.

Give me something to work with -- e.g. a runnable version of your code, containing, say, 4 or 4 example trials -- and I'll be happy to give you a concrete example.