Millisecond Forums

Repeat Error Trial Tutorial (Millisecond Software)

https://forums.millisecond.com/Topic14630.aspx

By katbo - 10/15/2014

For some experiments it's necessary to repeat error trials at a later point (and not necessarily right away).
Attached to this message is one Millisecond Software tutorial script that runs one possible repetition procedure.

The example task is simple: the computer presents 'A' stimuli (A1, A2, A3, A4) and 'B' stimuli (B1, B2, B3, B4)
and the task is to press the 'A' key if it's an A-stimuli and the 'B' key if it's a B-stimuli.

If a mistake is made (Example: you see 'A1' and press the B-key), the trial is repeated at later point which is randomly determined.
The procedure ends if all stimuli have been categorized correctly.
 
The example repetition procedure takes advantage of lists and the ability to edit while the script is running:

<list grouptype>
/items = (1, 1, 1, 1, 2, 2, 2, 2)
/replace = false
</list>


List.grouptype controls whether an A-trial (1) or a B-trial (2) is presented. The trialtype is determined randomly without replacement.

<list groupA>
/items = (1, 2, 3, 4)
/replace = false
</list>


List.groupA controls which particular A stimulus (A1, A2, A3 or A4) is going to be presented during an A-trial. The list items are drawn randomly without replacement.

<list groupB>
/items = (1, 2, 3, 4)
/replace = false
</list>


List.groupB controls which particular B stimulus (B1, B2, B3 or B4) is going to be presented during a B-trial. The list items are drawn randomly without replacement.

All list elements look pretty static at this point. But thankfully they are not. All item lists can still be edited during runtime.

For example, if a mistake was made and stimulus A1 was classified as a B-stimulus, the following trial code ensures that the trial will be repeated at a later point:
/ontrialend = [if (trial.showgroupA.error) {
                    insert(list.grouptype, 1, list.grouptype.itemcount + 1);
                    insert(list.groupA, text.groupA.currentitemnumber, list.groupA.itemcount + 1)}]


List.grouptype gets another A-trial to run: insert(list.grouptype, 1, list.grouptype.itemcount + 1)
List.groupA gets another A1 stimulus to run: insert(list.groupA, text.groupA.currentitemnumber, list.groupA.itemcount + 1)

The new items are inserted into the relevant lists at the very end of the list (they could be inserted at position 1 of the lists as well as the items are drawn
randomly).

And that's it. The basic idea is to take advantage of being able to edit list items when the script is run.
If you have any further questions, please, let us know.

cheers,
katja from Millisecond Software