Group: Administrators
Posts: 13K,
Visits: 104K
|
Start with something like this
<block myblock> / trials = [1-6=sequence(trial1, trial2, trial3)] </block>
*** select category, display 1st stimulus *** <trial trial1> / ontrialbegin = [values.t01hpos=50%] / ontrialbegin = [if(list.categorylist.unselectedcount>0) {values.selectedcategory=list.categorylist.nextvalue; list.categoryrepeatlist.appenditem(values.selectedcategory); } else values.selectedcategory=list.categoryrepeatlist.nextvalue] / ontrialbegin = [if (values.selectedcategory==1) { values.t01item=list.cat1itemlist.nextvalue; values.t02item=list.cat1itemlist.nextvalue; values.t03item=list.cat1itemlist.nextvalue; }] / ontrialbegin = [if (values.selectedcategory==2) { values.t01item=list.cat2itemlist.nextvalue; values.t02item=list.cat2itemlist.nextvalue; values.t03item=list.cat2itemlist.nextvalue; }] / ontrialbegin = [if (values.selectedcategory==3) { values.t01item=list.cat3itemlist.nextvalue; values.t02item=list.cat3itemlist.nextvalue; values.t03item=list.cat3itemlist.nextvalue; }] / stimulusframes = [1=t01] / validresponse = (57) </trial>
*** display 1st and 2nd stimulus *** <trial trial2> / ontrialbegin = [values.t01hpos=list.2poslist.nextvalue; values.t02hpos=list.2poslist.nextvalue; ] / stimulusframes = [1=t01, t02] / validresponse = (57) </trial>
*** display 1st, 2nd and 3rd stimulus *** <trial trial3> / ontrialbegin = [values.t01hpos=list.3poslist.nextvalue; values.t02hpos=list.3poslist.nextvalue; values.t03hpos=list.3poslist.nextvalue; ] / stimulusframes = [1=t01, t02, t03] / validresponse = (57) </trial>
*** Some global variables for currently selected category, selected items and positions *** <values> / selectedcategory = 0 / t01item = 1 / t02item = 1 / t03item = 1 / t01hpos = 50% / t02hpos = 50% / t03hpos = 50% </values>
*** 3 categories / selected at random *** <list categorylist> / items = (1,2,3) </list>
*** store initial random order of categories for later repetition *** <list categoryrepeatlist> / selectionmode = sequence </list>
*** item numbers for 6 items in category 1 *** <list cat1itemlist> / items = (1,2,3,4,5,6) / selectionrate = always </list>
*** item numbers for 6 items in category 2 *** <list cat2itemlist> / items = (7,8,9,10,11,12) / selectionrate = always </list>
*** item numbers for 6 items in category 3 *** <list cat3itemlist> / items = (13,14,15,16,17,18) / selectionrate = always </list>
*** random left / right position *** <list 2poslist> / items = (40%, 60%) / selectionrate = always </list>
*** random left / middle / right position *** <list 3poslist> / items = (30%, 50%, 70%) / selectionrate = always </list>
<text t01> / items = myitems / select = values.t01item / hposition = values.t01hpos </text>
<text t02> / items = myitems / select = values.t02item / hposition = values.t02hpos </text>
<text t03> / items = myitems / select = values.t03item / hposition = values.t03hpos </text>
<item myitems> / 1 = "Category 1 Item 1" / 2 = "Category 1 Item 2" / 3 = "Category 1 Item 3" / 4 = "Category 1 Item 4" / 5 = "Category 1 Item 5" / 6 = "Category 1 Item 6"
/ 7 = "Category 2 Item 1" / 8 = "Category 2 Item 2" / 9 = "Category 2 Item 3" / 10 = "Category 2 Item 4" / 11 = "Category 2 Item 5" / 12 = "Category 2 Item 6"
/ 13 = "Category 3 Item 1" / 14 = "Category 3 Item 2" / 15 = "Category 3 Item 3" / 16 = "Category 3 Item 4" / 17 = "Category 3 Item 5" / 18 = "Category 3 Item 6" </item>
and build / extend from there. I would recommend (1) working through the tutorials and the how-to section in the documentation for the basics, (2) study the topics on conditional logic, functions, operators, <values> and <expressions>, (3) familiarize yourself with <list> elements, their properties and functions via the applicable language reference topics.
In addition, perhaps pick out a couple of scripts from the task / test library to study to see the things mentioned above in practical use.
|