void option(string option, mixed setting)
The appearance of a page in the questionnaire can be altered with option()
. The command option()
can be put on every page in the questionnaire where the appearance should be altered simply by using PHP code. The following options and possible – differing depending on the option – settings are available:
'progress
' – Modify progress bar 'no
' – Hide progress bar'yes
' – Display progress bar (if it was disabled for the questionnaire)0
to 100
– Display this percentage of progress'progress.last
' – Define on which side the progress bar reaches 100% (default: “end”)'nextbutton
' – “Next” buttonfalse
- Hide the Next button on the current page'backbutton
' – Back button'breakbutton
' – Button to pause the questionnaire'leavebutton
' – Button to leave and delete the questionnairefalse
– Hide the corresponding button (if it was enabled in the questionnaire settings)true
– Display the corresponding button (if it was not enabled in the questionnaire settings)'langbutton
' – Buttons to select language during the questionnairefalse
– Hide buttons (if they were enabled in the questionnaire settings)true
– Display buttons (if they were not activated in the questionnaire settings)'layout
' – Use another layout for the current questionnaire page'resume
' – Hide information that the questionnaire is resumed after a pause true
– Hide information, because the questionnaire is expected to be resumed here false
– Display information (default setting)'warn.leave
– Show/hide warning when respondent closes browser window true
– Show hint (if supported by browser)false
– Deactivate hint'probing
' – Remove the current page from the back history'part
' – Set the start of a new questionnaire section for the print preview, s. answersPrint()
'questionNumber
' – Continue the automatic numbering of questions with the specified number.
Note: The command option()
is only suitable for changing the labels of buttons on individual pages. If you want to change the labeling in general, define then in Text Elements and Labels (Instructions for Common Jobs).
Note: In general, if you do not want to display a progress bar, disable it in Compose Questionnaire → Settings → Display progress bar.
Note: The option 'resume
' is helpful if you want to pause the survey on purpose at a certain place – e.g. to conduct multiple survey waves in the same questionnaire (buttonHide()
). The option must be placed before the participant leaves the questionnaire, e.g. right at the beginning of the page. Pausing the questionnaire at a specific place can be achieved by hiding the Next button with option("nextbutton", false)
.
The following PHP code ensures that the progress bar is hidden on an individual page (e.g. on the welcome page):
option('progress', 'no');
Adjusting the progress displayed is also possible. When the following PHP code is put on a page in the questionnaire, 30% progress is displayed.
As of version 2.5.00, the progress on following pages will be calculated on the basis of the set value. In older versions of the program, the progress has to be set individually for each page. In general, the progress has to be set individually for previous pages, e.g. if the progress bar should run more “slowly” at the beginning.
option('progress', 30);
The Back button will be hidden on an individual page with the following PHP code (as long as this button is enabled in the questionnaire):
option('backbutton', false);
If back buttons in the questionnaire are generally disabled, they can be shown again for individual pages:
option('backbutton', true);
When the following PHP code is put on the penultimate page in the questionnaire, the “Next” button is given the label “Submit details” and the “Back” button is given the label “Change details”.
option('nextbutton', 'Submit details'); option('backbutton', 'Change details');
Should extensive stimulus be displayed in the questionnaire, reflecting a website? The “normal” structure of the questionnaire is probably too narrow to do this and interferes with the appearance.
Open Questionnaire Layout in the menu. If you have not yet activated a layout, activate the “SoSci Survey Standard” layout first of all in Layout Templates (so the questionnaire appears in the default layout). Afterwards, activate the “SoSci Stimulus Presenter” layout – this is given the ID “presenter”.
Use the following PHP code on the page with the stimulus on it, which allows the structure of the questionnaire to disappear:
option('layout', 'presenter');