two responses for one trial + displaying feedback for those responses


two responses for one trial + displaying feedback for those responses

Author
Message
elobot9
elobot9
New Member
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)

Group: Forum Members
Posts: 3, Visits: 21
Hello,
I need help with:
- Getting Inquisit to record two valid responses for the same trial while keeping the stimuli in place
- Having it display those responses for the participant at the end of the trial

We are creating an experiment in which the participant sees several displays of 4 shapes, and for each display, selects two shapes (by pressing keys assigned to each shape). After
both shapes have been selected, we want to highlight which shapes were chosen (while keeping the whole display onscreen). 

So far I have managed to get Inquisit to record one response and then immediately indicate which shape was chosen by placing a red X over that shape (ultimately we want to highlight it 
with a rectangle or border). However, after the first shape is selected, Inquisit won't take in any more inputs until the next trial and won't display the shapes chose onscreen.

Below is our code for this aspect of the task. Many thanks!

<text fixation>
/ items = ("+")
/ position = (50,40)
/ txcolor =black
/fontstyle = ("8514oem", 3.70%, false, false, false, false, 5, 1)
</text>

<shape circle1>
/ shape = circle
/ color = gray
/ hposition = counter.horizontal.selectedvalue
/ vposition = counter.vertical.selectedvalue
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape circle2>
/ shape = circle
/ color = gray
/ hposition = counter.horizontal.selectedvalue
/ vposition = counter.vertical.selectedvalue
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle1>
/ shape = rectangle
/ color = gray
/ hposition = counter.horizontal.selectedvalue
/ vposition = counter.vertical.selectedvalue
/ size=(150,150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle2>
/ shape = rectangle
/ color = gray
/ hposition = counter.horizontal.selectedvalue
/ vposition = counter.vertical.selectedvalue
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<text ymessage>
/items = ("X")
/position = (45, 30)
/color = red
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<text umessage>
/items = ("X")
/position = (55, 30)
/color = red
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<text hmessage>
/items = ("X")
/position = (45, 50)
/color = red
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<text jmessage>
/items = ("X")
/position = (55, 50)
/color = red
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

<trial choicetrial>
/stimulusframes = [1=fixation; 99=blank; 100=shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2; 1000=blank]
/validresponse = ("y", "u", "h", "j")
/responseinterrupt = frames
/beginresponsetime=0
/responsemessage = ("y", ymessage, 2000)
/responsemessage = ("u", umessage, 2000)
/responsemessage = ("h", hmessage, 2000)
/responsemessage = ("j", jmessage, 2000)
</trial>

<counter horizontal>
/ items= (55,45,55,45)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vertical>
/ items= (30,30,50,50)
/ select = current(horizontal)
/ selectionrate = always
</counter>


<block fulltrial>
/trials = [1-10=choicetrial]
</block>

Dave
Dave
Supreme Being
Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)

Group: Administrators
Posts: 8.6K, Visits: 36K
elobot9 - Tuesday, February 13, 2018
Hello,
I need help with:
- Getting Inquisit to record two valid responses for the same trial while keeping the stimuli in place
- Having it display those responses for the participant at the end of the trial

We are creating an experiment in which the participant sees several displays of 4 shapes, and for each display, selects two shapes (by pressing keys assigned to each shape). After
both shapes have been selected, we want to highlight which shapes were chosen (while keeping the whole display onscreen). 

So far I have managed to get Inquisit to record one response and then immediately indicate which shape was chosen by placing a red X over that shape (ultimately we want to highlight it 
with a rectangle or border). However, after the first shape is selected, Inquisit won't take in any more inputs until the next trial and won't display the shapes chose onscreen.

Below is our code for this aspect of the task. Many thanks!

<text fixation>
/ items = ("+")
/ position = (50,40)
/ txcolor =black
/fontstyle = ("8514oem", 3.70%, false, false, false, false, 5, 1)
</text>

<shape circle1>
/ shape = circle
/ color = gray
/ hposition = counter.horizontal.selectedvalue
/ vposition = counter.vertical.selectedvalue
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape circle2>
/ shape = circle
/ color = gray
/ hposition = counter.horizontal.selectedvalue
/ vposition = counter.vertical.selectedvalue
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle1>
/ shape = rectangle
/ color = gray
/ hposition = counter.horizontal.selectedvalue
/ vposition = counter.vertical.selectedvalue
/ size=(150,150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle2>
/ shape = rectangle
/ color = gray
/ hposition = counter.horizontal.selectedvalue
/ vposition = counter.vertical.selectedvalue
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<text ymessage>
/items = ("X")
/position = (45, 30)
/color = red
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<text umessage>
/items = ("X")
/position = (55, 30)
/color = red
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<text hmessage>
/items = ("X")
/position = (45, 50)
/color = red
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<text jmessage>
/items = ("X")
/position = (55, 50)
/color = red
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

<trial choicetrial>
/stimulusframes = [1=fixation; 99=blank; 100=shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2; 1000=blank]
/validresponse = ("y", "u", "h", "j")
/responseinterrupt = frames
/beginresponsetime=0
/responsemessage = ("y", ymessage, 2000)
/responsemessage = ("u", umessage, 2000)
/responsemessage = ("h", hmessage, 2000)
/responsemessage = ("j", jmessage, 2000)
</trial>

<counter horizontal>
/ items= (55,45,55,45)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vertical>
/ items= (30,30,50,50)
/ select = current(horizontal)
/ selectionrate = always
</counter>


<block fulltrial>
/trials = [1-10=choicetrial]
</block>

The solution is to split things into separate trials: choice1 (select the 1st shape), branch to choice2 (select a 2nd shape), and from there /branch to a final result trial that displays that highlights the selections made in the two previous trials (choice1 and choice2). To keep the stimuli on-screen uninterrupted during that chain of three trials, simply set their respective /erase attributes to false.

You can find several scripts in the library that essentially do something very similar, for example: https://www.millisecond.com/download/library/v5/columbiacardtask/columbiacardtask_hot/columbiacardtask_hot.web

Taking your code as a starting point, you'd do something like this:

<text fixation>
/ items = ("+")
/ position = (50,40)
/ txcolor =black
/ erase = false
/fontstyle = ("8514oem", 3.70%, false, false, false, false, 5, 1)
</text>

<shape circle1>
/ shape = circle
/ color = gray
/ hposition = values.c1h
/ vposition = values.c1v
/ erase = false
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape circle2>
/ shape = circle
/ color = gray
/ hposition = values.c2h
/ vposition = values.c2v
/ erase = false
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle1>
/ shape = rectangle
/ color = gray
/ hposition = values.r1h
/ vposition = values.r1v
/ erase = false
/ size=(150,150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle2>
/ shape = rectangle
/ color = gray
/ hposition = values.r2h
/ vposition = values.r2v
/ erase = false
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<text ymessage>
/items = ("X")
/position = (45, 30)
/color = red
/ erase = false
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<text umessage>
/items = ("X")
/position = (55, 30)
/color = red
/ erase = false
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<text hmessage>
/items = ("X")
/position = (45, 50)
/color = red
/ erase = false
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<text jmessage>
/items = ("X")
/position = (55, 50)
/color = red
/ erase = false
/size = (100, 100)
/txbgcolor = (transparent)
</text>

<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

<trial choice1>
/ ontrialbegin = [
    values.c1h = counter.horizontal.selectedvalue;
    values.c1v = counter.vertical.selectedvalue;
    values.c2h = counter.horizontal.selectedvalue;
    values.c2v = counter.vertical.selectedvalue;
    values.r1h = counter.horizontal.selectedvalue;
    values.r1v = counter.vertical.selectedvalue;
    values.r2h = counter.horizontal.selectedvalue;
    values.r2v = counter.vertical.selectedvalue;
]
/ ontrialend = [
    if (computer.scancodetochar(trial.choice1.response) == "y") trial.result.insertstimulusframe(text.ymessage, 1);
    if (computer.scancodetochar(trial.choice1.response) == "u") trial.result.insertstimulusframe(text.umessage, 1);
    if (computer.scancodetochar(trial.choice1.response) == "h") trial.result.insertstimulusframe(text.hmessage, 1);
    if (computer.scancodetochar(trial.choice1.response) == "j") trial.result.insertstimulusframe(text.jmessage, 1);
]
/stimulusframes = [1=clearscreen, fixation; 99=blank; 100=shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/validresponse = ("y", "u", "h", "j")
/responseinterrupt = frames
/beginresponsetime=0
/ branch = [
    trial.choice2
]
</trial>

<trial choice2>
/ ontrialend = [
    if (computer.scancodetochar(trial.choice2.response) == "y") trial.result.insertstimulusframe(text.ymessage, 1);
    if (computer.scancodetochar(trial.choice2.response) == "u") trial.result.insertstimulusframe(text.umessage, 1);
    if (computer.scancodetochar(trial.choice2.response) == "h") trial.result.insertstimulusframe(text.hmessage, 1);
    if (computer.scancodetochar(trial.choice2.response) == "j") trial.result.insertstimulusframe(text.jmessage, 1);
]
/stimulusframes = [1=clearscreen, shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/validresponse = ("y", "u", "h", "j")
/responseinterrupt = frames
/beginresponsetime=0
/ branch = [
    trial.result
]
</trial>

<trial result>
/ ontrialend = [
    trial.result.resetstimulusframes();
]
/stimulusframes = [1=clearscreen, shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/ validresponse = (57)
/responseinterrupt = frames
/beginresponsetime=0
</trial>

<counter horizontal>
/ items= (55,45,55,45)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vertical>
/ items= (30,30,50,50)
/ select = current(horizontal)
/ selectionrate = always
</counter>

<block fulltrial>
/trials = [1-10=choice1]
</block>

<values>
/ c1h = 0%
/ c1v = 0%
/ c2h = 0%
/ c2v = 0%
/ r1h = 0%
/ r1v = 0%
/ r2h = 0%
/ r2v = 0%
</values>


elobot9
elobot9
New Member
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)

Group: Forum Members
Posts: 3, Visits: 21
Thanks so much!
elobot9
elobot9
New Member
New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)New Member (16 reputation)

Group: Forum Members
Posts: 3, Visits: 21
Hi again,

We have two follow-up questions:

1. Ultimately we want to be able to record the specific shapes that are chosen by participants on each trial. This is proving problematic at the moment because the keypresses target specific locations rather than the shapes themselves and we are randomising the location of the shapes. The only solution I have to this so far involves making separate versions of choicetrial1 and choicetrial2 with specific locations for the shapes for each possible configuration, which seems massively redundant. Is there a more elegant solution to be found?

2. We want to make sure that participants do not select the same shape twice within a trial. Is there a way to use inputs from the choice1 trial to alter what counts as a valid response for the choice2 trial? Ex. choice1 will take ('y', 'u', 'h', 'j') as valid inputs, and if the participant responds with 'y', choice2 will take only ('u', 'h', 'j') as valid inputs.

Attached is an updated copy of our code (all that has changed is that we are now putting borders around the selected shapes rather than Xs, and that we are providing the feedback after each input rather than at the end of the section).
 
Many thanks!!


<text fixation>
/ items = ("+")
/ position = (50,40)
/ txcolor =black
/ erase = false
/fontstyle = ("8514oem", 3.70%, false, false, false, false, 5, 1)
</text>

<shape circle1>
/ shape = circle
/ color = gray
/ hposition = values.c1h
/ vposition = values.c1v
/ erase = false
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape circle2>
/ shape = circle
/ color = gray
/ hposition = values.c2h
/ vposition = values.c2v
/ erase = false
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle1>
/ shape = rectangle
/ color = gray
/ hposition = values.r1h
/ vposition = values.r1v
/ erase = false
/ size=(150,150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle2>
/ shape = rectangle
/ color = gray
/ hposition = values.r2h
/ vposition = values.r2v
/ erase = false
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

-- Y BORDER --
<shape ybottom>
/ shape = rectangle
/ size = (183,10)
/ position = (45,38)
/erase = false
</shape>

<shape yleft>
/ shape = rectangle
/ size = (10,182)
/ position = (40,30)
/erase = false
</shape>

<shape yright>
/ shape = rectangle
/ size = (10,182)
/ position = (50,30)
/erase = false
</shape>

<shape ytop>
/ shape = rectangle
/ size = (183,10)
/ position = (45,22)
/erase = false
</shape>

-- U BORDER --
<shape ubottom>
/ shape = rectangle
/ size = (183,10)
/ position = (55,38)
</shape>

<shape uleft>
/ shape = rectangle
/ size = (10,182)
/ position = (50,30)
</shape>

<shape uright>
/ shape = rectangle
/ size = (10,182)
/ position = (60,30)
</shape>

<shape utop>
/ shape = rectangle
/ size = (183,10)
/ position = (55,22)
</shape>

-- H BORDER --
<shape hbottom>
/ shape = rectangle
/ size = (183, 10)
/ position = (45,58)
</shape>

<shape hleft>
/ shape = rectangle
/ size = (10,182)
/ position = (40,50)
</shape>

<shape hright>
/ shape = rectangle
/ size = (10,182)
/ position = (50,50)
</shape>

<shape htop>
/ shape = rectangle
/ size = (183,10)
/ position = (45,42)
</shape>

-- J BORDER --
<shape jbottom>
/ shape = rectangle
/ size = (183,10)
/ position = (55,58)
</shape>

<shape jleft>
/ shape = rectangle
/ size = (10,182)
/ position = (50,50)
</shape>

<shape jright>
/ shape = rectangle
/ size = (10,182)
/ position = (60,50)
</shape>

<shape jtop>
/ shape = rectangle
/ size = (183,10)
/ position = (55,42)
</shape>

<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

<trial choice1>
/ ontrialbegin = [
  values.c1h = counter.horizontal.selectedvalue;
  values.c1v = counter.vertical.selectedvalue;
  values.c2h = counter.horizontal.selectedvalue;
  values.c2v = counter.vertical.selectedvalue;
  values.r1h = counter.horizontal.selectedvalue;
  values.r1v = counter.vertical.selectedvalue;
  values.r2h = counter.horizontal.selectedvalue;
  values.r2v = counter.vertical.selectedvalue;
]
/ ontrialend = [
  if (computer.scancodetochar(trial.choice1.response) == "y") {
trial.result1.insertstimulusframe(shape.ybottom, 1);
trial.result1.insertstimulusframe(shape.ytop, 1);
trial.result1.insertstimulusframe(shape.yleft, 1);
trial.result1.insertstimulusframe(shape.yright, 1);
}
  if (computer.scancodetochar(trial.choice1.response) == "u") {
trial.result1.insertstimulusframe(shape.ubottom, 1);
trial.result1.insertstimulusframe(shape.utop, 1);
trial.result1.insertstimulusframe(shape.uleft, 1);
trial.result1.insertstimulusframe(shape.uright, 1);
}
  if (computer.scancodetochar(trial.choice1.response) == "h"){
trial.result1.insertstimulusframe(shape.hbottom, 1);
trial.result1.insertstimulusframe(shape.htop, 1);
trial.result1.insertstimulusframe(shape.hleft, 1);
trial.result1.insertstimulusframe(shape.hright, 1);
}
  if (computer.scancodetochar(trial.choice1.response) == "j"){
trial.result1.insertstimulusframe(shape.hbottom, 1);
trial.result1.insertstimulusframe(shape.htop, 1);
trial.result1.insertstimulusframe(shape.hleft, 1);
trial.result1.insertstimulusframe(shape.hright, 1);
}
]
/stimulusframes = [1=clearscreen, fixation; 99=blank; 100=shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/validresponse = ("y", "u", "h", "j")
/responseinterrupt = frames
/beginresponsetime=0
/ branch = [
  trial.result1
]
</trial>

<trial choice2>
/ ontrialend = [
  if (computer.scancodetochar(trial.choice2.response) == "y") {
trial.result2.insertstimulusframe(shape.ybottom, 1);
trial.result2.insertstimulusframe(shape.ytop, 1);
trial.result2.insertstimulusframe(shape.yleft, 1);
trial.result2.insertstimulusframe(shape.yright, 1);
}
  if (computer.scancodetochar(trial.choice2.response) == "u") {
trial.result2.insertstimulusframe(shape.ubottom, 1);
trial.result2.insertstimulusframe(shape.utop, 1);
trial.result2.insertstimulusframe(shape.uleft, 1);
trial.result2.insertstimulusframe(shape.uright, 1);
}
  if (computer.scancodetochar(trial.choice2.response) == "h"){
trial.result2.insertstimulusframe(shape.hbottom, 1);
trial.result2.insertstimulusframe(shape.htop, 1);
trial.result2.insertstimulusframe(shape.hleft, 1);
trial.result2.insertstimulusframe(shape.hright, 1);
}
  if (computer.scancodetochar(trial.choice2.response) == "j"){
trial.result2.insertstimulusframe(shape.hbottom, 1);
trial.result2.insertstimulusframe(shape.htop, 1);
trial.result2.insertstimulusframe(shape.hleft, 1);
trial.result2.insertstimulusframe(shape.hright, 1);
}
]
/stimulusframes = [1=clearscreen, shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/validresponse = ("y", "h", "u", "j")
/responseinterrupt = frames
/beginresponsetime=0
/ branch = [
  trial.result2
]
</trial>

<trial result1>
/ontrialend = [
trial.result1.resetstimulusframes()
]
/stimulusframes = [1=clearscreen, shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/timeout = 2000
/branch = [
trial.choice2
]
</trial>

<trial result2>
/ ontrialend = [
  trial.result2.resetstimulusframes();
]
/stimulusframes = [1=clearscreen, shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/ validresponse = (57)
/responseinterrupt = frames
/beginresponsetime=0
</trial>

<counter horizontal>
/ items= (55,45,55,45)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vertical>
/ items= (30,30,50,50)
/ select = current(horizontal)
/ selectionrate = always
</counter>

<block fulltrial>
/trials = [1-10=choice1]
</block>

<values>
/ c1h = 0%
/ c1v = 0%
/ c2h = 0%
/ c2v = 0%
/ r1h = 0%
/ r1v = 0%
/ r2h = 0%
/ r2v = 0%
</values>



Dave
Dave
Supreme Being
Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)Supreme Being (339K reputation)

Group: Administrators
Posts: 8.6K, Visits: 36K
elobot9 - Thursday, February 15, 2018
Hi again,

We have two follow-up questions:

1. Ultimately we want to be able to record the specific shapes that are chosen by participants on each trial. This is proving problematic at the moment because the keypresses target specific locations rather than the shapes themselves and we are randomising the location of the shapes. The only solution I have to this so far involves making separate versions of choicetrial1 and choicetrial2 with specific locations for the shapes for each possible configuration, which seems massively redundant. Is there a more elegant solution to be found?

2. We want to make sure that participants do not select the same shape twice within a trial. Is there a way to use inputs from the choice1 trial to alter what counts as a valid response for the choice2 trial? Ex. choice1 will take ('y', 'u', 'h', 'j') as valid inputs, and if the participant responds with 'y', choice2 will take only ('u', 'h', 'j') as valid inputs.

Attached is an updated copy of our code (all that has changed is that we are now putting borders around the selected shapes rather than Xs, and that we are providing the feedback after each input rather than at the end of the section).
 
Many thanks!!


<text fixation>
/ items = ("+")
/ position = (50,40)
/ txcolor =black
/ erase = false
/fontstyle = ("8514oem", 3.70%, false, false, false, false, 5, 1)
</text>

<shape circle1>
/ shape = circle
/ color = gray
/ hposition = values.c1h
/ vposition = values.c1v
/ erase = false
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape circle2>
/ shape = circle
/ color = gray
/ hposition = values.c2h
/ vposition = values.c2v
/ erase = false
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle1>
/ shape = rectangle
/ color = gray
/ hposition = values.r1h
/ vposition = values.r1v
/ erase = false
/ size=(150,150)
/ resetinterval = 1
/erase = false
</shape>

<shape rectangle2>
/ shape = rectangle
/ color = gray
/ hposition = values.r2h
/ vposition = values.r2v
/ erase = false
/ size = (150, 150)
/ resetinterval = 1
/erase = false
</shape>

-- Y BORDER --
<shape ybottom>
/ shape = rectangle
/ size = (183,10)
/ position = (45,38)
/erase = false
</shape>

<shape yleft>
/ shape = rectangle
/ size = (10,182)
/ position = (40,30)
/erase = false
</shape>

<shape yright>
/ shape = rectangle
/ size = (10,182)
/ position = (50,30)
/erase = false
</shape>

<shape ytop>
/ shape = rectangle
/ size = (183,10)
/ position = (45,22)
/erase = false
</shape>

-- U BORDER --
<shape ubottom>
/ shape = rectangle
/ size = (183,10)
/ position = (55,38)
</shape>

<shape uleft>
/ shape = rectangle
/ size = (10,182)
/ position = (50,30)
</shape>

<shape uright>
/ shape = rectangle
/ size = (10,182)
/ position = (60,30)
</shape>

<shape utop>
/ shape = rectangle
/ size = (183,10)
/ position = (55,22)
</shape>

-- H BORDER --
<shape hbottom>
/ shape = rectangle
/ size = (183, 10)
/ position = (45,58)
</shape>

<shape hleft>
/ shape = rectangle
/ size = (10,182)
/ position = (40,50)
</shape>

<shape hright>
/ shape = rectangle
/ size = (10,182)
/ position = (50,50)
</shape>

<shape htop>
/ shape = rectangle
/ size = (183,10)
/ position = (45,42)
</shape>

-- J BORDER --
<shape jbottom>
/ shape = rectangle
/ size = (183,10)
/ position = (55,58)
</shape>

<shape jleft>
/ shape = rectangle
/ size = (10,182)
/ position = (50,50)
</shape>

<shape jright>
/ shape = rectangle
/ size = (10,182)
/ position = (60,50)
</shape>

<shape jtop>
/ shape = rectangle
/ size = (183,10)
/ position = (55,42)
</shape>

<shape blank>
/ color = white
/ shape = rectangle
/ size = (100%, 100%)
/ erase = false
</shape>

<trial choice1>
/ ontrialbegin = [
  values.c1h = counter.horizontal.selectedvalue;
  values.c1v = counter.vertical.selectedvalue;
  values.c2h = counter.horizontal.selectedvalue;
  values.c2v = counter.vertical.selectedvalue;
  values.r1h = counter.horizontal.selectedvalue;
  values.r1v = counter.vertical.selectedvalue;
  values.r2h = counter.horizontal.selectedvalue;
  values.r2v = counter.vertical.selectedvalue;
]
/ ontrialend = [
  if (computer.scancodetochar(trial.choice1.response) == "y") {
trial.result1.insertstimulusframe(shape.ybottom, 1);
trial.result1.insertstimulusframe(shape.ytop, 1);
trial.result1.insertstimulusframe(shape.yleft, 1);
trial.result1.insertstimulusframe(shape.yright, 1);
}
  if (computer.scancodetochar(trial.choice1.response) == "u") {
trial.result1.insertstimulusframe(shape.ubottom, 1);
trial.result1.insertstimulusframe(shape.utop, 1);
trial.result1.insertstimulusframe(shape.uleft, 1);
trial.result1.insertstimulusframe(shape.uright, 1);
}
  if (computer.scancodetochar(trial.choice1.response) == "h"){
trial.result1.insertstimulusframe(shape.hbottom, 1);
trial.result1.insertstimulusframe(shape.htop, 1);
trial.result1.insertstimulusframe(shape.hleft, 1);
trial.result1.insertstimulusframe(shape.hright, 1);
}
  if (computer.scancodetochar(trial.choice1.response) == "j"){
trial.result1.insertstimulusframe(shape.hbottom, 1);
trial.result1.insertstimulusframe(shape.htop, 1);
trial.result1.insertstimulusframe(shape.hleft, 1);
trial.result1.insertstimulusframe(shape.hright, 1);
}
]
/stimulusframes = [1=clearscreen, fixation; 99=blank; 100=shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/validresponse = ("y", "u", "h", "j")
/responseinterrupt = frames
/beginresponsetime=0
/ branch = [
  trial.result1
]
</trial>

<trial choice2>
/ ontrialend = [
  if (computer.scancodetochar(trial.choice2.response) == "y") {
trial.result2.insertstimulusframe(shape.ybottom, 1);
trial.result2.insertstimulusframe(shape.ytop, 1);
trial.result2.insertstimulusframe(shape.yleft, 1);
trial.result2.insertstimulusframe(shape.yright, 1);
}
  if (computer.scancodetochar(trial.choice2.response) == "u") {
trial.result2.insertstimulusframe(shape.ubottom, 1);
trial.result2.insertstimulusframe(shape.utop, 1);
trial.result2.insertstimulusframe(shape.uleft, 1);
trial.result2.insertstimulusframe(shape.uright, 1);
}
  if (computer.scancodetochar(trial.choice2.response) == "h"){
trial.result2.insertstimulusframe(shape.hbottom, 1);
trial.result2.insertstimulusframe(shape.htop, 1);
trial.result2.insertstimulusframe(shape.hleft, 1);
trial.result2.insertstimulusframe(shape.hright, 1);
}
  if (computer.scancodetochar(trial.choice2.response) == "j"){
trial.result2.insertstimulusframe(shape.hbottom, 1);
trial.result2.insertstimulusframe(shape.htop, 1);
trial.result2.insertstimulusframe(shape.hleft, 1);
trial.result2.insertstimulusframe(shape.hright, 1);
}
]
/stimulusframes = [1=clearscreen, shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/validresponse = ("y", "h", "u", "j")
/responseinterrupt = frames
/beginresponsetime=0
/ branch = [
  trial.result2
]
</trial>

<trial result1>
/ontrialend = [
trial.result1.resetstimulusframes()
]
/stimulusframes = [1=clearscreen, shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/timeout = 2000
/branch = [
trial.choice2
]
</trial>

<trial result2>
/ ontrialend = [
  trial.result2.resetstimulusframes();
]
/stimulusframes = [1=clearscreen, shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/ validresponse = (57)
/responseinterrupt = frames
/beginresponsetime=0
</trial>

<counter horizontal>
/ items= (55,45,55,45)
/ select = noreplace
/ selectionrate = always
</counter>

<counter vertical>
/ items= (30,30,50,50)
/ select = current(horizontal)
/ selectionrate = always
</counter>

<block fulltrial>
/trials = [1-10=choice1]
</block>

<values>
/ c1h = 0%
/ c1v = 0%
/ c2h = 0%
/ c2v = 0%
/ r1h = 0%
/ r1v = 0%
/ r2h = 0%
/ r2v = 0%
</values>



Re. #1: You know the location of each shape per the values; c1h & c1v reflect the position of the 1st circle, c2h & c2v reflect the position of the 2nd circle, r1h & r1v reflect the position of the 1st rectangle, and r2h & r2v reflect the position of the 2nd rectangle. Since your keys also map specific locations as well, you can deduce which shapes were chosen in any given sequence of trials from that information.

Re. #2: Yes, you can exclude the response given in trial.choice1 from the valid responses given in trial.choice2 via a bit of /isvalidresponse logic.

<trial choice2>
/ ontrialend = [
  if (computer.scancodetochar(trial.choice2.response) == "y") {
trial.result2.insertstimulusframe(shape.ybottom, 1);
trial.result2.insertstimulusframe(shape.ytop, 1);
trial.result2.insertstimulusframe(shape.yleft, 1);
trial.result2.insertstimulusframe(shape.yright, 1);
}
  if (computer.scancodetochar(trial.choice2.response) == "u") {
trial.result2.insertstimulusframe(shape.ubottom, 1);
trial.result2.insertstimulusframe(shape.utop, 1);
trial.result2.insertstimulusframe(shape.uleft, 1);
trial.result2.insertstimulusframe(shape.uright, 1);
}
  if (computer.scancodetochar(trial.choice2.response) == "h"){
trial.result2.insertstimulusframe(shape.hbottom, 1);
trial.result2.insertstimulusframe(shape.htop, 1);
trial.result2.insertstimulusframe(shape.hleft, 1);
trial.result2.insertstimulusframe(shape.hright, 1);
}
  if (computer.scancodetochar(trial.choice2.response) == "j"){
trial.result2.insertstimulusframe(shape.hbottom, 1);
trial.result2.insertstimulusframe(shape.htop, 1);
trial.result2.insertstimulusframe(shape.hleft, 1);
trial.result2.insertstimulusframe(shape.hright, 1);
}
]
/stimulusframes = [1=clearscreen, shape.circle1, shape.circle2, shape.rectangle1, shape.rectangle2]
/validresponse = ("y", "h", "u", "j")
/ isvalidresponse = [
    trial.choice2.response != trial.choice1.response
]

/responseinterrupt = frames
/beginresponsetime=0
/ branch = [
  trial.result2
]
</trial>

i.e. the response in trial.choice2 is only valid if it is not the same as the response in trial.choice1.

GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search