Você está na página 1de 43

E-Prime Adaptive Staircase Testing Procedure

By Brian Verdine

This script is designed to present items of various difficulty at faster/slower speeds depending on the accuracy of responses to previous trials. Adaptive testing procedures require that item difficulties be known and that trials be presented according to increasing/decreasing difficulties. In this instance, the speed of the presentation is the variable of interest (we were trying to figure out the threshold time at which an array could be processed) and the number of items in the array is used to differentiate staircases (we wanted individual threshold times for each staircase). The advantages of an adaptive staircase testing procedure are that you can determine a participant s abilities with fewer trials than a traditional testing paradigm. This script is a bit of a Frankenstein, so it may not always be written in the most efficient way. That said, it has worked well on our systems and we believe it has been debugged. If you find problems with this script or would like to recommend improvements, please contact me (brian.verdine@gmail.com). This script borrowed heavily from various sources around the internet (that were unfortunately not well documented at the time) and from internal script used in Sasha Key s lab at Vanderbilt University. All internet code that was used, was shared with the intention of helping other researchers, which is why I am passing on my modifications despite not being able to properly document the contributors. If any of the below script appears to belong to you and you would like to be acknowledged for your contribution or would like this script removed, please contact me (brian.verdine@gmail.com). Note: Yourhardware limitations (and not this script) will determine the actual minimum threshold presentation time, so be sure to take that into account when using this script and reporting your findings. ' ' ' ' ' ' ' ' ' ' ' ' ' '

This file generated with E-Studio interface. E-Prime Copyright 1996-2005 Psychology Software Tools. ALL RIGHTS RESERVED Legal use of this experiment script requires a full E-Prime or Runtime License.

Author: Brian Verdine and Sasha Key

http://www.scribd.com/brian_verdine
1

' ' Option CStrings On Dim ebContext as Context

'-------------------------------------------------------------------------' Class Declarations '--------------------------------------------------------------------------

'-------------------------------------------------------------------------'InitTextDisplayDefaults '-------------------------------------------------------------------------Sub InitTextDisplayDefaults(theTextDisplay As TextDisplay) If theTextDisplay Is Nothing Then Exit Sub theTextDisplay.X = "center" theTextDisplay.Y = "center" theTextDisplay.Width = "100%" theTextDisplay.Height = "100%" theTextDisplay.ForeColor = CColor("black") theTextDisplay.BackColor = CColor("white") theTextDisplay.BackStyle = "opaque" theTextDisplay.BorderColor = CColor("black") theTextDisplay.BorderWidth = CLng("0") theTextDisplay.XAlign = "center" theTextDisplay.YAlign = "center" theTextDisplay.AlignHorizontal = "center" theTextDisplay.AlignVertical = "center" theTextDisplay.WordWrap = True http://www.scribd.com/brian_verdine
2

theTextDisplay.ClearAfter = CLogical("No") theTextDisplay.FontName = "Courier New" theTextDisplay.FontSize = "18" theTextDisplay.FontBold = CLogical("Yes") theTextDisplay.FontItalic = CLogical("No") theTextDisplay.FontUnderline = CLogical("No") theTextDisplay.FontStrikeout = CLogical("No") End Sub

'-------------------------------------------------------------------------'InitImageDisplayDefaults '-------------------------------------------------------------------------Sub InitImageDisplayDefaults(theImageDisplay As ImageDisplay) If theImageDisplay Is Nothing Then Exit Sub theImageDisplay.X = "center" theImageDisplay.Y = "center" theImageDisplay.Width = "100%" theImageDisplay.Height = "100%" theImageDisplay.BackColor = CColor("black") theImageDisplay.BackStyle = "opaque" theImageDisplay.BorderColor = CColor("black") theImageDisplay.BorderWidth = CLng("0") theImageDisplay.XAlign = "center" theImageDisplay.YAlign = "center" theImageDisplay.AlignHorizontal = "center" theImageDisplay.AlignVertical = "center" theImageDisplay.ClearAfter = CLogical("No") http://www.scribd.com/brian_verdine
3

theImageDisplay.UseSourceColorKey = CLogical("No") theImageDisplay.SourceColorKey = CColor("black") theImageDisplay.MirrorLeftRight = CLogical("No") theImageDisplay.MirrorUpDown = CLogical("No") theImageDisplay.Stretch = CLogical("No") End Sub

'-------------------------------------------------------------------------' Instance Declarations '-------------------------------------------------------------------------Dim Display As DisplayDevice Dim Sound As SoundDevice Dim Keyboard As KeyboardDevice Dim Mouse As MouseDevice Dim SRBOX As SRBOXDevice Dim SessionProc As Procedure Dim Welcome As TextDisplay Dim WelcomeEchoClients As EchoClientCollection Dim set2match As List Dim set1match As List Dim Fixation As ImageDisplay Dim ShowProbe As ImageDisplay http://www.scribd.com/brian_verdine
4

Dim ShowProbeEchoClients As EchoClientCollection Dim ShowDelay As ImageDisplay Dim set1mismatch As List Dim set2mismatch As List Dim Testing As List Dim AdaptiveTesting As Procedure Dim RandomAdaptiveTrials As List Dim TrialProcASProc As Procedure Dim ShowSet As ImageDisplay

'-------------------------------------------------------------------------' Package Declare Script '--------------------------------------------------------------------------

'-------------------------------------------------------------------------' User Script '-------------------------------------------------------------------------'---Declare variables 'Sound File variables Dim SoundFile(6) as Integer ' Denotes the current test tone Dim BaseNum as Integer ' Denotes current Base tone Dim MinFile as Integer ' sets minimum file number (AKA 1) http://www.scribd.com/brian_verdine
5

Dim MaxFile as Integer ' sets maximum file number (AKA 16) 'Staircase variables Dim Target(99) as Integer ' Deontes the variable being modified by the staircase Dim MinTarget as Integer ' sets minimum value for Target allowed by staircase Dim MaxTarget as Integer ' sets maximum value for Target allowed by staircase 'Generic Dim i as Integer ' used for counting in loops 'User-defined Dim RefreshRate as Double ' Refresh rate of monitor Dim NumStairs as Double ' denotes total number of staircases in paradigm Dim MaxReversals as Integer ' User defined number of reversals before quitting Dim RvrslStep2 as Integer ' User-defined number of reversals before decreasing step size Dim StepSize_2 as Integer ' User-defined number of refreshes per step after changing the first time Dim RvrslStep3 as Integer ' User-defined number of reversals before decreasing step size again Dim StepSize_3 as Integer ' User-defined number of refreshes per step after changing the second time Dim NumReversalsToAverage as Integer ' User-defined number of reversals to average across att he end Dim UpDownRatio as Double ' User-defined ratio between "up" and "down" step sizes. 'Used for visual stim/screen issues - likely not used Dim Refresh as Double ' Miliseconds per refresh Dim VSOA(3) as Single ' Denotes VisSOA for current Staircase 'Used in basic staircase Dim TrialNum as Integer ' Current number of trials occured Dim MadeReversal as Integer ' Denotes whether just made a reversal Dim ActualDuration as Single ' notes actual VSOA 'Used for individual staircases Dim StairNum as Integer ' Denotes current Staircase Dim StepSize(6) as Integer ' Number of refreshes per step http://www.scribd.com/brian_verdine
6

Dim StepDuration(6) as Double Dim NumReversals(6) as Integer Dim ReversalValue(6,99) as Integer ' Array to hold all values at which there was a reversal - format is: ReversalValue(StairNum, NumReversals) Dim TotalReversalSum(6) as Integer ' Keeps up with running total of reversal values for calculating the average Dim AverageReversal(6) as Integer ' Holds the Average reversal value for that staircase Dim StairNumCount(6) as Integer ' Keeps up with umber of trials in Staircase Dim PrevTrialAcc(6) as Integer ' Acuracy of the previous trial Dim MadeStep(6) as Integer ' keeps track of whether just made a step 'Counts number of Reps Dim NumReps as Integer 'Denotes Subject number/session Dim SubNum as Integer Dim SesNum as Integer 'Define Kill Variables Dim KillOne as Integer Dim KillTwo as Integer Dim KillAceOne as Integer Dim KillAceTwo as Integer

'-------------------------------------------------------------------------' Package Global Script '--------------------------------------------------------------------------

'-------------------------------------------------------------------------' Package Routines '--------------------------------------------------------------------------

http://www.scribd.com/brian_verdine
7

'-------------------------------------------------------------------------' Implementation '-------------------------------------------------------------------------Sub SessionProc_Run(c as Context) Welcome.Text = "Welcome to the experiment.\n\n\nView each memory set. \nAfter a delay, decide if the shape matches one from the array.\n\n\n" &_ c.GetAttrib("MatchButton") &_ " = match\n" &_ c.GetAttrib("MismatchButton") &_ " = mismatch\n\n\n\nPress 'b' to begin." Welcome.InputMasks.Reset If Keyboard.GetState() = ebStateOpen Then WelcomeEchoClients.RemoveAll Welcome.InputMasks.Add Keyboard.CreateInputMask("b", "", CLng(Welcome.Duration), CLng("1"), ebEndResponseActionTerminate, CLogical("Yes"), "", "", "ResponseMode:All ProcessBackspace:Yes")

End If Welcome.Run Testing.Run c c.Log End Sub Sub AdaptiveTesting_Run(c as Context) ''''''''''''''''''''''''''''''''''''''''''''' ' InLine - ASSettings BEGIN ''''''''''''''''''''''''''''''''''''''''''''' '**********Adaptive Staircase Settings********** http://www.scribd.com/brian_verdine
8

'This script contains the data necessary for the Staircase procedure to operate. 'Experimenters define values/parameters of the staircase below (there are 'other settings that change in the other AS Scripts). "Target" referes to the 'variable being modified by the staircase procedure.

'-----Stair Settings----'---Define total number of stairs. 'Note: ' This should match what is in the "Staircase" variable ' of the primary List (if they do not match you either need to change this number ' or add lines with additional staircases defined. NumStairs = 2 '---Define initial size of the basic "step" for the staircase to take. 'Other step sizes can be set below. As it is coded, both staircases use 'the same basic step sizes as they adjust. For i = 1 to NumStairs StepSize(i) = 200 Next i 'Define the size of each subsequent step RvrslStep2 = 3 ' Number of reversals before decreasing step size StepSize_2 = 100 ' Distance between steps after changing the first time RvrslStep3 = 5 ' Number of reversals before decreasing step size again StepSize_3 = 75 'Distance between steps after changing the second time '---Define ratio of size between "up" to "down" steps 'Notes: ' The step size will refer to the decreasing "down" steps. Numbers > 1 ' denote "up" steps are larger than "down"; e.g., .5 = 1/2 as large when stepping ' up than when stepping down ' While any number can be placed here, the actual resulting value of some step sizes http://www.scribd.com/brian_verdine
9

' and ratios will be limited to actual capacity of the hardware, e.g. monitor ' refresh rate or sound card response time. UpDownRatio = 1 '---Define starting value of the target to be altered by the staircase 'Each target below is a different, independent staircase run in parallel to one another. 'You can have as many different intial Targets values as you have independent staircases. Target(1) = 300 Target(2) = 500 '---Define min and max values allowed for the target so that the staircases have limits. 'While any numbers can be placed here the actual resulting value of some step sizes 'will be limited to actual capacity of the hardware, especially for MinTarget with fast 'visual presentations. MinTarget = 13 MaxTarget = 2000

'-----Reversal Settings----'Number of reversals after which the staircase procedure terminates 'Note: ' This should be an EVEN number MaxReversals = 8 'reversals 'Initial # of reversals on record (in most cases this will not change) For i = 1 to NumStairs NumReversals(i) = 0 'reversals Next i 'Number of reversals to average at the end (AKA, last 3, 10, etc are averaged 'together to determine threshold) NumReversalsToAverage = 3 'reversals http://www.scribd.com/brian_verdine
10

'-----Output----'---Trial Counter TrialNum = 1 '---Reversal Counter, reset For i = 1 to NumStairs NumReversals(i) = 0 Next i

'---Counts number of stairs so far For i = 1 to NumStairs StairNumCount(i) = 1 Next i '---Counter for number of staircases run NumReps = NumReps + 1

'---Set apart line for debugging debug.print " " debug.print "------------------------" debug.print "-----Staircase Data-----" debug.print " " 'Various parts of this program will also write data on the staircase 'out to a tab-delimited text file. It is titled according to the subject's ID and Sesion #. '---Set aside first line in data file Open c.GetAttrib("Subject") & " " & c.GetAttrib("Session") & " " & "Staircase.dat" For Append As #1 Print #1, "Staircase Data" Close http://www.scribd.com/brian_verdine
11

Open c.GetAttrib("Subject") & " " & c.GetAttrib("Session") & " " & "Staircase.dat" For Append As #1 Print #1, "Subject" & chr(9) & "Session" & chr(9) & "Trial" & chr(9) & "StairNum" & chr(9) & "Procedure" & chr(9) & "Target" & chr(9) & "Acc" & chr(9) & "RT" & chr(9) & "Prev_Acc" & chr(9) & "MadeReversal?" & chr(9) & "NumReversals" & chr(9) & "Last_Reversal" Close

''''''''''''''''''''''''''''''''''''''''''''' ' InLine - ASSettings END ''''''''''''''''''''''''''''''''''''''''''''' RandomAdaptiveTrials.Run c c.Log End Sub Sub TrialProcASProc_Run(c as Context) ''''''''''''''''''''''''''''''''''''''''''''' ' InLine - GetITI BEGIN ''''''''''''''''''''''''''''''''''''''''''''' c.SetAttrib "ITI", CStr(random(800,1000))

''''''''''''''''''''''''''''''''''''''''''''' ' InLine - GetITI END '''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''' ' InLine - ASParameters BEGIN ''''''''''''''''''''''''''''''''''''''''''''' '**********Adaptive Staircase Parameters********** 'These bits are best placed at the very beginning of the Procedure containing the 'object/variable being modified by the staircase procedure http://www.scribd.com/brian_verdine
12

'---Denote current staircase--'Note that the name here MUST correspond to a defined value in the above List object StairNum = c.GetAttrib("Staircase") '---Kill procedure--'This procedure works by referencing the "Kill" columns in the trial lists. The kill 'procedure in ASCalculations determines if a staircase is finished and then 'places the values in the "kill" columns. Then, on the next trial this script checks 'whether those columns are set to 0. When all kill columns are set to 0, this script 'forces the Testing List to terminate. '---Defines Kill columns for first trial If TrialNum < 2 then KillOne = 1 KillTwo = 1 End If

'---Reads kill columns to determine whether they are set to 0 and 'exits staircase if they are If KillOne = 0 and StairNum = 1 then Exit Sub End If If KillTwo = 0 and StairNum = 2 then Exit Sub End If

'This is the kill procedure for each step. It prevents trials from a certain staircase 'from running once the max reversals is met. This saves from wasted trials and from the 'ASCalculations making false calculations when the staircase completes. http://www.scribd.com/brian_verdine
13

If NumReversals(StairNum) >= MaxReversals Then Exit Sub End If '---Adaptive Staircase Main Variable--'Sets value of program object ("target") modified by the staircase procedure 'Whatever variable you set equal to Target(StairNum) will be varied by the Adaptive 'Staircase script. This can be any continuous property of an object that can be user-defined 'including setting an actual filename. c.SetAttrib "ArrayDuration", Target(StairNum) ''''''''''''''''''''''''''''''''''''''''''''' ' InLine - ASParameters END '''''''''''''''''''''''''''''''''''''''''''''

Fixation.Duration = CLng(c.GetAttrib("ITI")) Fixation.Run ShowSet.Filename = c.GetAttrib("Set") &_ ".bmp" ShowSet.Load ShowSet.Duration = CLng(c.GetAttrib("ArrayDuration")) ShowSet.Run c.SetAttrib "ShowSet.OnsetDelay", ShowSet.OnsetDelay c.SetAttrib "ShowSet.OnsetTime", ShowSet.OnsetTime c.SetAttrib "ShowSet.DurationError", ShowSet.DurationError c.SetAttrib "ShowSet.RTTime", ShowSet.RTTime c.SetAttrib "ShowSet.ACC", ShowSet.ACC c.SetAttrib "ShowSet.RT", ShowSet.RT c.SetAttrib "ShowSet.RESP", ShowSet.RESP c.SetAttrib "ShowSet.CRESP", ShowSet.CRESP c.SetAttrib "ShowSet.Tag", ShowSet.Tag http://www.scribd.com/brian_verdine
14

ShowDelay.Run ShowProbe.Filename = c.GetAttrib("Probe") &_ ".bmp" ShowProbe.Load ShowProbe.Tag = c.GetAttrib("ProbeTag") ShowProbe.InputMasks.Reset If Keyboard.GetState() = ebStateOpen Then ShowProbeEchoClients.RemoveAll ShowProbe.InputMasks.Add Keyboard.CreateInputMask("14", c.GetAttrib("CorrectResponse"), CLng(ShowProbe.Duration), CLng("1"), ebEndResponseActionTerminate, CLogical("Yes"), "", "", "ResponseMode:All ProcessBackspace:Yes")

End If

ShowProbe.Run c.SetAttrib "ShowProbe.OnsetDelay", ShowProbe.OnsetDelay c.SetAttrib "ShowProbe.OnsetTime", ShowProbe.OnsetTime c.SetAttrib "ShowProbe.DurationError", ShowProbe.DurationError c.SetAttrib "ShowProbe.RTTime", ShowProbe.RTTime c.SetAttrib "ShowProbe.ACC", ShowProbe.ACC c.SetAttrib "ShowProbe.RT", ShowProbe.RT c.SetAttrib "ShowProbe.RESP", ShowProbe.RESP c.SetAttrib "ShowProbe.CRESP", ShowProbe.CRESP

''''''''''''''''''''''''''''''''''''''''''''' ' InLine - ASCalculations BEGIN ''''''''''''''''''''''''''''''''''''''''''''' http://www.scribd.com/brian_verdine


15

'**********Staircase Calculations********** '-----Kill Procedure----'Kill script procedure for skipping trials. These lines use 'the max reversals to determine whether the "kill" variable should be 'changed to 0. When the kill variable is changed to 0, the program 'recognizes on the next sweep that the staircase is terminated and 'skips back to the beginning of the SCParameters list, aborting the 'trial without adjusting the current staircases. If NumReversals(StairNum) >= MaxReversals and Stairnum = 1 then KillOne = 0 End If If NumReversals(StairNum) >= MaxReversals and Stairnum = 2 then KillTwo = 0 End If

'-----Reversal Count----If StairNumCount(StairNum) > 1 then If PrevTrialAcc(StairNum) <> ShowProbe.ACC Then NumReversals(StairNum) = NumReversals(StairNum) + 1 c.SetAttrib "ReversalNum", NumReversals(StairNum) MadeReversal = 1 '---Fill array with values at each reversal ReversalValue(StairNum, NumReversals(StairNum))=Target(StairNum) Else MadeReversal = 0 End If End If '-----Reversal Staircase Kill----'Some arrays, specifically the 1-item arrays, will be quite easy for some participants. http://www.scribd.com/brian_verdine
16

'In order to prevent participants from having to do a bunch of trials that they are able 'to do without problems (i.e., they are acing it) and to shorten the task since getting them all 'right will result in very few reversals, I created a new variable that counts the number of 'times in a row that the participant got a given item correct without a reversal. In 'this example, if the participant gets 8 in a row correct without a reversal, the task will 'set the kill variables to 0 and the staircase will terminate. '---Define "KillAce" variables for first X trials. 'You must define the "KillAce" variables for at least the first trial '(i.e. TrialNum < 2). By changing the number after "TrialNum", this statement 'could also be used to prevent the procedure from terminating too early 'if the set criterion could be met within the first couple of trials '(i.e. the program can only start to track performance to terminate after 'X number of trials). If TrialNum < 2 then If Stairnum = 1 then KillAceOne = 0 End If If Stairnum = 2 then KillAceTwo = 0 End If End If '---Last trial accuracy detection and resetting or adding to "KillAce" variable If ShowProbe.ACC < 1 Then If Stairnum = 1 then KillAceOne = 0 End If If Stairnum = 2 then KillAceTwo = 0 End If Else If Stairnum = 1 and Target(StairNum) = MinTarget then 'MinTarget equation ensures that KillAce is only added to when display time is the shortest possible KillAceOne = KillAceOne + 1 http://www.scribd.com/brian_verdine
17

End If If Stairnum = 2 and Target(StairNum) = MinTarget then 'MinTarget equation ensures that KillAce is only added to when display time is the shortest possible KillAceTwo = KillAceTwo + 1 End If End If '---This detects whether the Kill Ace variables have reached criterion and 'sets the staircase to be terminated if it has. When the staircase terminates 'the code also prints an alert in the debugger. If KillAceOne >= 6 and Stairnum = 1 then '10 here represents the number of consecutive correct trials for this staircase to terminate early KillOne = 0 debug.print "--- Staircase " & Stairnum & " 100% performance criterion met!" TotalReversalSum(StairNum)=0 'Ensures running total begins at 0 For i=MaxReversals to (MaxReversals-NumReversalsToAverage+1) step -1 TotalReversalSum(StairNum) = TotalReversalSum(StairNum) + ReversalValue(StairNum, i) Debug.print "Reversal Number: " & i & chr(9) & "ReversalValue: " & ReversalValue(StairNum, i) & chr(9) & "Total: " & TotalReversalSum(StairNum) Next i AverageReversal(StairNum)=(TotalReversalSum(StairNum)/NumReversalsToAverage) Debug.print "Average Threshold for last " & NumReversalsToAverage & " reversals is : " & AverageReversal(StairNum) End If If KillAceTwo >= 6 and Stairnum = 2 then '10 here represents the number of consecutive correct trials for this staircase to terminate early KillTwo = 0 debug.print "--- Staircase " & Stairnum & " 100% performance criterion met!" TotalReversalSum(StairNum)=0 'Ensures running total begins at 0 For i=MaxReversals to (MaxReversals-NumReversalsToAverage+1) step -1 TotalReversalSum(StairNum) = TotalReversalSum(StairNum) + ReversalValue(StairNum, i) Debug.print "Reversal Number: " & i & chr(9) & "ReversalValue: " & ReversalValue(StairNum, i) & chr(9) & "Total: " & TotalReversalSum(StairNum) Next i AverageReversal(StairNum)=(TotalReversalSum(StairNum)/NumReversalsToAverage) Debug.print "Average Threshold for last " & NumReversalsToAverage & " reversals is : " & AverageReversal(StairNum) End If http://www.scribd.com/brian_verdine
18

'-----Staircase Adjustment Calculations and Output----'---Write data to editor and file 'This portion of the code is irrelevant to SC performance, just useful for 'debugging and data analysis debug.print "Trial: " & TrialNum & chr(9) & "StNum" & StairNum & ": " & Target(StairNum) & Chr(9) & c.GetAttrib("Procedure") & chr(9) &_ "ACC: " & ShowProbe.ACC & chr(9) & "MadeRvsl: " & MadeReversal & chr(9) & "NumRvsls" &_ StairNum & ":" & NumReversals(StairNum) & chr(9) & "RvsVal: " & ReversalValue(StairNum, NumReversals(StairNum)) &_ chr(9) & "KillAce1: " & KillAceOne & chr(9) & "KillAce2: " & KillAceTwo & "Kill1 " & KillOne & chr(9) & "Kill2 " & KillTwo Open c.GetAttrib("Subject") & " " & c.GetAttrib("Session") & " " & "Staircase.dat" For Append As #1 Print #1, c.GetAttrib("Subject") & chr(9) & c.GetAttrib("Session") & chr(9) & TrialNum & chr(9) & StairNum &_ chr(9) & c.GetAttrib("Procedure") & Chr(9) & Target(StairNum) & chr(9) & ShowProbe.ACC & chr(9) & ShowProbe.RT & chr(9) &_ PrevTrialAcc(Stairnum) & chr(9) & MadeReversal & chr(9) & NumReversals(StairNum) & chr(9) & ReversalValue(StairNum, NumReversals(StairNum)) &_ chr(9) & "KillAce1" & KillAceOne & chr(9) & "KillAce2" & KillAceTwo Close '---Add info to data Context for E-Data data file logging c.SetAttrib "NumRvsls", NumReversals(StairNum) c.SetAttrib "TargetValue", Target(Stairnum) '---Add to number of trials counted TrialNum = TrialNum + 1 StairNumCount(StairNum) = StairNumCount(StairNum) + 1 '---Check to see what StepSize should be If NumReversals(StairNum) >= RvrslStep2 and NumReversals(StairNum) < RvrslStep3 then StepSize(StairNum) = StepSize_2 End If If NumReversals(StairNum) >= RvrslStep3 then StepSize(StairNum) = StepSize_3 http://www.scribd.com/brian_verdine
19

End If '---Set total duration of single step up/down StepDuration(StairNum) = StepSize(StairNum) '---Change Value of Next Target If ShowProbe.ACC = 0 then Target(StairNum) = Target(StairNum) + (StepDuration(StairNum)*UpDownRatio) If PrevTrialAcc(StairNum) = 1 and ShowProbe.ACC = 1 and MadeStep(StairNum) = 0 then Target(StairNum) = Target(StairNum) - StepDuration(StairNum) MadeStep(StairNum) = 1 'Denotes having just made a step Else MadeStep(StairNum) = 0 'Denotes that did NOT just make a step End If '---Set Accuracy Value for next trial PrevTrialAcc(StairNum) = ShowProbe.ACC '---Ensure stimulus duration is not < MinTarget duration or > MaxTarget duration If Target(StairNum) < MinTarget then Target(StairNum) = MinTarget End If IF Target(StairNum) > MaxTarget then Target(StairNum) = MaxTarget End If 'Average together last several reversal values; # specified as "NumReversalsToAverage" If NumReversals(StairNum) = MaxReversals then debug.print "--- Staircase" & Stairnum & " completed!" TotalReversalSum(StairNum)=0 'Ensures running total begins at 0 For i=MaxReversals to (MaxReversals-NumReversalsToAverage+1) step -1 TotalReversalSum(StairNum) = TotalReversalSum(StairNum) + ReversalValue(StairNum, i) Debug.print "Reversal Number: " & i & chr(9) & "ReversalValue: " & ReversalValue(StairNum, i) & chr(9) & "Total: " & TotalReversalSum(StairNum) http://www.scribd.com/brian_verdine
20

Next i AverageReversal(StairNum)=(TotalReversalSum(StairNum)/NumReversalsToAverage) Debug.print "Average Threshold for last " & NumReversalsToAverage & " reversals is : " & AverageReversal(StairNum) End If ''''''''''''''''''''''''''''''''''''''''''''' ' InLine - ASCalculations END '''''''''''''''''''''''''''''''''''''''''''''

''''''''''''''''''''''''''''''''''''''''''''' ' InLine - PauseCheck BEGIN ''''''''''''''''''''''''''''''''''''''''''''' If GetUserBreakState()=-1 Then Display.Canvas.Clear Display.Canvas.Text 250, 100, "Paused... To resume press Ctrl+Shift" SetUserBreakState 0 while GetUserBreakState() <> -1 sleep(200) wend sleep(200) SetUserBreakState 0 End If ''''''''''''''''''''''''''''''''''''''''''''' ' InLine - PauseCheck END ''''''''''''''''''''''''''''''''''''''''''''' c.SetAttrib "ShowSet.OnsetDelay", ShowSet.OnsetDelay c.SetAttrib "ShowSet.OnsetTime", ShowSet.OnsetTime c.SetAttrib "ShowSet.DurationError", ShowSet.DurationError c.SetAttrib "ShowSet.RTTime", ShowSet.RTTime c.SetAttrib "ShowSet.ACC", ShowSet.ACC c.SetAttrib "ShowSet.RT", ShowSet.RT c.SetAttrib "ShowSet.RESP", ShowSet.RESP c.SetAttrib "ShowSet.CRESP", ShowSet.CRESP http://www.scribd.com/brian_verdine
21

c.SetAttrib "ShowSet.Tag", ShowSet.Tag c.SetAttrib "ShowProbe.OnsetDelay", ShowProbe.OnsetDelay c.SetAttrib "ShowProbe.OnsetTime", ShowProbe.OnsetTime c.SetAttrib "ShowProbe.DurationError", ShowProbe.DurationError c.SetAttrib "ShowProbe.RTTime", ShowProbe.RTTime c.SetAttrib "ShowProbe.ACC", ShowProbe.ACC c.SetAttrib "ShowProbe.RT", ShowProbe.RT c.SetAttrib "ShowProbe.RESP", ShowProbe.RESP c.SetAttrib "ShowProbe.CRESP", ShowProbe.CRESP

c.Log End Sub

'-------------------------------------------------------------------------' InitDevices ' '-------------------------------------------------------------------------Sub InitDevices(c As Context)

SetOSThreadPriority 3

Set Display = New DisplayDevice Display.Name = "Display" Dim DisplayDisplayDeviceInfo As DisplayDeviceInfo DisplayDisplayDeviceInfo.XRes = 1024 DisplayDisplayDeviceInfo.YRes = 768 http://www.scribd.com/brian_verdine
22

DisplayDisplayDeviceInfo.ColorDepth = 16 DisplayDisplayDeviceInfo.RefreshRate = 0 DisplayDisplayDeviceInfo.NumPages = 0 'Load values from context if they exist If c.AttribExists(Display.Name & ".XRes") Then DisplayDisplayDeviceInfo.XRes = c.GetAttrib(Display.Name & ".XRes") If c.AttribExists(Display.Name & ".YRes") Then DisplayDisplayDeviceInfo.YRes = c.GetAttrib(Display.Name & ".YRes") If c.AttribExists(Display.Name & ".ColorDepth") Then DisplayDisplayDeviceInfo.ColorDepth = c.GetAttrib(Display.Name & ".ColorDepth") 'Open the device, unless the context values indicate otherwise Dim DisplayOpen As Boolean DisplayOpen = True If c.AttribExists(Display.Name & ".Open") Then DisplayOpen = CLogical(c.GetAttrib(Display.Name & ".Open")) If DisplayOpen = True Then Display.Open DisplayDisplayDeviceInfo c.SetAttrib Display.Name & ".RefreshRate", Format$(Display.CalculatedRefreshRate, "0.000") End If Set Sound = New SoundDevice Sound.Name = "Sound" Dim SoundSoundOutDeviceInfo As SoundDeviceInfo SoundSoundOutDeviceInfo.Channels = 2 SoundSoundOutDeviceInfo.SamplesPerSecond = 22050 SoundSoundOutDeviceInfo.BitsPerSample = 16 'Load values from context if they exist If c.AttribExists(Sound.Name & ".Channels") Then SoundSoundOutDeviceInfo.Channels = c.GetAttrib(Sound.Name & ".Channels") If c.AttribExists(Sound.Name & ".SamplesPerSecond") Then SoundSoundOutDeviceInfo.SamplesPerSecond = c.GetAttrib(Sound.Name & ".SamplesPerSecond") If c.AttribExists(Sound.Name & ".BitsPerSample") Then SoundSoundOutDeviceInfo.BitsPerSample = c.GetAttrib(Sound.Name & ".BitsPerSample") Set Keyboard = New KeyboardDevice Keyboard.Name = "Keyboard" Dim KeyboardKeyboardDeviceInfo as KeyboardDeviceInfo http://www.scribd.com/brian_verdine
23

KeyboardKeyboardDeviceInfo.CollectionMode = ebPressesOnly KeyboardKeyboardDeviceInfo.CapsLock = ebCapsLockOff KeyboardKeyboardDeviceInfo.NumLock = ebNumLockOn 'Load values from context if they exist If c.AttribExists(Keyboard.Name & ".CollectionMode") Then KeyboardKeyboardDeviceInfo.CollectionMode = c.GetAttrib(Keyboard.Name & ".CollectionMode") If c.AttribExists(Keyboard.Name & ".CapsLock") Then KeyboardKeyboardDeviceInfo.CapsLock = c.GetAttrib(Keyboard.Name & ".CapsLock") If c.AttribExists(Keyboard.Name & ".NumLock") Then KeyboardKeyboardDeviceInfo.NumLock = c.GetAttrib(Keyboard.Name & ".NumLock") If c.AttribExists(Keyboard.Name & ".EmulateDeviceName") Then KeyboardKeyboardDeviceInfo.EmulateDeviceName = c.GetAttrib(Keyboard.Name & ".EmulateDeviceName") 'Open the device, unless the context values indicate otherwise Dim KeyboardOpen As Boolean KeyboardOpen = True If c.AttribExists(Keyboard.Name & ".Open") Then KeyboardOpen = CLogical(c.GetAttrib(Keyboard.Name & ".Open")) If KeyboardOpen = True Then Keyboard.Open KeyboardKeyboardDeviceInfo End If Set Mouse = New MouseDevice Mouse.Name = "Mouse" Dim MouseMouseDeviceInfo as MouseDeviceInfo MouseMouseDeviceInfo.OpenMode = ebMouseOpenModeDirect MouseMouseDeviceInfo.CollectionMode = ebPressesOnly MouseMouseDeviceInfo.ShowCursor = False 'Load values from context if they exist If c.AttribExists(Mouse.Name & ".OpenMode") Then MouseMouseDeviceInfo.OpenMode = c.GetAttrib(Mouse.Name & ".OpenMode") If c.AttribExists(Mouse.Name & ".CollectionMode") Then MouseMouseDeviceInfo.CollectionMode = c.GetAttrib(Mouse.Name & ".CollectionMode") If c.AttribExists(Mouse.Name & ".ShowCursor") Then MouseMouseDeviceInfo.ShowCursor = c.GetAttrib(Mouse.Name & ".ShowCursor") If c.AttribExists(Mouse.Name & ".EmulateDeviceName") Then MouseMouseDeviceInfo.EmulateDeviceName = c.GetAttrib(Mouse.Name & ".EmulateDeviceName") End Sub

http://www.scribd.com/brian_verdine
24

'-------------------------------------------------------------------------' InitObjects ' '-------------------------------------------------------------------------Sub InitObjects(c As Context) Set SessionProc = New Procedure SessionProc.Name = "SessionProc" SessionProc.Tag = "" SessionProc.Subroutine = "SessionProc_Run" Set Welcome = New TextDisplay Welcome.Name = "Welcome" Welcome.Tag = "" Set WelcomeEchoClients = New EchoClientCollection InitTextDisplayDefaults Welcome Welcome.ClearAfter = CLogical("Yes") Welcome.Duration = CLng("-1") Welcome.TimingMode = ebTimingModeEvent Welcome.PreRelease = Val("0") Welcome.OnsetSync = 1 Welcome.OffsetSync = 0 Set set2match = New List set2match.Name = "set2match" set2match.Tag = "" 'Initialization for set2match Set set2match.Order = New RandomOrder http://www.scribd.com/brian_verdine
25

Set set2match.Deletion = NoDeletion set2match.ResetEveryRun = False ' Create the column headings set2match.AddAttrib "Set" set2match.AddAttrib "Probe" set2match.AddAttrib "ProbeTag" set2match.AddAttrib "SetTag" set2match.AddAttrib "Match" set2match.Filename = "" set2match.LoadMethod = ebLoadMethodEmbedded set2match.Load Set set2match.TerminateCondition = Samples(4) Set set2match.ResetCondition = Samples(24) set2match.Reset Set set1match = New List set1match.Name = "set1match" set1match.Tag = "" 'Initialization for set1match Set set1match.Order = New RandomOrder Set set1match.Deletion = NoDeletion set1match.ResetEveryRun = False ' Create the column headings set1match.AddAttrib "Set" set1match.AddAttrib "Probe" set1match.AddAttrib "SetTag" set1match.AddAttrib "ProbeTag" set1match.AddAttrib "Match" http://www.scribd.com/brian_verdine
26

set1match.Filename = "" set1match.LoadMethod = ebLoadMethodEmbedded set1match.Load Set set1match.TerminateCondition = Samples(4) Set set1match.ResetCondition = Samples(12) set1match.Reset Set Fixation = New ImageDisplay Fixation.Name = "Fixation" Fixation.Tag = "fix1" Fixation.Filename = "Fixation.bmp" Fixation.Load InitImageDisplayDefaults Fixation Fixation.BackColor = CColor("white") Fixation.TimingMode = ebTimingModeEvent Fixation.PreRelease = Val("0") Fixation.OnsetSync = 1 Fixation.OffsetSync = 0 Set ShowProbe = New ImageDisplay ShowProbe.Name = "ShowProbe" Set ShowProbeEchoClients = New EchoClientCollection InitImageDisplayDefaults ShowProbe ShowProbe.BackColor = CColor("white") ShowProbe.Duration = CLng("-1") ShowProbe.TimingMode = ebTimingModeEvent http://www.scribd.com/brian_verdine
27

ShowProbe.PreRelease = Val("0") ShowProbe.OnsetSync = 1 ShowProbe.OffsetSync = 0 Set ShowDelay = New ImageDisplay ShowDelay.Name = "ShowDelay" ShowDelay.Tag = "del+" ShowDelay.Filename = "Delay.bmp" ShowDelay.Load InitImageDisplayDefaults ShowDelay ShowDelay.BackColor = CColor("white") ShowDelay.Duration = CLng("1200") ShowDelay.TimingMode = ebTimingModeEvent ShowDelay.PreRelease = Val("0") ShowDelay.OnsetSync = 1 ShowDelay.OffsetSync = 0 Set set1mismatch = New List set1mismatch.Name = "set1mismatch" set1mismatch.Tag = "" 'Initialization for set1mismatch Set set1mismatch.Order = New RandomOrder Set set1mismatch.Deletion = NoDeletion set1mismatch.ResetEveryRun = False ' Create the column headings set1mismatch.AddAttrib "Set" set1mismatch.AddAttrib "Probe" http://www.scribd.com/brian_verdine
28

set1mismatch.AddAttrib "SetTag" set1mismatch.AddAttrib "ProbeTag" set1mismatch.AddAttrib "Match" set1mismatch.Filename = "" set1mismatch.LoadMethod = ebLoadMethodEmbedded set1mismatch.Load Set set1mismatch.TerminateCondition = Samples(4) Set set1mismatch.ResetCondition = Samples(12) set1mismatch.Reset Set set2mismatch = New List set2mismatch.Name = "set2mismatch" set2mismatch.Tag = "" 'Initialization for set2mismatch Set set2mismatch.Order = New RandomOrder Set set2mismatch.Deletion = NoDeletion set2mismatch.ResetEveryRun = False ' Create the column headings set2mismatch.AddAttrib "Set" set2mismatch.AddAttrib "Probe" set2mismatch.AddAttrib "ProbeTag" set2mismatch.AddAttrib "SetTag" set2mismatch.AddAttrib "Match" set2mismatch.Filename = "" set2mismatch.LoadMethod = ebLoadMethodEmbedded set2mismatch.Load Set set2mismatch.TerminateCondition = Samples(4) http://www.scribd.com/brian_verdine
29

Set set2mismatch.ResetCondition = Samples(24) set2mismatch.Reset Set Testing = New List Testing.Name = "Testing" Testing.Tag = "" 'Initialization for Testing Set Testing.Order = New SequentialOrder Set Testing.Deletion = NoDeletion Testing.ResetEveryRun = False ' Create the column headings Testing.Filename = "" Testing.LoadMethod = ebLoadMethodEmbedded Testing.Load Set Testing.TerminateCondition = Cycles(1) Set Testing.ResetCondition = Samples(1) Testing.Reset Set AdaptiveTesting = New Procedure AdaptiveTesting.Name = "AdaptiveTesting" AdaptiveTesting.Tag = "" AdaptiveTesting.Subroutine = "AdaptiveTesting_Run" Set RandomAdaptiveTrials = New List RandomAdaptiveTrials.Name = "RandomAdaptiveTrials" RandomAdaptiveTrials.Tag = "" 'Initialization for RandomAdaptiveTrials http://www.scribd.com/brian_verdine
30

Set RandomAdaptiveTrials.Order = New RandomOrder Set RandomAdaptiveTrials.Deletion = NoDeletion RandomAdaptiveTrials.ResetEveryRun = False ' Create the column headings RandomAdaptiveTrials.AddAttrib "CellNumber" RandomAdaptiveTrials.AddAttrib "CellLabel" RandomAdaptiveTrials.AddAttrib "CorrectResponse" RandomAdaptiveTrials.AddAttrib "SetTag" RandomAdaptiveTrials.AddAttrib "ProbeTag" RandomAdaptiveTrials.AddAttrib "ArrayDuration" RandomAdaptiveTrials.AddAttrib "Staircase" RandomAdaptiveTrials.AddAttrib "Kill" RandomAdaptiveTrials.AddAttrib "KillAce" RandomAdaptiveTrials.Filename = "" RandomAdaptiveTrials.LoadMethod = ebLoadMethodEmbedded RandomAdaptiveTrials.Load Set RandomAdaptiveTrials.TerminateCondition = Cycles(100) Set RandomAdaptiveTrials.ResetCondition = Samples(4) RandomAdaptiveTrials.Reset Set TrialProcASProc = New Procedure TrialProcASProc.Name = "TrialProcASProc" TrialProcASProc.Tag = "" TrialProcASProc.Subroutine = "TrialProcASProc_Run" Set ShowSet = New ImageDisplay ShowSet.Name = "ShowSet" ShowSet.Tag = "" InitImageDisplayDefaults ShowSet http://www.scribd.com/brian_verdine
31

ShowSet.BackColor = CColor("white") ShowSet.TimingMode = ebTimingModeEvent ShowSet.PreRelease = Val("0") ShowSet.OnsetSync = 1 ShowSet.OffsetSync = 0

End Sub

'-------------------------------------------------------------------------' InitPackages ' '-------------------------------------------------------------------------Sub InitPackages(c As Context) End Sub

'-------------------------------------------------------------------------' InitGlobals ' '-------------------------------------------------------------------------Sub InitGlobals(c As Context) End Sub

'--------------------------------------------------------------------------

http://www.scribd.com/brian_verdine
32

'-------------------------------------------------------------------------'-------------------------------------------------------------------------' UnInitGlobals '-------------------------------------------------------------------------Sub UnInitGlobals() End Sub '-------------------------------------------------------------------------' UnInitDevices '-------------------------------------------------------------------------Sub UnInitDevices() Display.Close Set Display = Nothing Keyboard.Close Set Keyboard = Nothing Mouse.Close Set Mouse = Nothing End Sub

'-------------------------------------------------------------------------'-------------------------------------------------------------------------' UnInitPackages '-------------------------------------------------------------------------Sub UnInitPackages() End Sub

'-------------------------------------------------------------------------' UnInitObjects ' '-------------------------------------------------------------------------http://www.scribd.com/brian_verdine


33

Sub UnInitObjects() Set SessionProc = Nothing Set Welcome = Nothing Set WelcomeEchoClients = Nothing Set set2match = Nothing Set set1match = Nothing Set Fixation = Nothing Set ShowProbe = Nothing Set ShowProbeEchoClients = Nothing Set ShowDelay = Nothing Set set1mismatch = Nothing Set set2mismatch = Nothing Set Testing = Nothing Set AdaptiveTesting = Nothing Set RandomAdaptiveTrials = Nothing Set TrialProcASProc = Nothing Set ShowSet = Nothing http://www.scribd.com/brian_verdine
34

End Sub

'-------------------------------------------------------------------------' Main ' '-------------------------------------------------------------------------Sub Main() CreateDefaultPort ' Create and initialize the default context, data file, ' and provide global access to the context. Dim c As Context Set c = New Context Set c.DataFile = New DataFile c.PushNewFrame Set ebContext = c ' Set the log level names c.SetLogLevelName 1, "Session" c.SetLogLevelName 2, "Block" c.SetLogLevelName 3, "Trial" c.SetLogLevelName 4, "SubTrial" c.SetLogLevelName 5, "LogLevel5" c.SetLogLevelName 6, "LogLevel6" c.SetLogLevelName 7, "LogLevel7" c.SetLogLevelName 8, "LogLevel8" c.SetLogLevelName 9, "LogLevel9" c.SetLogLevelName 10, "LogLevel10" ' Set standard logging items ebContext.SetAttrib "Experiment", "Verdine VSTM Adaptive Procedure 2009-02-03" http://www.scribd.com/brian_verdine
35

ebContext.SetAttrib "SessionDate", Date$ ebContext.SetAttrib "SessionTime", Time$ ebContext.SetAttrib "RandomSeed", PRNG.GetSeed() If Basic.OS = ebWin32 Then WinActivate "E-Run Experiment Window" End If ' Get the StartupInfo ' Set default for GroupNumber c.SetAttrib "Group", "1"

' Set the defaults for all of the StartupInfo c.SetAttrib "Subject", "1" c.SetAttrib "Session", "1" c.SetAttrib "MatchButton", "1" c.SetAttrib "MisMatchButton", "4" c.SetAttrib "Age", "0" c.SetAttrib "Sex", "male" c.SetAttrib "Handedness", "left" c.SetAttrib "ResearcherID", "no id" Dim vAnswer As Variant StartupInfo_Begin: StartupInfoPrompt_Subject: vAnswer = AskBox("Please enter the Subject Number (1-100):", c.GetAttrib("Subject")) If Not IsEmpty(vAnswer) then If Not IsNumeric(vAnswer) then MsgBox "Please enter an integer value" GoTo StartupInfoPrompt_Subject ElseIf CLng(vAnswer) < 0 Then MsgBox "The value for Subject must not be less than 0" http://www.scribd.com/brian_verdine
36

GoTo StartupInfoPrompt_Subject ElseIf CLng(vAnswer) > 10000 Then MsgBox "The value for Subject must be not be greater than 10000" GoTo StartupInfoPrompt_Subject End If Else GoTo ExperimentAbort End if c.SetAttrib "Subject", CStr(vAnswer) StartupInfoPrompt_MatchButton: vAnswer = AskBox("Please enter the button that signals a 'match' (1 or 4):", c.GetAttrib("MatchButton")) If Not IsEmpty(vAnswer) then If Not IsNumeric(vAnswer) then MsgBox "Please enter an integer value" GoTo StartupInfoPrompt_MatchButton ElseIf CLng(vAnswer) < 1 Then MsgBox "The value for MatchButton must not be less than 1" GoTo StartupInfoPrompt_MatchButton ElseIf CLng(vAnswer) > 4 Then MsgBox "The value for MatchButton must be not be greater than 4" GoTo StartupInfoPrompt_MatchButton End If Else GoTo ExperimentAbort End if c.SetAttrib "MatchButton", CStr(vAnswer) StartupInfoPrompt_MisMatchButton: vAnswer = AskBox("Please enter the button that signals a 'mismatch' (1 or 4):", c.GetAttrib("MisMatchButton")) If Not IsEmpty(vAnswer) then If Not IsNumeric(vAnswer) then http://www.scribd.com/brian_verdine
37

MsgBox "Please enter an integer value" GoTo StartupInfoPrompt_MisMatchButton ElseIf CLng(vAnswer) < 1 Then MsgBox "The value for MisMatchButton must not be less than 1" GoTo StartupInfoPrompt_MisMatchButton ElseIf CLng(vAnswer) > 4 Then MsgBox "The value for MisMatchButton must be not be greater than 4" GoTo StartupInfoPrompt_MisMatchButton End If Else GoTo ExperimentAbort End if c.SetAttrib "MisMatchButton", CStr(vAnswer) ' Display the summary Dim strSummary As String strSummary = "Subject: " & c.GetAttrib("Subject") & "\n" strSummary = strSummary & "MatchButton: " & c.GetAttrib("MatchButton") & "\n" strSummary = strSummary & "MisMatchButton: " & c.GetAttrib("MisMatchButton") & "\n" strSummary = strSummary & "\nContinue with the above startup info?" Dim nSummaryAnswer As Integer nSummaryAnswer = MsgBox(strSummary, ebYesNoCancel + ebQuestion, "Summary of Startup Info") If nSummaryAnswer = ebNo Then GoTo StartupInfo_Begin ElseIf nSummaryAnswer = ebCancel Then GoTo ExperimentAbort End If

' Set the default Data Filename c.DataFile.Filename = CStr(c.GetAttrib("Experiment")) & "-" & CStr(c.GetAttrib("Subject")) & "-" & CStr(c.GetAttrib("Session")) & ".txt" http://www.scribd.com/brian_verdine
38

' If we are logging data, then prompt to overwrite the data file if it exists If CLng(c.GetAttrib("Subject")) <> 0 Then Dim strFilenameEDAT As String strFilenameEDAT = CStr(c.GetAttrib("Experiment")) & "-" & CStr(c.GetAttrib("Subject")) & "-" & CStr(c.GetAttrib("Session")) & ".edat" If FileExists(c.DataFile.Filename) Or FileExists(strFilenameEDAT) Then If ebYes <> MsgBox("WARNING: The data file and/or recovery file already exists:\nFILE: " & c.DataFile.Filename & "\n\nDo you want to overwrite?", ebYesNo + ebQuestion) Then GoTo ExperimentAbort End If End If End If ' Initialize all system devices, packages, and objects InitGlobals c InitDevices c InitPackages c InitObjects c ' If we are logging data, then open the datafile If CLng(c.GetAttrib("Subject")) <> 0 Then c.DataFile.Open c.LogHeader End If

#If RUNTIME_VERSION_MAJOR > 1 Or (RUNTIME_VERSION_MAJOR = 1 And RUNTIME_VERSION_MINOR >= 2) Then ' Log clock timing information c.SetAttrib "Clock.Information", Clock.Information #End If ' Start the running of the Experiment SessionProc.Run c http://www.scribd.com/brian_verdine
39

' Clean up the context and close the datafile If CLng(c.GetAttrib("Subject")) <> 0 Then c.DataFile.Close ' Attempt to convert the recovery file into a data file Dim nConvert As Long nConvert = c.DataFile.Convert(ebProgressNone) If nConvert = 0 Then ' Settings in E-Studio are set to not remove E-Recovery file Else ' The datafile failed to convert! MsgBox "ERROR: The datafile did not convert!\nFILE: " & c.DataFile.Filename & "\n\nIt is recommended that you recover your data with the E-Recovery utility" MsgBox c.DataFile.GetLastErrorMessage() End If End If ExperimentFinish: UnInitObjects UnInitPackages UnInitDevices UnInitGlobals ExperimentAbort: ' Clean up the context c.PopFrame Set c = Nothing Set ebContext = Nothing DestroyDefaultPort End Sub http://www.scribd.com/brian_verdine
40

[DataSection_set2match(1)] Weight Nested Procedure 1 02-01a 1 02-02a 1 02-03a 1 02-04a 1 02-05a 1 02-06a 1 02-07a 1 02-08a 1 02-09a 1 02-10a 1 02-11a 1 02-12a 1 02-01a 1 02-02a 1 02-03a 1 02-04a 1 02-05a 1 02-06a 1 02-07a 1 02-08a 1 02-09a 1 02-10a 1 02-11a 1 02-12a [DataSection_set1match(1)] Weight Nested Procedure 1 01-01a 1 01-02a 1 01-03a 1 01-04a

Set 1 1 1 2 2 2 3 3 3 4 4 4 2 3 4 1 3 4 1 2 4 1 2 3

Probe pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+ pr2+

ProbeTag 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1\0

SetTag Match

Set 1 1 1 2

Probe 1 1 1 1

SetTag pr1+ pr1+ pr1+ pr1+

ProbeTag 1 1 1 1

Match

http://www.scribd.com/brian_verdine
41

1 1 1 1 1 1 1 1

01-05a 01-06a 01-07a 01-08a 01-09a 01-10a 01-11a 01-12a

2 2 3 3 3 4 4 4

1 1 1 1 1 1 1 1

pr1+ pr1+ pr1+ pr1+ pr1+ pr1+ pr1+ pr1+

1 1 1 1 1 1 1 1\0

[DataSection_set1mismatch(1)] Weight Nested Procedure Set 1 01-01a 2 1 01-02a 3 1 01-03a 4 1 01-04a 1 1 01-05a 3 1 01-06a 4 1 01-07a 1 1 01-08a 2 1 01-09a 4 1 01-10a 1 1 01-11a 2 1 01-12a 3 [DataSection_set2mismatch(1)] Weight Nested Procedure Set 1 02-01a 3 1 02-02a 2 1 02-03a 2 1 02-04a 3 1 02-05a 1 1 02-06a 1 1 02-07a 2 1 02-08a 1

Probe 1 1 1 1 1 1 1 1 1 1 1 1

SetTag pr1pr1pr1pr1pr1pr1pr1pr1pr1pr1pr1pr1-

ProbeTag 0 0 0 0 0 0 0 0 0 0 0 0\0

Match

Probe pr2pr2pr2pr2pr2pr2pr2pr2-

ProbeTag 2 0 2 0 2 0 2 0 2 0 2 0 2 0 2 0

SetTag Match

http://www.scribd.com/brian_verdine
42

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

02-09a 02-10a 02-11a 02-12a 02-01a 02-02a 02-03a 02-04a 02-05a 02-06a 02-07a 02-08a 02-09a 02-10a 02-11a 02-12a

2 3 1 2 4 4 3 4 4 3 4 4 1 2 3 1

pr2pr2pr2pr2pr2pr2pr2pr2pr2pr2pr2pr2pr2pr2pr2pr2-

2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\0

[DataSection_Testing(1)] Weight Nested Procedure 1 AdaptiveTesting\0 [DataSection_RandomAdaptiveTrials(1)] Weight Nested Procedure CellNumber 1 set1match TrialProcASProc 1 1 set1mismatch TrialProcASProc 2 1 set2match TrialProcASProc 3 1 set2mismatch TrialProcASProc 4

CellLabel set1 match set1 mismatch set2match set2mismatch

CorrectResponse \[MatchButton\] \[MismatchButton\] \[MatchButton\] \[MismatchButton\]

SetTag set1 set1 set2 set2

ProbeTag ArrayDuration pr1+ \[ArrayDuration\] pr1\[ArrayDuration\] pr2+ \[ArrayDuration\] pr2\[ArrayDuration\]

Staircase Kill 1 \[KillOne\] 1 \[KillOne\] 2 \[KillTwo\] 2 \[KillTwo\]

KillAce \[KillAceOne\] \[KillAceOne\] \[KillAceTwo\] \[KillAceTwo\]\0

http://www.scribd.com/brian_verdine
43

Você também pode gostar