Picture Pairing.


Author
Message
nonamenick
nonamenick
Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)
Group: Awaiting Activation
Posts: 20, Visits: 100
Hi, I have a snippet of my script here hoping to get some suggestions on how to recall a single picture/trial at the end of the experiment. Each slide(picture) is associated with a couple numbers ( a fixed win amount, a gamble win amount, and a gamble win percentage) that are expressed on the slide. The script currently stores the results of the winning amount and recalls one trial's result at random at the end of the experiment and from which trial it was on. I wish to recall the slide(picture) that is associated with that trial. This way the participant can visually see the trial that was picked for their reward instead of just seeing the result. 

Here is the snippet of the script:

<values>
/ prob = 0
/ probamount = 0
/ fixedamount = 5
/ win = 0
/ randomnumber = 0
/ slidevalues = 0
/ lottery = 0
</values>
**********************************blocks**************************************************************
<block fixedblock>
/ trials = [1-5=fixedtrial]
</block>

<trial fixedtrial>
/ ontrialbegin = [values.probamount=list.slidevalues.nextvalue; values.prob=list.slideprob.nextvalue; values.win=0; ]
/ ontrialbegin = [values.randomnumber = rand(0,100); ]
/ ontrialbegin = [picture.risk_slides]
/ ontrialend = [if (trial.fixedtrial.response=="30") {values.win=values.fixedamount;}; ]
/ ontrialend = [if (trial.fixedtrial.response=="10" && values.prob >= values.randomnumber) {values.win=values.probamount; values.lottery=100 }; ]
/ ontrialend = [if (trial.fixedtrial.response=="10" && values.prob < values.randomnumber) {values.win=0;values.lottery=69 }; ]
/ ontrialend = [item.storedwinnings.appenditem(values.win) ]
/ stimulusframes = [1=30, 10, risk_slides]
/ inputdevice = mouse
/ response = timeout(5000)
/ validresponse = (30, 10)
/ posttrialpause = 100
</trial>




<picture risk_slides>
/items = ("1#5#13.png","1#8#13.png","1#20#13.png","1#50#13.png","1#125#13.png",
"1#5#25.png","1#8#25.png","1#20#25.png","1#50#25.png","1#125#25.png",
"1#5#38.png","1#8#38.png","1#20#38.png","1#50#38.png","1#125#38.png",
"1#5#50.png","1#8#50.png","1#20#50.png","1#50#50.png","1#125#50.png",
"1#5#75.png","1#8#75.png","1#20#75.png","1#50#75.png","1#125#75.png",)
/ size = (80%, 80%)
/ select = list.slidevalues.currentindex
</picture>


<list slidevalues>
/ items = (5,8,20,50,125,5,8,20,50,125,5,8,20,50,125,5,8,20,50,125,5,8,20,50,125)
/selectionmode = random
</list>


<list slideprob>
/ items = (13, 13, 13, 13, 13, 25, 25, 25, 25, 25, 38, 38, 38, 38, 38, 50, 50, 50, 50, 50, 75, 75, 75, 75, 75)
/selectionmode = list.slidevalues.currentindex
</list>


<text 30>
/ items = ("0")
/ position = (25%, 50%)
/ fontstyle = ("Arial", 75%)
</text>
fixed

<text 10>
/ items = ("1")
/ position = (67%, 50%)
/ fontstyle = ("Arial", 70%)
</text>
Known


<trial payouttrial>
/ stimulusframes = [1=payoutmsg, payout, trialmsg, endslide]
/ validresponse = (57)
</trial>

<block payoutblock>
/ trials = [1=payouttrial]
</block>

<text payoutmsg>
/ items = ("Your payout is")
/ position = (50%, 40%)
</text>

<text payout>
/ items = storedwinnings
</text>

<text trialmsg>
/ items = ("which is the amount you won in trial #<%text.payout.currentitemnumber%>."
)
/ position = (50%, 60%)
</text>

<picture endslide>
/ items = ("<%picture.risk_slides.currentitem%>")
/ position = (25%, 25%)
/ size = (20%, 20%)
</picture>

<item storedwinnings>
</item>



The error is involving appending the picture while also appending the winnings.

Any help would be great! 
Thanks again
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
<picture endslide>
/ items = ("<%picture.risk_slides.currentitem%>")
/ position = (25%, 25%)
/ size = (20%, 20%)
</picture>

this is invalid syntax and will not work. What you need to do instead is store the displayed slide item (or item number) just like you already store the winnings. Then, in the final trial, retrieve the item (number) along with the associated win amount. Have <picture endslide> display that item.

In other words, you'll want to do with <picture endslide> exactly the same thing that you already do with <text payout> and its items.

nonamenick
nonamenick
Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)
Group: Awaiting Activation
Posts: 20, Visits: 100
I changed some of the script regarding the <picture endslide> but have been getting this error saying it is unable to initialize the picture and to verify that it exist. I think my script is not properly storing the picture or recalling it.

This is what I have added...

<picture endslide>
/ items = endslide
</picture>

<trial endslidetrial>
/ stimulusframes = [1=endslide]
/ validresponse = (57)
</trial>

<item endslide>
</item>

<block payoutblock>
/ trials = [1=payouttrial; 2=endslidetrial]
</block>

as well as 
/ ontrialend = [item.endslide.appenditem()]

in < trial fixedtrial>




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
> / ontrialend = [item.endslide.appenditem()]
> in < trial fixedtrial>

is wrong and will to append any item. The "()" is empty, but it must of course contain the actual item you want to append as in

item.endslide.appenditem(picture.somepicture.currentitem)


nonamenick
nonamenick
Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)
Group: Awaiting Activation
Posts: 20, Visits: 100
I figured as much but just wasn't sure of the proper way to append the picture. Anyways I have added the proper language into the append picture and it is finally showing a picture at the end of the experiment (which is great), however, the picture that is showing is not the same as the payout trial. For example, if the payout trial was trial 4, the slide that comes up is not 4. I'm trying to make it so that the slide that is shown coincides with the trial that is picked for the payout. 

This is the updated <trial fixedtrial> with the append picture. 

<trial fixedtrial>
/ ontrialbegin = [values.probamount=list.slidevalues.nextvalue; values.prob=list.slideprob.nextvalue; values.win=0; ]
/ ontrialbegin = [values.randomnumber = rand(0,100); ]
/ ontrialbegin = [picture.risk_slides]
/ ontrialend = [if (trial.fixedtrial.response=="30") {values.win=values.fixedamount;}; ]
/ ontrialend = [if (trial.fixedtrial.response=="10" && values.prob >= values.randomnumber) {values.win=values.probamount; values.lottery=100 }; ]
/ ontrialend = [if (trial.fixedtrial.response=="10" && values.prob < values.randomnumber) {values.win=0;values.lottery=69 }; ]
/ ontrialend = [item.storedwinnings.appenditem(values.win) ]
/ ontrialend = [item.endslide.appenditem(picture.risk_slides.currentitem)]
/ stimulusframes = [1=30, 10, risk_slides]
/ inputdevice = mouse
/ response = timeout(5000)
/ validresponse = (30, 10)
/ posttrialpause = 100
</trial>


Should the storedwinnings and endslide be in the same bracket? or is there something else that needs to be done?


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
<picture endslide> needs to be set to select the same item number as <text payout>

<picture endslide>
/ items = endslide
/ select = text.payout.currentindex
</picture>
nonamenick
nonamenick
Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)Distinguished Member (3K reputation)
Group: Awaiting Activation
Posts: 20, Visits: 100
Gotcha, seems to be working perfectly now.

Once again Dave, thanks so much for your help!!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search