Millisecond Forums

Retrieve a stimulus for Data analysis

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

 By nonamenick - 2/12/2016 Hi there, So i'm having a problem retrieving certain data that I need from my experiment. Here is an example of a trial:/ 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=="3") {values.win=values.fixedamount; }; ]/ ontrialend = [if (trial.fixedtrial.response=="1" && values.prob >= values.randomnumber) {values.win=values.probamount; }; ]/ ontrialend = [if (trial.fixedtrial.response=="1" && values.prob < values.randomnumber) {values.win=0; }; ]/ ontrialend = [item.storedwinnings.appenditem(values.win); values.score+=values.win; ]/ stimulusframes = [1=3, 1, risk_slides]/ inputdevice = mouse/ response = timeout(10000)/ validresponse = (3, 1)/ posttrialpause = 500The experiment is a choice between a fixed amount ("3") and a lottery ("1") where the participant can either win a certain amount or lose and win nothing. Each lottery will have a different win amount (slidevalues) and win probability (slideprob). The trial is actually presented as a picture with all the information on it, and the participant responds using the mouse and clicking on the lottery or the fixed amount. The data script I have right now is this:/ columns = [date time subject blockcode blocknum trialcode trialnum response latency stimulusnumber stimulusitem stimulusnumber stimulusitem stimulusnumber stimulusitem]The stimulusitem and stimulus number are giving me what the participant chose, either the fixed amount ("3") or chose the lottery ("1"), it also gives me the picture file for each slide. The one thing that is missing that I need, is whether the participant won on that particular trial. I've looked at the language reference for data but it hasn't been able to solve my problem. If anyone has any solutions to this, that would be great help! Thank you!!!!!!!! By Dave - 2/12/2016 > The one thing that is missing that I need, is whether the participant won on that particular trial. You did not explicitly state what in your script would actually convey that information. From glancing over the code in the element and some guessing, I would assume that you'd want to log values.prob, values.randomnumber, values.win and values.score to the data file:/ columns = [date time subject blockcode blocknum trialcode trialnum response latency stimulusnumber stimulusitem stimulusnumber stimulusitem stimulusnumber stimulusitem values.prob values.randomnumber values.win values.score ]