This shows you the differences between two versions of the page.
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:52] – [Function] test.de | ||
---|---|---|---|
Line 10: | Line 10: | ||
===== Function ===== | ===== Function ===== | ||
- | - The first time the questionnaire page was visited is saved in a PHP variable | + | - 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 (" | **Note:** The participant cannot restart the timer by reloading the questionnaire page (" | ||
- | **Tip:** If your questionnaire offers a " | + | **Tip:** If your questionnaire offers a " |
Line 56: | Line 56: | ||
// Function to forward | // Function to forward | ||
function next() { | function next() { | ||
- | // Display | + | // Display |
alert(" | alert(" | ||
// Forward participant onto the next page | // Forward participant onto the next page | ||
Line 74: | Line 74: | ||
Some of the JavaScript sections are marked as // | Some of the JavaScript sections are marked as // | ||
- | **Note:** If you want to display a message after the timer has expired using '' | + | **Note:** If you want to display a message after the timer has expired using '' |
- | Initialization of the forwarding will only be carried out once the questionnaire page has been fully loaded ('' | + | Initialization of the forwarding will only be carried out once the questionnaire page has been fully loaded ('' |
Line 100: | Line 100: | ||
// Function to forward | // Function to forward | ||
function weiter() { | function weiter() { | ||
- | // Display | + | // Display message (optional) |
alert(" | alert(" | ||
// 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: | + | **Restriction: |