This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
en:create:timer-submit [28.04.2021 17:53] – [Implementation] sophia.schauer | en:create:timer-submit [28.04.2021 17:57] – [Display Countdown] sophia.schauer | ||
---|---|---|---|
Line 57: | Line 57: | ||
<script type=" | <script type=" | ||
<!-- | <!-- | ||
+ | |||
// Function to forward | // Function to forward | ||
function next() { | function next() { | ||
Line 91: | Line 92: | ||
Now insert text elements and/or questions to be shown in the questionnaire underneath the PHP and JavaScript codes. Positioning them below the PHP code is important to ensure the filter works properly if time has already expired. | Now insert text elements and/or questions to be shown in the questionnaire underneath the PHP and JavaScript codes. Positioning them below the PHP code is important to ensure the filter works properly if time has already expired. | ||
+ | |||
+ | **Multilingual versions:** If you use different languages for the questionnaire, | ||
===== Display Countdown ===== | ===== Display Countdown ===== | ||
Line 106: | Line 109: | ||
<script type=" | <script type=" | ||
<!-- | <!-- | ||
+ | |||
// Function to forward | // Function to forward | ||
function weiter() { | function weiter() { | ||
Line 113: | Line 117: | ||
SoSciTools.submitPage(); | SoSciTools.submitPage(); | ||
} | } | ||
+ | |||
// Display countdown | // Display countdown | ||
var date0 = new Date(); | var date0 = new Date(); | ||
Line 135: | Line 140: | ||
out.appendChild(displayNode); | out.appendChild(displayNode); | ||
} | } | ||
+ | |||
+ | // Hide Next button (optional) | ||
+ | SoSciTools.submitButtonsHide(); | ||
+ | | ||
// Initialize forwarding | // Initialize forwarding | ||
SoSciTools.attachEvent(window, | SoSciTools.attachEvent(window, | ||
- | | + | |
- | SoSciTools.submitButtonsHide(); | + | |
// Additional timer to update the countdown | // Additional timer to update the countdown | ||
window.setInterval(updateCountdown, | window.setInterval(updateCountdown, | ||
Line 145: | Line 153: | ||
window.setTimeout(next, | window.setTimeout(next, | ||
}); | }); | ||
+ | |||
// --> | // --> | ||
</ | </ |