ExperimentSession Attributes and Methods#

Administrative information (ExperimentSession)#

config

The experiment configuration.

secrets

The secret experiment configuration.

plugins

A modified dictionary of experiment plugins.

urlargs

A dictionary of key-value pairs that the experiment might have received as url parameters.

session_timeout

The session's timeout (in seconds).

session

Experiment session.

append(*items)

Appends Sections or Pages to the experiment's root section.

progress_bar

The experiment's progress bar.

condition

Experiment condition.

Participant data (ExperimentSession)#

get_page_data(name)

Get the data dictionary of a specific page.

get_section_data(name)

Get the data dictionary for all pages in a specific section.

all_exp_data

List of all experiment datasets.

all_unlinked_data

List of all unlinked datasets.

values

Dictionary of input elements and their current values.

session_data

Full dataset of the current experimental session.

client_data

Dictionary of information about the client, such as:

move_history

A list, containing the movement history for the current session.

Database access (ExperimentSession)#

db

Database object of the main mongo saving agent.

db_main

Document collection of the main mongo saving agent.

db_unlinked

Document collection of the unlinked mongo saving agent.

db_misc

Document collection for miscellaneous data.

General utility (ExperimentSession)#

post_message(msg[, title, level])

Post a message for one-time display after the next move.

read_csv_todict(path[, encoding])

Iterates over the rows in a .csv file, yielding dictionaries.

read_csv_tolist(path[, encoding])

Iterates over the rows in a .csv file, yielding lists.

path

Path to the experiment directory

subpath(path)

Returns the full path of an experiment subdirectory.

log

Alfred's logging interface.

encrypt(data)

Encrypts the input and returns the encrypted string.

decrypt(data)

Decrypts input and returns the decrypted object as str.

adata

Shortcut for accessing the additional data dictionary.

additional_data

The additional data dictionary.

Sections and pages (ExperimentSession)#

all_members

Dictionary of all sections and pages in the experiment.

all_pages

Dictionary of all pages in the experiment.

all_sections

Dictionary of all sections in the experiment.

current_page

The currently active page of the experiment.

final_page

The experiment's final page.

root_section

The experiment's root section, organizing all other sections, including content.

Movement and events (ExperimentSession)#

abort(reason[, title, msg, icon, page])

Aborts the experiment session.

abort_functions

A list of functions that will be called upon aborting an experiment session.

aborted

Indicates, whether the experiment was aborted.

finish_functions

A list of functions that will be called upon finishing an experiment session.

finished

Indicates, whether the experiment has finished orderly.

session_expired

Indicates whether the session has expired.

forward()

Moves the experiment forward one page.

backward()

Moves the experiment backward one page.

jump(to)

Jumps to a specific page in the experiment.

Information about the experiment (ExperimentSession)#

alfred_version

The alfred3 version used for the current experiment.

author

Returns the experiment author.

version

Experiment version

metadata

A dict of information about the experiment.

session_id

Unique session identifier

session_status

Session status for the current experiment.

start_time

Start time in seconds since epoch.

start_timestamp

A human-readable string, indicating the start time.

title

Experiment title