Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:survey:publish [19.03.2015 14:08] – [Defining the survey administration period] muhammad.rizwanen:survey:publish [13.07.2021 22:39] (current) – [Prolonging the survey administration period] sophia.schauer
Line 8: Line 8:
  
  
-====== Prolonging the survey administration period ======+===== Prolonging the survey administration period =====
  
-The survey administration period is limited, for technical reasons in order to avoid inactive surveys, to three months. However, if a longer survey administration period is needed, a prolongation is always possible.+The survey administration period is first limited, for technical reasons in order to avoid inactive surveys, to three months. However, if a longer survey administration period is needed, a prolongation is always possible.
  
   * You can set this in the area **Project summary** prior to the originally set end date. In this way, the survey administration period can be prolonged as many times as needed.   * You can set this in the area **Project summary** prior to the originally set end date. In this way, the survey administration period can be prolonged as many times as needed.
-  * Generally you can change the survey administration period at any given point in time (e.g. as of the actual date). You do this in the area **Project Settings**. In case you change the survey administration period prior to its originally set ending date, then the survey administration continues without interruption; no data is lost.+  * Generally you can change the survey administration period at any given point in time (e.g. as of the actual date). You do this in the area **Project Settings**. In case you change the survey administration period prior to its originally set ending date, then the survey administration continues without interruption; __no__ data is lost
 + 
 + 
 +===== Adjustion pro Fragebogen ===== 
 + 
 +The administration period is in the survey project is used for all questionnaires in the project. But it is also possile to change the administration period for individual questionnaires via [[:en:create:php|PHP-Code]]. 
 + 
 +For this purpose, a PHP code is inserted on the first page of the questionnaire as the first element, which checks the current time and rejects the respondents if necessary. If the administration period should be available between the 15th to 17th March 2021, the PHP code would look like the following: 
 + 
 +<code php> 
 +$now = time(); 
 +if (($now < strtotime('2021-03-15')) || ($now >= strtotime('2021-03-18'))) { 
 +  text('SO01'); 
 +  buttonHide(); 
 +  pageStop(); 
 +
 +</code> 
 + 
 +The ''time()'' function returns a current timestamp and the [[:en:create:php-filters|IF-Filter]] then checks if the current time is before the allowed start or (''||'') after the allowed end. The function ''strtotime()'' helps to calculate the UNIX timestamps. 
 + 
 +In the second ''strtotime()'' the following day is entered, so the 18th and not the 17th till when the questionnaire should be opend. The reason therefore is that ''strtotime()'' sets the timestamp for 0 o'clock of the date if no further information is entered. Alternatively, the following specification would also be possible: ''($now > strtotime('2021-03-17 23:59:59'))''
 + 
 +The function ''[[:en:create:functions:text]]'' then displays the screenout text "SO01", which you have stored in the question catalog in case of an untimely/delayed call. The function ''[[:en:create:functions:buttonhide]]'' ensures that no "Next" button is offered and ''[[:en:create:functions:pagestop]]'' prevents the display of further elements on the page. 
 + 
 +**Note:** Once the questionnaire is started the further completion is also beyond the administration period possible. This is different at the administration period for the hole project.
en/survey/publish.txt · Last modified: 13.07.2021 22:39 by sophia.schauer
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki