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
Next revisionBoth sides next revision
en:create:timer-submit [08.02.2015 12:43] test.deen:create:timer-submit [01.06.2016 14:27] – [Implementation] klaus-peter.speidel
Line 10: Line 10:
 ===== Function ===== ===== Function =====
  
-  - The first time the questionnaire page was visited is saved in a PHP variable to start with. This means the timer cannot go onto the next page by the page being reloaded or when the Back button is used.+  - The first time the questionnaire page was visited is saved in a PHP variable. This means the timer cannot go onto the next page by the page being reloaded or when the Back button is used.
   - If necessary, the Next button (if applicable, the Back button as well) can be hidden.   - If necessary, the Next button (if applicable, the Back button as well) can be hidden.
   - A timer then starts that calls up the function to forward onto the next page after a certain amount of time.   - A timer then starts that calls up the function to forward onto the next page after a certain amount of time.
Line 17: Line 17:
 **Note:** The participant cannot restart the timer by reloading the questionnaire page ("Reload", "Refresh", F5 button). If you want to test this, do __not__ start the questionnaire from the page with the timer, otherwise a new interview will begin every time the page is reloaded . Simply start the questionnaire on the page before -- or on the first page as normal.  **Note:** The participant cannot restart the timer by reloading the questionnaire page ("Reload", "Refresh", F5 button). If you want to test this, do __not__ start the questionnaire from the page with the timer, otherwise a new interview will begin every time the page is reloaded . Simply start the questionnaire on the page before -- or on the first page as normal. 
  
-**Tip:** If your questionnaire offers a "Back" button (**Compose Questionnaire** -> //Settings//), it could make sense to hide the button on the page __after__the timer (see PHP function ''[[:en:create:functions:option#buttons_in_the_questionnaire|option()]]'').+**Tip:** If your questionnaire offers a "Back" button (**Compose Questionnaire** -> //Settings//), it could make sense to hide the button on the page __after__ the timer (see PHP function ''[[:en:create:functions:option#buttons_in_the_questionnaire|option()]]'').
  
  
Line 41: Line 41:
  
 **Note:** If you want to use multiple, independent timers in the questionnaire, the variable ''$time0'' in the PHP code has to be called something different each time. The name of the variable also has to be changed in the ''registerVariable()'' command -- therefore, a total of 5 times.  **Note:** If you want to use multiple, independent timers in the questionnaire, the variable ''$time0'' in the PHP code has to be called something different each time. The name of the variable also has to be changed in the ''registerVariable()'' command -- therefore, a total of 5 times. 
 +**Different language versions** Use the translation support tool and copy-paste the suppression of the "next" button into the different language versions.
  
 If the participant is able to restart the timer by reloading the page or using the "Back" button, you can reduce the PHP code to one line (not recommended). However, this variant will not work if you want to let the timer to run over several pages.  If the participant is able to restart the timer by reloading the page or using the "Back" button, you can reduce the PHP code to one line (not recommended). However, this variant will not work if you want to let the timer to run over several pages. 
Line 56: Line 56:
 // Function to forward // Function to forward
 function next() { function next() {
-  // Display warning (optional)+  // Display message (optional)
   alert("Time's up.");   alert("Time's up.");
   // Forward participant onto the next page   // Forward participant onto the next page
Line 74: Line 74:
 Some of the JavaScript sections are marked as //optional//. These sections can be removed where necessary. Some of the JavaScript sections are marked as //optional//. These sections can be removed where necessary.
  
-**Note:** If you want to display a message after the timer has expired using ''alert()'', the time taken to close the message will appear in the processing time in the data record. The processing time that is saved is therefore higher than the timer actually allows for processing.+**Note:** If you want to display a message after the timer has expired using ''alert()'', the time taken to close the message will appear in the dwell time in the data record. The dwell time that is saved is therefore higher than the timer actually for the participant to be on the page.
  
  
-Initialization of the forwarding will only be carried out once the questionnaire page has been fully loaded (''onload''). There are two reasons for this: first of all, the loading time is considered in the actual processing time, and the reason being that the Next button can only be hidden once the page has been fully loaded.+Initialization of the forwarding will only be carried out once the questionnaire page has been fully loaded (''onload''). There are two reasons for this: first of all, the loading time is considered in the actual dwell time, and the reason being that the Next button can only be hidden once the page has been fully loaded.
  
  
Line 100: Line 100:
 // Function to forward // Function to forward
 function weiter() { function weiter() {
-  // Display message (optional)+  // Display message (optional)
   alert("Time's up.");   alert("Time's up.");
   // Forward participant onto the next page   // Forward participant onto the next page
Line 164: Line 164:
 Place the text element with the JavaScript on the second page below the PHP code, and the questions beneath this. Place the text element with the JavaScript on the second page below the PHP code, and the questions beneath this.
  
-**Restriction:** Loading times occured between questionnaire pages are deducted from the participant'processing time. Conversely, the participant gets given a maximum of one second due to rounding errors.+**Restriction:** Loading times occured between questionnaire pages are deducted from the participant'dwell time. Conversely, the participant gets given a maximum of one second due to rounding errors.
  
en/create/timer-submit.txt · Last modified: 12.04.2022 21:39 by admin
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki