Both sides previous revisionPrevious revisionNext revision | Previous revision |
en:create:functions:option [20.12.2014 18:40] – [Layout] alexander.ritter | en:create:functions:option [29.01.2025 08:50] (current) – admin |
---|
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 [[:en:create:php|PHP code]]. The following //options// and possible -- differing depending on the option -- //settings// are available: | 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 [[:en:create:php|PHP code]]. The following //options// and possible -- differing depending on the option -- //settings// are available: |
| |
* '''progress''' -- Modify progress bar | * ''%%'progress'%%'' -- Modify progress bar |
* '''no''' -- Hide progress bar | * ''%%'no'%%'' -- Hide progress bar |
* '''yes''' -- Display progress bar (if it was disabled for the questionnaire) | * ''%%'yes'%%'' -- Display progress bar (if it was disabled for the questionnaire) |
* ''0'' to ''100'' -- Display this percentage of progress | * ''0'' to ''100'' -- Display this percentage of progress |
* '''nextbutton''' -- "Next" button | * ''%%'progress.last'%%'' -- Define on which side the progress bar reaches 100% (default: "end") |
| * Text (string) -- questionnaire page ([[:en:glossary#page identification|page identification]]) on which 100% are reached |
| * ''%%'nextbutton'%%'' -- "Next" button |
* Text (string) -- Display this text on the Next button | * Text (string) -- Display this text on the Next button |
* ''false'' - Hide the Next button on the current page | * ''false'' - Hide the Next button on the current page |
* '''backbutton''' -- Back button | * ''%%'backbutton'%%'' -- Back button |
* '''breakbutton''' -- Button to pause the questionnaire | * ''%%'breakbutton'%%'' -- Button to pause the questionnaire |
* '''leavebutton''' -- Button to leave and delete the questionnaire | * ''%%'leavebutton'%%'' -- Button to leave and delete the questionnaire |
* ''false'' -- Hide the corresponding button (if it was enabled in the questionnaire settings) | * ''false'' -- 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) | * ''true'' -- Display the corresponding button (if it was not enabled in the questionnaire settings) |
* Text (String) -- Display button with the text given | * Text (String) -- Display button with the text given |
* '''langbutton''' -- Buttons to select language during the questionnaire | * ''%%'langbutton'%%'' -- Buttons to select language during the questionnaire |
* ''false'' -- Hide buttons (if they were enabled in the questionnaire settings) | * ''false'' -- Hide buttons (if they were enabled in the questionnaire settings) |
* ''true'' -- Display buttons (if they were not activated 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 | * ''%%'layout'%%'' -- Use another layout for the current questionnaire page |
* ID (String) -- ID of the layout to be used for the page | * ID (String) -- ID of the layout to be used for the page |
* '''resume''' -- Hide information that the questionnaire is resumed after a pause | * ''%%'resume'%%'' -- Hide information that the questionnaire is resumed after a pause |
* ''true'' -- Hide information, because the questionnaire is expected to be resumed here | * ''true'' -- Hide information, because the questionnaire is expected to be resumed here |
* ''false'' -- Display information (default setting) | * ''false'' -- Display information (default setting) |
| * ''%%'warn.leave'%%'' -- Show/hide warning when respondent closes browser window \\ This setting corresponds to the selection option **Compose Questionaire** -> //Settings// -> "Show a warning if browser back button is used or window is closed" |
| * ''true'' -- Show hint (if supported by browser) |
| * ''false'' -- Deactivate hint |
| * '''probing''' -- Remove the current page from the back history\\ If you use an additional page to check for missing answers and allow a back button at the same time, you can use this setting to specify that the respondent skips the additional page on "back". |
| * ''%%'part'%%'' -- Set the start of a new questionnaire section for the print preview, s. ''[[:/en:create:functions:answersprint]]'' |
| * Text (string) -- Any designation of the section |
| * ''%%'questionNumber'%%'' -- Continue the automatic numbering of questions with the specified number. |
| * number (integer) -- Number ≥ 1 |
| |
| |
**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** ([[:en:create:stuff#weiter-knopf_beschriften|Instructions for Common Jobs]]). | **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** ([[:en:create:stuff#weiter-knopf_beschriften|Instructions for Common Jobs]]). |
| |
**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 (''[[:en:create:functions:buttonhide|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)%%''. | **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 (''[[:en:create:functions:buttonhide|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)%%''. |
| |
| |
===== Progress Bar ===== | ===== Progress Bar ===== |
<code php> | <code php> |
option('backbutton', false); | option('backbutton', false); |
| </code> |
| |
| If back buttons in the questionnaire are generally disabled, they can be shown again for individual pages: |
| |
| <code php> |
| option('backbutton', true); |
</code> | </code> |
| |