Functions

Experimentor Software comes with a number of handy built-in functions, but it is also possible to build your own plug-in functions using .NET that can then be easily used by your Experimentor codes.


This section contains the documentation for each built-in function and describes how to build build a plug-in function using the free Visual Studio Express editions.

General functions

Function

Description

cancelTrial

Cancels the currently running trial and marks it as cancelled-by-experimenter.

error

Writes an error message to the application log

now

Get the time right now

print

Prints a message to the application log

random

The random function can be used to create a random number, create a random number between a minimum and maximum values, or simply randomly choose an item from the list on items within the parenthesis.
Please read the documentation for more details.

wait

Waits for the given duration in milliseconds.

waitOrCancelTrial

Waits for the given duration in milliseconds, or if the session’s target duration is reached then this function will cancel the currently active trial.

Shape related functions

Function

Description

colourShapes

Assign each shape one of the colours provided (automatically avoiding the colour of any other shapes).

distance

Calculates the distance between (the centre of) two shapes

hide

Hide specific shapes or a collection of shapes.

hideAllObjectsOnScreen

Hides all of the objects (shapes, text, images, etc.) that have been created, so that there are no objects visible on the screen.

moveShape

Moves the given shape to the x,y location.

moveShape2

Moves the shapeToMove relative to the referenceShape a certain distance away  – between the given minimum and maximum distance.

moveShapeAngle

Moves the shapeToMove relative to the referenceShape the given distance away at the specified angle (in degrees).

moveShapes

Arrange any number of shapes on the screen a minimum distance away from every other shape on the screen.

moveShapesOnCircle

Arrange a collection of shapes on an imaginary circle around the reference shape (spaced equally apart), ordering the shapes around the circle in the order that you provide them.

moveShapesOnCheckerboard

Move a collection of shapes on an imaginary checker-board around the reference shape.
The shapes are arranged in the order you specify.

moveShapesRandomlyOnCircle

Arrange a collection of shapes on an imaginary circle around the reference shape (spaced equally apart), randomly ordering the shapes around the circle.

moveShapesOnGrid

Move a collection of shapes on an imaginary grid around the reference shape.  The shapes are arranged in the order you specify.

moveShapesRandomlyOnGrid

Move a collection of shapes on an imaginary grid around the reference shape.  The shapes are arranged in a random order.

Saving data related functions

hasSubjectData

Determines if this subject has a particular piece of saved subject data

loadSubjectData

Loads a named piece of subject specific data (which persists for that subject between sessions).

save

Saves the given data into the database with the given name, associated to the current phase and trial.

saveSubjectData

Saves a named piece of subject specific data (which persists for that subject between sessions).