Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
en:create:timer-submit [08.02.2015 12:43] – test.de | en:create:timer-submit [08.02.2015 12:47] – [Function] test.de |
---|
**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()]]''). |
| |
| |
// 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 |
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. |
| |
| |
// Function to forward | // Function to forward |
function weiter() { | function weiter() { |
// Display a 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 |
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's 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's dwell time. Conversely, the participant gets given a maximum of one second due to rounding errors. |
| |