Magpie

Magpie is a framework for easily and flexibly building psychological online experiments.

Base Components

src/components/DebugStatement.vue
Prop nameDescriptionDefault
text
string - required

-

type
string

info

src/components/Experiment.vue

This is the main component for your online experiment. Put it at the root of your application. The experiment is available in all subcomponents and in the parent as $magpie

Prop nameDescriptionDefault
audioAssets

Pass an array of paths to audio files that will be needed in this experiment to enable preloading

array

[]

imageAssets

Pass an array of paths to images that will be needed in this experiment to enable preloading

array

[]

recordData

Optionally specify variables that should be recorded for the whole experiment

object

{}

title

Optionally specify a title for your experiment which will be displayed in the browser title bar (or in the browser tab)

string

''

validateSubmission

This function is called before data is submitted to the server. It will receive the submitted csv data as an array of objects as its only argument.

func

Function

videoAssets

Pass an array of paths to video files that will be needed in this experiment to enable preloading

array

[]

wide

Whether to display the experiment in wide format-filling mode

boolean

false

SlotDescriptionBindings
default

Place your screens inside this slot. They will be visible one after the other, like a slide show.

-
title

The contents of this slot will be visible during the entire experiment

-

A simple experiment with 3 screens

blue

Using a loop to create screens

Screen 0: blue

Providing a title

Besides the screens slot, the Experiment component also provides an optional title slot that allows you to display header information on all screens of your experiment.

My experiment
blue

Validate entered data

The Experiment component also allows specifying a function that will be used to validate the to-be-submitted data before sending it to the server.

blue
src/components/Screen.vue

This component lets you create experiment sections that appear one after the other like a slideshow. Trial data

Prop nameDescriptionDefault
label

A label that can be used to jump to this screen

string

''

progress

If you want to show a progress bar, set this to a value between 0 and 1

number

-1

title

The title of this screen

string

''

validations

Define validators for measurements

object

{}

SlotDescriptionBindings
default

Place your slides inside this slot. They will be visible one after the other, like a slide show.

-

Simple screen

Hello World.

Show progress

Hello World.

Multiple slides

One screen may consist of multiple slides that are numbered incrementally and displayed one after another. You can go to the next slide with the nextSlide function that is exposed by the Screen component.

Wow.

Hello .

Store measurements

The screen component also conveniently exposes an object for you to store in the measurements of the current screen, so you can later save them.

Wow.

Hello
?

Validate measurements

The screen can also be used to validate observations.

Hello
?

At least 4 characters required and only alphabetic characters, please.

Jump using labels

Hello 1th World.
src/components/Slide.vue
SlotDescription
default
-

Screens

While magpie allows you to easily create your own screens, it also comes with a selection of built-in screens that you can just drop into your experiment. These include essential screens like <SubmitResultsScreen> but also ready-made complex appliances that are often used like <SelfPacedReadingScreen>. In addition to the props defined below, these screens also support all props supported by the <Screen> component.

src/components/screens/AwaitIteratedResultScreen.vue
SlotDescription
default
-

Use this screen to initiate the interactive socket connection. Once the connection is set up and enough users have joined, this screen will automatically go to the next screen.

You can customize the content of this screen by adding new content inside it. By default it looks like this:

src/components/screens/ConnectInteractiveScreen.vue
SlotDescription
default
-

Use this screen to initiate the interactive socket connection. Once the connection is set up and enough users have joined, this screen will automatically go to the next screen.

You can customize the content of this screen by adding new content inside it. By default it looks like this:

src/components/screens/DebugResultsScreen.vue

This will display all data that has been entered into the experiment up to this point in a table. This is useful for debugging. Once you are gaoing live with your experiment, you can use the SubmitResultsScreen instead of this one to submit the data to the server and say thank you to the user.

src/components/screens/EyetrackingCalibrationScreen.vue
Prop nameDescriptionDefault
debug
boolean

false

This screen is used to initialize and calibrate eye tracking. Eyetracking requires that you install webgazer.

Click the button to start full screen.
src/components/screens/EyetrackingValidationScreen.vue

Inherits from LifecycleScreen

Global Measurements

MeasurementTypeDescription
et_accuracyfloatThe measured accuracy
Prop nameDescriptionDefault
precision
number

100

This screen is used to initialize and calibrate eye tracking. Eyetracking requires that you install webgazer.

Click the button to start full screen.
src/components/screens/InstructionScreen.vue
SlotDescription
default
-

This is a pre-built instruction screen, with limited functionality, but simpler to use.

These are instructions for the participant.
Below the instructions is a button to continue.
src/components/screens/LifecycleScreen.vue

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
Prop nameDescriptionDefault
feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
task
-
feedback
-

This is a built-in screen with 4 life cycle phases:

  • Pause
  • Fixation
  • Stimulus presentation
  • Response
  • Feedback

The last four phases can be completely customized using the corresponding slots, as you can see below.

Press the button to try this.
src/components/screens/PostTestScreen.vue

Global Measurements

MeasurementTypeDescription
ageint
gender'' | 'male' | 'female' | 'other'
education'' | 'below highschool' | 'highschool' | 'college' | 'higher'
languagesstring
commentsstring
Prop nameDescriptionDefault
age

Whether to ask for participant age

boolean

true

comments

Whether to ask for comments

boolean

true

education

Whether to ask for participant education

boolean

true

gender

Whether to ask for participant gender

boolean

true

languages

Whether to ask for participant mother tongues

boolean

true

SlotDescriptionBindings
default

You can add additional questions here, storing data in measurements

measurements: objecta temporary object to store your responses before adding them to the results

Additional information

Answering the following questions is optional, but your answers will help us analyze our results.

Further comments
src/components/screens/SubmitResultsScreen.vue

Use this screen at the end of your experiment to submit the data to the server. You can provide the submission URL to the Experiment component.

Stimuli

Text

As with normal HTML you can use normal P tags for paragraphs as well as strong, em etc. to mark them up.

This is a bold text.

src/components/stimuli/Audio.vue
Prop nameDescriptionDefault
src

The URL of the audio to embed.

string - required

-

autoplay

if specified, the audio will automatically begin playback as soon as it can do so, without waiting for the entire audio file to finish downloading.

boolean

false

controls

If this attribute is set, the browser will offer controls to allow the user to control audio playback, including volume, seeking, and pause/resume playback.

boolean

false

loop

if true, the audio player will automatically seek back to the start upon reaching the end of the audio.

boolean

false

muted

indicates whether the audio will be initially silenced

boolean

false

You can use HTML's audio tag to play audio.

For more details see HTML Audio Element docs on MDN.

This is a dog.
src/components/stimuli/Canvas.vue

Magpie has built-in support for creating visual stimuli on the fly via Konva.js.

Konva Components are prefixed with Canvas, so Konva.Circle becomes CanvasCircle in magpie. Learn more about using Konva.js in Vue.

Drawing simple shapes

Some drawing exercises

src/components/stimuli/FixationCross.vue
Prop nameDescriptionDefault
x

X-coordinate of cross center

number

425

y

Y-coordinate of cross center

number

200

This component allows you to display a fixation cross.

src/components/stimuli/Img.vue
Prop nameDescriptionDefault
src

The URL of the image to embed.

string - required

-

You can use HTML's <img> tag to display images.

For more details see HTML img Element docs on MDN.

This is a sealion.
src/components/stimuli/Rsvp.vue
Prop nameDescriptionDefault
chunks

The chunks

array - required

-

interval

Interval between chunks in miliseconds

number

300

Event nameDescription
end
SlotDescriptionBindings
presentation
-
chunk

This component allows you to display textual or other content in a rapid serial manner, commonly known as Rapid Serial Visual Presentation (RSVP).

Text

Images

The Rsvp component allows you to define the presentation of the chunks you provide. E.g. we could also use this component to display images.

src/components/stimuli/Synth.vue
Prop nameDescriptionDefault
frequency

The note frequency in hertz (like 440) or as "pitch-octave" notation (like "D#2")

number|string - required

-

attack

The attack of the output envelope in seconds. The attack time is the amount of time it takes for the envelope to reach it's maximum value.

number

0.05

decay

the decay of the output envelope in seconds. After the attack portion of the envelope, the value will fall over the duration of the decay time to it's sustain value.

number

0.1

duration

Duration in seconds. By default the tone will only stop when the component is unmounted.

number

Infinity

oscillator

"fatsine" | "fatsquare" | "fatsawtooth" | "fattriangle" | "fatcustom" | "fmsine" | "fmsquare" | "fmsawtooth" | "fmtriangle" | "fmcustom" | "amsine" | "amsquare" | "amsawtooth" | "amtriangle" | "amcustom" | "pulse" | "pwm"

string

fmsine

release

Release time of the output envelope in seconds. After the duration of the synth tone, the envelope's value will fall to it's minimum value over the duration of the release time.

number

0.1

sustain

The sustain value is the value which the envelope rests at after triggerAttack is called, but before triggerRelease is invoked. Must be between 0 and 1.

number

0.5

volume

The volume of the output in decibels.

number

-6

The Synth component is a basic sound Synthesizer based on Tone.js.

Click to beep.

src/components/stimuli/Video.vue
Prop nameDescriptionDefault
src

The URL of the video to embed.

string - required

-

autoplay

if specified, the audio will automatically begin playback as soon as it can do so, without waiting for the entire video file to finish downloading.

boolean

false

controls

If this attribute is set, the browser will offer controls to allow the user to control playback, including volume, seeking, and pause/resume playback.

boolean

false

loop

if true, the video player will automatically seek back to the start upon reaching the end of the video.

boolean

false

muted

indicates whether the video will be initially silenced

boolean

false

You can use HTML's video tag to play video footage.

For more details see HTML Video Element docs on MDN.

This is a sealion.

Trial Screens

Trial screens display stimuli and record responses during a variety of tasks.

As such they usually inherit from <LifecycleScreen>, including its 4 life cycle phases:

  • Pause
  • Fixation
  • Stimulus presentation
  • Response

This means, for all trial screens you can adjust pause, fixation point and stimulus duration and can replace fixation and stimulus contents via component slots as seen over at <LifecycleScreen>.

src/components/trial_screens/CompletionScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
optionsarray
textstring
responsestringThe completed text
responsesarrayThe individual completions
Prop nameDescriptionDefault
options

An array of arrays with possible completions per %s

array - required

-

text

The text that is supposed to be completed. %s marks completions

string - required

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

question

A question

string

undefined

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built completion screen, with limited functionality, but simpler to use.

What happened in antartica?

One fell over three .
src/components/trial_screens/ForcedChoiceMousetrackingScreen.vue

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between click on 'Go' and response
responseTimeoutbooleanWhether the response time limit was reached
mt_timearrayMouse tracking time coordinates
mt_xarrayMouse tracking x coordinates (origin is at the 'Go' button, positive goes right)
mt_yarrayMouse tracking y coordinates (origin is at the 'Go' button, positive goes down)
mtstarttimeintTime stamp of when mouse tracking started
Prop nameDescriptionDefault
option1

string representation of option 1

string

option1

option2

string representation of option 2

string

option2

pauseTime

Duration of the pause phase, don't set this, to avoid the pause altogether

number

0

qud

Question under discussion. Always visible on the screen

string

undefined

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether

number

0

selectEvent

The event that causes the response to be selected, e.g. click, mouseover, etc.

string

mouseover

SlotDescriptionBindings
preparation

provide a preparation stimulus, i.e. a text or an audio explanation

-
option1
-
-
option2
-
-
stimulus

provide content for the main stimulus

coordinates: objectThe coordinates of the Start button on the page (`{x: number, y: number})
feedback

provide content for the main stimulus

-
Mammal
Bird
src/components/trial_screens/ForcedChoiceScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
optionsarray
responsestringThe chosen option
Prop nameDescriptionDefault
options

Forced choice options

array - required

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

question

A question

string

undefined

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built forced choice screen, with limited functionality, but simpler to use.

Always do the opposite of what you are asked.

Do you understand this question?

Yes
No
src/components/trial_screens/ImageSelectionScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
optionsarrayThe labels of the available options
responsestringThe label of the chosen option
Prop nameDescriptionDefault
options

Forced choice options. Each option must be an object looking as follows {src: 'image path', label: 'my label'}

array - required

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

question

A question

string

undefined

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built image selection screen, with limited functionality, but simpler to use.

Eating healthy is good for you.

What do you eat?

fries
soup
src/components/trial_screens/KeypressScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
responsestringThe label of the pressed key
Prop nameDescriptionDefault
keys

An object with keys mapped to option labels

object - required

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

question

A question

string

undefined

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

showOptions

Determines whether information about possible keypresses and their meaning is shown

boolean

true

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built keypress screen, with limited functionality, but simpler to use.

Are fries healthy?

~ = yes ^ = no
src/components/trial_screens/MazeScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
responsesarrayThe selected responses
target_positionsarrayThe list of positions of the target words for each choice. Either ('left' or 'right')
response_timesarrayThe response times per selectable option
mazeTimeLimitintThe maze time limit
maze_timeoutbooleanWhether the maze time limit was reached
correctbooleanWhether all responses were correct
Prop nameDescriptionDefault
competitors

Competitor chunks

array - required

-

targets

Target chunks

array - required

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

leftKey

The keyboard key to press for the left continuation

string

f

mazeTimeLimit

Time in miliseconds the participant has to select the individual words; -1 for no time limit

number

-1

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

progress
number

undefined

qud

Question under discussion. Always visible on the screen

string

''

question

A question

string

undefined

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

rightKey

The keyboard key to press for the right continuation

string

j

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built maze task screen.

Are fries healthy?

f = left j = right
xxx-xxx
Fries
src/components/trial_screens/MultipleChoiceMatrixScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionsarray
optionsarray
randomize?boolean
responsesarray
Prop nameDescriptionDefault
options

The possible options to choose from

array - required

-

questions

The questions to ask

array - required

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

randomize

Whether to shuffle questions

boolean

false

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built multiple choice matrix screen, with limited functionality, but easier to use.

How is the weather today?

How was your breakfast today?

How do you like your job?

What is your opinion of television?

What is your opinion of folk music?

src/components/trial_screens/MultipleChoiceScreen.vue

Have participants choose answer from multiple options

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
optionsarray
optionsHtml (optional)array
randomizeboolean
orientationstring
responsestringThe chosen option
Prop nameDescriptionDefault
options

The possible options to choose from

array - required

-

question

A question

string - required

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

optionsHtml

The possible options to choose from as HTML strings

array

[]

orientation

Whether to display 'vertical' or 'horizontal'

string

vertical

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

randomize

Whether to randomize the option order

boolean

false

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built multiple choice screen, with limited functionality, but easier to use.

How was your breakfast?

src/components/trial_screens/RatingScreen.vue

Have participants choose answer from multiple options

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
optionLeft?string
optionRight?string
countint
responseintThe chosen option
Prop nameDescriptionDefault
question

A question

string - required

-

count

The length of the rating scale

number

7

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

optionLeft

Left label for rating

string

''

optionRight

Right label for rating

string

''

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built rating screen, with limited functionality, but simpler to use.

Eating healthy is good for you.

How healthy do you usually eat?

Very healthy
Very unhealthy
src/components/trial_screens/SelfPacedReadingScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
responsesstringThe selected responses
response_timesstringThe response times per selectable option
spr_timeoutbooleanWhether the participant took longer than the set time limit per chunk
sprTimeLimitintTime limit per chunk
Prop nameDescriptionValuesDefault
chunks

Self-paced reading text chunks

array - required

-

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

-

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

-

0

instructions

Give instructions on what the participant is supposed to do

string

-

Press SPACE to reveal the words.

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

-

0

qud

Question under discussion. Always visible on the screen

string

-

''

question

A question

string

-

undefined

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

-

0

sprTimeLimit

Time limit per chunk

number

-

-1

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

-

0

trigger

The key to press to reveal the next word

string

-

underline

Underline type

string

words, sentence or none

none

wordPos

Whether to show the next word at the same position or at the next

string

same or next

same

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built self-paced reading task screen.

Are fries healthy?

Press SPACE to reveal the words.

Friesareveryhealthyindeed.
src/components/trial_screens/SliderRangesScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
optionLeft?string
optionRight?string
intervalint
rangesarray
minint
maxint
responsearrayThe values of all sliders
range_valuesarrayThe length of the ranges between all sliders and min max
Prop nameDescriptionDefault
question

A question

string - required

-

ranges

The labels for the ranges

array - required

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

interval

Interval between slider values

number

1

max

Maximum slider value

number

100

min

Minimal slider value

number

0

optionLeft

Left label for rating

string

''

optionRight

Right label for rating

string

''

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built slider rating screen, with limited functionality, but simpler to use.

Eating healthy is good for you.

How often do you eat meat, vegetarian or vegan?

  • 33 meat
  • 34 vegetarian
  • 33 vegan
src/components/trial_screens/SliderScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
optionLeft?string
optionRight?string
intervalint
rangesarray
minint
maxint
initialint
responseintThe value of the slider
Prop nameDescriptionDefault
question

A question

string - required

-

disabled
boolean

false

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

initial

Initial slider position

number

0

interval

Interval between slider values

number

1

max

Maximum slider value

number

100

min

Minimal slider value

number

0

optionLeft

Left label for rating

string

''

optionRight

Right label for rating

string

''

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built slider rating screen, with limited functionality, but simpler to use.

Eating healthy is good for you.

How healthy do you usually eat?

Very healthy
Very unhealthy
src/components/trial_screens/TextareaScreen.vue

Inherits from LifecycleScreen

Screen Measurements

MeasurementTypeDescription
responseTimeintTime between display of this screen until the screen is left
responseTimeoutbooleanWhether the response time limit was reached
qud (optional)string
pauseTime (optional)int
fixationTime (optional)int
stimulusTime (optional)int
responseTimeLimit (optional)intThe response time limit
feedbackTime (optional)int
questionstring
responsestringThe entered response text
Prop nameDescriptionDefault
question

A question

string - required

-

feedbackTime

How long feedback should be displayed. Don't set this, to avoid displaying feedback altogether; set to -1 if you want to call nextScreen manually

number

0

fixationTime

Duration of the fixation point phase. Don't set this to avoid showing the fixation point altogether. Set to -1 to call nextSlide manually

number

0

pauseTime

Duration of the pause phase. Don't set this, to avoid the pause altogether.

number

0

qud

Question under discussion. Always visible on the screen

string

''

responseTimeLimit

How long the response should be enabled, don't set this, to avoid the timeout altogether. When this is set, a responseTimeout boolean property will be added to the result, indicating whether timeout occurred

number

0

stimulusTime

Duration of the stimulus phase. Don't set this to avoid hiding the stimulus altogether. Set to -1 to call nextSlide manually

number

0

SlotDescription
fixation
-
stimulus
-
feedback
-
task
-

This is a pre-built image selection screen, with limited functionality, but simpler to use.

Eating healthy is good for you.

What do you usually eat?

Inputs

Magpie offers a range of ready-made default input methods for your experiments to quickly get up and running.

src/components/inputs/CompletionInput.vue

Have the participant complete a text with various gaps.

Prop nameDescriptionDefault
options

An array of arrays with possible completions per %s

array - required

-

text

The text that is supposed to be completed. %s marks completions

string - required

-

Event nameDescription
update:response
update:responses
One fell over three .
src/components/inputs/DropdownInput.vue

Have your participants provide a text answer

Prop nameDescriptionDefault
options
array - required

-

Event nameDescription
update:response

Fries or soup?

src/components/inputs/ForcedChoiceInput.vue

Have the participant choose between multiple options.

Prop nameDescriptionDefault
options

The possible options to choose from

array - required

-

Event nameDescriptionProperties
update:response

Change event with the chosen option. Useful in combination with response.sync

<anonymous>: undefined

What's on the bread?

Ham
Jam

The following example will submit the response directly on clicking it.

What's on the bread?

Ham
Jam
src/components/inputs/ImageSelectionInput.vue

Have the participant select an image

Prop nameDescriptionDefault
options

An array of option objects { src: '', label: '' }

array - required

-

Event nameDescriptionProperties
update:response

Change event with the selected image label

<anonymous>: undefined

Fries or soup?

fries
soup
src/components/inputs/KeypressInput.vue

Have your participants react

Prop nameDescriptionDefault
keys

An object with keys mapped to option labels

object - required

-

showOptions

Determines whether information about possible keypresses and their meaning is shown

boolean

true

Event nameDescriptionProperties
update:response
<anonymous>: undefined

Fries or soup?

~ = fries ^ = soup
src/components/inputs/MazeInput.vue
Prop nameDescriptionDefault
competitors

Competitor chunks

array - required

-

targets

Target chunks

array - required

-

leftKey

The keyboard key to press for the left continuation

string

f

responseTimeLimit

Maximum time alotted for a single response

number

-1

rightKey

The keyboard key to press for the right continuation

string

j

showKeypressOptions

Whether to show the options for the KeypressInput

boolean

true

Event nameDescriptionProperties
update:response-times

The list of response times per item

array
update:responses

The list of selected options

array
update:target-positions

The list of target positions (either 'left' or 'right')

array
update:correct

Whether all responses selected the target word

boolean
update:timeout

Whether the participant took longer than the timeout for one item and the task was aborted

boolean
end

Emitted when the task was aborted due to timeout or incorrect response, or after selecting the last correct option

f = left j = right
This
xxx-xxx
src/components/inputs/MultipleChoiceInput.vue
Prop nameDescriptionDefault
options

The possible options to choose from

array - required

-

labels

Whether to display labels

boolean

true

optionsHtml

The possible options to choose from as HTML strings

array

[]

orientation

Whether to display 'vertical' or 'horizontal'

string

vertical

randomize

Whether to randomize the option order

boolean

false

Event nameDescriptionProperties
update:response

Change event with the chosen option. Useful in combination with response.sync

<anonymous>: undefined

How was your breakfast?

How was your breakfast?

Which sentence is ungrammatical?

src/components/inputs/MultipleChoiceMatrixInput.vue

Have the participant choose between multiple options for multiple questions (arranged in a matrix).

Prop nameDescriptionDefault
options

The possible answers to choose from

array - required

-

questions

The questions to ask

array - required

-

randomize

Whether to shuffle questions

boolean

false

Event nameDescriptionProperties
update:responses

Change event with the chosen options.

<anonymous>: undefined

How is the weather today?

How was your breakfast today?

How do you like your job?

What is your opinion of television?

What is your opinion of folk music?

You can also randomize the question order. The response data will still be in the order you supplied the questions in.

What is your opinion of television?

How was your breakfast today?

How is the weather today?

How do you like your job?

What is your opinion of folk music?

src/components/inputs/RankOrderInput.vue

Have your participants rank a list of options

Prop nameDescriptionDefault
options
array - required

-

Event nameDescriptionProperties
update:response
<anonymous>: undefined

Please order the following foods with regards to their healthiness.

1Fries
2Vegetable soup
3Salad
4Burger
5Risotto
src/components/inputs/RatingInput.vue

Have your participants rate their answer on a rating scale

Prop nameDescriptionDefault
count

The length of the rating scale

number

7

left

Text left of the rating scale

string

''

right

Text right of the rating scale

string

''

Event nameDescription
update:response

Fries or soup?

Fries
Soup

Fries or soup?

Fries
Soup
src/components/inputs/SelfPacedReadingInput.vue
Prop nameDescriptionValuesDefault
chunks

Self-paced reading text chunks

array - required

-

-

instructions

Give instructions on what the participant is supposed to do

string

-

Press SPACE to reveal the words.

responseTimeLimit

Maximum time alotted for a single response

number

-

-1

showKeypressOptions

Whether to show the options for the KeypressInput

boolean

-

true

trigger

The key to press to reveal the next word

string

-

underline

Underline type

string

words, sentence or none

none

wordPos

Whether to show the next word at the same position or at the next

string

same or next

same

Event nameDescriptionProperties
update:response-times

List of response times

array
update:timeout

Whether the user took more time on one item than the set response time

array
end

Emitted either when the user takes longer than the set response time, or they finish until the end of chunks.

$ = Press $ to reveal the next word.
Thisisaniceandverylongtext
src/components/inputs/SerialInput.vue

SerialInputs allow you to record inputs on a series of items that are interrelated and belong to the same trial

Prop nameDescriptionDefault
iterations

The number of iterations

number - required

-

Event nameDescription
end

Emitted when next() has been called on the last iteration

SlotDescriptionBindings
default

Your content for each iteration

i
iterations: NumberThe overall number of iterations
record: fn(variable:string, value:mixed)A function to record trial measurements per iteration resulting in an array of values stored at $magpie.measurements.{variable}
next: fn()A function to go to the next iteration

This is a simple implementation of a Self-paced reading task.

Does the sentence it the picture?
f = yes j = no b = maybe

Hello

src/components/inputs/SliderInput.vue
Prop nameDescriptionDefault
disabled

Whether to show the tooltip

boolean

false

initial

Initial slider position

number

0

interval

Interval between slider values

number

1

left

Text left of the slider

string

''

max

Maximum slider value

number

100

min

Minimal slider value

number

0

right

Text right of the slider

string

''

tooltip

Whether to show the tooltip

boolean

false

Event nameDescriptionProperties
update:response
<anonymous>: undefined

Fries or soup?

Fries
Soup
Lunch: % Soup
src/components/inputs/SliderRangesInput.vue
Prop nameDescriptionDefault
ranges

The labels for the ranges

array - required

-

initial

Initial slider position

number

0

interval

Interval between slider values

number

1

left

Text left of the slider

string

''

max

Maximum slider value

number

100

min

Minimal slider value

number

0

right

Text right of the slider

string

''

tooltip

Whether to show the tooltip

boolean

false

Event nameDescriptionProperties
update:responses
<anonymous>: undefined
update:rangeValues
<anonymous>: undefined

How often do you eat meat, vegetarian or vegan?

33% Meat, 34% Vegetarian, 33% Vegan

src/components/inputs/TextareaInput.vue

Have your participants provide a text answer

Event nameDescription
update:response

Fries or soup? Discuss.

Interactive

Magpie allows creating experiments where participants interact with each other online. This works via a web socket connection to the magpie server that relays events to all participants in the same experiment room. There are a number of preconfigured components available for you to use in such scenarios, like e.g. the Chat component, which allows participants to communicate via text messages.

You will likely want to create your own interactive components. To showcase how this works, we'll use a simplified version of the chat component as an example:

<template>
  <div class="chat">
    <div ref="box" class="chat-box">
      <!-- List all chat messages -->
      <p
        v-for="(message, i) in messages"
        :key="i"
        v-text="message.message"
      ></p>
    </div>
    <div class="chat-input">
      <!-- Textarea (with a ref called 'text') for composing messages and 'send' button for sending them -->
      <textarea ref="text"></textarea>
      <button @click.stop="send()">Send</button>
    </div>
  </div>
</template>

<script>
import Vue from 'vue';

export default {
  name: 'Chat',
  data() {
    return {
      messages: []
    };
  },
  // This is a magpie-specific extension to Vue, which allows
  // you to specify callbacks for specific socket events. In this case
  // we're listening on the 'chat_message' event 
  socket: {
    chat_message(payload) {
      this.messages.push(payload);
    }
  },
  methods: {
    send() {
      // Here we get the current message from the textarea using the Vue ref we set above
      const message = this.$refs.text.value;
      // If the experiment was setup with a socketURL config setting,
      // the socket will be available as part of the magic $magpie property
      // allowing us to broadcast this message to the fellow participants in the current room (including ourself)
      this.$magpie.socket.broadcast('chat_message', message);
    }
  }
};
</script>
src/components/interactive/Chat.vue
Prop nameDescriptionDefault
participantLabel
string

null

Event nameDescriptionProperties
update:messages

Messages contains all chat messages as objects: [{message: '', participantId: '', time: 2345678765}, ...]

<anonymous>: undefined
update:data

Data contains all chat messages in tabular form: {chatMessage: [], chatParticipantId: [], chatTime: []}

<anonymous>: undefined

This interactive component provides participants the opportunity to chat with each other, if they are in the same room.

src/components/interactive/WaitForParticipants.vue
Prop nameDescriptionDefault
number
number - required

-

Event nameDescription
done

This interactive component allow waiting until a specified number of participants are on the current screen.

Helpers

src/components/helpers/EyetrackingStart.vue

This component (re)starts capturing the eye gaze track. You can retrieve the current eye track with $magpie.eyetracking.getEyeTrack(). Eyetracking requires that you install webgazer.

src/components/helpers/FullscreenStart.vue

This component asks the user to enable full screen.

src/components/helpers/HideCursor.vue
src/components/helpers/MousetrackingStart.vue

This component (re)starts capturing the mouse track. You can retrieve the current mouse track with $magpie.mousetracking.getMouseTrack().

src/components/helpers/PreventCopyPaste.vue
src/components/helpers/Record.vue
Prop nameDescriptionDefault
data

The data you want to add

object - required

-

global

If you set the global prop, the data will be added to the global experiment measurements instead of only to the current trial

boolean

false

Record allows you to easily add arbitrary data to your measurements:

Slide 1
src/components/helpers/ResponseTimeStart.vue

This component (re)starts the timer for recording the response time.

src/components/helpers/TimerStart.vue
Prop nameDescriptionDefault
id
string - required

-

This component starts a timer. See TimerStop for how to use it.

src/components/helpers/TimerStop.vue
Prop nameDescriptionDefault
id
string - required

-

Event nameDescriptionProperties
update:time
<anonymous>: undefined
Slide 1
src/components/helpers/Wait.vue
Prop nameDescriptionDefault
time
number - required

-

Event nameDescription
done
Slide 1

API

Classes

Magpie
Socket
Mousetracking
Eyetracking

Magpie

Kind: global class

new Magpie()

Magpie specific vue tools exposed as $magpie

magpie.validators : object

Gives easy access to validators. Validation is based on vuelidate.

NameMeta parametersDescription
requirednoneRequires non-empty data. Checks for empty arrays and strings containing only whitespaces.
requiredIflocator *Requires non-empty data only if provided property or predicate is true.
requiredUnlesslocator *Requires non-empty data only if provided property or predicate is false.
minLengthmin lengthRequires the input to have a minimum specified length, inclusive. Works with arrays.
maxLengthmax lengthRequires the input to have a maximum specified length, inclusive. Works with arrays.
minValueminRequires entry to have a specified minimum numeric value or Date.
maxValuemaxRequires entry to have a specified maximum numeric value or Date.
betweenmin, maxChecks if a number or Date is in specified bounds. Min and max are both inclusive.
alphanoneAccepts only alphabet characters.
alphaNumnoneAccepts only alphanumerics.
numericnoneAccepts only numerics.
integernoneAccepts positive and negative integers.
decimalnoneAccepts positive and negative decimal numbers.
emailnoneAccepts valid email addresses. Keep in mind you still have to carefully verify it on your server, as it is impossible to tell if the address is real without sending verification email.
ipAddressnoneAccepts valid IPv4 addresses in dotted decimal notation like 127.0.0.1.
macAddressseparator=':'Accepts valid MAC addresses like 00:ff:11:22:33:44:55. Don't forget to call it macAddress(), as it has optional parameter. You can specify your own separator instead of ':'. Provide empty separator macAddress('') to validate MAC addresses like 00ff1122334455.
sameAslocator *Checks for equality with a given property.
urlnoneAccepts only URLs.
orvalidators...Passes when at least one of provided validators passes.
andvalidators...Passes when all of provided validators passes.
notvalidatorPasses when provided validator would not pass, fails otherwise. Can be chained with other validators like not(sameAs('field')).

* Locator is a sibling property name.

Kind: instance property of Magpie\

magpie.v : object

Shorthand for $magpie.validators

Kind: instance property of Magpie\

magpie.id : string

The ID of the experiment

Kind: instance property of Magpie\

magpie.serverUrl : string

Kind: instance property of Magpie\

magpie.submissionUrl : string

Kind: instance property of Magpie\

magpie.submissionUrl : string

Kind: instance property of Magpie\

magpie.contactEmail : string

Kind: instance property of Magpie\

magpie.mode : string

Kind: instance property of Magpie\

magpie.debug : boolean

Kind: instance property of Magpie\

magpie.socket : Socket

Kind: instance property of Magpie\

magpie.mousetracking : Mousetracking

Kind: instance property of Magpie\

magpie.eyetracking : Eyetracking

Kind: instance property of Magpie\

magpie.currentScreenIndex : number

The id of the current screen

Kind: instance property of Magpie\

magpie.currentSlideIndex : number

The id of the current slide

Kind: instance property of Magpie\

magpie.responseTimeStart : number

The start time of the responseTime measurement

Kind: instance property of Magpie\

magpie.measurements : object

The measurements of the current screen. All data in this object can be saved using $magpie.saveMeasurements

Kind: instance property of Magpie\

magpie.validateMeasurements : object

Validation results on the current measurements

Kind: instance property of Magpie\

magpie.timers : object

A hash of timer start points by id

Kind: instance property of Magpie\

magpie.nextSlide(index)

Go to the next slide.

Kind: instance method of Magpie\ Access: public

ParamTypeDescription
indexintthe index of the slide to go to (optional; default is next slide)

magpie.nextScreen(index)

Go to the next screen. (Will also reset scroll position.)

Kind: instance method of Magpie\ Access: public

ParamTypeDescription
indexintStringthe index or label of the screen to go to (optional; default is next screen)

magpie.saveAndNextScreen(index)

SaveMeasurements and go to the next screen. (Will also reset scroll position.)

Kind: instance method of Magpie\ Access: public

ParamTypeDescription
indexintStringthe index or label of the screen to go to (optional; default is next screen)

magpie.addTrialData(data)

Add a result set This method will automatically add a responseTime key to your data with time measured from the start of the current screen

Kind: instance method of Magpie\ Access: public

ParamTypeDescription
dataObjecta flat object whose data you want to add to the results

magpie.addExpData(data)

Add global facts that will be added to each result set

Kind: instance method of Magpie\ Access: public

ParamTypeDescription
dataObjecta flat object whose data you want to add to the facts

magpie.getAllData() ⇒ Array.<Object>

Returns an array of objects with all trial data that has been submitted so far, including experiment-wide data

Kind: instance method of Magpie\ Access: public\

magpie.submit() ⇒ Promise.<void>

Submit all data collected so far

Kind: instance method of Magpie\

magpie.submitIntermediateResults() ⇒ Promise.<void>

Submit all data collected so far as intermediate results

Kind: instance method of Magpie\

magpie.setProgress(percentage)

Set progress bar percentage Will display a progress bar if it's not visible, yet.

Kind: instance method of Magpie\ Access: public

ParamTypeDescription
percentagefloatthe percentage to display as a number between 0 and 1

Socket

Kind: global class

socket.participantId : string

Kind: instance property of Socket\

socket.experimentId : string

Kind: instance property of Socket\

socket.participantId : 'CONNECTING' | 'CONNECTED' | 'WAITING' | 'READY' | 'ERROR'

A reactive property with the state of the socket

Kind: instance property of Socket\

socket.participantId : 'WAITING' | 'READY' | 'ERROR'

A reactive property with the state of the socket

Kind: instance property of Socket\

socket.participants : Array.<string>

A reactive list of online participants

Kind: instance property of Socket\

socket.active : Array.<string>

A reactive list of participants currently active in the current screen

Kind: instance property of Socket\

socket.variant : Number

The variant number of this session

Kind: instance property of Socket\

socket.chain : Number

The chain number of this session

Kind: instance property of Socket\

socket.generation : Number

The generation number of this session

Kind: instance property of Socket\

socket.player : Number

The player id of this session

Kind: instance property of Socket\

socket.groupLabel : String

The group id of this session

Kind: instance property of Socket\

socket.lastIterationResults : Array

The results of the last iteration

Kind: instance property of Socket\

socket.getParticipantName(id) ⇒ String

Kind: instance method of Socket

ParamType
idString

socket.getParticipantColor(id) ⇒ String

Kind: instance method of Socket

ParamType
idString

socket.initialize()

Initialize the socket

Kind: instance method of Socket\

socket.broadcast(event, payload)

Kind: instance method of Socket

ParamType
eventstring
payload

Mousetracking

Kind: global class

mousetracking.start(x, y)

(re)start mouse tracking for the current screen

Kind: instance method of Mousetracking\ Access: public

ParamTypeDescription
xNumberRelative Origin x coordinate
yNumberRelative Origin y coordinate

mousetracking.getMouseTrack(rate) ⇒ Object

Get the mouse track since the appearance of the current screen

Kind: instance method of Mousetracking\ Access: public

ParamTypeDefaultDescription
rateint15Time resolution in ms (optional; defaults to 15ms)

Eyetracking

Kind: global class

eyetracking.start(x, y)

(re)start eye tracking for the current screen

Kind: instance method of Eyetracking\ Access: public

ParamTypeDescription
xNumberRelative Origin x coordinate
yNumberRelative Origin y coordinate

eyetracking.setDebug(debugging)

set debugging status

Kind: instance method of Eyetracking\ Access: public

ParamTypeDescription
debuggingBooleanWhether to display debugging information

eyetracking.getEyeTrack(rate) ⇒ Object

Get the eye gaze track since the appearance of the current screen

Kind: instance method of Eyetracking\ Access: public

ParamTypeDefaultDescription
rateint15Time resolution in ms (optional; defaults to 15ms)

.validateSubmission(data) ⇒ boolean

Kind: instance function\ Methodof: Magpie

ParamType
dataArray.<Object>