This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
en:create:functions:pagestop [12.12.2014 17:34] – alexander.ritter | en:create:functions:pagestop [30.04.2021 09:53] – sophia.schauer | ||
---|---|---|---|
Line 5: | Line 5: | ||
This function prevents further contents of a questionnaire page being shown or executed. | This function prevents further contents of a questionnaire page being shown or executed. | ||
+ | If there are other commands within a PHP code element in the questionnaire, | ||
- | ===== Example ===== | + | ===== Example: Screenout |
In the following example, '' | In the following example, '' | ||
Line 43: | Line 44: | ||
} else { | } else { | ||
goToPage(' | goToPage(' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ===== Example: | ||
+ | |||
+ | Sometimes the survey project uses several questionnaires -- and not all of them should be available for the same time period. At the same time, only one survey period can be defined for the entire survey project in the **Project Settings**. | ||
+ | |||
+ | With a small PHP filter on the first page of the questionnaire, | ||
+ | |||
+ | Create a new text in the **List of Questions** in a section of your choice. The following example assumes that the text has the identifier TX02. The following PHP code ensures that the questionnaire can only be completed in the period between 01/04/2021 and 30/06/2021. | ||
+ | |||
+ | <code php> | ||
+ | if ((time() < strtotime(' | ||
+ | text(' | ||
+ | buttonHide(); | ||
+ | pageStop(); | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | The survey period specified in the project settings must start before 4/1/2021 and/or end after 6/30/2021 for the filter to be active. | ||
+ | |||
+ | In the same way, you can restrict that the questionnaire can only be filled out in a certain time window. The following PHP code allows filling in only from 9 to 11 o' | ||
+ | |||
+ | <code php> | ||
+ | if ((date(' | ||
+ | text(' | ||
+ | buttonHide(); | ||
+ | pageStop(); | ||
} | } | ||
</ | </ |