DMDX Help.

Some time ago someone here need to run the Probabilistic Selection Task (from Frank et al., 2004) however they didn't have the hundreds of dollars needed for an EPrime license to run the original code so we coded up a DMDX version of it.  This is interesting from several points of view, first it has training items that must be executed over and over (requiring randomization an indefinite number of times) until the subject becomes proficient at the task and this entails using macros from counters to iterate over a list.  It also uses probabilistic feedback (the same answer is not always right).

First the probabilistic feedback (as that's the about the most basic thing happening here) is handled in items 200 through 215 where counter number 90 is loaded with the probability of the left hand response being correct before the call (items 1100, 1200 and 1300) and depending on whether a random number is appropriately below this threshold or not the feedback is reversed (we're assuming that everyone will be responding within 100 seconds so we don't handle the Too Long case).

To randomize the training items repeatedly we use a list of counters, numbers 1 through 60.  Here each counter is going to have the values 1, 2 or 3 corresponding to the three training trials (item 1006).  Using the code from the macro documentation to set a macro from a counter (these days you'd use the command that didn't exist when this item file was designed) the list is first set up in items 1000 through 1006, when it is reused if the training needs repeating we don't have to repeat this, merely mix it up again which is what items 1010 through 1016 do where we iterate over the list swapping every counter's value with another randomly selected counter from the list.  Then starting at item 1020 we iterate over our list of 60 counters using the value in each counter to decide (in item 1030) what training item number to branch to (either 1100, 1200 or 1300).  Eventually we execute all 60 training items and fall out of item 1400 and test the counters that have been incrementing during the testing (numbers 80, 81 and 82) whenever the subject makes the right decision (not what they've been necessarily told) repeating training if needed and re-randomizing them with a branch to 1010.  Otherwise the test trials commence.

<ep> f1 <vm desktop> <id keyboard> <umb> <mpr +0> <mnr +1> <mr +space>
<nfb> <t 100000> <cr> S1 <eop>
\$
0 <inst .1,.1,.85> "Two ", "black ", "symbols ", "will ", "appear ", "simultaneously ", "on ", "the ", "computer ", "screen. ", "One ", "of ", "the ", "symbols ", "will ", "be ", "'correct' ", "and ", "one ", "will ", "be ", "'incorrect,' ", "but ", "at ", "first ", "you ", "will ", "not ", "know ", "which ", "is ", "which. ", "Try ", "to ", "guess ", "the ", "'correct' ", "figure ", "as ", "quickly ", "and ", "as ", "accurately ", "as ", "possible. ", "There ", "is ", "no ", "ABSOLUTE ", "right ", "answer, ", "but ", "some ", "symbols ", "have ", "a ", "higher ", "chance ", "of ", "being ", "correct ", "than ", "others. ", "Try ", "to ", "pick ", "the ", "symbol ", "that ", "you ", "find ", "to ", "have ", "the ", "highest ", "chance ", "of ", "being ", "correct.";

0 <inst .1,.1,.85> <! one of these instructions should be commented out with a ! before the item number>  "The ", "following ", "symbol ", "will ", "have ", "the ", "lowest ", "probability ", "of ", "being ", "correct, ", "so ", "you ", "should ", "avoid ", "selecting ", "it. " <inst newline>, <bmp> "symbol 5" <inst newline>, "You'll ", "have ", "to ", "figure ", "out ", "which ", "of ", "the ", "other ", "symbols ", "you ", "should ", "select ", "when ", "they ", "appear ", "by ", "trying ", "them ", "out. ", "Use ", "the ", "1 ", "key ", "to ", "select ", "the ", "figure ", "on ", "the ", "left. ", "Use ", "the ", "0 ", "key ", "to ", "select ", "the ", "figure ", "on ", "the ", "right.";
!0 <inst .1,.1,.85> "The ", "following ", "symbol ", "will ", "have ", "the ", "highest ", "probability ", "of ", "being ", "correct, ", "so ", "you ", "should ", "select ", "it."  <inst newline>, <bmp> "symbol 6" <inst newline>, "You'll ", "have ", "to ", "figure ", "out ", "which ", "of ", "the ", "other ", "symbols ", "you ", "should ", "select ", "when ", "they ", "appear ", "by ", "trying ", "them ", "out. ", "Use ", "the ", "1 ", "key ", "to ", "select ", "the ", "figure ", "on ", "the ", "left. ", "Use ", "the ", "0 ", "key ", "to ", "select ", "the ", "figure ", "on ", "the ", "right.";
~1<bu 1000> <xyjustification 1> <! skip over our subroutines>;

~98 mC++  <set c97=c99> <! subroutine to turn value of counter 99 into contents of macro C>;
~99 <set c98=(c97 % 10)+100><ib 98>;
~100 mC+0~C+ <bu 110>;
~101 mC+1~C+ <bu 110>;
~102 mC+2~C+ <bu 110>;
~103 mC+3~C+ <bu 110>;
~104 mC+4~C+ <bu 110>;
~105 mC+5~C+ <bu 110>;
~106 mC+6~C+ <bu 110>;
~107 mC+7~C+ <bu 110>;
~108 mC+8~C+ <bu 110>;
~109 mC+9~C+;
~110 <set c97=c97 / 10> <bi -99, c97 .gt. 0>;
~111 <return>;

~200 <set c91 = random 100> <biw 210> <! probabilistic feedback in counter 90 (percent)>;
~202 <bi 215, c91 .lt. c90>;
205 <emit correct> d2 "Correct" <msfd 500> <return>;
~210 <bi -205, c91 .lt. c90>;
215 <emit wrong> d2 "Wrong" <msfd 500> <return>;

~1000 <set c99 = 1> <! setup a list of 60 training trials>;
~1005 <call -98>;
~1006 <set c~C = (c99 % 3) + 1> <inc 99> <bi -1005, c99 .le. 60>;

~1010 <set c95 = 1> <! randomize the training trials order>;
~1012 <set c99 = c95> <call -98>;
~1014 mD+~C+ <set c99 = (random 60) + 1> <call -98>;
~1016 <set c96 = c~D> <set c~D = c~C> <set c~C = c96> <inc 95> <bi -1012, c95 .le. 60>;

~1020 <set c99 = 1> <set c80 = 0> <set c81=0> <set c82 = 0> <! present a block of training trials>;
~1025 <call -98>;
~1030 <set c98 = c~C * 100 + 1000> <ib 98> <! branch to one of the training trial types>

<!  c90 is the probability that the left figure is correct>;
+1100 <xy .45,.4> <bmp> "symbol 1", <xy .55,.4> <bmp> "symbol 2" * <set c90 = 80> <inciw 80> <call -200>;
~1102 <bu 1400>;
+1200 <xy .45,.4> <bmp> "symbol 3", <xy .55,.4> <bmp> "symbol 4" * <set c90 = 70> <inciw 81> <call -200>;
~1202 <bu 1400>;
+1300 <xy .45,.4> <bmp> "symbol 5", <xy .55,.4> <bmp> "symbol 6" * <set c90 = 60> <inciw 82> <call -200>;

~1400 <inc 99> <bi -1025, c99 .le. 60> <! continue training block, next item decides whether to do another block>;
~1405 <emit 80> <emit 81> <emit 82>;
~1410 <bi -1010, c80 .lt. 13 .or. c81 .lt. 12 .or. c82 .lt. 10> <! 13 is 65% of 20, 12 is 60% and 10 is 50%>;

0 "Training Complete";
\$
+2012 <xy .45,.4> <bmp> "symbol 1", <xy .55,.4> <bmp> "symbol 2" *;
+2013 <xy .45,.4> <bmp> "symbol 1", <xy .55,.4> <bmp> "symbol 3" *;
+2014 <xy .45,.4> <bmp> "symbol 1", <xy .55,.4> <bmp> "symbol 4" *;
+2015 <xy .45,.4> <bmp> "symbol 1", <xy .55,.4> <bmp> "symbol 5" *;
+2016 <xy .45,.4> <bmp> "symbol 1", <xy .55,.4> <bmp> "symbol 6" *;

+2021 <xy .45,.4> <bmp> "symbol 2", <xy .55,.4> <bmp> "symbol 1" *;
+2023 <xy .45,.4> <bmp> "symbol 2", <xy .55,.4> <bmp> "symbol 3" *;
+2024 <xy .45,.4> <bmp> "symbol 2", <xy .55,.4> <bmp> "symbol 4" *;
+2025 <xy .45,.4> <bmp> "symbol 2", <xy .55,.4> <bmp> "symbol 5" *;
+2026 <xy .45,.4> <bmp> "symbol 2", <xy .55,.4> <bmp> "symbol 6" *;

+2031 <xy .45,.4> <bmp> "symbol 3", <xy .55,.4> <bmp> "symbol 1" *;
+2032 <xy .45,.4> <bmp> "symbol 3", <xy .55,.4> <bmp> "symbol 2" *;
+2034 <xy .45,.4> <bmp> "symbol 3", <xy .55,.4> <bmp> "symbol 4" *;
+2035 <xy .45,.4> <bmp> "symbol 3", <xy .55,.4> <bmp> "symbol 5" *;
+2036 <xy .45,.4> <bmp> "symbol 3", <xy .55,.4> <bmp> "symbol 6" *;

+2041 <xy .45,.4> <bmp> "symbol 4", <xy .55,.4> <bmp> "symbol 1" *;
+2042 <xy .45,.4> <bmp> "symbol 4", <xy .55,.4> <bmp> "symbol 2" *;
+2043 <xy .45,.4> <bmp> "symbol 4", <xy .55,.4> <bmp> "symbol 3" *;
+2045 <xy .45,.4> <bmp> "symbol 4", <xy .55,.4> <bmp> "symbol 5" *;
+2046 <xy .45,.4> <bmp> "symbol 4", <xy .55,.4> <bmp> "symbol 6" *;

+2051 <xy .45,.4> <bmp> "symbol 5", <xy .55,.4> <bmp> "symbol 1" *;
+2052 <xy .45,.4> <bmp> "symbol 5", <xy .55,.4> <bmp> "symbol 2" *;
+2053 <xy .45,.4> <bmp> "symbol 5", <xy .55,.4> <bmp> "symbol 3" *;
+2054 <xy .45,.4> <bmp> "symbol 5", <xy .55,.4> <bmp> "symbol 4" *;
+2056 <xy .45,.4> <bmp> "symbol 5", <xy .55,.4> <bmp> "symbol 6" *;

+2061 <xy .45,.4> <bmp> "symbol 6", <xy .55,.4> <bmp> "symbol 1" *;
+2062 <xy .45,.4> <bmp> "symbol 6", <xy .55,.4> <bmp> "symbol 2" *;
+2063 <xy .45,.4> <bmp> "symbol 6", <xy .55,.4> <bmp> "symbol 3" *;
+2064 <xy .45,.4> <bmp> "symbol 6", <xy .55,.4> <bmp> "symbol 4" *;
+2065 <xy .45,.4> <bmp> "symbol 6", <xy .55,.4> <bmp> "symbol 5" *;

\$ 9999 "Done";\$

DMDX Index.