API Docs for: 0.5.1
Show:

ExpLookitGeometryAlternation Class

Frame to implement specific test trial structure for geometry alternation experiment. Includes announcement, calibration, and alternation (test) phases. During "alternation," two streams of triangles are shown, in rectangles on the left and right of the screen: one one side both size and shape change, on the other only size changes. Frame is displayed fullscreen and video recording is conducted during calibration/test.

The geometry randomizer generates a series of ExpLookitGeometryAlternation frames.

These frames extend ExpFrameBaseUnsafe because they are displayed fullscreen and expected to be repeated.

"frames": {
   "alt-trial": {
       "kind": "exp-lookit-geometry-alternation",
       "triangleLineWidth": 8,
       "calibrationVideoSources": [
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/webm/attention.webm",
               "type": "video/webm"
           },
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/mp4/attention.mp4",
               "type": "video/mp4"
           }
       ],
       "trialLength": 60,
       "attnLength": 10,
       "calibrationLength": 3000,
       "fsAudio": [
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/mp3/fullscreen.mp3",
               "type": "audio/mp3"
           },
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/ogg/fullscreen.ogg",
               "type": "audio/ogg"
           }
       ],
       "triangleColor": "#056090",
       "unpauseAudio": [
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/mp3/return_after_pause.mp3",
               "type": "audio/mp3"
           },
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/ogg/return_after_pause.ogg",
               "type": "audio/ogg"
           }
       ],
       "pauseAudio": [
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/mp3/pause.mp3",
               "type": "audio/mp3"
           },
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/ogg/pause.ogg",
               "type": "audio/ogg"
           }
       ],
       "videoSources": [
           {
               "src": "https://s3.amazonaws.com/lookitcontents/exp-physics-final/stimuli/attention/webm/attentiongrabber.webm",
               "type": "video/webm"
           },
           {
               "src": "https://s3.amazonaws.com/lookitcontents/exp-physics-final/stimuli/attention/mp4/attentiongrabber.mp4",
               "type": "video/mp4"
           }
       ],
       "musicSources": [
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/mp3/happy-stroll.mp3",
               "type": "audio/mp3"
           },
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/ogg/happy-stroll.ogg",
               "type": "audio/ogg"
           }
       ],
       "calibrationAudioSources": [
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/mp3/chimes.mp3",
               "type": "audio/mp3"
           },
           {
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/ogg/chimes.ogg",
               "type": "audio/ogg"
           }
       ],
       "altOnLeft": true,
       "context": true,
       "audioSources": [
           {
               "type": "audio/mp3",
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/mp3/video_01.mp3"
           },
           {
               "type": "audio/ogg",
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/ogg/video_01.ogg"
           }
       ],
       "endAudioSources": [
           {
               "type": 'audio/mp3',
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/mp3/all_done.mp3"
           },
           {
               "type": "audio/ogg",
               "src": "https://s3.amazonaws.com/lookitcontents/geometry/ogg/all_done.ogg"
           }
       ]
   }
}

Methods

exitFullscreen

()
Exit fullscreen mode

serializeContent

(
  • context
  • altOnLeft
  • videoID
  • hasBeenPaused
  • eventTimings
)
Object

Parameters captured and sent to the server

Parameters:

  • context Boolean

    True to use big fat triangle as context figure, or false to use small skinny triangle as context. [same as passed to this frame]

  • altOnLeft Boolean

    Whether to put the shape+size alternating stream on the left (other stream alternates only in size) [same as passed to this frame]

  • videoID String

    The ID of any video recorded during this frame

  • hasBeenPaused Boolean

    whether this trial was paused

  • eventTimings Object

Returns:

Object:

The payload sent to the server

showFullscreen

()
Make a specified element fullscreen

Properties

altOnLeft

Boolean

Whether to put the shape+size alternating stream on the left (other stream alternates only in size)

Default: true

attnLength

Number

minimum amount of time to show attention-getter in seconds

Default: 5

audioSources

Object[]

Sources Array of {src: 'url', type: 'MIMEtype'} objects for instructions during attention-getter video

calibrationAudioSources

Object[]

Sources Array of {src: 'url', type: 'MIMEtype'} objects for calibration audio (played 4 times during calibration)

calibrationLength

Number

length of single calibration segment in ms

Default: 3000

calibrationVideoSources

Object[]

Sources Array of {src: 'url', type: 'MIMEtype'} objects for calibration video (played from start 4 times during calibration)

context

Boolean

True to use big fat triangle as context figure, or false to use small skinny triangle as context.

Default: true

endAudioSources

Object[]

Sources Array of {src: 'url', type: 'MIMEtype'} objects for audio after completion of trial (optional; used for last trial "okay to open your eyes now" announcement)

fsAudio

Object[]

Sources Array of {src: 'url', type: 'MIMEtype'} objects for audio played when study is paused due to not being fullscreen

fsButtonID

String
The element ID of a button to show if the user leaves fullscreen mode

fullScreenElementId

String
The element ID of the thing to make full screen (video element, div, etc)

musicSources

Object[]

Sources Array of {src: 'url', type: 'MIMEtype'} objects for music during trial

pauseAudio

Object[]

Sources Array of {src: 'url', type: 'MIMEtype'} objects for audio played upon pausing study

trialLength

Number

length of alternation trial in seconds

Default: 6

triangleColor

String

color of triangle outline (3 or 6 char hex, starting with #)

Default: '#056090'

triangleLineWidth

Integer

triangle line width in pixels

Default: 5

unpauseAudio

Object[]

Sources Array of {src: 'url', type: 'MIMEtype'} objects for audio played upon unpausing study

videoSources

Object[]

Sources Array of {src: 'url', type: 'MIMEtype'} objects for attention-getter video (should be loopable)

Events

clearTriangles

Records each time triangles are cleared from display

enteredFullscreen

When change to fullscreen is detected

leftFullscreen

When change to non-fullscreen is detected

nextFrame

Move to next frame

onCamAccess

When recorder detects a change in camera access

Event Payload:

pauseVideo

When pausing study, immediately before request to pause webcam recording

startCalibration

Start of EACH calibration segment

Event Payload:

  • location String

    location of calibration ball, relative to child: 'left', 'right', or 'center'

startIntro

Immediately before starting intro/announcement segment

startTestTrial

Immediately before starting test trial segment

stoppingCapture

Just before stopping webcam video capture

unpauseVideo

When unpausing study, immediately before request to resume webcam recording

videoStreamConnection

When recorder detects a change in video stream connection status

Event Payload:

  • status String

    status of video stream connection, e.g. 'NetConnection.Connect.Success' if successful

videoStreamConnection

records EACH triangle presentation during test trial

Event Payload:

  • Lshape String

    shape of left triangle: 'skinny' or 'fat'

  • Rshape String

    shape of right triangle: 'skinny' or 'fat'

  • LX Number

    Horizontal offset of left triangle from rectangle center, in units where rectangle width = 70; positive = to right

  • LY Number

    Vertical offset of left triangle from rectangle center, in units where rectangle height = 100.8; positive = down

  • RX Number

    Horizontal offset of right triangle from rectangle center, in units where screen width = 200 and rectangle width = 70; positive = to right

  • RY Number

    Vertical offset of right triangle from rectangle center, in units where rectangle height = 100.8; positive = down

  • LRot Number

    rotation of left triangle in degrees. 0 degrees has long side horizontal and 15 degree angle (skinny triangle) or 60 degree angle (fat triangle) on left.

  • RRot Number

    rotation of right triangle in degrees. 0 degrees has long side horizontal and 15 degree angle (skinny triangle) or 60 degree angle (fat triangle) on left.

  • LFlip Number

    whether left triangle is flipped (1 = no, -1 = yes)

  • RFlip Number

    whether right triangle is flipped (1 = no, -1 = yes)

  • LSize Number

    size of left triangle, relative to standard ('standard' sizes are set so that areas of skinny & fat triangles are equal), in terms of side length (e.g. for a rectangle, 2 would mean take a 1x3 rectangle and make it a 2x6 rectangle, quadrupling the area)

  • RSize Number

    size of right triangle, relative to standard ('standard' sizes are set so that areas of skinny & fat triangles are equal), in terms of side length (e.g. for a rectangle, 2 would mean take a 1x3 rectangle and make it a 2x6 rectangle, quadrupling the area)