Constructor
new Survey(options)
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
Properties
|
Extends
- VisualStim
Methods
(protected) _augmentQuestionNames()
- Source:
Augment the model question names with model names.
(protected) _estimateBoundingBox()
- Source:
Estimate the bounding box.
(protected) _initSurveyJS()
- Source:
Init the SurveyJS.io library and various extensions, setup the theme.
(protected) _onCurrentPageChanging()
- Source:
Callback triggered when the participant changed the page.
(protected) _onFlowComplete()
- Source:
Callback triggered when we have run through the whole flow.
(protected) _onQuestionValueChanged(survey, questionData)
- Source:
Callback triggered whenever the participant answer a question.
Parameters:
Name | Type | Description |
---|---|---|
survey |
||
questionData |
(protected) _onSurveyJSComplete(node, surveyModel, options)
- Source:
Callback triggered when the participant has completed a SurveyJS Question Block.
Parameters:
Name | Type | Description |
---|---|---|
node |
Object | super-flow QUESTION_BLOCK node |
surveyModel |
the associated SurveyJS model |
|
options |
the SurveyJS model options |
(protected) _processSurveyData()
- Source:
Go over required surveyModelData and apply randomization settings.
(protected) _registerCustomExpressionFunctions() → {void}
- Source:
Register custom SurveyJS expression functions.
Returns:
- Type
- void
(protected) _registerCustomSurveyProperties() → {void}
- Source:
Register custom Survey properties. Usially these are relevant for different question types.
Returns:
- Type
- void
(protected) _registerWidgets() → {void}
- Source:
Register SurveyJS widgets.
Returns:
- Type
- void
(protected) _runQuestionBlock(node, surveyData)
- Source:
Run a QUESTION_BLOCK as a SurveyJS survey.
Parameters:
Name | Type | Description |
---|---|---|
node |
Object | super-flow QUESTION_BLOCK node |
surveyData |
Object | the complete surveyData (model) |
(protected) _updateIfNeeded()
- Source:
Update the stimulus, if necessary.
evaluateExpression(expression) → {any}
- Source:
Evaluate an expression, taking into account the survey responses.
Parameters:
Name | Type | Description |
---|---|---|
expression |
string | the expression to evaluate |
Returns:
the evaluated expression
- Type
- any
getResponse()
- Source:
Get the survey response.
hide()
- Source:
Hide this stimulus on the next frame draw.
onFinished(callback) → {void}
- Source:
Add a callback that will be triggered when the participant finishes the survey.
Parameters:
Name | Type | Description |
---|---|---|
callback |
callback triggered when the participant finishes the survey |
Returns:
- Type
- void
save() → {Promise.<ServerManager.UploadDataPromise>}
- Source:
Upload the survey response to the pavlovia.org server.
Returns:
a promise resolved when the survey response has been saved
- Type
- Promise.<ServerManager.UploadDataPromise>
setModel(model, logopt) → {void}
- Source:
Setter for the model attribute.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
model |
Object | string | the survey model |
||
log |
boolean |
<optional> |
false
|
whether to log |
Returns:
- Type
- void
setSurveyId(surveyId, logopt) → {void}
- Source:
Setter for the surveyId attribute.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
surveyId |
string | the survey Id |
||
log |
boolean |
<optional> |
false
|
whether to log |
Returns:
- Type
- void
setVariables(variables, excludedNamesopt) → {void}
- Source:
Set survey variables.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
variables |
Object | an object with a number of variable name/variable value pairs |
||
excludedNames |
Array.<string> |
<optional> |
{}
|
excluded variable names |
Returns:
- Type
- void