## Variable Trial Number

##### Variable Trial Number
 Author Message mrg4 posted 6 Years Ago ANSWER HOT         Group: Forum Members Posts: 19, Visits: 218 Hi,I am currently working on creating templates for some standard procedures which only vary in their stimulus material and a few parameters.One of those parameters is the number of trials within a specific block.Is there any chance of using values within a block's trial-attribute?Here is a example of how I imagine the ideal sultion:/trials = [1-values.NumTrials = noreplace(trialA, trialB)/...Is this possible somehow?Thanks in advance!Dominik Dave posted 6 Years Ago ANSWER         Group: Administrators Posts: 12K, Visits: 89K +xmrg4 - Tuesday, November 7, 2017Hi,I am currently working on creating templates for some standard procedures which only vary in their stimulus material and a few parameters.One of those parameters is the number of trials within a specific block.Is there any chance of using values within a block's trial-attribute?Here is a example of how I imagine the ideal sultion:/trials = [1-values.NumTrials = noreplace(trialA, trialB)/...Is this possible somehow?Thanks in advance!DominikYou can achieve this by performing trial selection via a and setting the 's /poolsize via :/ ntrials = 10/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]The above will run 10 trials (5 x a; 5 x b).Change the ntrials parameter to 20, and you'll get 10 x a and 10 x b:/ ntrials = 20/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]Hope this helps. mrg4 posted 6 Years Ago ANSWER         Group: Forum Members Posts: 19, Visits: 218 +xDave - Tuesday, November 7, 2017+xmrg4 - Tuesday, November 7, 2017Hi,I am currently working on creating templates for some standard procedures which only vary in their stimulus material and a few parameters.One of those parameters is the number of trials within a specific block.Is there any chance of using values within a block's trial-attribute?Here is a example of how I imagine the ideal sultion:/trials = [1-values.NumTrials = noreplace(trialA, trialB)/...Is this possible somehow?Thanks in advance!DominikYou can achieve this by performing trial selection via a and setting the 's /poolsize via :/ ntrials = 10/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]The above will run 10 trials (5 x a; 5 x b).Change the ntrials parameter to 20, and you'll get 10 x a and 10 x b:/ ntrials = 20/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]Hope this helps.Thank you so much for your quick response! That's the solution I was looking for! :)Best regards. AndrewPapale          Group: Forum Members Posts: 26, Visits: 101 +x mrg4 - 11/9/2017+xDave - Tuesday, November 7, 2017+xmrg4 - Tuesday, November 7, 2017Hi,I am currently working on creating templates for some standard procedures which only vary in their stimulus material and a few parameters.One of those parameters is the number of trials within a specific block.Is there any chance of using values within a block's trial-attribute?Here is a example of how I imagine the ideal sultion:/trials = [1-values.NumTrials = noreplace(trialA, trialB)/...Is this possible somehow?Thanks in advance!DominikYou can achieve this by performing trial selection via a and setting the 's /poolsize via :/ ntrials = 10/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]The above will run 10 trials (5 x a; 5 x b).Change the ntrials parameter to 20, and you'll get 10 x a and 10 x b:/ ntrials = 20/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]Hope this helps.Thank you so much for your quick response! That's the solution I was looking for! :)Best regards.I am trying to implement this to randomize total trial numbers, but it is not working correctly.  e.g. in the code I specified, I wanted it to run 5 trials, and Inquisit is instead running exactly 3 trials of my task.  The only difference appears to be that I branch from my trial in trial list to a feedback screen, and then from that feedback screen to list.triallist.nextvalue.  Any help would be appreciated!/ onblockbegin = [    values.scrfunc = noreplace("IEV","DEV","CEV","CEVR","IEV","DEV","IEV","DEV");    parameters.ntrials = 5;    values.blockCount = values.blockCount + 1;    values.trialCount = values.trialCount + parameters.ntrials;    ]/ stop = [    block.experiment.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/items = (trial.experiment)/ poolsize = parameters.ntrials/ branch = [    return trial.dispFeedback;]/ branch = [    list.triallist.nextvalue]/ blocks = [    1=instructions;    2=experiment;    3=experiment;    4=endscreen;] Dave posted Last Month ANSWER         Group: Administrators Posts: 12K, Visits: 89K +x AndrewPapale - 1/17/2023+x mrg4 - 11/9/2017+xDave - Tuesday, November 7, 2017+xmrg4 - Tuesday, November 7, 2017Hi,I am currently working on creating templates for some standard procedures which only vary in their stimulus material and a few parameters.One of those parameters is the number of trials within a specific block.Is there any chance of using values within a block's trial-attribute?Here is a example of how I imagine the ideal sultion:/trials = [1-values.NumTrials = noreplace(trialA, trialB)/...Is this possible somehow?Thanks in advance!DominikYou can achieve this by performing trial selection via a and setting the 's /poolsize via :/ ntrials = 10/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]The above will run 10 trials (5 x a; 5 x b).Change the ntrials parameter to 20, and you'll get 10 x a and 10 x b:/ ntrials = 20/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]Hope this helps.Thank you so much for your quick response! That's the solution I was looking for! :)Best regards.I am trying to implement this to randomize total trial numbers, but it is not working correctly.  e.g. in the code I specified, I wanted it to run 5 trials, and Inquisit is instead running exactly 3 trials of my task.  The only difference appears to be that I branch from my trial in trial list to a feedback screen, and then from that feedback screen to list.triallist.nextvalue.  Any help would be appreciated!/ onblockbegin = [    values.scrfunc = noreplace("IEV","DEV","CEV","CEVR","IEV","DEV","IEV","DEV");    parameters.ntrials = 5;    values.blockCount = values.blockCount + 1;    values.trialCount = values.trialCount + parameters.ntrials;    ]/ stop = [    block.experiment.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/items = (trial.experiment)/ poolsize = parameters.ntrials/ branch = [    return trial.dispFeedback;]/ branch = [    list.triallist.nextvalue]/ blocks = [    1=instructions;    2=experiment;    3=experiment;    4=endscreen;]Feedback trials obviously go towards the trial count, so what you get is the expected resutl: Dave posted Last Month ANSWER         Group: Administrators Posts: 12K, Visits: 89K +x Dave - 1/17/2023+x AndrewPapale - 1/17/2023+x mrg4 - 11/9/2017+xDave - Tuesday, November 7, 2017+xmrg4 - Tuesday, November 7, 2017Hi,I am currently working on creating templates for some standard procedures which only vary in their stimulus material and a few parameters.One of those parameters is the number of trials within a specific block.Is there any chance of using values within a block's trial-attribute?Here is a example of how I imagine the ideal sultion:/trials = [1-values.NumTrials = noreplace(trialA, trialB)/...Is this possible somehow?Thanks in advance!DominikYou can achieve this by performing trial selection via a and setting the 's /poolsize via :/ ntrials = 10/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]The above will run 10 trials (5 x a; 5 x b).Change the ntrials parameter to 20, and you'll get 10 x a and 10 x b:/ ntrials = 20/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]Hope this helps.Thank you so much for your quick response! That's the solution I was looking for! :)Best regards.I am trying to implement this to randomize total trial numbers, but it is not working correctly.  e.g. in the code I specified, I wanted it to run 5 trials, and Inquisit is instead running exactly 3 trials of my task.  The only difference appears to be that I branch from my trial in trial list to a feedback screen, and then from that feedback screen to list.triallist.nextvalue.  Any help would be appreciated!/ onblockbegin = [    values.scrfunc = noreplace("IEV","DEV","CEV","CEVR","IEV","DEV","IEV","DEV");    parameters.ntrials = 5;    values.blockCount = values.blockCount + 1;    values.trialCount = values.trialCount + parameters.ntrials;    ]/ stop = [    block.experiment.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/items = (trial.experiment)/ poolsize = parameters.ntrials/ branch = [    return trial.dispFeedback;]/ branch = [    list.triallist.nextvalue]/ blocks = [    1=instructions;    2=experiment;    3=experiment;    4=endscreen;]Feedback trials obviously go towards the trial count, so what you get is the expected resutl: To do this properly, i.e. 5 "experiment" trials, each followed by a feedback trial per block, you'll want to do something like this:/ scrfunc = ""/ blockcount = 0/ trialcount = 0/ ntrials = 0/ onblockbegin = [    values.scrfunc = noreplace("IEV","DEV","CEV","CEVR","IEV","DEV","IEV","DEV");    parameters.ntrials = 5;    list.triallist.poolsize = parameters.ntrials;    values.trialcount = 0;    values.blockCount = values.blockCount + 1;]/ stop = [    values.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/items = (trial.experiment)/ poolsize = parameters.ntrials/ trialduration = 100/ branch = [    return trial.dispFeedback;]/ ontrialbegin = [    values.trialcount += 1;]/ trialduration = 100/ branch = [    list.triallist.nextvalue]/ blocks = [    1=instructions;    2=experiment;    3=experiment;    4=endscreen;]/ preinstructions = (intro)/ preinstructions = (end)^intro page^end page/ columns = (date time subject group blocknum blockcode trialnum trialcode block.experiment.trialcount values.trialcount) AndrewPapale          Group: Forum Members Posts: 26, Visits: 101 +x Dave - 1/17/2023+x Dave - 1/17/2023+x AndrewPapale - 1/17/2023+x mrg4 - 11/9/2017+xDave - Tuesday, November 7, 2017+xmrg4 - Tuesday, November 7, 2017Hi,I am currently working on creating templates for some standard procedures which only vary in their stimulus material and a few parameters.One of those parameters is the number of trials within a specific block.Is there any chance of using values within a block's trial-attribute?Here is a example of how I imagine the ideal sultion:/trials = [1-values.NumTrials = noreplace(trialA, trialB)/...Is this possible somehow?Thanks in advance!DominikYou can achieve this by performing trial selection via a and setting the 's /poolsize via :/ ntrials = 10/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]The above will run 10 trials (5 x a; 5 x b).Change the ntrials parameter to 20, and you'll get 10 x a and 10 x b:/ ntrials = 20/ stop = [    block.myblock.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/ items = (trial.a, trial.b)/ poolsize = parameters.ntrials/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]/ validresponse = (0)/ trialduration = 10/ branch = [    list.triallist.nextvalue;]Hope this helps.Thank you so much for your quick response! That's the solution I was looking for! :)Best regards.I am trying to implement this to randomize total trial numbers, but it is not working correctly.  e.g. in the code I specified, I wanted it to run 5 trials, and Inquisit is instead running exactly 3 trials of my task.  The only difference appears to be that I branch from my trial in trial list to a feedback screen, and then from that feedback screen to list.triallist.nextvalue.  Any help would be appreciated!/ onblockbegin = [    values.scrfunc = noreplace("IEV","DEV","CEV","CEVR","IEV","DEV","IEV","DEV");    parameters.ntrials = 5;    values.blockCount = values.blockCount + 1;    values.trialCount = values.trialCount + parameters.ntrials;    ]/ stop = [    block.experiment.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/items = (trial.experiment)/ poolsize = parameters.ntrials/ branch = [    return trial.dispFeedback;]/ branch = [    list.triallist.nextvalue]/ blocks = [    1=instructions;    2=experiment;    3=experiment;    4=endscreen;]Feedback trials obviously go towards the trial count, so what you get is the expected resutl: To do this properly, i.e. 5 "experiment" trials, each followed by a feedback trial per block, you'll want to do something like this:/ scrfunc = ""/ blockcount = 0/ trialcount = 0/ ntrials = 0/ onblockbegin = [    values.scrfunc = noreplace("IEV","DEV","CEV","CEVR","IEV","DEV","IEV","DEV");    parameters.ntrials = 5;    list.triallist.poolsize = parameters.ntrials;    values.trialcount = 0;    values.blockCount = values.blockCount + 1;]/ stop = [    values.trialcount >= parameters.ntrials]/ trials = [1=list.triallist]/items = (trial.experiment)/ poolsize = parameters.ntrials/ trialduration = 100/ branch = [    return trial.dispFeedback;]/ ontrialbegin = [    values.trialcount += 1;]/ trialduration = 100/ branch = [    list.triallist.nextvalue]/ blocks = [    1=instructions;    2=experiment;    3=experiment;    4=endscreen;]/ preinstructions = (intro)/ preinstructions = (end)^intro page^end page/ columns = (date time subject group blocknum blockcode trialnum trialcode block.experiment.trialcount values.trialcount)Thank you, this works wonderfully.

#### Merge Selected

Merge into selected topic...

Merge into merge target...

Merge into a specific topic ID...