Class: Form

visual.Form(options)

new Form(options)

Form stimulus.
Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
name String the name used when logging messages from this stimulus
win module:core.Window the associated Window
pos Array.<number> <optional>
[0, 0] the position of the center of the slider
size Array.<number> the size of the slider, e.g. [1, 0.1] for an horizontal slider
units string <optional>
'height' the units of the Slider position, and font size
color Color <optional>
Color('LightGray') the color of the slider
contrast number <optional>
1.0 the contrast of the slider
opacity number <optional>
1.0 the opacity of the slider
depth number <optional>
0 the depth (i.e. the z order), note that the text, radio buttons and slider elements are at depth + 1
items Array.<number> <optional>
[] the array of labels
itemPadding number <optional>
0.05 the granularity
fontFamily string <optional>
'Helvetica' the text font
bold boolean <optional>
true whether or not the font of the labels is bold
italic boolean <optional>
false whether or not the font of the labels is italic
fontSize number <optional>
the font size of the labels (in form units), the default fontSize depends on the Form units: 14 for 'pix', 0.03 otherwise
clipMask PIXI.Graphics <optional>
null the clip mask
autoDraw boolean <optional>
false whether or not the stimulus should be automatically drawn on every frame flip
autoLog boolean <optional>
false whether or not to log
Mixes In:
Source:

Extends

Members

contains

Determine whether an object is inside the bounding box of the stimulus.
Overrides:
Source:

setOri

Setter for the orientation attribute.
Inherited From:
Source:

setPos

Setter for the position attribute.
Inherited From:
Source:

setSize

Setter for the size attribute.
Inherited From:
Source:

Methods

(protected) _estimateBoundingBox()

Estimate the bounding box.
Overrides:
Source:

(private) _importItems()

Import the form items from either a spreadsheet resource files (.csv, .xlsx, etc.) or from an array.
Source:

(protected) _onChange(withPixiopt, withBoundingBoxopt) → {function}

Generate a callback that prepares updates to the stimulus. This is typically called in the constructor of a stimulus, when attributes are added with _addAttribute.
Parameters:
Name Type Attributes Default Description
withPixi boolean <optional>
false whether or not the PIXI representation must also be updated
withBoundingBox boolean <optional>
false whether or not to immediately estimate the bounding box
Inherited From:
Source:
Returns:
Type
function

(private) _processItems()

Import and process the form items from either a spreadsheet resource files (.csv, .xlsx, etc.) or from an array.
Source:

(private) _sanitizeItems()

Sanitize the form items: check that the keys are valid, and fill in default values.
Source:

(private) _setupStimuli()

Setup the stimuli, and the scrollbar.
Source:

(private) _updateDecorations()

Update the form decorations (bounding box, lines between items, etc.)
Source:

(private) _updateVisibleStimuli()

Update the visible stimuli.
Source:

addDataToExp(experiment, formatopt)

Add the form data to the given experiment.
Parameters:
Name Type Attributes Default Description
experiment module:data.ExperimentHandler the experiment into which to insert the form data
format string <optional>
'rows' whether to insert the data as rows or as columns
Source:

draw()

Overridden draw that also calls the draw method of all form elements.
Source:

getData() → {object}

Collate the questions and responses into a single dataset.
Source:
Returns:
- the dataset with all questions and responses.
Type
object

hide()

Overridden hide that also calls the hide method of all form elements.
Source:

refresh()

Force a refresh of the stimulus.
Overrides:
Source:

reset()

Reset the form.
Source: