DMDX Help.


Moving Response Window Notes.


    A moving response window was needed here recently (N correct out of a moving window of M responses) and while I've probably coded it before I figured I'd write it up this time.  The task involves repeating a trial or a set of trials until a required level of proficiency is reached before moving on to the next set of trials.  I built a routine that allows varying size windows (up to some hard coded maximum, here it's 20) and varying correct response counts within that window.  The items call the routine whenever they gather a response and whenever a test to repeat is required another routine is called with a window size (here it's in counter 110) and another is counter returned that has the correct response count that can be tested against (here counter 111).  A third routine is provided that resets the window to zero correct responses (that's also needed to be called before things begin).

<ep> f60 <nfb> <vm desktop> <id keyboard>
<cr> <eop>

0 "Start" <bu 999>;

~800 <set c1=0> <set c2=0> <set c3=0> <set c4=0> <set c5=0>     <! the routine to reset the counters>
    <set c6=0> <set c7=0> <set c8=0> <set c9=0> <set c10=0>
    <set c11=0> <set c12=0> <set c13=0> <set c14=0> <set c15=0>
    <set c16=0> <set c17=0> <set c18=0> <set c19=0> <set c20=0> <return>;

~900 <set c1=c2> <set c2=c3> <set c3=c4> <set c4=c5> <set c5=c6>    <! update the moving window>
    <set c6=c7><set c7=c8> <set c8=c9> <set c9=c10> <set c10=c11>
    <set c11=c12> <set c12=c13> <set c13=c14> <set c14=c15> <set c15=c16>
    <set c16=c17><set c17=c18> <set c18=c19> <set c19=c20>
    <set c20=lastxt .gt. 0> <set c111=0> <set c100=(20 - c110) + 901> <ib 100> ;

~901<set c111=c111+c1>;
~902<set c111=c111+c2>;
~903<set c111=c111+c3>;
~904<set c111=c111+c4>;
~905<set c111=c111+c5>;
~906<set c111=c111+c6>;
~907<set c111=c111+c7>;
~908<set c111=c111+c8>;
~909<set c111=c111+c9>;
~910<set c111=c111+c10>;
~911<set c111=c111+c11>;
~912<set c111=c111+c12>;
~913<set c111=c111+c13>;
~914<set c111=c111+c14>;
~915<set c111=c111+c15>;
~916<set c111=c111+c16>;
~917<set c111=c111+c17>;
~918<set c111=c111+c18>;
~919<set c111=c111+c19>;
~920<set c111=c111+c20> <return>;

~999 <call -800> ;

~1000;

+1001 * "test" <! of course in real life we'd have some much more complex item in here > ;

~1
<set c110=12> <! Moving window size in c110, max is 20. Count of correct returns in c111> <call -900>;
~1 <bi -1000, c111 .lt. 10>            <! continue till 10 responses out of the last 12 are correct>;

~1 <call -800>;

~2000;

+2001 * "another test";

~1
<set c110=18> <call -900>;
~1 <bi -2000, c111 .lt. 15>;        <! continue till 15 responses out of the last 18 are correct>;

0 "End";


DMDX Index.