Navigation stuff goes here


Command groups: display survey

This command is used to show a series of questions to a participant and allow them to fill in the answers. It can show both text and images to the participant, and pose questions. Answers can take the form of …

This command sets out surveys in a specific way, using a particular font and layout. You cannot adjust these. Nor can you sent a time-limit for completion. If the precise formatting and presentation of your questions is important to you you should use the other, more flexible but harder to set up, capabilities of PsyScript to display the questions as you would stimuli.

How to enter the contents of a survey

The first item in each line of the above table tells the software what kind of display or question that row represents. The possible values are as follows:

First parameterOther parametersPurpose
showtexttext to be shownShow anything up to a few paragraphs of text, to explain ensuing questions.
showimageimage filenameShow an image, to explain ensuing questions.
shorttextlabelallow users to enter a few words
longtextlabelallow users to enter a few sentences (adds scroll bar where needed)
sliderlabel,min,max,minlabel,maxlabelallow users to set a slider position
radiorowlabel,option 1, option 2, option 3 ...allow users to pick exactly one option shown in a row
radiocolumnlabel,option 1, option 2, option 3 ...allow users to pick exactly one option shown in a column
continuebutton text, label textAllows you to change the text used for the continue button at the end of the survey.

How to find and process the responses

Survey responses are returned as an array in the variable $lastResponses. You can write them straight to the log file using either of the following instructions …

log array $lastResponses log $lastResponses

or you could log the responses individually …

set $varThisOne to item 1 of array $lastResponses log $varThisOne set $varThatOne to item 2 of array $lastResponses log $varThatOne set $varTheOtherOne to item 3 of array $lastResponses log $varTheOtherOne

… depending on what format you want the results in. You can also have PsyScript extract one of the responses and use it in the script …

set $varExperienced to item 4 of array $lastResponses if $varExperienced is yes do testsForExperienced else do testsForInExperienced end if

Example

The contents of your survey are entered into a table in your script. Here's an example table, showing at least one of each kind of entry:

table demosurvey showtext,Here I am, impersonating an introductory paragraph, doing a bad job of it. showimage,dragonfly.png short text,type some text please:,20 showtext,The next line should be a slider from 1 to 7. slider,How friendly are you ?,1,7,little,very slider,Do you care ?,0,2 longtext,Please enter a long piece of text. radioline,What's your favourite colour ?,red,blue,orange,green,other radiocolumn,Have you ever worn a breadbin ?,yes,no,prefer not to say showtext,Here I am at the end with an extremely long piece of text. I'm having trouble thinking of something to write in it. continue,continuar,Cuando esté satisfecho con sus respuestas, pulse el botón 'Continuar'. end table

Here's the line of code used to make the survey appear:

display survey from table demosurvey

Here's what the result looks like:

Commands

display survey from table name

Displays the survey described by that table, then waits for the participant to click the 'Continue' button before continuing.

display survey from table ReactionToSpeechSurvey


Technical notes

None.

See also