Skip to main content

Class SessionInfo

Holds the participant and study configuration for the current runtime session, populated from the server or URL query string at startup.

[Serializable]
public class SessionInfo

Inheritance​

object→SessionInfo

Remarks​

The simulator runs as a WebGL build embedded in a web page. Before the scene starts, the JavaScript host passes study parameters (participant ID, scene graph name, level index, …) via the URL or a backend API. SessionInfo is the in-memory representation of those parameters, serialisable so it can be stored or transmitted along with collected data.

Access the current session via SessionInstance rather than constructing SessionInfo directly. SessionInstance is the authoritative singleton that SessionInfoFetcher populates at startup.

Constructors​

SessionInfo()​

Creates a SessionInfo with all fields at their default empty/zero values.

public SessionInfo()

Remarks​

Used by Unity's JSON deserialiser when reconstructing the object from a server response. The deserialiser requires a parameterless constructor.

SessionInfo(SessionInfo)​

Creates a deep copy of data.

public SessionInfo(SessionInfo data)

Parameters​

NameTypeDescription
dataSessionInfoThe source instance to copy.

Remarks​

Used when a session needs to be snapshotted or passed across asynchronous boundaries without aliasing the original instance.

SessionInfo(string, string, string, int, string, string, int)​

Creates a fully specified SessionInfo with all fields set.

public SessionInfo(string URL, string mTurkID, string SceneGraphName, int SubID, string studyID, string sessionID, int levelIndex)

Parameters​

NameTypeDescription
URLstringThe WebGL canvas URL.
mTurkIDstringThe participant's Prolific or MTurk worker ID.
SceneGraphNamestringThe name of the scene graph asset for this session.
SubIDintThe numeric subject identifier.
studyIDstringObsolete study identifier; pass an empty string for new sessions.
sessionIDstringObsolete session identifier; pass an empty string for new sessions.
levelIndexintZero-based index of the starting level.

Fields​

ParticipantID​

The participant's Prolific or MTurk worker ID, used to link simulation data back to survey responses in the study's external dataset.

public string ParticipantID

Field Value​

string

levelIndex​

Zero-based index of the current level within the scene graph's ordered level list.

public int levelIndex

Field Value​

int

Remarks​

Used by the scene-transition system to determine which scene to load next and to label each data segment with the level the participant was experiencing.

sceneGraph​

The name of the SceneNetworkGraph asset that defines the scene sequence for this session.

public string sceneGraph

Field Value​

string

Remarks​

Different study conditions may use different scene graphs (e.g., different task orderings or experimental conditions). This field records which graph was active so session data can be grouped by condition during analysis.

sessionID​

Session identifier — superseded by subject ID combined with the scene graph name.

[Obsolete]
public string sessionID

Field Value​

string

studyID​

Study identifier — superseded by the scene graph name and no longer written.

[Obsolete]
public string studyID

Field Value​

string

subjectID​

Numeric subject identifier assigned by the study management system.

public int subjectID

Field Value​

int

Remarks​

Used as the primary key when merging WebGL telemetry with offline survey data.

url​

The URL of the WebGL canvas page that launched this study session.

public string url

Field Value​

string

Remarks​

Stored so that data exports can be traced back to the specific deployment page.

  • Remarks
  • Constructors
    • SessionInfo()
    • SessionInfo(SessionInfo)
    • SessionInfo(string, string, string, int, string, string, int)
  • Fields
    • ParticipantID
    • levelIndex
    • sceneGraph
    • sessionID
    • studyID
    • subjectID
    • url