Skip to content

Home > @world-wide-lab/client > Session

Session class

A world-wide-lab session, corresponding to a person's participation in a study. Use this class to capture responses.

Signature:

typescript
export declare class Session extends _ClientModel

Extends: _ClientModel

Constructors

Constructor

Modifiers

Description

(constructor)(clientInstance, sessionId)

Constructs a new instance of the Session class

Properties

Property

Modifiers

Type

Description

participant?

Participant

(Optional)

sessionId

string

Methods

Method

Modifiers

Description

addScoreToLeaderboard(leaderboardId, leaderboardScoreData)

Add a score to a leaderboard.

finish()

Finish the session. This will mark the session as finished.

getPublicInfo()

Retrieve public meta-data for a session

response(opts)

Create a new Response.

storeParticipantId()

Store the participantId of the participant that is doing this session.

update(data)

Update the session's meta-data.

updateLeaderboardScore(leaderboardId, leaderboardScoreId, leaderboardScoreData)

Update a score on a leaderboard.