[WARNING] WARNING: DO NOT EDIT THIS FILE DIRECTLY! Use only E-Studio to edit this file. Editing of this file from any other means is not supported and may corrupt the experiment design specification. Technical support will not be able to address any issue in regards to this file format. [Experiment] VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=75 _VersionPersist=6 Root="SessionProc" Author="Amy Eschman" Abstract="This example illustrates the use of a user-defined type (GridInfo)\r\nto define a series of checkboxes on the screen. The example is\r\nwritten to allow the user to define the size of the cells, or the max\r\nnumber of rows and/or columns in order to modify the display. \r\n\r\nCellWidth - modify this to change the size of the response area\r\nintMaxRows\r\nintMaxColumns -- modify these to set the max numbers of rows/columns\r\n\r\n\r\n\r\n\r\nAlso, the response area is defined as the area including both the \r\ncheckbox and the accompanying string, while only the checkbox\r\nis drawn as a rectangle. This allows the user to respond by \r\nclicking the checkbox or the word itself in order to register a \r\nresponse. Uncomment the commands set to draw in red in order \r\nto view the entire response area." Notes="" Creation=1595435283 [Device0] _VersionPersist=1 OpenDevice=1 Width=640 Height=480 Bpp=32 Name="Display" Class="Display" [Device1] _VersionPersist=1 OpenDevice=0 Channels=2 Samples=22050 Bps=16 Name="Sound" Class="Sound" [Device2] _VersionPersist=1 OpenDevice=1 CollectionMode=1 EmulateDeviceName="" CapsLock=0 NumLock=0 Name="Keyboard" Class="Keyboard" [Device3] _VersionPersist=1 OpenDevice=1 CollectionMode=1 EmulateDeviceName="" OpenMode=0 ShowCursor=0 Name="Mouse" Class="Mouse" [DataFile] WarnBeforeOverwrite=1 WarnIfConvertFailed=1 RemoveERecoveryFile=0 ReceiveFeedbackDuringDataFileConversion=1 LogLevel(2).Name="Block" LogLevel(3).Name="Trial" LogLevel(4).Name="SubTrial" LogLevel(5).Name="LogLevel5" LogLevel(6).Name="LogLevel6" LogLevel(7).Name="LogLevel7" LogLevel(8).Name="LogLevel8" LogLevel(9).Name="LogLevel9" LogLevel(10).Name="LogLevel10" [StartupInfo] DisplaySummary=1 UseDefaults=0 [StartupInfo1] Name="Subject" Prompt="Please enter the Subject Number (0-32767):" DataType=0 Enabled=1 PromptEnabled=1 Default="1" Min=0 Max=32767 PrivateFlags=268435477 PrivateInfo=1 [StartupInfo2] Name="Session" Prompt="Please enter the Session Number (0-32767):" DataType=0 Enabled=1 PromptEnabled=1 Default="1" Min=0 Max=32767 PrivateFlags=268435477 PrivateInfo=1 [StartupInfo3] Name="Group" Prompt="Please enter Subject's Group (0-32767):" DataType=0 Enabled=0 PromptEnabled=0 Default="1" Min=0 Max=32767 [StartupInfo4] Name="Name" Prompt="Please enter Subject's Name:" DataType=1 Enabled=0 PromptEnabled=0 Default="" MaxLength=255 [StartupInfo5] Name="Age" Prompt="Please enter Subject's Age (0-150):" DataType=0 Enabled=0 PromptEnabled=0 Default="0" Min=0 Max=150 [StartupInfo6] Name="Sex" Prompt="Please enter Subject's Sex:" DataType=2 Enabled=0 PromptEnabled=0 Default="male" Choice(1).Value="male" Choice(2).Value="female" [StartupInfo7] Name="Handedness" Prompt="Enter Subject's Handedness:" DataType=2 Enabled=0 PromptEnabled=0 Default="left" Choice(1).Value="left" Choice(2).Value="right" [StartupInfo8] Name="ResearcherID" Prompt="Please enter Researcher's ID:" DataType=0 Enabled=0 PromptEnabled=0 Default="1" Min=0 Max=32767 [Object0] _Version=65536 _ExtentX=2646 _ExtentY=1323 _StockProps=0 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 _ItemList="InitGrid;DrawGrid;TrialList;Goodbye" _VersionPersist=1 FlowLines(0).Count=4 FlowLines(0).FlowItem(0).Name="InitGrid" FlowLines(0).FlowItem(1).Name="DrawGrid" FlowLines(0).FlowItem(2).Name="TrialList" FlowLines(0).FlowItem(3).Name="Goodbye" LogData=1 Name="SessionProc" TypeName="Procedure" Tag="" Notes="" [Object1] _Version=131072 _ExtentX=2646 _ExtentY=1323 _StockProps=0 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 _VersionPersist=1 Code="'Define canvas and declare vars\nSet cnvs = Display.Canvas\ncnvs.BackStyle = \"Transparent\"\n\nMouse.ShowCursor True\nMouse.ShowCursor True\n\nDim i As Integer\nDim j As Integer\nDim x As Integer\nDim y As Integer\n\nfoundClick = False\nCellWidth = Display.XRes*.10\t\t\t'Sets cell size\nCellHeight = CellWidth/4\nxMargin = CellWidth\nyMargin = CellWidth/2\nCellSpacing = CellHeight*1.5\nintMaxRows = (Display.YRes-yMargin*2)/CellSpacing\nintMaxCols = (Display.XRes-xMargin*2)/(CellWidth+CellSpacing)\ncnvs.FontSize = CStr(CellWidth*.15)\n\nx = xMargin\ny = yMargin\n\n'Initialize grid values\nFor j = 1 to intMaxCols\n\tFor i = 1 To intMaxRows\n\t\tGrid(i,j).XCoord = x\n\t\tGrid(i,j).YCoord = y\n\t\tGrid(i,j).Selected = False\n\t\tGrid(i,j).Contents = \"Word\"\t\t'Would likely initialize from a List or text file\n\t\ty = y + CellSpacing\n\t\tIf i = intMaxRows Then\n\t\t\tx = x + CellWidth + CellSpacing\n\t\t\ty = yMargin\n\t\tEnd If\n\tNext i\nNext j\n\n'Set Exit location\nrectExit.Left = Display.XRes - CellWidth*1.5\nrectExit.Top = Display.YRes - CellHeight*1.5\nrectExit.Right = rectExit.Left+CellWidth\nrectExit.Bottom = rectExit.Top+CellHeight\n\n" Name="InitGrid" TypeName="InLine" Tag="" Notes="" [Object2] _Version=131072 _ExtentX=2646 _ExtentY=1323 _StockProps=0 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 _VersionPersist=1 Code="'Draw grid and selected areas\n'Blue is the displayed checkbox area\n'Red is the entire defined area - uncomment to view\n\nFor j = 1 To intMaxCols\n\tFor i = 1 To intMaxRows\n'\t\tcnvs.PenColor = CColor(\"Red\")\n'\t\tcnvs.Rectangle Grid(i,j).XCoord+1, Grid(i,j).YCoord+1, CellWidth, CellHeight\n\t\tcnvs.PenColor = CColor(\"Blue\")\n\t\tcnvs.Rectangle Grid(i,j).XCoord, Grid(i,j).YCoord, CellWidth*.25, CellHeight\n\t\tcnvs.Text Grid(i,j).XCoord+CellWidth*.30, Grid(i,j).YCoord+CellHeight*.02, Grid(i,j).Contents \n\tNext i\nNext j\n\n'Draw Exit button\ncnvs.PenColor = CColor(\"Black\")\ncnvs.Rectangle rectExit.Left, rectExit.Top, CellWidth, CellHeight\ncnvs.Text rectExit.Left+CellWidth*.30, rectExit.Top+CellHeight*.02, \"Exit\"\n\n\n" Name="DrawGrid" TypeName="InLine" Tag="" Notes="" [Object3] _Version=65536 _ExtentX=2646 _ExtentY=1323 _StockProps=0 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 Logging("OnsetDelay").Log=0 Logging("OnsetTime").Log=0 Logging("DurationError").Log=0 Logging("PreRelease").Log=0 Logging("Duration").Log=0 Logging("StartTime").Log=0 Logging("OffsetTime").Log=0 Logging("FinishTime").Log=0 Logging("TimingMode").Log=0 Logging("CustomOnsetTime").Log=0 Logging("CustomOffsetTime").Log=0 Logging("ActionDelay").Log=0 Logging("ActionTime").Log=0 Logging("TargetOffsetTime").Log=0 Logging("TargetOnsetTime").Log=0 Logging("OffsetDelay").Log=0 Logging("RTTime").Log=0 Logging("ACC").Log=0 Logging("RT").Log=0 Logging("RESP").Log=0 Logging("CRESP").Log=0 Logging("Tag").Log=0 Input(0)=!Data0 _VersionPersist=1 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 Text="Click a box" ForeColor="black" BackColor="white" BackStyle="transparent" BorderColor="black" BorderWidth="0" X="center" Y="top" Width="100%" Height="10%" XAlign="center" YAlign="top" AlignHorizontal="center" AlignVertical="center" FontName="Arial" FontSize="14" FontBold="Yes" FontItalic="No" FontUnderline="No" FontStrikeout="No" WordWrap=1 ClearAfter="No" Duration="-1" JumpLabel="" TimingMode=0 PreRelease="0" OnsetSync=1 OffsetSync=0 Name="CollectClick" TypeName="TextDisplay" Tag="" Notes="" [Data0] DeviceName="Mouse" DeviceClass="Mouse" AllowableInput="1" CorrectInput="" TimeLimit="" MaxCount="1" InputAction=1 SyncOwnerDuration=1 Enabled=1 FlushInputBuffer="Yes" TerminationInput="" UserTag="" [Object4] _Version=65536 _ExtentX=2646 _ExtentY=1323 _StockProps=0 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 _ItemList="RedrawProc" _VersionPersist=1 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 Order=0 OrderBy=0 ResetEveryRun=0 HideLevelsWithZeroWeight=0 CycleDef=0 CycleValueSamples=0 CycleValueCondition="" ExitDef=0 ExitValueCycles=1 ExitValueSamples=1 ExitValueSeconds=0 ExitValueCondition="" LoadMethod=0 Filename="" UserAttributes=0 Attributes("Weight").DefaultValue="1" Attributes("Weight").Visible=1 Attributes("Weight").Width=75 Attributes("Weight").OrderIndex=0 Attributes("Nested").DefaultValue="" Attributes("Nested").Visible=1 Attributes("Nested").Width=75 Attributes("Nested").OrderIndex=1 Attributes("Procedure").DefaultValue="" Attributes("Procedure").Visible=1 Attributes("Procedure").Width=75 Attributes("Procedure").OrderIndex=2 Levels=1 Levels(1).ValueString="100\t\tRedrawProc\t" Name="TrialList" TypeName="List" Tag="" Notes="" [Object5] _Version=65536 _ExtentX=2646 _ExtentY=1323 _StockProps=0 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 _ItemList="CollectClick;UpdateGrid" _VersionPersist=1 FlowLines(0).Count=2 FlowLines(0).FlowItem(0).Name="CollectClick" FlowLines(0).FlowItem(1).Name="UpdateGrid" LogData=1 Name="RedrawProc" TypeName="Procedure" Tag="" Notes="" [Object6] _Version=131072 _ExtentX=2646 _ExtentY=1323 _StockProps=0 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 _VersionPersist=1 Code="'Evaluate input and redraw Grid\nDim i As Integer\nDim j As Integer\nDim rectResp As Rect\nMouse.GetCursorPos ptClick.x, ptClick.y\n\n'If clicked Exit, terminate trials\nIf PointInRect(ptClick, rectExit) Then\n\tcnvs.BackStyle = \"opaque\"\n\tcnvs.FillColor = CColor(\"Black\")\n\tcnvs.TextColor = CColor(\"White\")\n\tcnvs.TextBackColor = CColor (\"Black\")\n\tcnvs.Rectangle rectExit.Left, rectExit.Top, CellWidth, CellHeight\n\tcnvs.Text rectExit.Left+CellWidth*.30, rectExit.Top+CellHeight*.02, \"Exit\"\n\tSleep 500\n\tc.SetAttrib \"WordSelection\", \"Exit\"\n\tTrialList.Terminate\nElse\n\t'Find which checkbox was clicked and set this to \"selected\"\n\tFor j = 1 To intMaxCols\n\t\tFor i = 1 To intMaxRows\n\t\t\trectResp.Left = Grid(i,j).XCoord\n\t\t\trectResp.Top = Grid(i,j).YCoord\n\t\t\trectResp.Right = Grid(i,j).XCoord + CellWidth\n\t\t\trectResp.Bottom = Grid(i,j).YCoord + CellHeight\n\t\t\tIf PointInRect(ptClick, rectResp) Then\n\t\t\t\tGrid(i,j).Selected = True\n\t\t\t\tc.SetAttrib \"WordSelection\", Grid(i,j).Contents\n\t\t\t\tfoundClick = True\n\t\t\tEnd If\n\t\tNext i\n\tNext j\n\n\t'If a click was not a specific word (e.g., accidental, in the margin)\n\tIf foundClick = False Then\n\t\tc.SetAttrib \"WordSelection\", \"InvalidResponse\"\n\tElse\n\t\tfoundClick = False\n\tEnd If\n\n\t'Redraw the grid with 'X's marking selected boxes\n\tFor j = 1 To intMaxCols\n\t\tFor i = 1 To intMaxRows\n'\t\t\tcnvs.PenColor = CColor(\"Red\")\n'\t\t\tcnvs.Rectangle Grid(i,j).XCoord+1, Grid(i,j).YCoord+1, CellWidth, CellHeight\n\t\t\tcnvs.PenColor = CColor(\"Blue\")\n\t\t\tcnvs.Rectangle Grid(i,j).XCoord, Grid(i,j).YCoord, CellWidth*.25, CellHeight\n\t\t\tIf Grid(i,j).Selected = True Then\n\t\t\t\tcnvs.Text Grid(i,j).XCoord+CellWidth*.08, Grid(i,j).YCoord+CellHeight*.02, \"X\" \n\t\t\tEnd If\n\t\tNext i\n\tNext j\n\n\t'Draw Exit button\n\tcnvs.PenColor = CColor(\"Black\")\n\tcnvs.Rectangle rectExit.Left, rectExit.Top, CellWidth, CellHeight\n\tcnvs.Text rectExit.Left+CellWidth*.30, rectExit.Top+CellHeight*.02, \"Exit\"\nEnd If\n\n" Name="UpdateGrid" TypeName="InLine" Tag="" Notes="" [Object7] _Version=65536 _ExtentX=2646 _ExtentY=1323 _StockProps=0 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 Logging("OnsetDelay").Log=0 Logging("OnsetTime").Log=0 Logging("DurationError").Log=0 Logging("PreRelease").Log=0 Logging("Duration").Log=0 Logging("StartTime").Log=0 Logging("OffsetTime").Log=0 Logging("FinishTime").Log=0 Logging("TimingMode").Log=0 Logging("CustomOnsetTime").Log=0 Logging("CustomOffsetTime").Log=0 Logging("ActionDelay").Log=0 Logging("ActionTime").Log=0 Logging("TargetOffsetTime").Log=0 Logging("TargetOnsetTime").Log=0 Logging("OffsetDelay").Log=0 Logging("RTTime").Log=0 Logging("ACC").Log=0 Logging("RT").Log=0 Logging("RESP").Log=0 Logging("CRESP").Log=0 Logging("Tag").Log=0 _VersionPersist=1 VersionMajor=1 VersionMinor=2 VersionInternal=1 VersionBuild=52 Text="That's it...Goodbye!" ForeColor="black" BackColor="white" BackStyle="transparent" BorderColor="black" BorderWidth="0" X="center" Y="bottom" Width="100%" Height="10%" XAlign="center" YAlign="bottom" AlignHorizontal="center" AlignVertical="center" FontName="Arial" FontSize="14" FontBold="Yes" FontItalic="No" FontUnderline="No" FontStrikeout="No" WordWrap=1 ClearAfter="No" Duration="1000" JumpLabel="" TimingMode=0 PreRelease="0" OnsetSync=1 OffsetSync=0 Name="Goodbye" TypeName="TextDisplay" Tag="" Notes="" [UserScript] Dim cnvs As Canvas Dim offScreenCnvs As Canvas 'Type CellInfo is used to keep track of information related to specific 'cells within the grid. Type CellInfo ID As Integer Row As Integer Column As Integer XCoord As Integer YCoord As Integer Available As Boolean Selected As Boolean CellColor As String CellSize As Integer Contents As String RespRectTop As Integer RespRectLeft As Integer End Type Dim Grid(0 To 50, 0 To 50) As CellInfo '9x9 'Values set globally to allow users to easily modify the display Dim CellWidth As Integer Dim CellHeight As Integer Dim xMargin As Integer Dim yMargin As Integer Dim CellSpacing As Integer Dim intMaxRows As Integer Dim intMaxCols As Integer Dim ptClick As Point Dim rectExit As Rect Dim foundClick As Boolean