Randomly choose one of two stim versions


1 comment

  • Avatar
    James Booth (Edited )

    I was able to implement this in a situation where A and B were male and female speakers in my videos. VidVal is a dynamically managed string. My trial list has two columns: File_Vid_F and File_Vid_M. I also recorded the result in another string VidGend which only stored M or F. I'll paste code below, but we ended up using 2 counterbalanced lists instead. While this randomizes on run, there's no assurance that you will globally have half M and half F.

    -Chris Brozdowski


    In UserScript, declare strings:

    Dim VidVal As String 'Specific Vid Code
    Dim VidGend As String 'Only Gender for output file

    Just before my trial InLine script:

    If Random(1,2) = 1 Then 'Random number 1 or 2, If 1...
          VidVal = c.GetAttrib("File_Vid_F") 'get vid file name from F column in list 
          c.SetAttrib "VidVal", VidVal 'set as global
          VidGend = "F" 'record Gender as F in output
          c.SetAttrib "VidGend", VidGend
         VidVal = c.GetAttrib("File_Vid_M") 'Same process the other half of the time
         c.SetAttrib "VidVal", VidVal 'set as global
         VidGend = "M"
         c.SetAttrib "VidGend", VidGend
    End If

    And the video itself is set to [VidVal].mp4


    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk