SoPHIE API Documentation

Context API Documentation

SoPHIE Context API Class

The Context API allows access to all parameters defining the
context within which SoPHIE runs steps. It is used throughout
the steptypes and within the rendering engine and scripting
engine to provide a unified interface for all parts interaction
with the context.

Init: $contextApi = $api->get('sophie_context');

Method: $contextApi->getChecksum(...)

Return a string that is used to uniquely identify the current procedural context.

Returns String

Method: $contextApi->getTreatment(...)

Get details for the treatment used within the current context. The function returns an array of raw database entry values.

Returns Array

Method: $contextApi->getTreatmentAttributes(...)

Get treatment attributes used within the current context. The function returns an associative array of all values.

Returns Array

Method: $contextApi->getStepgroupLabel(...)

Returns the current stepgroup label of the context.

Returns String

Method: $contextApi->getStepgroupLoop(...)

Returns the current stepgroup loop of the context.

Returns Integer

Method: $contextApi->getStepLabel(...)

Returns the current step label of the context.

Returns String

Method: $contextApi->getParticipantLabel(...)

Returns the current participant label of the context.

Returns String

Method: $contextApi->getGroupLabel(...)

Returns the current group label of the context.

Returns String

Method: $contextApi->getExperiment(...)

Get details for the experiment used within the current context. The function returns an array of raw database entry values.

Returns Array

Method: $contextApi->getStepgroup(...)

Get details for the stepgroup used within the current context. The function returns an array of raw database entry values.

Returns Array

Method: $contextApi->getStep(...)

Get details for the step used within the current context. The function returns an array of raw database entry values.

Returns Array

Method: $contextApi->getSession(...)

Get details for the session used within the current context. The function returns an array of raw database entry values.

Returns Array

Method: $contextApi->getSessionAttributes(...)

Get session attributes used within the current context. The function returns an associative array of all values.

Returns Array

Method: $contextApi->getSessiontype(...)

Get details for the sessiontype used within the current context. The function returns an array of raw database entry values.

Returns Array

Method: $contextApi->getParticipantTypeLabel(...)

Returns the current participant type label of the context.

Returns String

Method: $contextApi->getParticipant(...)

Get details for the participant used within the current context. The function returns an array of raw database entry values.

Returns Array

Method: $contextApi->getFrontUrl(...)

Get url of frontend.

Returns String

Method: $contextApi->isPreview(...)

Determine whether the current context is called from a running session or as for a preview.

Returns Boolean