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:52] – [Function] test.de | en:create:timer-submit [28.04.2021 17:53] – [Implementation] sophia.schauer | ||
---|---|---|---|
Line 27: | Line 27: | ||
if (!isset($time0)) { | if (!isset($time0)) { | ||
$time0 = time(); | $time0 = time(); | ||
- | registerVariable(' | + | registerVariable(' |
} | } | ||
// Check if time has already expired | // Check if time has already expired | ||
Line 42: | Line 42: | ||
**Note:** If you want to use multiple, independent timers in the questionnaire, | **Note:** If you want to use multiple, independent timers in the questionnaire, | ||
+ | **Different language versions:** Use the translation support tool and copy-paste the suppression of the " | ||
If the participant is able to restart the timer by reloading the page or using the " | If the participant is able to restart the timer by reloading the page or using the " | ||
Line 49: | Line 50: | ||
</ | </ | ||
- | Create | + | For the actual timer, create |
+ | |||
+ | For the // | ||
<code javascript> | <code javascript> | ||
Line 61: | Line 64: | ||
SoSciTools.submitPage(); | SoSciTools.submitPage(); | ||
} | } | ||
+ | |||
+ | // Hide next button (optional) | ||
+ | SoSciTools.submitButtonsHide(); | ||
+ | |||
// Initialization of forwarding | // Initialization of forwarding | ||
SoSciTools.attachEvent(window, | SoSciTools.attachEvent(window, | ||
- | | + | |
- | SoSciTools.submitButtonsHide(); | + | |
// Start timer to forward automatically | // Start timer to forward automatically | ||
window.setTimeout(next, | window.setTimeout(next, | ||
Line 73: | Line 79: | ||
Some of the JavaScript sections are marked as // | Some of the JavaScript sections are marked as // | ||
+ | |||
+ | After saving, drag this text module directly below the PHP code onto the questionnaire page. | ||
**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 '' |