Correct picture name not saving in the 'response' column following mouse click on picture


Author
Message
pops
pops
Esteemed Member (2.4K reputation)Esteemed Member (2.4K reputation)Esteemed Member (2.4K reputation)Esteemed Member (2.4K reputation)Esteemed Member (2.4K reputation)Esteemed Member (2.4K reputation)Esteemed Member (2.4K reputation)Esteemed Member (2.4K reputation)Esteemed Member (2.4K reputation)
Group: Forum Members
Posts: 69, Visits: 85
I am about to start editing an experiment file so wanted to fix this issue in it before I started. Last time I ran the experiment there was one place where the data file did not correctly record the image being shown. Luckily I could still work out and recode behaviour, but I think in the interests of making future code available to others etc it would be better to get things saving correctly. Below is the critical bit of the code. In the data file, if participants click on the monster image during the trial, then it records a *different* monster image name in the 'response' column. As there is only one image on screen at a time I can recode it as simply 'clicked on image yes/no' but it's a bit unnerving (I've extensively tested it and luckily the 'values.picname' and 'values.monsterType' variables are recording correctly). It seems totally random as to the picname that appears in the 'response' column in the datafile. I think the errors come about due to the rather complex counterbalancing? Or perhaps it is because I am using multiple ontrialbegin commands in the trial? Any advice appreciated.

<item monsterImages>
/ 1 ="M1.GIF"
/ 2 ="M2.GIF"
/ 3 ="M3.GIF"
/ 4 ="M4.GIF"
</item>

<list counterB>
/ items = (1,2,3,4)
/ selectionmode =random
/ selectionrate = experiment
</list>

<expressions>
/pic2 = if (values.counterbalance==3) {4} else {mod(values.counterbalance + 1, 4)}
/pic3 = if (values.counterbalance==2) {4} else {mod(values.counterbalance + 2, 4)}
/pic4 = if (values.counterbalance==1) {4} else {mod(values.counterbalance + 3, 4)}
</expressions>

<list transferTrialType>
/items = (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
/ selectionmode = random
/ selectionrate = trial
/replace=false
</list>

<values>
/monsterType = " "
/picName = ""
</values>

<picture goToWinIcePic>
/ items = monsterImages
/ select = values.counterbalance
</picture>

<picture goToWinChocPic>
/ items = monsterImages
/ select = expressions.pic2
</picture>

...

<trial transferTrial>
/ inputdevice = mouse
/ ontrialbegin = [
    values.trialType = list.transferTrialType.nextvalue;
    trial.transferTrial.insertstimulustime(shape.eraser, parameters.fixationduration);
        {lots of other commands here using 'if (mod(values.trialType, 4)==x', but not involving the variables below}
      ]
/ ontrialbegin = [    
        if (mod(values.trialType, 4)==1){
        trial.transferTrial.insertstimulustime(picture.goToWinIcePic, parameters.fixationduration);
        values.picName = picture.goToWinIcePic.currentitem; values.monsterType = "goToWinIce"}
        else if (mod(values.trialType, 4)==2){
        trial.transferTrial.insertstimulustime(picture.nogoToWinIcePic, parameters.fixationduration);
        values.picName = picture.nogoToWinIcePic.currentitem;values.monsterType = "nogoToWinIce"}
.......
        ]
    / validresponse = (goToWinChocPic,nogoToWinChocPic, goToWinIcePic, nogoToWinIcePic, noresponse)
    / ontrialend = [trial.transferTrial.resetstimulusframes();]
</trial>

<block transferTrials>
/ onblockbegin = [values.blockCount +=1; values.trialcount = 0;]
/ trials = [1-20 = transferTrial]
</block>

<expt>
/ blocks = [1 = instrumTrials; 2 = pavlovianTrials; 3 = transferTrials]
/onexptbegin = [values.counterbalance = list.counterB.nextvalue;]
</expt>


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search