Skip to content

Home > @world-wide-lab/integration-jspsych > jsPsychWorldWideLab

jsPsychWorldWideLab class

A simple integration of World-Wide-Lab for jsPsych. This plugin makes it easy to either automatically store data from any experiment running in jsPsych, which can then be neatly downloaded via the World-Wide-Lab UI.

Signature:

typescript
declare class jsPsychWorldWideLab implements JsPsychPlugin<PluginInfo>

Implements: JsPsychPlugin<PluginInfo>

Constructors

Constructor

Modifiers

Description

(constructor)(jsPsych)

Constructs a new instance of the jsPsychWorldWideLab class

Properties

Property

Modifiers

Type

Description

client

static

Client

World-Wide-Lab Client instance.

ready

static

boolean

Whether the client has finished initializing and creating a Session to store data.

session

static

Session

The active Session instance.

studyId

static

string

The studyId of the Study in which the data should be stored

Methods

Method

Modifiers

Description

deleteStoredParticipantId()

static

Delete the stored participant Id from the participant's browser (if there is one).

hasStoredParticpantId()

static

Check whether the participant Id is stored in the participant's browser.

initJsPsych(jsPsychOptions, setupOptions)

static

Initialize JsPsych with the World-Wide-Lab integration.

onExperimentFinish()

static

Finish the experiment and mark the Session as finished.

save(trialName, data)

static

Save a response to World-Wide-Lab.

setup(options)

static

Setup the World-Wide-Lab JsPsych Integration.

Either this function or jsPsychWorldWideLab.initJsPsych() must be called before any data can be stored.

setupCompleted()

static

Wait for setup to be completed. Note that this function does *not* call the setup function, it just waits for it.

storeParticipantId()

static

Store the participant Id in the participant's browser. Depending on the browser configuration, this is not always possible.