Record correct answer


Author
Message
Expra2
Expra2
Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)
Group: Forum Members
Posts: 6, Visits: 13

Dear all,
our student-research group is conducting an experiment in which matches of Chinesesymbols must be remembered and in the testing-phase the subject must choose thecorrect match to a presented symbol.
The testing screen consists of two parts. One the left-hand side one symbol ispresented and on the right-hand side four different symbols are displayed fromwhich the subject hast to choose one by pressing the corresponding number onthe keyboard.

Our problemis that the four symbols have to be displayed randomized and that the rightanswer has to be among those four symbols. In addition to that we need torecord, if the subject chose the right answer – but since the symbols aredisplayed randomly and the right answers are not in a fixed spot, we havedifficulties doing so.

 

Below you’llfind the code we are using right now.

x_1.jpg andx_2.jpg are the symbols matching each other.  

Our currentidea is to translate the position of the correct answer into a number and putit in a list item, but we are not able to find a way to read out the list inthe end.

Anotheridea is to directly record the position of the correct item and then totranslate the position into the corresponding number.


<item BilderWZCue1>
/1= "1_1.jpg"
/2= "2_1.jpg"
/3= "3_1.jpg"
/4= "4_1.jpg"
/5= "5_1.jpg"
/6= "6_1.jpg"
/7= "7_1.jpg"
/8= "8_1.jpg"
/9= "9_1.jpg"
/10= "10_1.jpg"
/11= "11_1.jpg"
/12= "12_1.jpg"
/13= "13_1.jpg"
/14= "14_1.jpg"
/15= "15_1.jpg"
</item>

<item BilderWZCue2>
/1= "1_2.jpg"
/2= "2_2.jpg"
/3= "3_2.jpg"
/4= "4_2.jpg"
/5= "5_2.jpg"
/6= "6_2.jpg"
/7= "7_2.jpg"
/8= "8_2.jpg"
/9= "9_2.jpg"
/10= "10_2.jpg"
/11= "11_2.jpg"
/12= "12_2.jpg"
/13= "13_2.jpg"
/14= "14_2.jpg"
/15= "15_2.jpg"
</item>

<item BilderDis>
/1= "1_2.jpg"
/2= "2_2.jpg"
/3= "3_2.jpg"
/4= "4_2.jpg"
/5= "5_2.jpg"
/6= "6_2.jpg"
/7= "7_2.jpg"
/8= "8_2.jpg"
/9= "9_2.jpg"
/10= "10_2.jpg"
/11= "11_2.jpg"
/12= "12_2.jpg"
/13= "13_2.jpg"
/14= "14_2.jpg"
/15= "15_2.jpg"
</item>


<picture BilderWZCue1>
/items = BilderWZCue1
/select = noreplace
/size = (300, 300)
/position = (20 ,40)
</picture>

Position der Antwortmöglichkeiten: vertikale Positionen randomisiert variiert
<list randomvpos>
/items = (10%, 35%, 60%, 85%)
/selectionrate = always
</list>

<picture korrekteAntwort>
/items = BilderWZCue2
/select = picture.BilderWZCue1.currentindex
/size = (300, 300)
/vposition = list.randomvpos.nextvalue
</picture>

<counter picselector>
/select = noreplacenorepeat(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
/selectionrate = always
/allowrepeats = false
</counter>

<picture Distraktor2>
/items = BilderDis
/select = picselector
/size = (300, 300)
/vposition = list.randomvpos.nextvalue
</picture>

<picture Distraktor3>
/items = BilderDis
/select = picselector
/size = (300, 300)
/vposition = list.randomvpos.nextvalue
</picture>

<picture Distraktor4>
/items = BilderDis
/select = picselector
/size = (300, 300)
/vposition = list.randomvpos.nextvalue
</picture>

<list Liste1>

</list>

<picture Cuepräsentieren>
/items = BilderWZCue1
/select = list.Liste1
/size = (300, 300)
/position = (20 ,40)
</picture>

<trial Präsentation>
/stimulustimes = [0=BilderWZCue1]
/timeout = 0
/recorddata = false
</trial>

<item Liste2>

</item>


<trial Präsentation2>
/ontrialbegin = [item.BilderDis.removeitem(picture.BilderWZCue1.currentindex)]
/ontrialbegin = [list.Liste1.appenditem(picture.BilderWZCue1.currentindex)]
/stimulustimes = [0=Cuepräsentieren, korrekteAntwort, Distraktor2, Distraktor3, Distraktor4]
/ inputdevice = keyboard
/ validresponse = ("1", "2", "3", "4")
/ontrialend = [item.BilderDis.reset()]
/ontrialend = [list.Liste1.reset()]
/ontrialbegin = [if(picture.korrekteAntwort.vposition==10%) item.Liste2.appenditem("1")]
/ontrialbegin = [if(picture.korrekteAntwort.vposition==35%) item.Liste2.appenditem("2")]
/ontrialbegin = [if(picture.korrekteAntwort.vposition==60%) item.Liste2.appenditem("3")]
/ontrialbegin = [if(picture.korrekteAntwort.vposition==85%) item.Liste2.appenditem("4")]
</trial>

<text Liste2>
/items = Liste2
/select = noreplace
</text>

<trial Positionausführen>
/ stimulustimes = [0=Liste2]
/timeout = 0
/ recorddata = true
/ontrialend = [item.Liste2.reset()]
</trial>

<block Block1>
/trials = [1-15 = Präsentation, Präsentation2, Positionausführen]
</block>

Thank you for your help - we are grateful for every input!




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
Expra2 - Monday, November 07, 2016

Dear all,
our student-research group is conducting an experiment in which matches of Chinesesymbols must be remembered and in the testing-phase the subject must choose thecorrect match to a presented symbol.
The testing screen consists of two parts. One the left-hand side one symbol ispresented and on the right-hand side four different symbols are displayed fromwhich the subject hast to choose one by pressing the corresponding number onthe keyboard.

Our problemis that the four symbols have to be displayed randomized and that the rightanswer has to be among those four symbols. In addition to that we need torecord, if the subject chose the right answer – but since the symbols aredisplayed randomly and the right answers are not in a fixed spot, we havedifficulties doing so.

 

Below you’llfind the code we are using right now.

x_1.jpg andx_2.jpg are the symbols matching each other.  

Our currentidea is to translate the position of the correct answer into a number and putit in a list item, but we are not able to find a way to read out the list inthe end.

Anotheridea is to directly record the position of the correct item and then totranslate the position into the corresponding number.


<item BilderWZCue1>
/1= "1_1.jpg"
/2= "2_1.jpg"
/3= "3_1.jpg"
/4= "4_1.jpg"
/5= "5_1.jpg"
/6= "6_1.jpg"
/7= "7_1.jpg"
/8= "8_1.jpg"
/9= "9_1.jpg"
/10= "10_1.jpg"
/11= "11_1.jpg"
/12= "12_1.jpg"
/13= "13_1.jpg"
/14= "14_1.jpg"
/15= "15_1.jpg"
</item>

<item BilderWZCue2>
/1= "1_2.jpg"
/2= "2_2.jpg"
/3= "3_2.jpg"
/4= "4_2.jpg"
/5= "5_2.jpg"
/6= "6_2.jpg"
/7= "7_2.jpg"
/8= "8_2.jpg"
/9= "9_2.jpg"
/10= "10_2.jpg"
/11= "11_2.jpg"
/12= "12_2.jpg"
/13= "13_2.jpg"
/14= "14_2.jpg"
/15= "15_2.jpg"
</item>

<item BilderDis>
/1= "1_2.jpg"
/2= "2_2.jpg"
/3= "3_2.jpg"
/4= "4_2.jpg"
/5= "5_2.jpg"
/6= "6_2.jpg"
/7= "7_2.jpg"
/8= "8_2.jpg"
/9= "9_2.jpg"
/10= "10_2.jpg"
/11= "11_2.jpg"
/12= "12_2.jpg"
/13= "13_2.jpg"
/14= "14_2.jpg"
/15= "15_2.jpg"
</item>


<picture BilderWZCue1>
/items = BilderWZCue1
/select = noreplace
/size = (300, 300)
/position = (20 ,40)
</picture>

Position der Antwortmöglichkeiten: vertikale Positionen randomisiert variiert
<list randomvpos>
/items = (10%, 35%, 60%, 85%)
/selectionrate = always
</list>

<picture korrekteAntwort>
/items = BilderWZCue2
/select = picture.BilderWZCue1.currentindex
/size = (300, 300)
/vposition = list.randomvpos.nextvalue
</picture>

<counter picselector>
/select = noreplacenorepeat(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14)
/selectionrate = always
/allowrepeats = false
</counter>

<picture Distraktor2>
/items = BilderDis
/select = picselector
/size = (300, 300)
/vposition = list.randomvpos.nextvalue
</picture>

<picture Distraktor3>
/items = BilderDis
/select = picselector
/size = (300, 300)
/vposition = list.randomvpos.nextvalue
</picture>

<picture Distraktor4>
/items = BilderDis
/select = picselector
/size = (300, 300)
/vposition = list.randomvpos.nextvalue
</picture>

<list Liste1>

</list>

<picture Cuepräsentieren>
/items = BilderWZCue1
/select = list.Liste1
/size = (300, 300)
/position = (20 ,40)
</picture>

<trial Präsentation>
/stimulustimes = [0=BilderWZCue1]
/timeout = 0
/recorddata = false
</trial>

<item Liste2>

</item>


<trial Präsentation2>
/ontrialbegin = [item.BilderDis.removeitem(picture.BilderWZCue1.currentindex)]
/ontrialbegin = [list.Liste1.appenditem(picture.BilderWZCue1.currentindex)]
/stimulustimes = [0=Cuepräsentieren, korrekteAntwort, Distraktor2, Distraktor3, Distraktor4]
/ inputdevice = keyboard
/ validresponse = ("1", "2", "3", "4")
/ontrialend = [item.BilderDis.reset()]
/ontrialend = [list.Liste1.reset()]
/ontrialbegin = [if(picture.korrekteAntwort.vposition==10%) item.Liste2.appenditem("1")]
/ontrialbegin = [if(picture.korrekteAntwort.vposition==35%) item.Liste2.appenditem("2")]
/ontrialbegin = [if(picture.korrekteAntwort.vposition==60%) item.Liste2.appenditem("3")]
/ontrialbegin = [if(picture.korrekteAntwort.vposition==85%) item.Liste2.appenditem("4")]
</trial>

<text Liste2>
/items = Liste2
/select = noreplace
</text>

<trial Positionausführen>
/ stimulustimes = [0=Liste2]
/timeout = 0
/ recorddata = true
/ontrialend = [item.Liste2.reset()]
</trial>

<block Block1>
/trials = [1-15 = Präsentation, Präsentation2, Positionausführen]
</block>

Thank you for your help - we are grateful for every input!




Store the respective positions for the "korrekte Antwort" and the three "Distraktor" objects in global variables (<values> entries). Then use a bit of conditional logic to set another variable to the number key corresponding to the position of the "korrekte Antwort" object. Use the <trial>'s /iscorrectresponse attribute to check the participant's response against that variable.

<item BilderWZCue1>
/1= "1_1.jpg"
/2= "2_1.jpg"
/3= "3_1.jpg"
/4= "4_1.jpg"
/5= "5_1.jpg"
/6= "6_1.jpg"
/7= "7_1.jpg"
/8= "8_1.jpg"
/9= "9_1.jpg"
/10= "10_1.jpg"
/11= "11_1.jpg"
/12= "12_1.jpg"
/13= "13_1.jpg"
/14= "14_1.jpg"
/15= "15_1.jpg"
</item>

<item BilderWZCue2>
/1= "1_2.jpg"
/2= "2_2.jpg"
/3= "3_2.jpg"
/4= "4_2.jpg"
/5= "5_2.jpg"
/6= "6_2.jpg"
/7= "7_2.jpg"
/8= "8_2.jpg"
/9= "9_2.jpg"
/10= "10_2.jpg"
/11= "11_2.jpg"
/12= "12_2.jpg"
/13= "13_2.jpg"
/14= "14_2.jpg"
/15= "15_2.jpg"
</item>

<item BilderDis>
/1= "1_2.jpg"
/2= "2_2.jpg"
/3= "3_2.jpg"
/4= "4_2.jpg"
/5= "5_2.jpg"
/6= "6_2.jpg"
/7= "7_2.jpg"
/8= "8_2.jpg"
/9= "9_2.jpg"
/10= "10_2.jpg"
/11= "11_2.jpg"
/12= "12_2.jpg"
/13= "13_2.jpg"
/14= "14_2.jpg"
/15= "15_2.jpg"
</item>


<text BilderWZCue1>
/items = BilderWZCue1
/select = noreplace
/position = (20 ,40)
</text>

Position der Antwortmöglichkeiten: vertikale Positionen randomisiert variiert
<list randomvpos>
/items = (10%, 35%, 60%, 85%)
/selectionrate = always
</list>

<text korrekteAntwort>
/items = BilderWZCue2
/select = text.BilderWZCue1.currentindex
/vposition = values.korrektvpos
</text>

<counter picselector>
/select = noreplacenorepeat(1,2,3,4,5,6,7,8,9,10,11,12,13,14)
/selectionrate = always
/allowrepeats = false
</counter>

<text Distraktor2>
/items = BilderDis
/select = picselector
/vposition = values.distraktor2vpos
</text>

<text Distraktor3>
/items = BilderDis
/select = picselector
/vposition = values.distraktor3vpos
</text>

<text Distraktor4>
/items = BilderDis
/select = picselector
/vposition = values.distraktor4vpos
</text>

<list Liste1>

</list>

<text Cuepräsentieren>
/items = BilderWZCue1
/select = list.Liste1
/position = (20 ,40)
</text>

<trial Präsentation>
/stimulustimes = [0=BilderWZCue1]
/timeout = 0
/recorddata = false
</trial>

<item Liste2>

</item>

<values>
/ korrektvpos = 0
/ distraktor2vpos = 0
/ distraktor3vpos = 0
/ distraktor4vpos = 0
/ korrektetaste = 0
</values>


<trial Präsentation2>
/ontrialbegin = [item.BilderDis.removeitem(text.BilderWZCue1.currentindex)]
/ontrialbegin = [list.Liste1.appenditem(text.BilderWZCue1.currentindex)]
/ ontrialbegin = [
    values.korrektvpos = list.randomvpos.nextvalue;
    values.distraktor2vpos = list.randomvpos.nextvalue;
    values.distraktor3vpos = list.randomvpos.nextvalue;
    values.distraktor4vpos = list.randomvpos.nextvalue;
]
/ ontrialbegin = [
    if (values.korrektvpos == 10%) values.korrektetaste = 2
    else if (values.korrektvpos == 35%) values.korrektetaste = 3
    else if (values.korrektvpos == 60%) values.korrektetaste = 4
    else if (values.korrektvpos == 85%) values.korrektetaste = 5
]

/stimulustimes = [0=Cuepräsentieren, korrekteAntwort, Distraktor2, Distraktor3, Distraktor4]
/ inputdevice = keyboard
/ validresponse = ("1", "2", "3", "4")
/ iscorrectresponse = [
    trial.Präsentation2.response == values.korrektetaste
]
/ontrialend = [item.BilderDis.reset()]
/ontrialend = [list.Liste1.reset()]
/ontrialbegin = [if(text.korrekteAntwort.vposition==10%) item.Liste2.appenditem("1")]
/ontrialbegin = [if(text.korrekteAntwort.vposition==35%) item.Liste2.appenditem("2")]
/ontrialbegin = [if(text.korrekteAntwort.vposition==60%) item.Liste2.appenditem("3")]
/ontrialbegin = [if(text.korrekteAntwort.vposition==85%) item.Liste2.appenditem("4")]
</trial>

<text Liste2>
/items = Liste2
/select = noreplace
</text>

<trial Positionausführen>
/ stimulustimes = [0=Liste2]
/timeout = 0
/ recorddata = true
/ontrialend = [item.Liste2.reset()]
</trial>

<block Block1>
/trials = [1-15 = sequence(Präsentation, Präsentation2, Positionausführen)]
</block>

Expra2
Expra2
Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)Partner Member (730 reputation)
Group: Forum Members
Posts: 6, Visits: 13
Dear Dave,
thank you for your fast and kind answer! It works! You really are a "supreme being"!


Best wishes
Expra2
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search