-
Experiment
The experiment object is at the top level of the JSON file.
Properties
canvasobjectAn object describing the experiment layout with the following properties: sizeSizeThe size of the experiment canvas. stagesarray(Stage)The stages of the experiment. trialsarray(Trial)An array containing the experiment's trials. listsarray(List)An array containing the experiment's lists. questionnaireobjectAn object describing the experiment's questionnaire, using the following properties: questionsarray(Question)An array of Questions. introstringOptional text to be added to the experiment's intro screen. outrostringOptional text to be added to the experiment's outro screen. Example
This example contains several layers and other objects, plus into and outro text.
{- "canvas": {
- "size": {
- "width": 1200,
- "height": 800
- "size": {
- "stages": [
- {
- "layers": [
- {
- "type": "text",
- "name": "intro_text",
- "geometry": {
- "position": {
- "x": 10,
- "y": 10
- "size": {
- "width": 100,
- "height": 200
- "position": {
- "delay": 0
- {
- "type": "audio",
- "name": "intro_audio"
- {
- "events": [
- {
- "type": "onplaybackend",
- "layer": "intro_audio",
- "action": "stage.next",
- "delay": 1000
- {
- "layers": [
- {
- "layers": [
- {
- "type": "image",
- "name": "image1",
- "geometry": {
- "position": {
- "x": 10,
- "y": 10
- "size": {
- "width": 100,
- "height": 200
- "position": {
- "conditions": 2
- {
- "type": "image",
- "name": "image2",
- "geometry": {
- "position": {
- "x": 120,
- "y": 10
- "size": {
- "width": 100,
- "height": 200
- "position": {
- {
- "events": [
- {
- "type": "onclick",
- "layer": null,
- "action": "stage.next"
- {
- "layers": [
- {
- "trials": [
- {
- "name": "food",
- "conditions": [
- {
- "name": "adult",
- "variables": [
- {
- "layer": "image1",
- "value": "kermit.jpg"
- {
- "layer": "image2",
- "value": "kermit.jpg"
- {
- "layer": "intro_audio",
- "value": "dog.wav"
- {
- {
- "name": "kid",
- "variables": [
- {
- "layer": "image1",
- "value": "kermit.jpg"
- {
- "layer": "image2",
- "value": "kermit.jpg"
- {
- "layer": "intro_audio",
- "value": "dog.wav"
- {
- {
- {
- "name": "drink",
- "conditions": [
- {
- "name": "adult",
- "variables": [
- {
- "layer": "image1",
- "value": "kermit.jpg"
- {
- "layer": "image2",
- "value": "kermit.jpg"
- {
- "layer": "intro_audio",
- "value": "dog.wav"
- {
- {
- "name": "kid",
- "variables": [
- {
- "layer": "image1",
- "value": "kermit.jpg"
- {
- "layer": "image2",
- "value": "kermit.jpg"
- {
- "layer": "intro_audio",
- "value": "dog.wav"
- {
- {
- {
- "name": "cars",
- "conditions": [
- {
- "name": "filler",
- "variables": [
- {
- "layer": "image1",
- "value": "kermit.jpg"
- {
- "layer": "image2",
- "value": "kermit.jpg"
- {
- "layer": "intro_audio",
- "value": "dog.wav"
- {
- {
- {
- "lists": [
- {
- "name": "1",
- "trials": [
- "food:adult",
- "drink:kid",
- "cars:filler"
- {
- "name": "2",
- "trials": [
- "food:kid",
- "drink:adult"
- {
- "intro": "Hello",
- "outro": "Bye!"
- "canvas": {
-
Hotspot
The hotspot object describes a clickable area of an image asset.
Properties
namestringUsed to identify the hotspot. assetstringThe name of the asset on which the hotspot will be drawn. geometryGeometryDescribes the shape of the hotspot. Example
A hotspot with its geometry.
{- "name": "fruit",
- "layer": "image1",
- "geometry": {
- "position": {
- "x": 10,
- "y": 10
- "size": {
- "width": 50,
- "height": 50
- "position": {
-
Geometry
The geometry object describes a shape by a top-left coordinate system. Note that currently the assumed geometry type is rectangle, though others may be added in future.
Properties
positionPositionDescribes the origin point of the shape. sizeSizeDescribes the size of the shape. Example
{- "position": {
- "x": 10,
- "y": 10
- "size": {
- "width": 50,
- "height": 50
- "position": {
-
Stage
The stage object describes a single stage of the experiment.
Properties
layersarray(Layer)Describes where content will be presented within the stage. eventsarray(Event)Describes the interactions between the participant and items in the stage. Example
{- "layers": [
- {
- "type": "text",
- "name": "intro_text",
- "geometry": {
- "position": {
- "x": 10,
- "y": 10
- "size": {
- "width": 100,
- "height": 200
- "position": {
- "delay": 0
- {
- "type": "audio",
- "name": "intro_audio"
- {
- "events": [
- {
- "type": "onplaybackend",
- "layer": "intro_audio",
- "action": "stage.next",
- "delay": 1000
- {
- "layers": [
-
Layer
The layer object determines how an item from a Trial will be presented on the stage.
Properties
typestringDenotes the type of asset that will be placed here, either image,audioortext.namestringUsed to refer to the layer with Trials. geometryGeometry|nullFor image layers, describes where the layer should appear on the stage. delayintegerThe number of milliseconds after the stage is shown that the layer should appear. The default is 0.Example
Intro text that will appear immediately.
{- "type": "text",
- "name": "intro_text",
- "geometry": {
- "position": {
- "x": 10,
- "y": 10
- "size": {
- "width": 100,
- "height": 200
- "position": {
- "delay": 0
-
Event
The event object describes interaction between stages or between the user and a stage.
Properties
layerstring|nullThe layer on which the event can be triggered. If no layer is specified, the event will be triggered on the stage itself. hotspotstringOptional; if the layer is an image layer, you can specify the hotspot on which the event must occur. typestringDenotes the type of event to listen for. One of: onstagestart- called when the stage starts.onclick- called when the target is clicked.onplaybackstart- called as soon as the target audio clip starts.onplaybackend- called as soon as the target audio clip ends.
actionstringDenotes what should happen when the event is detected on the layer. One of stage.next- moves the trial on to the next stage.
delayintegerThe number of milliseconds after the event is detected that the action should occur. The default is 0.Example
1 second after the "intro_audio" audio clip finishes playing, move to the next stage.
{- "type": "onplaybackend",
- "layer": "intro_audio",
- "action": "stage.next",
- "delay": 1000
-
Trial
The trial object describes a single trial of the experiment.
Properties
namestringA name for the trial. conditionsarray(Condition)Describes the different conditions the trial can have. Example
{- "name": "food",
- "conditions": [
- {
- "name": "adult",
- "variables": [
- {
- "layer": "image1",
- "value": "kermit.jpg"
- {
- "layer": "image2",
- "value": "kermit.jpg"
- {
- "layer": "intro_audio",
- "value": "dog.wav"
- {
- {
- "name": "kid",
- "variables": [
- {
- "layer": "image1",
- "value": "kermit.jpg"
- {
- "layer": "image2",
- "value": "kermit.jpg"
- {
- "layer": "intro_audio",
- "value": "dog.wav"
- {
- {
-
Condition
The condition object describes a single condition of a trial.
Properties
namestringA name for the condition. variablesarray(Variable)Describes which assets will be used for each layer. Example
{- "name": "adult",
- "variables": [
- {
- "layer": "image1",
- "value": "kermit.jpg"
- {
- "layer": "image2",
- "value": "kermit.jpg"
- {
- "layer": "intro_audio",
- "value": "dog.wav"
- {
-
Variable
The variable object describes a variable within a condition.
Properties
layerstringThe name of the layer. valuestringThe name of the asset to assign to the layer, or for text layers, the text to display within the layer. Example
{- "layer": "image1",
- "value": "kermit.jpg"
-
List
The list object describes an ordered list of trials and conditions.
Properties
namestringThe name of the list. trialsarray(string)Denotes the trial and condition to display, separated with a semi-colon. For example, "food:adult". Example
{- "name": "1",
- "trials": [
- "food:adult",
- "drink:kid",
- "cars:filler"
-
Question
Describes a single question in a questionnaire.
Properties
textstringThe question text. answersarray(Answer)An array of possible answers for the question. requiredbooleanOptional; determines if the participant must provide an answer. Defaults to true. multiplebooleanOptional; determines if the participant is allowed to select more than one answer. Defaults to false. Example
{- "text": "Which languages do you speak fluently?",
- "answers": [
- {
- "text": "English"
- {
- "text": "Español"
- {
- "text": "普通话"
- {
- "multiple": true
-
Answer
Describes a single answer to a question.
Properties
textstringThe answer text. liststringOptional; if the participant selects this answer, the list given here will be assigned to the participant. custombooleanOptional; determines if the participant is allowed to enter their own answer. Defaults to false. Example
{- "text": "Blue",
- "list": "1",
- "custom": false
-
Size
The size object describes the size of a shape.
Properties
widthintegerThe width of the rectangle. heightintegerThe height of the rectangle. Example
{- "width": 50,
- "height": 50
-
Position
The position object describes the size of a shape.
Properties
xintegerThe shape's origin along the X axis. yintegerThe shape's origin along the Y axis. Example
{- "x": 10,
- "y": 10